]> git.baikalelectronics.ru Git - kernel.git/commit
drm: rcar-du: Use DRM-managed allocation for VSP planes
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Thu, 3 Dec 2020 13:09:22 +0000 (15:09 +0200)
committerLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tue, 5 Jan 2021 05:20:01 +0000 (07:20 +0200)
commit73deb7b34c845a04047ad9ecd945f82e31614a40
treeed19d597cc89c78517b773d6a4bbd34c817b47f6
parentd8d164a2b2c71d9fe798fdead06695d1be241c17
drm: rcar-du: Use DRM-managed allocation for VSP planes

devm_kcalloc() is the wrong API to allocate planes, as the lifetime of
the planes is tied to the DRM device, not the device to driver
binding. drmm_kcalloc() isn't a good option either, as it would result
in the planes being freed before being unregistered during the managed
cleanup of the DRM objects. Use a plain kcalloc(), and cleanup the
planes and free the memory in the existing rcar_du_vsp_cleanup()
handler.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
drivers/gpu/drm/rcar-du/rcar_du_vsp.c