[Mesa-dev] [PATCH] i965: Don't enable reset notification support on Gen4-5.

Ian Romanick idr at freedesktop.org
Wed Mar 12 11:02:48 PDT 2014


On 03/12/2014 01:43 AM, Kenneth Graunke wrote:
> arekm reported that using Chrome with GPU acceleration enabled on GM45
> triggered the hw_ctx != NULL assertion in brw_get_graphics_reset_status.
> 
> We definitely do not want to advertise reset notification support on
> Gen4-5 systems, since it needs hardware contexts, and we never even
> request a hardware context on those systems.
> 
> Cc: Ian Romanick <idr at freedesktop.org>
> Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
> ---
>  src/mesa/drivers/dri/i965/intel_screen.c | 13 +++++++++----
>  1 file changed, 9 insertions(+), 4 deletions(-)
> 
> This may not be the best solution; if someone would like to send patches for
> a better one, I'm more than happy to go with something else.  Checking for
> hardware contexts is a bit awkward - we need to decide whether to advertise
> support here in the screen, but we don't create hardware contexts until
> context creation time, which is a fair bit later.  So, I'm not sure how to
> do better than the generation check, for now.

I'm confused.  I thought the ioctl was was supposed to fail with EINVAL
in that case.  Mika, what's your suggestion?

> diff --git a/src/mesa/drivers/dri/i965/intel_screen.c b/src/mesa/drivers/dri/i965/intel_screen.c
> index 464cebf..12006be 100644
> --- a/src/mesa/drivers/dri/i965/intel_screen.c
> +++ b/src/mesa/drivers/dri/i965/intel_screen.c
> @@ -1342,13 +1342,18 @@ __DRIconfig **intelInitScreen2(__DRIscreen *psp)
>      * no error.  If the ioctl is not supported, it always generate EINVAL.
>      * Use this to determine whether to advertise the __DRI2_ROBUSTNESS
>      * extension to the loader.
> +    *
> +    * Don't even try on pre-Gen6, since we don't attempt to use contexts there.
>      */
> -   struct drm_i915_reset_stats stats;
> -   memset(&stats, 0, sizeof(stats));
> +   if (intelScreen->devinfo->gen >= 6) {
> +      struct drm_i915_reset_stats stats;
> +      memset(&stats, 0, sizeof(stats));
>  
> -   const int ret = drmIoctl(psp->fd, DRM_IOCTL_I915_GET_RESET_STATS, &stats);
> +      const int ret = drmIoctl(psp->fd, DRM_IOCTL_I915_GET_RESET_STATS, &stats);
>  
> -   intelScreen->has_context_reset_notification = (ret != -1 || errno != EINVAL);
> +      intelScreen->has_context_reset_notification =
> +         (ret != -1 || errno != EINVAL);
> +   }
>  
>     psp->extensions = !intelScreen->has_context_reset_notification
>        ? intelScreenExtensions : intelRobustScreenExtensions;
> 



More information about the mesa-dev mailing list