xserver-multidpi/hw/xfree86
Jose Maria Casanova Crespo 73480f172a 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"
2020-06-27 08:29:45 +00:00
..
common Xorg: honor AutoRepeat option 2020-04-10 16:38:17 +02:00
ddc xfree86: add drm modes on non-GTF panels 2020-06-23 13:09:20 +08:00
dixmods glx: unbreak on Unix without /usr/include/drm 2020-05-27 07:15:07 +00:00
doc xfree86: Remove -flippixels 2018-09-27 16:50:22 +00:00
dri hw/xfree86: unvalidated lengths 2017-10-10 23:33:44 +02:00
dri2 dri2: Set fallback driver names for Intel and AMD chips 2019-09-30 12:57:22 -04:00
drivers modesetting: Fix front_bo leak at drmmode_xf86crtc_resize on XRandR rotation 2020-06-27 08:29:45 +00:00
exa meson: Install man pages 2018-03-27 10:28:33 -04:00
fbdevhw xfree86: ensure the readlink buffer is null-terminated 2018-10-17 09:41:15 +10:00
glamor_egl glamor: Make Xv extension initialize at depth 30. 2018-02-27 10:18:06 -05:00
i2c Add a Meson build system alongside autotools. 2017-04-26 15:25:27 -07:00
int10 xfree86: Merge vbe into int10 2019-10-02 10:03:26 -04:00
loader loader: strdup const string assigned to local variable name 2020-01-28 20:35:06 +00:00
man Update URL's in man pages 2020-05-10 17:46:33 -07:00
modes xfree86: add drm modes on non-GTF panels 2020-06-23 13:09:20 +08:00
os-support Remove BSD APM support. 2020-06-03 17:33:10 +02:00
parser Fix various spelling errors 2019-10-01 17:05:28 +00:00
ramdac hw/xfree86: Avoid cursor use after free 2020-06-24 08:02:59 +00:00
shadowfb meson: Fix linkage of loadable modules for PE/COFF 2017-10-12 15:22:04 -04:00
utils gtf: Warning fix 2018-04-05 14:18:16 -04:00
vgahw xfree86: Remove -flippixels 2018-09-27 16:50:22 +00:00
x86emu Fix various spelling errors 2019-10-01 17:05:28 +00:00
xkb Move statically linked xorgxkb files from dixmods to a separate directory 2017-06-27 12:42:06 -04:00
.gitignore Xorg: Add Xorg.wrap to hw/xfree86/.gitignore 2014-04-18 11:39:16 +02:00
Makefile.am xfree86: Merge vbe into int10 2019-10-02 10:03:26 -04:00
meson.build xfree86: Merge vbe into int10 2019-10-02 10:03:26 -04:00
sdksyms.sh include: Remove now-empty site.h 2019-10-30 16:17:04 +00:00
xorg-wrapper.c Fix various spelling errors 2019-10-01 17:05:28 +00:00
Xorg.sh.in xfree86: rename Xorg.bin to Xorg 2015-01-05 09:53:58 +10:00
xorgconf.cpp xfree86: Remove NoTrapSignals 2018-09-12 20:47:15 +00:00