diff options
author | Xiang, Haihao <haihao.xiang@intel.com> | 2014-04-19 00:12:35 +0800 |
---|---|---|
committer | Xiang, Haihao <haihao.xiang@intel.com> | 2014-05-26 11:58:47 +0800 |
commit | e7318fe6166fbacc53413bbf175d4fc97a1c9807 (patch) | |
tree | 041d4f3f6c0cc82ef2683b271adcea2e653c655e | |
parent | a1b90545a6b428a91e080ffb9dd29835212e5304 (diff) | |
download | libva-intel-driver-e7318fe6166fbacc53413bbf175d4fc97a1c9807.tar.gz libva-intel-driver-e7318fe6166fbacc53413bbf175d4fc97a1c9807.tar.bz2 libva-intel-driver-e7318fe6166fbacc53413bbf175d4fc97a1c9807.zip |
Add a new intel_device_info structure
To store statically known device information
Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
(cherry picked from commit eb014a09fde988ba3ed2d2be6e8d6f0c650d281e)
-rw-r--r-- | src/i965_device_info.c | 112 | ||||
-rw-r--r-- | src/intel_driver.c | 7 | ||||
-rw-r--r-- | src/intel_driver.h | 16 |
3 files changed, 135 insertions, 0 deletions
diff --git a/src/i965_device_info.c b/src/i965_device_info.c index 0164f1d..55e762b 100644 --- a/src/i965_device_info.c +++ b/src/i965_device_info.c @@ -187,3 +187,115 @@ i965_get_codec_info(int devid) return NULL; } } + +static const struct intel_device_info g4x_device_info = { + .gen = 4, + + .urb_size = 384, + .max_wm_threads = 50, /* 10 * 5 */ + + .is_g4x = 1, +}; + +static const struct intel_device_info ilk_device_info = { + .gen = 5, + + .urb_size = 1024, + .max_wm_threads = 72, /* 12 * 6 */ +}; + +static const struct intel_device_info snb_gt1_device_info = { + .gen = 6, + .gt = 1, + + .urb_size = 1024, + .max_wm_threads = 40, +}; + +static const struct intel_device_info snb_gt2_device_info = { + .gen = 6, + .gt = 2, + + .urb_size = 1024, + .max_wm_threads = 80, +}; + +static const struct intel_device_info ivb_gt1_device_info = { + .gen = 7, + .gt = 1, + + .urb_size = 4096, + .max_wm_threads = 48, + + .is_ivybridge = 1, +}; + +static const struct intel_device_info ivb_gt2_device_info = { + .gen = 7, + .gt = 2, + + .urb_size = 4096, + .max_wm_threads = 172, + + .is_ivybridge = 1, +}; + +static const struct intel_device_info byt_device_info = { + .gen = 7, + .gt = 1, + + .urb_size = 4096, + .max_wm_threads = 48, + + .is_ivybridge = 1, + .is_baytrail = 1, +}; + +static const struct intel_device_info hsw_gt1_device_info = { + .gen = 7, + .gt = 1, + + .urb_size = 4096, + .max_wm_threads = 102, + + .is_haswell = 1, +}; + +static const struct intel_device_info hsw_gt2_device_info = { + .gen = 7, + .gt = 2, + + .urb_size = 4096, + .max_wm_threads = 204, + + .is_haswell = 1, +}; + +static const struct intel_device_info hsw_gt3_device_info = { + .gen = 7, + .gt = 3, + + .urb_size = 4096, + .max_wm_threads = 408, + + .is_haswell = 1, +}; + +static const struct intel_device_info bdw_device_info = { + .gen = 8, + + .urb_size = 4096, + .max_wm_threads = 64, /* per PSD */ +}; + +const struct intel_device_info * +i965_get_device_info(int devid) +{ + switch (devid) { +#undef CHIPSET +#define CHIPSET(id, family, dev, str) case id: return &dev##_device_info; +#include "i965_pciids.h" + default: + return NULL; + } +} diff --git a/src/intel_driver.c b/src/intel_driver.c index 8650dba..e3e082d 100644 --- a/src/intel_driver.c +++ b/src/intel_driver.c @@ -67,6 +67,8 @@ static void intel_driver_get_revid(struct intel_driver_data *intel, int *value) return; } +extern const struct intel_device_info *i965_get_device_info(int devid); + bool intel_driver_init(VADriverContextP ctx) { @@ -91,6 +93,11 @@ intel_driver_init(VADriverContextP ctx) pthread_mutex_init(&intel->ctxmutex, NULL); intel_driver_get_param(intel, I915_PARAM_CHIPSET_ID, &intel->device_id); + intel->device_info = i965_get_device_info(intel->device_id); + + if (!intel->device_info) + return false; + if (intel_driver_get_param(intel, I915_PARAM_HAS_EXECBUF2, &has_exec2)) intel->has_exec2 = has_exec2; if (intel_driver_get_param(intel, I915_PARAM_HAS_BSD, &has_bsd)) diff --git a/src/intel_driver.h b/src/intel_driver.h index 3c74ed3..18bbfe6 100644 --- a/src/intel_driver.h +++ b/src/intel_driver.h @@ -116,6 +116,20 @@ struct intel_batchbuffer; } \ } while (0) +struct intel_device_info +{ + int gen; + int gt; + + unsigned int urb_size; + unsigned int max_wm_threads; + + unsigned int is_g4x : 1; /* gen4 */ + unsigned int is_ivybridge : 1; /* gen7 */ + unsigned int is_baytrail : 1; /* gen7 */ + unsigned int is_haswell : 1; /* gen7 */ +}; + struct intel_driver_data { int fd; @@ -134,6 +148,8 @@ struct intel_driver_data unsigned int has_bsd : 1; /* Flag: has bitstream decoder for H.264? */ unsigned int has_blt : 1; /* Flag: has BLT unit? */ unsigned int has_vebox : 1; /* Flag: has VEBOX unit */ + + const struct intel_device_info *device_info; }; bool intel_driver_init(VADriverContextP ctx); |