modesetting: ms_dri2_create_buffer: check screen of existing front buffers
If a frontbuffer drawable already has a pixmap, make sure it was created on the right screen. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
This commit is contained in:
parent
35c4e96ed1
commit
03a7c50202
@ -118,17 +118,6 @@ get_drawable_pixmap(DrawablePtr drawable)
|
|||||||
return screen->GetWindowPixmap((WindowPtr) drawable);
|
return screen->GetWindowPixmap((WindowPtr) drawable);
|
||||||
}
|
}
|
||||||
|
|
||||||
static PixmapPtr
|
|
||||||
get_front_buffer(DrawablePtr drawable)
|
|
||||||
{
|
|
||||||
PixmapPtr pixmap;
|
|
||||||
|
|
||||||
pixmap = get_drawable_pixmap(drawable);
|
|
||||||
pixmap->refcnt++;
|
|
||||||
|
|
||||||
return pixmap;
|
|
||||||
}
|
|
||||||
|
|
||||||
static DRI2Buffer2Ptr
|
static DRI2Buffer2Ptr
|
||||||
ms_dri2_create_buffer(DrawablePtr drawable, unsigned int attachment,
|
ms_dri2_create_buffer(DrawablePtr drawable, unsigned int attachment,
|
||||||
unsigned int format)
|
unsigned int format)
|
||||||
@ -152,8 +141,13 @@ ms_dri2_create_buffer(DrawablePtr drawable, unsigned int attachment,
|
|||||||
}
|
}
|
||||||
|
|
||||||
pixmap = NULL;
|
pixmap = NULL;
|
||||||
if (attachment == DRI2BufferFrontLeft)
|
if (attachment == DRI2BufferFrontLeft) {
|
||||||
pixmap = get_front_buffer(drawable);
|
pixmap = get_drawable_pixmap(drawable);
|
||||||
|
if (pixmap && pixmap->drawable.pScreen != screen)
|
||||||
|
pixmap = NULL;
|
||||||
|
if (pixmap)
|
||||||
|
pixmap->refcnt++;
|
||||||
|
}
|
||||||
|
|
||||||
if (pixmap == NULL) {
|
if (pixmap == NULL) {
|
||||||
int pixmap_width = drawable->width;
|
int pixmap_width = drawable->width;
|
||||||
|
Loading…
Reference in New Issue
Block a user