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 291a3cce8f8eb1506032bf592996e902fc59bcbd..a5ab14b36631ffdf2e0513a92cd2b9d4e18e9c4c 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 e592b8d3c76d0a586eb04b0ab685236aca3c0f5f..7676b2bdd6b101ffdfd9963cffa6a074eef5aa55 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 47a822f5d9bcc21fca4b3e6b327a5bc0786c7ba8..d84793f71f80f527a906d16a057eb3c26caaec9e 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 2a21d4e19eee5e3b45f6e7bddadc7ad8ec94f5fb..d0ebab4bbd5de9360ba2bccd0233843dacacf547 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)
 {