mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-04 04:50:11 +01:00
gallium/video: Move DRI2 support behind legacy-x11
Acked-by: Daniel Stone <daniels@collabora.com> Reviewed-by: David Heidelberg <david@ixit.cz> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29969>
This commit is contained in:
parent
ae51322d7b
commit
b919bdc6f6
4 changed files with 14 additions and 0 deletions
|
|
@ -32,7 +32,9 @@
|
|||
|
||||
#include <X11/Xlib-xcb.h>
|
||||
#include <X11/extensions/dri2tokens.h>
|
||||
#ifdef HAVE_X11_DRI2
|
||||
#include <xcb/dri2.h>
|
||||
#endif
|
||||
#include <xf86drm.h>
|
||||
#include <errno.h>
|
||||
|
||||
|
|
@ -67,13 +69,16 @@ struct vl_dri_screen
|
|||
struct u_rect dirty_areas[2];
|
||||
|
||||
bool flushed;
|
||||
#ifdef HAVE_X11_DRI2
|
||||
xcb_dri2_swap_buffers_cookie_t swap_cookie;
|
||||
xcb_dri2_wait_sbc_cookie_t wait_cookie;
|
||||
xcb_dri2_get_buffers_cookie_t buffers_cookie;
|
||||
#endif
|
||||
|
||||
int64_t last_ust, ns_frame, last_msc, next_msc;
|
||||
};
|
||||
|
||||
#ifdef HAVE_X11_DRI2
|
||||
static const unsigned attachments[1] = { XCB_DRI2_ATTACHMENT_BUFFER_BACK_LEFT };
|
||||
|
||||
static void vl_dri2_screen_destroy(struct vl_screen *vscreen);
|
||||
|
|
@ -317,6 +322,7 @@ get_xcb_screen(xcb_screen_iterator_t iter, int screen)
|
|||
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
static xcb_visualtype_t *
|
||||
get_xcb_visualtype_for_depth(struct vl_screen *vscreen, int depth)
|
||||
|
|
@ -370,6 +376,7 @@ vl_dri2_format_for_depth(struct vl_screen *vscreen, int depth)
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef HAVE_X11_DRI2
|
||||
struct vl_screen *
|
||||
vl_dri2_screen_create(Display *display, int screen)
|
||||
{
|
||||
|
|
@ -520,3 +527,4 @@ vl_dri2_screen_destroy(struct vl_screen *vscreen)
|
|||
/* There is no user provided fd */
|
||||
FREE(scrn);
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -77,8 +77,10 @@ struct vl_screen *omx_get_screen(void)
|
|||
goto error;
|
||||
|
||||
omx_screen = vl_dri3_screen_create(omx_display, 0);
|
||||
#ifdef HAVE_X11_DRI2
|
||||
if (!omx_screen)
|
||||
omx_screen = vl_dri2_screen_create(omx_display, 0);
|
||||
#endif
|
||||
if (!omx_screen) {
|
||||
XCloseDisplay(omx_display);
|
||||
goto error;
|
||||
|
|
|
|||
|
|
@ -145,8 +145,10 @@ VA_DRIVER_INIT_FUNC(VADriverContextP ctx)
|
|||
case VA_DISPLAY_GLX:
|
||||
case VA_DISPLAY_X11:
|
||||
drv->vscreen = vl_dri3_screen_create(ctx->native_dpy, ctx->x11_screen);
|
||||
#ifdef HAVE_X11_DRI2
|
||||
if (!drv->vscreen)
|
||||
drv->vscreen = vl_dri2_screen_create(ctx->native_dpy, ctx->x11_screen);
|
||||
#endif
|
||||
if (!drv->vscreen)
|
||||
drv->vscreen = vl_xlib_swrast_screen_create(ctx->native_dpy, ctx->x11_screen);
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -64,8 +64,10 @@ vdp_imp_device_create_x11(Display *display, int screen, VdpDevice *device,
|
|||
pipe_reference_init(&dev->reference, 1);
|
||||
|
||||
dev->vscreen = vl_dri3_screen_create(display, screen);
|
||||
#ifdef HAVE_X11_DRI2
|
||||
if (!dev->vscreen)
|
||||
dev->vscreen = vl_dri2_screen_create(display, screen);
|
||||
#endif
|
||||
if (!dev->vscreen)
|
||||
dev->vscreen = vl_xlib_swrast_screen_create(display, screen);
|
||||
if (!dev->vscreen) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue