drm/rockchip: allocate correct crtc state structure on reset
Subsystems (5)
PATCH 1/1 drm/rockchip: allocate correct crtc state structure on reset
Because we are using a custom crtc_state structure, we must override the reset helper to allocate the correct amount of memory.
Cc stable at vger.kernel.org
Fixes 4e257d9eee23 ("drm/rockchip: get rid of rockchip_drm_crtc_mode_config")
Signed-off-by John Keeping <[email protected]>
--- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)
drivers/gpu/drm/rockchip/rockchip_drm_vop.c +12 -1
@@ -1048,6 +1048,17 @@ static void vop_crtc_destroy(struct drm_crtc *crtc)drm_crtc_cleanup (crtc); } +static void vop_crtc_reset (struct drm_crtc *crtc) +{ +if (crtc->state) +__drm_atomic_helper_crtc_destroy_state (crtc, crtc->state); +kfree (crtc->state); + + crtc->state =kzalloc (sizeof (struct rockchip_crtc_state ),GFP_KERNEL ); +if (crtc->state) + crtc->state->crtc = crtc; +} +static struct drm_crtc_state *vop_crtc_duplicate_state (struct drm_crtc *crtc) {struct rockchip_crtc_state *rockchip_state;
@@ -1073,7 +1084,7 @@ static const struct drm_crtc_funcs vop_crtc_funcs = { .set_config = drm_atomic_helper_set_config, .page_flip = drm_atomic_helper_page_flip, .destroy = vop_crtc_destroy, - .reset = drm_atomic_helper_crtc_reset, + .reset = vop_crtc_reset, .atomic_duplicate_state = vop_crtc_duplicate_state, .atomic_destroy_state = vop_crtc_destroy_state, };
Signature · 1 line
2.9.0.465.g8850cbc.dirty
Quoted 6 lines · John Keeping
Because we are using a custom
crtc_statestructure, we must override the reset helper to allocate the correct amount of memory.Cc stable at vger.kernel.orgFixes 4e257d9eee23 ("drm/rockchip: get rid of rockchip_drm_crtc_mode_config")Signed-off-by John Keeping <[email protected]>
Reviewed-by Sean Paul <[email protected]>
Quoted 42 lines
--- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)drivers/gpu/drm/rockchip/rockchip_drm_vop.c +12
-2@@ -1048,6 +1048,17 @@ static void vop_crtc_destroy(struct drm_crtc *crtc)drm_crtc_cleanup (crtc); } +static void vop_crtc_reset (struct drm_crtc *crtc) +{ +if (crtc->state) +__drm_atomic_helper_crtc_destroy_state (crtc, crtc->state); +kfree (crtc->state); + + crtc->state =kzalloc (sizeof (struct rockchip_crtc_state ),GFP_KERNEL ); +if (crtc->state) + crtc->state->crtc = crtc; +} +static struct drm_crtc_state *vop_crtc_duplicate_state (struct drm_crtc *crtc) {struct rockchip_crtc_state *rockchip_state;@@ -1073,7 +1084,7 @@ static const struct drm_crtc_funcs vop_crtc_funcs = { .set_config = drm_atomic_helper_set_config, .page_flip = drm_atomic_helper_page_flip, .destroy = vop_crtc_destroy, - .reset = drm_atomic_helper_crtc_reset, + .reset = vop_crtc_reset, .atomic_duplicate_state = vop_crtc_duplicate_state, .atomic_destroy_state = vop_crtc_destroy_state, }; --2.9.0.465.g8850cbc.dirty
_______________________________________________
dri-devel mailing list
dri-devel at lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 9 lines · John Keeping
Because we are using a custom
crtc_statestructure, we must override the reset helper to allocate the correct amount of memory.Cc stable at vger.kernel.orgFixes 4e257d9eee23 ("drm/rockchip: get rid of rockchip_drm_crtc_mode_config")Signed-off-by John Keeping <[email protected]>--- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)
Thanks for the fixes, Applied to my drm-fixes
Quoted 31 lines
drivers/gpu/drm/rockchip/rockchip_drm_vop.c +12
-1@@ -1048,6 +1048,17 @@ static void vop_crtc_destroy(struct drm_crtc *crtc)drm_crtc_cleanup (crtc); } +static void vop_crtc_reset (struct drm_crtc *crtc) +{ +if (crtc->state) +__drm_atomic_helper_crtc_destroy_state (crtc, crtc->state); +kfree (crtc->state); + + crtc->state =kzalloc (sizeof (struct rockchip_crtc_state ),GFP_KERNEL ); +if (crtc->state) + crtc->state->crtc = crtc; +} +static struct drm_crtc_state *vop_crtc_duplicate_state (struct drm_crtc *crtc) {struct rockchip_crtc_state *rockchip_state;@@ -1073,7 +1084,7 @@ static const struct drm_crtc_funcs vop_crtc_funcs = { .set_config = drm_atomic_helper_set_config, .page_flip = drm_atomic_helper_page_flip, .destroy = vop_crtc_destroy, - .reset = drm_atomic_helper_crtc_reset, + .reset = vop_crtc_reset, .atomic_duplicate_state = vop_crtc_duplicate_state, .atomic_destroy_state = vop_crtc_destroy_state, };
Signature · 1 line
?ark Yao