i965: Store the command parser version number in intel_screen
authorNeil Roberts <neil@linux.intel.com>
Fri, 7 Nov 2014 18:20:17 +0000 (18:20 +0000)
committerNeil Roberts <neil@linux.intel.com>
Tue, 12 May 2015 10:20:35 +0000 (11:20 +0100)
In order to detect whether the predicate source registers can be used
in a later patch we will need to know the version number for the
command parser. This patch just adds a member to intel_screen and does
an ioctl to get the version.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/intel_screen.c
src/mesa/drivers/dri/i965/intel_screen.h

index dda16389f8a0994cc7e548190239c2694c51264a..896a12534e6adc7b1e0458a153db57a7a3b2beb0 100644 (file)
@@ -1407,6 +1407,13 @@ __DRIconfig **intelInitScreen2(__DRIscreen *psp)
          (ret != -1 || errno != EINVAL);
    }
 
+   struct drm_i915_getparam getparam;
+   getparam.param = I915_PARAM_CMD_PARSER_VERSION;
+   getparam.value = &intelScreen->cmd_parser_version;
+   const int ret = drmIoctl(psp->fd, DRM_IOCTL_I915_GETPARAM, &getparam);
+   if (ret == -1)
+      intelScreen->cmd_parser_version = 0;
+
    psp->extensions = !intelScreen->has_context_reset_notification
       ? intelScreenExtensions : intelRobustScreenExtensions;
 
index e7a14903d6e1333d1ada401bec3457e65fe755ac..742b3d30eee2a229d8d0c731ae81eb5b9de5fd8e 100644 (file)
@@ -72,7 +72,13 @@ struct intel_screen
    * Configuration cache with default values for all contexts
    */
    driOptionCache optionCache;
-};
+
+   /**
+    * Version of the command parser reported by the
+    * I915_PARAM_CMD_PARSER_VERSION parameter
+    */
+   int cmd_parser_version;
+ };
 
 extern void intelDestroyContext(__DRIcontext * driContextPriv);