[Mesa-dev] [PATCH 1/2] i965: Store the command parser version number in intel_screen
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 --- src/mesa/drivers/dri/i965/intel_screen.c | 7 +++ src/mesa/drivers/dri/i965/intel_screen.h | 8 +++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/mesa/drivers/dri/i965/intel_screen.c b/src/mesa/drivers/dri/i965/intel_screen.c index dda1638..896a125 100644 --- a/src/mesa/drivers/dri/i965/intel_screen.c +++ b/src/mesa/drivers/dri/i965/intel_screen.c @@ -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; diff --git a/src/mesa/drivers/dri/i965/intel_screen.h b/src/mesa/drivers/dri/i965/intel_screen.h index e7a1490..742b3d3 100644 --- a/src/mesa/drivers/dri/i965/intel_screen.h +++ b/src/mesa/drivers/dri/i965/intel_screen.h @@ -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); -- 1.9.3 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 1/2] i965: Store the command parser version number in intel_screen
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. --- src/mesa/drivers/dri/i965/intel_screen.c | 7 +++ src/mesa/drivers/dri/i965/intel_screen.h | 8 +++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/mesa/drivers/dri/i965/intel_screen.c b/src/mesa/drivers/dri/i965/intel_screen.c index 6618c1a..ab7ac85 100644 --- a/src/mesa/drivers/dri/i965/intel_screen.c +++ b/src/mesa/drivers/dri/i965/intel_screen.c @@ -1362,6 +1362,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; diff --git a/src/mesa/drivers/dri/i965/intel_screen.h b/src/mesa/drivers/dri/i965/intel_screen.h index 393315e..a7706b3 100644 --- a/src/mesa/drivers/dri/i965/intel_screen.h +++ b/src/mesa/drivers/dri/i965/intel_screen.h @@ -115,7 +115,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); -- 1.9.3 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 1/2] i965: Store the command parser version number in intel_screen
On Friday, November 07, 2014 06:52:59 PM Neil Roberts wrote: > 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. > --- > src/mesa/drivers/dri/i965/intel_screen.c | 7 +++ > src/mesa/drivers/dri/i965/intel_screen.h | 8 +++- > 2 files changed, 14 insertions(+), 1 deletion(-) > > diff --git a/src/mesa/drivers/dri/i965/intel_screen.c b/src/mesa/drivers/dri/i965/intel_screen.c > index 6618c1a..ab7ac85 100644 > --- a/src/mesa/drivers/dri/i965/intel_screen.c > +++ b/src/mesa/drivers/dri/i965/intel_screen.c > @@ -1362,6 +1362,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; > > diff --git a/src/mesa/drivers/dri/i965/intel_screen.h b/src/mesa/drivers/dri/i965/intel_screen.h > index 393315e..a7706b3 100644 > --- a/src/mesa/drivers/dri/i965/intel_screen.h > +++ b/src/mesa/drivers/dri/i965/intel_screen.h > @@ -115,7 +115,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); Patch 1 is: Reviewed-by: Kenneth Graunke We'll clearly want this eventually. Whether or not we can actually use the command parser is unclear - at present, the kernel leaves the hardware command validator enabled even if you also validate in software. It looks like Brad sent out new patches that might fix this, though, so assuming those land, maybe we'll be good to go... :) --Ken signature.asc Description: This is a digitally signed message part. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev