drm/panel: Add new helpers for refcounted panel allocatons
authorAnusha Srivatsa <asrivats@redhat.com>
Mon, 31 Mar 2025 15:15:25 +0000 (11:15 -0400)
committerMaxime Ripard <mripard@kernel.org>
Tue, 1 Apr 2025 14:58:03 +0000 (16:58 +0200)
commited9c594d495deb676825489032cee0a03ce29bf9
treed0901259a3fd3c58fe56cbb245d7b0b19372e8af
parent65931bbc5177f8192a48a0aa5bdb9b95b9f6e87f
drm/panel: Add new helpers for refcounted panel allocatons

Introduce reference counted allocations for panels to avoid
use-after-free. The patch adds the macro devm_drm_bridge_alloc()
to allocate a new refcounted panel. Followed the documentation for
drmm_encoder_alloc() and devm_drm_dev_alloc and other similar
implementations for this purpose.

Reviewed-by: Maxime Ripard <mripard@kernel.org>
Signed-off-by: Anusha Srivatsa <asrivats@redhat.com>
Link: https://lore.kernel.org/r/20250331-b4-panel-refcounting-v4-1-dad50c60c6c9@redhat.com
Signed-off-by: Maxime Ripard <mripard@kernel.org>
drivers/gpu/drm/drm_panel.c
include/drm/drm_panel.h