OSDN Git Service

drm/msm: Allocate msm_drm_private early and pass it as driver data
authorAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Wed, 1 Dec 2021 10:52:09 +0000 (11:52 +0100)
committerRob Clark <robdclark@chromium.org>
Mon, 6 Dec 2021 17:22:51 +0000 (09:22 -0800)
commitec919e6e7146e01a411506a0e45c9a62efef405b
tree868128f0e182ab0ab2bf3c8f7c06b4b6d94fbcc6
parent83b965d118cbab1dbdfffdff8cabc8c1cfd183c6
drm/msm: Allocate msm_drm_private early and pass it as driver data

In preparation for registering the mdss interrupt controller earlier,
move the allocation of msm_drm_private from component bind time to
msm_drv probe; this also allows us to use the devm variant of kzalloc.

Since it is not right to allocate the drm_device at probe time (as
it should exist only when all components are bound, and taken down
when components get cleaned up), the only way to make this happen is
to pass a pointer to msm_drm_private as driver data (like done in
many other DRM drivers), instead of one to drm_device like it's
currently done in this driver.

This is also simplifying some bind/unbind functions around drm/msm,
as some of them are using drm_device just to grab a pointer to the
msm_drm_private structure, which we now retrieve in one call.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20211201105210.24970-2-angelogioacchino.delregno@collabora.com
Signed-off-by: Rob Clark <robdclark@chromium.org>
drivers/gpu/drm/msm/adreno/adreno_device.c
drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c
drivers/gpu/drm/msm/dp/dp_display.c
drivers/gpu/drm/msm/dsi/dsi.c
drivers/gpu/drm/msm/hdmi/hdmi.c
drivers/gpu/drm/msm/msm_drv.c