Skip to content

Commit

Permalink
drm/rockchip: vop: Fix reset of state in duplicate state crtc funcs
Browse files Browse the repository at this point in the history
[ Upstream commit 13fc288 ]

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: 4e257d9 ("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
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Kwiboo authored and gregkh committed Nov 20, 2023
1 parent 0a83cf3 commit 2a4cdca
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/gpu/drm/rockchip/rockchip_drm_vop.c
Original file line number Diff line number Diff line change
Expand Up @@ -1071,7 +1071,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;

Expand Down

0 comments on commit 2a4cdca

Please sign in to comment.