summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQiang Yu <Qiang.Yu@amd.com>2017-01-10 18:51:55 +0800
committerAdam Jackson <ajax@redhat.com>2017-01-11 15:04:12 -0500
commit14516988e095ed748e738c14a87c3656006846f7 (patch)
treefb41e89bf20a38e79095e334424be5e46938d19d
parent3381e2c26b2ac40b1dd909439bf72559b80d0d86 (diff)
randr: fix xserver crash when xrandr setprovideroutputsource
xrandr --setprovideroutputsource <screen> <gpu screen> Xorg: ../../../xserver/dix/dispatch.c:4018: AttachOutputGPU: Assertion `new->isGPU' failed. GPUScreen is not allowed to be sink output. Signed-off-by: Qiang Yu <Qiang.Yu@amd.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry picked from commit 555e0a42d138ac8d83af62638752a1bebad602d6)
-rw-r--r--randr/rrprovider.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/randr/rrprovider.c b/randr/rrprovider.c
index f9df67e0b..e4bc2bf6a 100644
--- a/randr/rrprovider.c
+++ b/randr/rrprovider.c
@@ -338,6 +338,9 @@ ProcRRSetProviderOutputSource(ClientPtr client)
pScreen = provider->pScreen;
pScrPriv = rrGetScrPriv(pScreen);
+ if (!pScreen->isGPU)
+ return BadValue;
+
pScrPriv->rrProviderSetOutputSource(pScreen, provider, source_provider);
RRInitPrimeSyncProps(pScreen);