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>
This commit is contained in:
Hans de Goede
2016-05-13 15:58:10 +02:00
parent bab0f450a7
commit 5c7af02b10
11 changed files with 104 additions and 108 deletions

View File

@@ -526,8 +526,12 @@ rrCheckPixmapBounding(ScreenPtr pScreen,
RegionUnion(&total_region, &total_region, &new_crtc_region);
}
xorg_list_for_each_entry(slave, &pScreen->output_slave_list, output_head) {
xorg_list_for_each_entry(slave, &pScreen->slave_list, slave_head) {
rrScrPrivPtr slave_priv = rrGetScrPriv(slave);
if (!slave->is_output_slave)
continue;
for (c = 0; c < slave_priv->numCrtcs; c++) {
RRCrtcPtr slave_crtc = slave_priv->crtcs[c];
@@ -1700,7 +1704,10 @@ RRConstrainCursorHarder(DeviceIntPtr pDev, ScreenPtr pScreen, int mode, int *x,
if (ret == TRUE)
return;
xorg_list_for_each_entry(slave, &pScreen->output_slave_list, output_head) {
xorg_list_for_each_entry(slave, &pScreen->slave_list, slave_head) {
if (!slave->is_output_slave)
continue;
ret = check_all_screen_crtcs(slave, x, y);
if (ret == TRUE)
return;
@@ -1711,7 +1718,10 @@ RRConstrainCursorHarder(DeviceIntPtr pDev, ScreenPtr pScreen, int mode, int *x,
if (ret == TRUE)
return;
xorg_list_for_each_entry(slave, &pScreen->output_slave_list, output_head) {
xorg_list_for_each_entry(slave, &pScreen->slave_list, slave_head) {
if (!slave->is_output_slave)
continue;
ret = constrain_all_screen_crtcs(pDev, slave, x, y);
if (ret == TRUE)
return;