pipe-loader: move dup(fd) within pipe_loader_drm_probe_fd
authorEmil Velikov <emil.velikov@collabora.com>
Wed, 29 Aug 2018 17:13:14 +0000 (18:13 +0100)
committerEmil Velikov <emil.l.velikov@gmail.com>
Wed, 3 Oct 2018 12:38:05 +0000 (13:38 +0100)
commit6ccc435e7ad92bb0ba77d3fdb48c7127ba71239e
tree6ca059b425d4b452bcfe76a634d4d852bed0f6d8
parent7b8d1b313cd01bb916898d8bb92a566534e37677
pipe-loader: move dup(fd) within pipe_loader_drm_probe_fd

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@amd.com>
Cc: Thomas Hellstrom <thellstrom@vmware.com>
Cc: Axel Davy <davyaxel0@gmail.com>
Cc: Patrick Rudolph <siro@das-labor.org>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Axel Davy <davyaxel0@gmail.com> (for nine)
src/gallium/auxiliary/pipe-loader/pipe_loader.h
src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c
src/gallium/auxiliary/vl/vl_winsys_dri.c
src/gallium/auxiliary/vl/vl_winsys_drm.c
src/gallium/state_trackers/dri/dri2.c
src/gallium/state_trackers/dri/dri_screen.c
src/gallium/state_trackers/xa/xa_tracker.c
src/gallium/targets/d3dadapter9/drm.c