diff options
author | Emil Velikov <[email protected]> | 2014-06-12 15:41:29 +0100 |
---|---|---|
committer | Emil Velikov <[email protected]> | 2014-06-22 23:05:49 +0100 |
commit | 9df2c4956b6fc4fff1497923d42011c16e777322 (patch) | |
tree | 74d4e3ed92d980e68aedde023a86df01bea2e7a7 /src/gallium/auxiliary/vl | |
parent | 8b2e0ddf8a0e8a9b30fccf07051fbf20c1798c0d (diff) |
targets/vdpau-nouveau: convert to static/shared pipe-drivers
Create a single library (for the vdpau api) thus reducing
the overall size of mesa. Current commit converts
vdpau-nouveau, with upcomming commits handling the rest.
The library can be built with the relevant pipe-drivers
statically linked in, or loaded as shared modules.
Currently we default to static.
Add SPLIT_TARGETS to guard the other VL targets.
Note: symlink handling is rather ugly and will need an
update to work with BSD and other non-linux platforms.
v2: Split the conversion into per-target basis.
Cc: Maarten Lankhorst <[email protected]>
Cc: Ilia Mirkin <[email protected]>
Signed-off-by: Emil Velikov <[email protected]>
Tested-by: Thomas Helland <thomashelland90 at gmail.com>
Diffstat (limited to 'src/gallium/auxiliary/vl')
-rw-r--r-- | src/gallium/auxiliary/vl/vl_winsys.h | 2 | ||||
-rw-r--r-- | src/gallium/auxiliary/vl/vl_winsys_dri.c | 24 |
2 files changed, 25 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/vl/vl_winsys.h b/src/gallium/auxiliary/vl/vl_winsys.h index 642f0108d02..f6b47c964f9 100644 --- a/src/gallium/auxiliary/vl/vl_winsys.h +++ b/src/gallium/auxiliary/vl/vl_winsys.h @@ -38,10 +38,12 @@ struct pipe_screen; struct pipe_surface; +struct pipe_loader_device; struct vl_screen { struct pipe_screen *pscreen; + struct pipe_loader_device *dev; }; struct vl_screen* diff --git a/src/gallium/auxiliary/vl/vl_winsys_dri.c b/src/gallium/auxiliary/vl/vl_winsys_dri.c index 5d83e5799da..d1bbcc2ed58 100644 --- a/src/gallium/auxiliary/vl/vl_winsys_dri.c +++ b/src/gallium/auxiliary/vl/vl_winsys_dri.c @@ -40,6 +40,7 @@ #include "pipe/p_screen.h" #include "pipe/p_context.h" #include "pipe/p_state.h" +#include "pipe-loader/pipe_loader.h" #include "state_tracker/drm_driver.h" #include "util/u_memory.h" @@ -375,10 +376,19 @@ vl_screen_create(Display *display, int screen) if (authenticate == NULL || !authenticate->authenticated) goto free_authenticate; +#if SPLIT_TARGETS scrn->base.pscreen = driver_descriptor.create_screen(fd); +#else +#if GALLIUM_STATIC_TARGETS + scrn->base.pscreen = dd_create_screen(fd); +#else + if (pipe_loader_drm_probe_fd(&scrn->base.dev, fd, true)) + scrn->base.pscreen = pipe_loader_create_screen(scrn->base.dev, PIPE_SEARCH_DIR); +#endif // GALLIUM_STATIC_TARGETS +#endif // SPLIT_TARGETS if (!scrn->base.pscreen) - goto free_authenticate; + goto release_pipe; scrn->base.pscreen->flush_frontbuffer = vl_dri2_flush_frontbuffer; vl_compositor_reset_dirty_area(&scrn->dirty_areas[0]); @@ -391,6 +401,13 @@ vl_screen_create(Display *display, int screen) return &scrn->base; +release_pipe: +#if !SPLIT_TARGETS +#if !GALLIUM_STATIC_TARGETS + if (scrn->base.dev) + pipe_loader_release(&scrn->base.dev, 1); +#endif // !GALLIUM_STATIC_TARGETS +#endif // !SPLIT_TARGETS free_authenticate: free(authenticate); free_connect: @@ -418,5 +435,10 @@ void vl_screen_destroy(struct vl_screen *vscreen) vl_dri2_destroy_drawable(scrn); scrn->base.pscreen->destroy(scrn->base.pscreen); +#if !SPLIT_TARGETS +#if !GALLIUM_STATIC_TARGETS + pipe_loader_release(&scrn->base.dev, 1); +#endif // !GALLIUM_STATIC_TARGETS +#endif // !SPLIT_TARGETS FREE(scrn); } |