summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2015-01-17 10:09:54 +0000
committerDave Airlie <airlied@gmail.com>2015-02-01 09:23:28 +1000
commit0722a8043c89e7224c398eef270611cc65c1e219 (patch)
tree69593d9b869146becfa6af96414a4b22ba19ede1
parentf7e3478fe7817457017f31eb51803c4d03c69249 (diff)
dri2: SourceOffloads may be for DRI3 only
As a DDX may declare offload support without supporting DRI2 (because it is using an alternative acceleration mechanism like DRI3), when iterating the list of offload_source Screens to find a matching DRI2 provider we need to check before assuming it is DRI2 capable. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88514 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com> (cherry picked from commit 082931014811e587a9734cbf4d88fd948979b641)
-rw-r--r--hw/xfree86/dri2/dri2.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c
index 6459f11b1..f64ba7ca9 100644
--- a/hw/xfree86/dri2/dri2.c
+++ b/hw/xfree86/dri2/dri2.c
@@ -156,6 +156,9 @@ GetScreenPrime(ScreenPtr master, int prime_id)
DRI2ScreenPtr ds;
ds = DRI2GetScreen(slave);
+ if (ds == NULL)
+ continue;
+
if (ds->prime_id == prime_id)
return slave;
}