1
0
xorg-x11-server/u_randr-Do-not-crash-if-slave-screen-does-not-have-pro.patch
Stefan Dirsch acfb9a6c3f Accepting request 596204 from home:michalsrb:branches:bnc1068961:X11:XOrg
- U_xfree86-Remove-broken-RANDR-disabling-logic-v4.patch
  * Fix crash on initialization when fbdev and modesetting are used
    together. (bnc#1068961)
- u_randr-Do-not-crash-if-slave-screen-does-not-have-pro.patch
  * Fix crash when using randr when fbdev and modesetting are used
    together. (bnc#1068961)

OBS-URL: https://build.opensuse.org/request/show/596204
OBS-URL: https://build.opensuse.org/package/show/X11:XOrg/xorg-x11-server?expand=0&rev=698
2018-04-13 09:01:22 +00:00

42 lines
1.7 KiB
Diff

Patch-mainline: To be upstreamed
Author: Michal Srb <msrb@suse.com>
Subject: randr: Do not crash if slave screen does not have provider.
References: bnc#1068961
All GPU screens are attached as unbound GPUs to master, even if they have no
capabilities or the provider field is null. Handle that case in RRTellChanged.
---
This prevents crash in setups with for example two qxl devices, or fbdev and
qxl device. I am not sure if it is a proper fix and not just papering over a
bug somewhere else, but there are more places that test whether the provider
is set, so maybe it is correct way.
I would think that if a slave screen does not have provider, there is no reason
for it to become an unbound GPU in master's slave_list. Similarly if master has
no provider, then having anything in slave_list is useless. But it seems the
AttachUnboundGPU and the rest of the code handling screen to GPU screen
attachments does not know about randr's privates, so it can not check whether
provider is there.
randr/randr.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/randr/randr.c b/randr/randr.c
index feb54bcc8..661f66da2 100644
--- a/randr/randr.c
+++ b/randr/randr.c
@@ -643,7 +643,9 @@ RRTellChanged(ScreenPtr pScreen)
xorg_list_for_each_entry(iter, &master->slave_list, slave_head) {
pSlaveScrPriv = rrGetScrPriv(iter);
- pSlaveScrPriv->provider->changed = FALSE;
+ if (pSlaveScrPriv->provider) {
+ pSlaveScrPriv->provider->changed = FALSE;
+ }
if (iter->is_output_slave) {
for (i = 0; i < pSlaveScrPriv->numOutputs; i++)
pSlaveScrPriv->outputs[i]->changed = FALSE;
--
2.13.6