xserver-multidpi/randr
Hans de Goede a46afee84d randr: rrCheckPixmapBounding: do not shrink the screen_pixmap
The purpose of rrCheckPixmapBounding is to make sure that the
screen_pixmap is *large* enough for the slave-output which crtc is
being configured.

However until now rrCheckPixmapBounding would also shrink the
screen_pixmap in certain scenarios leading to various problems.

For example: Take a laptop with its internalscreen on a slave-output and
currently disabled and an external monitor at 1920x1080+0+0.
Now lets say that we want to drive the external monitor at its native
resolution of 2560x1440 and have the internal screen mirror the top left
part of the external monitor, so we run:

  $ xrandr --output eDP --mode 1920x1080 --pos 0x0 --output HDMI \
  --mode 2560x1440 --pos 0x0

Here xrandr utility first calls RRSetScreenSize to 2560x1440, then it
calls RRSetCrtc 1920x1080+0+0 on the eDP, since this is a slave output,
rrCheckPixmapBounding gets called and resizes the screen_pixmap to
1920x1080, undoing the RRSetScreenSize. Then RRSetCrtc 2560x1440+0+0
gets called on the HDMI, depending on crtc->transforms this will
either result in a BadValue error from ProcRRSetCrtcConfig; or
it will succeed, but the monitor ends up running at 2560x1440
while showing a 1920x1080 screen_pixmap + black borders on the right
and bottom. Neither of which is what we want.

This commit removes the troublesome shrinking behavior, fixing this.

Note:

1) One could argue that this will leave us with a too large screen_pixmap
in some cases, but rrCheckPixmapBounding only gets called for slave
outputs, so xrandr clients already must manually shrink the screen_pixmap
after disabling crtcs in normal setups.

2) An alternative approach would be to also call rrCheckPixmapBounding
on RRSetCrtc on normal (non-slave) outputs, but that would result in
2 unnecessary resizes of the screen_pixmap in the above example, which
seems undesirable.

Cc: Nikhil Mahale <nmahale@nvidia.com>
Cc: Dave Airlie <airlied@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2016-12-05 11:21:49 +01:00
..
Makefile.am randr: Add Monitor support (v1.1) 2015-03-31 12:32:04 +10:00
randr.c randr: Adjust master's last set time with slaves 2016-06-17 11:38:13 +02:00
randrstr.h randr: Add RRHasScanoutPixmap helper function 2016-09-13 10:26:47 +02:00
rrcrtc.c randr: rrCheckPixmapBounding: do not shrink the screen_pixmap 2016-12-05 11:21:49 +01:00
rrdispatch.c randr: Allow RRSelectInput for ProviderChange and ResourceChange events 2015-09-23 13:12:21 -04:00
rrinfo.c Convert top level extensions to new *allocarray functions 2015-04-21 16:57:08 -07:00
rrmode.c Convert top level extensions to new *allocarray functions 2015-04-21 16:57:08 -07:00
rrmonitor.c xrandrprovider: Do not use separate lists for unbound / source / offload slaves 2016-06-17 11:35:58 +02:00
rroutput.c xrandrprovider: Do not use separate lists for unbound / source / offload slaves 2016-06-17 11:35:58 +02:00
rrpointer.c randr: Fix logic in RRPointerToNearestCrtc 2014-07-30 14:40:17 -07:00
rrproperty.c Convert top level extensions to new *allocarray functions 2015-04-21 16:57:08 -07:00
rrprovider.c randr: Add ability to turn PRIME sync off 2016-07-05 14:30:27 -04:00
rrproviderproperty.c Convert top level extensions to new *allocarray functions 2015-04-21 16:57:08 -07:00
rrscreen.c xrandrprovider: Do not use separate lists for unbound / source / offload slaves 2016-06-17 11:35:58 +02:00
rrsdispatch.c randr: Add Monitor support (v1.1) 2015-03-31 12:32:04 +10:00
rrtransform.c randr: Silence -Wshift-negative-value warnings 2015-10-19 11:51:52 -04:00
rrtransform.h Drop trailing whitespaces 2014-11-12 10:25:00 +10:00
rrxinerama.c randr: Use Monitor list for Xinerama 2015-03-31 12:32:04 +10:00