summaryrefslogtreecommitdiff
path: root/uxa/uxa.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-05-31 17:23:36 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2010-05-31 18:00:11 +0100
commitcd38b705be84901a38380dc2a1b90889b553d565 (patch)
tree7e3f647b1cbf7e9bda7297fda95d04f6aa139cf7 /uxa/uxa.c
parent5fff430046db2030f89e49beb66c6476dc3fcd4c (diff)
Disable acceleration if we detect a hardware error.
This is wildly optimistic, but it should work in a surprising number of error situations and some output in those cases will be hopefully be better than none... If we submit a batchbuffer and the kernel reports the GPU is hung (which will be caused by an earlier execbuffer, and so the kernel should have had enough time to determine whether or not it could reset the GPU) then disable any further attempt to accelerate gfx and force fallbacks to map the buffers and use the CPU. We cannot normally map any more buffers if the GPU is hung, so only those already mapped prior to the hang can be written to, or those allocated in system memory. However, we can expect that the framebuffer is already mapped, and so have a reasonable expectation to continue to see the display update. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'uxa/uxa.c')
-rw-r--r--uxa/uxa.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/uxa/uxa.c b/uxa/uxa.c
index 330b3893..a9a705c2 100644
--- a/uxa/uxa.c
+++ b/uxa/uxa.c
@@ -350,6 +350,13 @@ void uxa_set_fallback_debug(ScreenPtr screen, Bool enable)
uxa_screen->fallback_debug = enable;
}
+void uxa_set_force_fallback(ScreenPtr screen, Bool value)
+{
+ uxa_screen_t *uxa_screen = uxa_get_screen(screen);
+
+ uxa_screen->force_fallback = value;
+}
+
/**
* uxa_close_screen() unwraps its wrapped screen functions and tears down UXA's
* screen private, before calling down to the next CloseSccreen.
@@ -473,6 +480,8 @@ Bool uxa_driver_init(ScreenPtr screen, uxa_driver_t * uxa_driver)
dixSetPrivate(&screen->devPrivates, &uxa_screen_index, uxa_screen);
+ uxa_screen->force_fallback = FALSE;
+
uxa_screen->solid_cache_size = 0;
uxa_screen->solid_clear = 0;
uxa_screen->solid_black = 0;