loader_dri3/glx/egl: Reinstate the loader_dri3_vtable get_dri_screen callback
Removing this callback caused rendering corruption in some multi-screen cases,
so it is reinstated but without the drawable argument which was never used
by implementations and was confusing since the drawable could have been
created with another screen.
Cc: "17.3 18.0" mesa-stable@lists.freedesktop.org
Fixes: 5198e48a0d (loader_dri3/glx/egl: Remove the loader_dri3_vtable get_dri_screen callback)
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105013
Reported-by: Daniel van Vugt <daniel.van.vugt@canonical.com>
Tested-by: Timo Aaltonen <tjaalton@ubuntu.com>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
This commit is contained in:
@@ -1318,6 +1318,7 @@ dri3_get_pixmap_buffer(__DRIdrawable *driDrawable, unsigned int format,
|
||||
xcb_sync_fence_t sync_fence;
|
||||
struct xshmfence *shm_fence;
|
||||
int fence_fd;
|
||||
__DRIscreen *cur_screen;
|
||||
|
||||
if (buffer)
|
||||
return buffer;
|
||||
@@ -1348,8 +1349,17 @@ dri3_get_pixmap_buffer(__DRIdrawable *driDrawable, unsigned int format,
|
||||
if (!bp_reply)
|
||||
goto no_image;
|
||||
|
||||
/* Get the currently-bound screen or revert to using the drawable's screen if
|
||||
* no contexts are currently bound. The latter case is at least necessary for
|
||||
* obs-studio, when using Window Capture (Xcomposite) as a Source.
|
||||
*/
|
||||
cur_screen = draw->vtable->get_dri_screen();
|
||||
if (!cur_screen) {
|
||||
cur_screen = draw->dri_screen;
|
||||
}
|
||||
|
||||
buffer->image = loader_dri3_create_image(draw->conn, bp_reply, format,
|
||||
draw->dri_screen, draw->ext->image,
|
||||
cur_screen, draw->ext->image,
|
||||
buffer);
|
||||
if (!buffer->image)
|
||||
goto no_image;
|
||||
|
||||
@@ -99,6 +99,7 @@ struct loader_dri3_vtable {
|
||||
void (*set_drawable_size)(struct loader_dri3_drawable *, int, int);
|
||||
bool (*in_current_context)(struct loader_dri3_drawable *);
|
||||
__DRIcontext *(*get_dri_context)(struct loader_dri3_drawable *);
|
||||
__DRIscreen *(*get_dri_screen)(void);
|
||||
void (*flush_drawable)(struct loader_dri3_drawable *, unsigned);
|
||||
void (*show_fps)(struct loader_dri3_drawable *, uint64_t);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user