[Mesa-stable] [PATCH] gbm/dri: Check dri extension version before flush after unmap

Dylan Baker dylan at pnwbakers.com
Thu Mar 30 17:37:11 UTC 2017


This fixes the issue on i915 for us. Feel free to nominate this to stable along
with the reject previous patch if you like.

Tested-by: Dylan Baker <dylan at pnwbakers.com>

Quoting Thomas Hellstrom (2017-03-30 07:44:08)
> The commit mentioned below required the __DRI2FlushExtension to have
> version 4 or above, for GBM functionality. That broke GBM with some
> classic dri drivers. Relax that requirement so that we only flush
> after unmap if we have version 4 or above. Drivers that require the flush
> for correct functionality should implement the desired version.
> 
> Fixes: ba8df228 ("gbm/dri: Flush after unmap")
> Cc: <mesa-stable at lists.freedesktop.org>
> Signed-off-by: Thomas Hellstrom <thellstrom at vmware.com>
> ---
>  src/gbm/backends/dri/gbm_dri.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/src/gbm/backends/dri/gbm_dri.c b/src/gbm/backends/dri/gbm_dri.c
> index 189a8fc..8df6a6b 100644
> --- a/src/gbm/backends/dri/gbm_dri.c
> +++ b/src/gbm/backends/dri/gbm_dri.c
> @@ -253,7 +253,7 @@ struct dri_extension_match {
>  };
>  
>  static struct dri_extension_match dri_core_extensions[] = {
> -   { __DRI2_FLUSH, 4, offsetof(struct gbm_dri_device, flush) },
> +   { __DRI2_FLUSH, 1, offsetof(struct gbm_dri_device, flush) },
>     { __DRI_IMAGE, 1, offsetof(struct gbm_dri_device, image) },
>     { __DRI2_FENCE, 1, offsetof(struct gbm_dri_device, fence), 1 },
>     { __DRI2_INTEROP, 1, offsetof(struct gbm_dri_device, interop), 1 },
> @@ -1245,7 +1245,8 @@ gbm_dri_bo_unmap(struct gbm_bo *_bo, void *map_data)
>      * on the mapping context. Since there is no explicit gbm flush
>      * mechanism, we need to flush here.
>      */
> -   dri->flush->flush_with_flags(dri->context, NULL, __DRI2_FLUSH_CONTEXT, 0);
> +   if (dri->flush->base.version >= 4)
> +      dri->flush->flush_with_flags(dri->context, NULL, __DRI2_FLUSH_CONTEXT, 0);
>  }
>  
>  
> -- 
> 2.5.0
> 
> _______________________________________________
> mesa-stable mailing list
> mesa-stable at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-stable
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: signature
URL: <https://lists.freedesktop.org/archives/mesa-stable/attachments/20170330/b81fe4ea/attachment-0001.sig>


More information about the mesa-stable mailing list