diff options
author | Álvaro Fernández Rojas <noltari@gmail.com> | 2021-08-21 10:54:34 +0200 |
---|---|---|
committer | Álvaro Fernández Rojas <noltari@gmail.com> | 2021-08-21 19:07:07 +0200 |
commit | 8299d1f057439f94c6a4412e2e5c5082b82a30c9 (patch) | |
tree | 1bf678d61f11f7394493be464c7876e496f7faed /target/linux/bcm27xx/patches-5.10/950-0713-drm-gud-Free-buffers-on-device-removal.patch | |
parent | 33b6885975ce376ff075362b7f0890326043111b (diff) | |
download | upstream-8299d1f057439f94c6a4412e2e5c5082b82a30c9.tar.gz upstream-8299d1f057439f94c6a4412e2e5c5082b82a30c9.tar.bz2 upstream-8299d1f057439f94c6a4412e2e5c5082b82a30c9.zip |
bcm27xx: add kernel 5.10 support
Rebased RPi foundation patches on linux 5.10.59, removed applied and reverted
patches, wireless patches and defconfig patches.
bcm2708: boot tested on RPi B+ v1.2
bcm2709: boot tested on RPi 4B v1.1 4G
bcm2711: boot tested on RPi 4B v1.1 4G
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Diffstat (limited to 'target/linux/bcm27xx/patches-5.10/950-0713-drm-gud-Free-buffers-on-device-removal.patch')
-rw-r--r-- | target/linux/bcm27xx/patches-5.10/950-0713-drm-gud-Free-buffers-on-device-removal.patch | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/target/linux/bcm27xx/patches-5.10/950-0713-drm-gud-Free-buffers-on-device-removal.patch b/target/linux/bcm27xx/patches-5.10/950-0713-drm-gud-Free-buffers-on-device-removal.patch new file mode 100644 index 0000000000..507b7be713 --- /dev/null +++ b/target/linux/bcm27xx/patches-5.10/950-0713-drm-gud-Free-buffers-on-device-removal.patch @@ -0,0 +1,60 @@ +From 888d867aa6f8fe384b37c0915eed07bb3a970fc4 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= <noralf@tronnes.org> +Date: Thu, 1 Jul 2021 19:07:47 +0200 +Subject: [PATCH] drm/gud: Free buffers on device removal +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +[ drm-misc commit f8ac863b6a93863334cefb94285daaa6617381b5 ] + +Free transfer and compression buffers on device removal instead of at +DRM device removal time. This ensures that the usual 2x8MB buffers are +released when the device is unplugged and not kept around should +userspace keep the DRM device fd open. + +At least Ubuntu 20.04 doesn't release the DRM device on unplug. + +The damage_lock mutex is not destroyed because it is used outside the +drm_dev_enter/exit block in gud_pipe_update(). AFAICT it's possible for +an open fbdev descriptor to trigger a commit after the USB device is gone. + +v2: Don't destroy damage_lock + +Reviewed-by: Linus Walleij <linus.walleij@linaro.org> +Signed-off-by: Noralf Trønnes <noralf@tronnes.org> +Link: https://patchwork.freedesktop.org/patch/msgid/20210701170748.58009-1-noralf@tronnes.org +--- + drivers/gpu/drm/gud/gud_drv.c | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +--- a/drivers/gpu/drm/gud/gud_drv.c ++++ b/drivers/gpu/drm/gud/gud_drv.c +@@ -407,14 +407,15 @@ static struct drm_driver gud_drm_driver + .minor = 0, + }; + +-static void gud_free_buffers_and_mutex(struct drm_device *drm, void *unused) ++static void gud_free_buffers_and_mutex(void *data) + { +- struct gud_device *gdrm = to_gud_device(drm); ++ struct gud_device *gdrm = data; + + vfree(gdrm->compress_buf); ++ gdrm->compress_buf = NULL; + kfree(gdrm->bulk_buf); ++ gdrm->bulk_buf = NULL; + mutex_destroy(&gdrm->ctrl_lock); +- mutex_destroy(&gdrm->damage_lock); + } + + static int gud_probe(struct usb_interface *intf, const struct usb_device_id *id) +@@ -468,7 +469,7 @@ static int gud_probe(struct usb_interfac + INIT_WORK(&gdrm->work, gud_flush_work); + gud_clear_damage(gdrm); + +- ret = drmm_add_action_or_reset(drm, gud_free_buffers_and_mutex, NULL); ++ ret = devm_add_action(dev, gud_free_buffers_and_mutex, gdrm); + if (ret) + return ret; + |