diff options
author | Hans de Goede <hdegoede@redhat.com> | 2016-05-13 15:58:10 +0200 |
---|---|---|
committer | Hans de Goede <hdegoede@redhat.com> | 2016-06-17 11:35:58 +0200 |
commit | 5c7af02b103790ac1fb6a71822788892c70290b6 (patch) | |
tree | 461aac3e1d7caacda49b58c5226319e0b74ffa77 /randr/randr.c | |
parent | bab0f450a719a11799491043b82c2f293fed27fe (diff) |
xrandrprovider: Do not use separate lists for unbound / source / offload slaves
A single provider can be both a offload and source slave at the same time,
the use of seperate lists breaks in this case e.g. :
xrandr --listproviders
Providers: number : 2
Provider 0: id: 0x7b cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 3 outputs: 2 associated providers: 0 name:modesetting
Provider 1: id: 0x46 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 2 outputs: 5 associated providers: 0 name:modesetting
xrandr --setprovideroutputsource 1 0x7b
xrandr --listproviders
Providers: number : 2
Provider 0: id: 0x7b cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 3 outputs: 2 associated providers: 1 name:modesetting
Provider 1: id: 0x46 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 2 outputs: 5 associated providers: 1 name:modesetting
xrandr --setprovideroffloadsink 1 0x7b
xrandr --listproviders
Providers: number : 3
Provider 0: id: 0x7b cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 3 outputs: 2 associated providers: 2 name:modesetting
Provider 1: id: 0x46 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 2 outputs: 5 associated providers: 2 name:modesetting
Provider 2: id: 0x46 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 2 outputs: 5 associated providers: 2 name:modesetting
Not good. The problem is that the provider with id 0x46 now is on both
the output_slave_list and the offload_slave_list of the master screen.
This commit fixes this by unifying all 3 lists into a single slaves list.
Note that this does change the struct _Screen definition, so this is an ABI
break. I do not expect any of the drivers to actually use the removed / changed
fields so a recompile should suffice.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'randr/randr.c')
-rw-r--r-- | randr/randr.c | 42 |
1 files changed, 16 insertions, 26 deletions
diff --git a/randr/randr.c b/randr/randr.c index 3aabb1981..95ed7e5e6 100644 --- a/randr/randr.c +++ b/randr/randr.c @@ -483,7 +483,10 @@ TellChanged(WindowPtr pWin, void *value) RRDeliverCrtcEvent(client, pWin, crtc); } - xorg_list_for_each_entry(iter, &pScreen->output_slave_list, output_head) { + xorg_list_for_each_entry(iter, &pScreen->slave_list, slave_head) { + if (!iter->is_output_slave) + continue; + pSlaveScrPriv = rrGetScrPriv(iter); for (i = 0; i < pSlaveScrPriv->numCrtcs; i++) { RRCrtcPtr crtc = pSlaveScrPriv->crtcs[i]; @@ -502,7 +505,10 @@ TellChanged(WindowPtr pWin, void *value) RRDeliverOutputEvent(client, pWin, output); } - xorg_list_for_each_entry(iter, &pScreen->output_slave_list, output_head) { + xorg_list_for_each_entry(iter, &pScreen->slave_list, slave_head) { + if (!iter->is_output_slave) + continue; + pSlaveScrPriv = rrGetScrPriv(iter); for (i = 0; i < pSlaveScrPriv->numOutputs; i++) { RROutputPtr output = pSlaveScrPriv->outputs[i]; @@ -514,17 +520,7 @@ TellChanged(WindowPtr pWin, void *value) } if (pRREvent->mask & RRProviderChangeNotifyMask) { - xorg_list_for_each_entry(iter, &pScreen->output_slave_list, output_head) { - pSlaveScrPriv = rrGetScrPriv(iter); - if (pSlaveScrPriv->provider->changed) - RRDeliverProviderEvent(client, pWin, pSlaveScrPriv->provider); - } - xorg_list_for_each_entry(iter, &pScreen->offload_slave_list, offload_head) { - pSlaveScrPriv = rrGetScrPriv(iter); - if (pSlaveScrPriv->provider->changed) - RRDeliverProviderEvent(client, pWin, pSlaveScrPriv->provider); - } - xorg_list_for_each_entry(iter, &pScreen->unattached_list, unattached_head) { + xorg_list_for_each_entry(iter, &pScreen->slave_list, slave_head) { pSlaveScrPriv = rrGetScrPriv(iter); if (pSlaveScrPriv->provider->changed) RRDeliverProviderEvent(client, pWin, pSlaveScrPriv->provider); @@ -602,21 +598,15 @@ RRTellChanged(ScreenPtr pScreen) for (i = 0; i < pScrPriv->numCrtcs; i++) pScrPriv->crtcs[i]->changed = FALSE; - xorg_list_for_each_entry(iter, &master->output_slave_list, output_head) { - pSlaveScrPriv = rrGetScrPriv(iter); - pSlaveScrPriv->provider->changed = FALSE; - for (i = 0; i < pSlaveScrPriv->numOutputs; i++) - pSlaveScrPriv->outputs[i]->changed = FALSE; - for (i = 0; i < pSlaveScrPriv->numCrtcs; i++) - pSlaveScrPriv->crtcs[i]->changed = FALSE; - } - xorg_list_for_each_entry(iter, &master->offload_slave_list, offload_head) { - pSlaveScrPriv = rrGetScrPriv(iter); - pSlaveScrPriv->provider->changed = FALSE; - } - xorg_list_for_each_entry(iter, &master->unattached_list, unattached_head) { + xorg_list_for_each_entry(iter, &master->slave_list, slave_head) { pSlaveScrPriv = rrGetScrPriv(iter); pSlaveScrPriv->provider->changed = FALSE; + if (iter->is_output_slave) { + for (i = 0; i < pSlaveScrPriv->numOutputs; i++) + pSlaveScrPriv->outputs[i]->changed = FALSE; + for (i = 0; i < pSlaveScrPriv->numCrtcs; i++) + pSlaveScrPriv->crtcs[i]->changed = FALSE; + } } if (mastersp->layoutChanged) { |