summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/target-helpers
diff options
context:
space:
mode:
authorRob Herring <[email protected]>2016-01-29 16:36:28 -0600
committerDave Airlie <[email protected]>2016-02-02 09:58:29 +1000
commitf87330dbce3f67cb531194f63a5db59685dcbbd3 (patch)
tree3800acb99c5ee8b8bd1bd73995ab44e6288c565d /src/gallium/auxiliary/target-helpers
parent6711592c2f30307948487a448094e0ff5dc1aedc (diff)
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 <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/target-helpers')
-rw-r--r--src/gallium/auxiliary/target-helpers/drm_helper.h7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/gallium/auxiliary/target-helpers/drm_helper.h b/src/gallium/auxiliary/target-helpers/drm_helper.h
index 332b1cba984..90820d3fe91 100644
--- a/src/gallium/auxiliary/target-helpers/drm_helper.h
+++ b/src/gallium/auxiliary/target-helpers/drm_helper.h
@@ -226,14 +226,9 @@ pipe_freedreno_create_screen(int fd)
struct pipe_screen *
pipe_virgl_create_screen(int fd)
{
- struct virgl_winsys *vws;
struct pipe_screen *screen;
- vws = virgl_drm_winsys_create(fd);
- if (!vws)
- return NULL;
-
- screen = virgl_create_screen(vws);
+ screen = virgl_drm_screen_create(fd);
return screen ? debug_screen_wrap(screen) : NULL;
}