loader/dri3: add drawable type set by GLX and EGL

Drawable type include more information which can be used
to distinguish pixmap and pbuffer which both treated as
pixmap before.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13750>
This commit is contained in:
Qiang Yu
2021-11-12 10:25:11 +08:00
committed by Marge Bot
parent 887f5a6320
commit 13bf30583c
4 changed files with 45 additions and 1 deletions
+2
View File
@@ -384,6 +384,7 @@ loader_dri3_drawable_fini(struct loader_dri3_drawable *draw)
int
loader_dri3_drawable_init(xcb_connection_t *conn,
xcb_drawable_t drawable,
enum loader_dri3_drawable_type type,
__DRIscreen *dri_screen,
bool is_different_gpu,
bool multiplanes_available,
@@ -403,6 +404,7 @@ loader_dri3_drawable_init(xcb_connection_t *conn,
draw->ext = ext;
draw->vtable = vtable;
draw->drawable = drawable;
draw->type = type;
draw->region = 0;
draw->dri_screen = dri_screen;
draw->is_different_gpu = is_different_gpu;
+9
View File
@@ -116,6 +116,13 @@ struct loader_dri3_vtable {
#define LOADER_DRI3_NUM_BUFFERS (1 + LOADER_DRI3_MAX_BACK)
enum loader_dri3_drawable_type {
LOADER_DRI3_DRAWABLE_UNKNOWN,
LOADER_DRI3_DRAWABLE_WINDOW,
LOADER_DRI3_DRAWABLE_PIXMAP,
LOADER_DRI3_DRAWABLE_PBUFFER,
};
struct loader_dri3_drawable {
xcb_connection_t *conn;
xcb_screen_t *screen;
@@ -129,6 +136,7 @@ struct loader_dri3_drawable {
uint8_t have_back;
uint8_t have_fake_front;
uint8_t is_pixmap;
enum loader_dri3_drawable_type type;
/* Information about the GPU owning the buffer */
__DRIscreen *dri_screen;
@@ -202,6 +210,7 @@ loader_dri3_drawable_fini(struct loader_dri3_drawable *draw);
int
loader_dri3_drawable_init(xcb_connection_t *conn,
xcb_drawable_t drawable,
enum loader_dri3_drawable_type type,
__DRIscreen *dri_screen,
bool is_different_gpu,
bool is_multiplanes_available,