drm/rockchip: vop2: Add missing call to crtc reset helper
[ Upstream commit 4d49d87b3606369c6e29b9d051892ee1a6fc4e75 ]
Add missing call to crtc reset helper to properly vblank reset.
Also move vop2_crtc_reset and call vop2_crtc_destroy_state to simplify
and remove duplicated code.
Fixes: 604be85547 ("drm/rockchip: Add VOP2 driver")
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-6-jonas@kwiboo.se
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
bc05621888
commit
2d68194e1a
1 changed files with 14 additions and 17 deletions
|
|
@ -2075,23 +2075,6 @@ static const struct drm_crtc_helper_funcs vop2_crtc_helper_funcs = {
|
||||||
.atomic_disable = vop2_crtc_atomic_disable,
|
.atomic_disable = vop2_crtc_atomic_disable,
|
||||||
};
|
};
|
||||||
|
|
||||||
static void vop2_crtc_reset(struct drm_crtc *crtc)
|
|
||||||
{
|
|
||||||
struct rockchip_crtc_state *vcstate = to_rockchip_crtc_state(crtc->state);
|
|
||||||
|
|
||||||
if (crtc->state) {
|
|
||||||
__drm_atomic_helper_crtc_destroy_state(crtc->state);
|
|
||||||
kfree(vcstate);
|
|
||||||
}
|
|
||||||
|
|
||||||
vcstate = kzalloc(sizeof(*vcstate), GFP_KERNEL);
|
|
||||||
if (!vcstate)
|
|
||||||
return;
|
|
||||||
|
|
||||||
crtc->state = &vcstate->base;
|
|
||||||
crtc->state->crtc = crtc;
|
|
||||||
}
|
|
||||||
|
|
||||||
static struct drm_crtc_state *vop2_crtc_duplicate_state(struct drm_crtc *crtc)
|
static struct drm_crtc_state *vop2_crtc_duplicate_state(struct drm_crtc *crtc)
|
||||||
{
|
{
|
||||||
struct rockchip_crtc_state *vcstate;
|
struct rockchip_crtc_state *vcstate;
|
||||||
|
|
@ -2118,6 +2101,20 @@ static void vop2_crtc_destroy_state(struct drm_crtc *crtc,
|
||||||
kfree(vcstate);
|
kfree(vcstate);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void vop2_crtc_reset(struct drm_crtc *crtc)
|
||||||
|
{
|
||||||
|
struct rockchip_crtc_state *vcstate =
|
||||||
|
kzalloc(sizeof(*vcstate), GFP_KERNEL);
|
||||||
|
|
||||||
|
if (crtc->state)
|
||||||
|
vop2_crtc_destroy_state(crtc, crtc->state);
|
||||||
|
|
||||||
|
if (vcstate)
|
||||||
|
__drm_atomic_helper_crtc_reset(crtc, &vcstate->base);
|
||||||
|
else
|
||||||
|
__drm_atomic_helper_crtc_reset(crtc, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
static const struct drm_crtc_funcs vop2_crtc_funcs = {
|
static const struct drm_crtc_funcs vop2_crtc_funcs = {
|
||||||
.set_config = drm_atomic_helper_set_config,
|
.set_config = drm_atomic_helper_set_config,
|
||||||
.page_flip = drm_atomic_helper_page_flip,
|
.page_flip = drm_atomic_helper_page_flip,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue