From 603ddda622b40414262e28f58a36526a9067807b Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Sun, 27 May 2018 20:36:49 +0100 Subject: [PATCH] i965: store device revision in gen_device_info Signed-off-by: Lionel Landwerlin Reviewed-by: Kenneth Graunke --- src/intel/dev/gen_device_info.h | 1 + src/mesa/drivers/dri/i965/brw_performance_query.c | 3 +-- src/mesa/drivers/dri/i965/intel_screen.c | 4 +++- src/mesa/drivers/dri/i965/intel_screen.h | 3 --- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/intel/dev/gen_device_info.h b/src/intel/dev/gen_device_info.h index 291a3cce8f8..a5ab14b3663 100644 --- a/src/intel/dev/gen_device_info.h +++ b/src/intel/dev/gen_device_info.h @@ -46,6 +46,7 @@ struct drm_i915_query_topology_info; struct gen_device_info { int gen; /**< Generation number: 4, 5, 6, 7, ... */ + int revision; int gt; bool is_g4x; diff --git a/src/mesa/drivers/dri/i965/brw_performance_query.c b/src/mesa/drivers/dri/i965/brw_performance_query.c index e592b8d3c76..7676b2bdd6b 100644 --- a/src/mesa/drivers/dri/i965/brw_performance_query.c +++ b/src/mesa/drivers/dri/i965/brw_performance_query.c @@ -2017,7 +2017,6 @@ init_oa_sys_vars(struct brw_context *brw) { const struct gen_device_info *devinfo = &brw->screen->devinfo; uint64_t min_freq_mhz = 0, max_freq_mhz = 0; - __DRIscreen *screen = brw->screen->driScrnPriv; if (!read_sysfs_drm_device_file_uint64(brw, "gt_min_freq_mhz", &min_freq_mhz)) return false; @@ -2045,7 +2044,7 @@ init_oa_sys_vars(struct brw_context *brw) brw->perfquery.sys_vars.gt_min_freq = min_freq_mhz * 1000000; brw->perfquery.sys_vars.gt_max_freq = max_freq_mhz * 1000000; brw->perfquery.sys_vars.timestamp_frequency = devinfo->timestamp_frequency; - brw->perfquery.sys_vars.revision = intel_device_get_revision(screen->fd); + brw->perfquery.sys_vars.revision = devinfo->revision; compute_topology_builtins(brw); return true; diff --git a/src/mesa/drivers/dri/i965/intel_screen.c b/src/mesa/drivers/dri/i965/intel_screen.c index 47a822f5d9b..d84793f71f8 100644 --- a/src/mesa/drivers/dri/i965/intel_screen.c +++ b/src/mesa/drivers/dri/i965/intel_screen.c @@ -2416,7 +2416,7 @@ set_max_gl_versions(struct intel_screen *screen) * Return the revision (generally the revid field of the PCI header) of the * graphics device. */ -int +static int intel_device_get_revision(int fd) { struct drm_i915_getparam gp; @@ -2521,6 +2521,8 @@ __DRIconfig **intelInitScreen2(__DRIscreen *dri_screen) if (!gen_get_device_info(screen->deviceID, &screen->devinfo)) return NULL; + screen->devinfo.revision = intel_device_get_revision(dri_screen->fd); + if (!intel_init_bufmgr(screen)) return NULL; diff --git a/src/mesa/drivers/dri/i965/intel_screen.h b/src/mesa/drivers/dri/i965/intel_screen.h index 2a21d4e19ee..d0ebab4bbd5 100644 --- a/src/mesa/drivers/dri/i965/intel_screen.h +++ b/src/mesa/drivers/dri/i965/intel_screen.h @@ -139,9 +139,6 @@ double get_time(void); const int* intel_supported_msaa_modes(const struct intel_screen *screen); -int -intel_device_get_revision(int fd); - static inline bool can_do_pipelined_register_writes(const struct intel_screen *screen) { -- 2.30.2