virgl: reuse screen when fd is already open
authorRob Herring <robh@kernel.org>
Fri, 29 Jan 2016 22:36:28 +0000 (16:36 -0600)
committerDave Airlie <airlied@redhat.com>
Mon, 1 Feb 2016 23:58:29 +0000 (09:58 +1000)
commitf87330dbce3f67cb531194f63a5db59685dcbbd3
tree3800acb99c5ee8b8bd1bd73995ab44e6288c565d
parent6711592c2f30307948487a448094e0ff5dc1aedc
virgl: reuse screen when fd is already open

It is necessary to share the screen between mesa and gralloc to
properly ref count resources. This implements a hash lookup on
the file description to re-use an already created screen. This is
a similar implementation as freedreno and radeon.

Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/gallium/auxiliary/target-helpers/drm_helper.h
src/gallium/drivers/virgl/virgl_screen.c
src/gallium/drivers/virgl/virgl_screen.h
src/gallium/winsys/virgl/drm/virgl_drm_public.h
src/gallium/winsys/virgl/drm/virgl_drm_winsys.c