i965: store device revision in gen_device_info
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Sun, 27 May 2018 19:36:49 +0000 (20:36 +0100)
committerLionel Landwerlin <lionel.g.landwerlin@intel.com>
Wed, 17 Apr 2019 13:10:42 +0000 (14:10 +0100)
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/intel/dev/gen_device_info.h
src/mesa/drivers/dri/i965/brw_performance_query.c
src/mesa/drivers/dri/i965/intel_screen.c
src/mesa/drivers/dri/i965/intel_screen.h

index 291a3cc..a5ab14b 100644 (file)
@@ -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;
index e592b8d..7676b2b 100644 (file)
@@ -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;
index 47a822f..d84793f 100644 (file)
@@ -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;
 
index 2a21d4e..d0ebab4 100644 (file)
@@ -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)
 {