Skip to content

Commit a6ba45a

Browse files
Bruce Wangrobclark
Bruce Wang
authored andcommitted
drm/msm/dpu: Replace dpu_crtc_reset by atomic helper
Since we removed all suspend logic from the crtc code (see patch 3/4), dpu_crtc_reset does the same things as drm_atomic_helper_crtc_reset, so let's just replace it with a call to the atomic helper. v3: added patch to patchset Reviewed-by: Sean Paul <seanpaul@chromium.org> Signed-off-by: Bruce Wang <bzwang@chromium.org> Signed-off-by: Sean Paul <seanpaul@chromium.org> Signed-off-by: Rob Clark <robdclark@gmail.com>
1 parent a1e25e7 commit a6ba45a

File tree

1 file changed

+1
-38
lines changed

1 file changed

+1
-38
lines changed

drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c

+1-38
Original file line numberDiff line numberDiff line change
@@ -844,43 +844,6 @@ static struct drm_crtc_state *dpu_crtc_duplicate_state(struct drm_crtc *crtc)
844844
return &cstate->base;
845845
}
846846

847-
/**
848-
* dpu_crtc_reset - reset hook for CRTCs
849-
* Resets the atomic state for @crtc by freeing the state pointer (which might
850-
* be NULL, e.g. at driver load time) and allocating a new empty state object.
851-
* @crtc: Pointer to drm crtc structure
852-
*/
853-
static void dpu_crtc_reset(struct drm_crtc *crtc)
854-
{
855-
struct dpu_crtc *dpu_crtc;
856-
struct dpu_crtc_state *cstate;
857-
858-
if (!crtc) {
859-
DPU_ERROR("invalid crtc\n");
860-
return;
861-
}
862-
863-
/* revert suspend actions, if necessary */
864-
if (dpu_kms_is_suspend_state(crtc->dev))
865-
_dpu_crtc_set_suspend(crtc, false);
866-
867-
/* remove previous state, if present */
868-
if (crtc->state) {
869-
dpu_crtc_destroy_state(crtc, crtc->state);
870-
crtc->state = 0;
871-
}
872-
873-
dpu_crtc = to_dpu_crtc(crtc);
874-
cstate = kzalloc(sizeof(*cstate), GFP_KERNEL);
875-
if (!cstate) {
876-
DPU_ERROR("failed to allocate state\n");
877-
return;
878-
}
879-
880-
cstate->base.crtc = crtc;
881-
crtc->state = &cstate->base;
882-
}
883-
884847
static void dpu_crtc_handle_power_event(u32 event_type, void *arg)
885848
{
886849
struct drm_crtc *crtc = arg;
@@ -1499,7 +1462,7 @@ static const struct drm_crtc_funcs dpu_crtc_funcs = {
14991462
.set_config = drm_atomic_helper_set_config,
15001463
.destroy = dpu_crtc_destroy,
15011464
.page_flip = drm_atomic_helper_page_flip,
1502-
.reset = dpu_crtc_reset,
1465+
.reset = drm_atomic_helper_crtc_reset,
15031466
.atomic_duplicate_state = dpu_crtc_duplicate_state,
15041467
.atomic_destroy_state = dpu_crtc_destroy_state,
15051468
.late_register = dpu_crtc_late_register,

0 commit comments

Comments
 (0)