[Mesa-dev] [PATCH 2/2] pipe-loader: move dup(fd) within pipe_loader_drm_probe_fd

Thomas Hellstrom thellstrom at vmware.com
Wed Aug 29 18:21:40 UTC 2018


Hi, Emil,

On 08/29/2018 07:13 PM, Emil Velikov wrote:
> From: Emil Velikov <emil.velikov at collabora.com>
>
> Currently pipe_loader_drm_probe_fd takes ownership of the fd given.
> To match that, pipe_loader_release closes it.
>
> Yet we have many instances which do not want the change of ownership,
> and thus duplicate the fd before passing it to the pipe-loader.
>
> Move the dup() within pipe-loader, explicitly document that and document
> all the cases through the codebase.
>
> A trivial git grep -2 pipe_loader_release makes things as obvious as it
> gets ;-)
>
> Cc: Leo Liu <leo.liu at amd.com>
> Cc: Thomas Hellstrom <thellstrom at vmware.com>
> Cc: Axel Davy <davyaxel0 at gmail.com>
> Cc: Patrick Rudolph <siro at das-labor.org>
> Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
> ---
> I'm 99% sure that the VAAPI/XA notes are correct, but I left it as CHECK
> since it's been a while since I useed those ;-)
>
> Leo, Thomas, can you please confirm the respective CHECK notes?
>

Yes, The user of the xa API maintains ownership of the drm fd passed to XA.

For the xa part:
Reviewed-by: Thomas Hellstrom <thellstrom at vmware.com>


Thanks,
Thomas



More information about the mesa-dev mailing list