sna: Force the creation of a backing pixmap for scanout
Ordinarily if the GPU is wedged, we just want to create a shadow buffer. Except that we must ensure that we do allow a bo to be created for attaching to the scanout. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
6abfa4c566
commit
33af42e628
|
|
@ -2365,7 +2365,7 @@ unsigned kgem_can_create_2d(struct kgem *kgem,
|
|||
uint32_t pitch, size;
|
||||
unsigned flags = 0;
|
||||
|
||||
if (depth < 8 || kgem->wedged)
|
||||
if (depth < 8)
|
||||
return 0;
|
||||
|
||||
if (width > MAXSHORT || height > MAXSHORT)
|
||||
|
|
|
|||
|
|
@ -730,6 +730,14 @@ static PixmapPtr sna_create_pixmap(ScreenPtr screen,
|
|||
}
|
||||
assert(width && height);
|
||||
|
||||
if (wedged(sna)) {
|
||||
if (usage == SNA_CREATE_FB) {
|
||||
flags = KGEM_CAN_CREATE_GPU;
|
||||
goto force_create;
|
||||
}
|
||||
goto fallback;
|
||||
}
|
||||
|
||||
flags = kgem_can_create_2d(&sna->kgem, width, height, depth);
|
||||
if (flags == 0) {
|
||||
DBG(("%s: can not use GPU, just creating shadow\n",
|
||||
|
|
@ -758,6 +766,7 @@ static PixmapPtr sna_create_pixmap(ScreenPtr screen,
|
|||
if (usage == CREATE_PIXMAP_USAGE_GLYPH_PICTURE)
|
||||
goto fallback;
|
||||
|
||||
force_create:
|
||||
pad = PixmapBytePad(width, depth);
|
||||
if (pad * height <= 4096) {
|
||||
DBG(("%s: small buffer [%d], attaching to shadow pixmap\n",
|
||||
|
|
|
|||
Loading…
Reference in New Issue