summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-03-08 12:10:24 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2012-03-08 12:18:11 +0000
commit33af42e6284f104ed3c4cdba4bf3b1c29322ce9c (patch)
treeb3cbe8da5e365f89768eb3703222425da66927e8
parent6abfa4c5662e5294edc501953dbfa7aabf0b2f57 (diff)
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>
-rw-r--r--src/sna/kgem.c2
-rw-r--r--src/sna/sna_accel.c9
2 files changed, 10 insertions, 1 deletions
diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index 2dff2ed1..cfa46cf1 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -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)
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 2769d4b8..a1798a5e 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -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",