xserver/hw/xfree86/drivers/modesetting
Jose Maria Casanova Crespo 4912f693e8 modesetting: Fix front_bo leak at drmmode_xf86crtc_resize on XRandR rotation
Since the introduction of "modesetting: Remove unnecessary fb addition from
drmmode_xf86crtc_resize" the fb_id isn't initialited at
drmmode_xf86crtc_resize.

Rotate operation of XRandR uses rotate_bo. So in this case the fb_id
associated to the front_bo is not initialized at drmmode_set_mode_major.
So fd_id remains 0.

As every call to drmmode_xf86crtc_resize allocates a new front_bo we should
destroy unconditionally the old_front_bo if operation success. So we free
the allocated GBM handles.

This avoids crashing xserver with a OOM in the RPI4 1Gb at 4k resolution
after 3 series xrandr rotations from normal to left and vice versa reported at
https://github.com/raspberrypi/firmware/issues/1345

Signed-off-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1024
Fixes: 8774532121 "modesetting: Remove unnecessary fb addition from
       drmmode_xf86crtc_resize"
(cherry picked from commit 73480f172a)
2020-07-21 15:22:48 +00:00
..
Makefile.am modesetting: Fix broken manpage in autoconf build 2019-10-30 19:38:30 +00:00
dri2.c modesetting: Disable pageflipping when using a swcursor 2020-05-22 08:07:56 +02:00
driver.c modesetting: Disable pageflipping when using a swcursor 2020-05-22 08:07:56 +02:00
driver.h modesetting: Disable pageflipping when using a swcursor 2020-05-22 08:07:56 +02:00
drmmode_display.c modesetting: Fix front_bo leak at drmmode_xf86crtc_resize on XRandR rotation 2020-07-21 15:22:48 +00:00
drmmode_display.h modesetting: Disable pageflipping when using a swcursor 2020-05-22 08:07:56 +02:00
dumb_bo.c modesetting: Include dix-config.h from dumb_bo.c 2015-05-12 08:02:11 -07:00
dumb_bo.h modesetting: Drop dumb_bo::map_count field and dead unmap code. 2014-12-11 11:26:19 -08:00
meson.build modesetting: set gbm as dependency in meson build 2018-05-08 12:41:58 -04:00
modesetting.man modesetting: Document Option "DoubleShadow" in the man page 2018-10-04 17:25:52 +02:00
pageflip.c modesetting: Use atomic modesetting to set DPMS mode 2018-04-04 14:01:48 -04:00
present.c modesetting: Disable pageflipping when using a swcursor 2020-05-22 08:07:56 +02:00
vblank.c modesetting: Check whether RandR was initialized before calling rrGetScrPriv 2020-01-13 22:11:10 +00:00