summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Karlman <jonas@kwiboo.se>2023-06-22 01:33:17 +0300
committerHeiko Stuebner <heiko@sntech.de>2023-08-13 00:53:32 +0300
commit13fc28804bf10ca0b7bce3efbba95c534836d7ca (patch)
tree67e6c1fa4345517dd2320c95fddbbd3ee1e7a282
parent5976a28b344ecb6810882a01b76a320cac21d307 (diff)
downloadlinux-13fc28804bf10ca0b7bce3efbba95c534836d7ca.tar.xz
drm/rockchip: vop: Fix reset of state in duplicate state crtc funcs
struct rockchip_crtc_state members such as output_type, output_bpc and enable_afbc is always reset to zero in the atomic_duplicate_state crtc funcs. Fix this by using kmemdup on the subclass rockchip_crtc_state struct. Fixes: 4e257d9eee23 ("drm/rockchip: get rid of rockchip_drm_crtc_mode_config") Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Reviewed-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Heiko Stuebner <heiko@sntech.de> Link: https://patchwork.freedesktop.org/patch/msgid/20230621223311.2239547-2-jonas@kwiboo.se
-rw-r--r--drivers/gpu/drm/rockchip/rockchip_drm_vop.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
index 86fd9f51c692..3c68a239d88a 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
@@ -1613,7 +1613,8 @@ static struct drm_crtc_state *vop_crtc_duplicate_state(struct drm_crtc *crtc)
if (WARN_ON(!crtc->state))
return NULL;
- rockchip_state = kzalloc(sizeof(*rockchip_state), GFP_KERNEL);
+ rockchip_state = kmemdup(to_rockchip_crtc_state(crtc->state),
+ sizeof(*rockchip_state), GFP_KERNEL);
if (!rockchip_state)
return NULL;