[PATCH 1/2] drm/gud: Free buffers on device removal

Linus Walleij linus.walleij at linaro.org
Mon Jun 14 20:31:25 UTC 2021


On Mon, Mar 29, 2021 at 8:01 PM Noralf Trønnes <noralf at tronnes.org> wrote:

> 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.
>
> Signed-off-by: Noralf Trønnes <noralf at tronnes.org>

Interesting, we have exactly the same thing with a shim device
staying around for open file handles after the actual physical
device dies in gpiolib. I guess this is a common problem.

Connect the buffer allocations to the device which will use
them not the userspace facing device, indeed.
Reviewed-by: Linus Walleij <linus.walleij at linaro.org>

Yours,
Linus Walleij


More information about the dri-devel mailing list