[Mesa-dev] [PATCH v13 16/36] i965: Remove same-FD restriction for imports

Jason Ekstrand jason at jlekstrand.net
Fri May 19 18:26:29 UTC 2017


On Fri, May 19, 2017 at 2:37 AM, Daniel Stone <daniels at collabora.com> wrote:

> Intel hardware requires that all planes of an image come from the same
> buffer, which is currently implemented by testing that all FDs are
> numerically the same.
>
> However, when going through a winsys (e.g.) or anything which transits
> FDs individually, the FDs may be different even if the underlying buffer
> is the same.
>
> Since there is nothing we can do to detect this properly, just remove
> the test for now.
>

That's not actually true.  If two FDs point to the same underlying GEM bo,
then brw_bo_gem_create_from_prime (called below) will return the same
pointers for both of them.  What we really want to do is call that on all
of the FDs (or maybe all of the unique FDs?) and check that they're all the
same.


> Signed-off-by: Daniel Stone <daniels at collabora.com>
> ---
>  src/mesa/drivers/dri/i965/intel_screen.c | 5 -----
>  1 file changed, 5 deletions(-)
>
> diff --git a/src/mesa/drivers/dri/i965/intel_screen.c
> b/src/mesa/drivers/dri/i965/intel_screen.c
> index 91ed128f83..69c450a431 100644
> --- a/src/mesa/drivers/dri/i965/intel_screen.c
> +++ b/src/mesa/drivers/dri/i965/intel_screen.c
> @@ -819,11 +819,6 @@ intel_create_image_from_fds(__DRIscreen *dri_screen,
>     if (fds == NULL || num_fds < 1)
>        return NULL;
>
> -   /* We only support all planes from the same bo */
> -   for (i = 0; i < num_fds; i++)
> -      if (fds[0] != fds[i])
> -         return NULL;
> -
>     f = intel_image_format_lookup(fourcc);
>     if (f == NULL)
>        return NULL;
> --
> 2.13.0
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170519/149028c9/attachment.html>


More information about the mesa-dev mailing list