Merge "disp: msm: sde: add input handler unregister check before encoder wakeup"
This commit is contained in:

committed by
Gerrit - the friendly Code Review server

커밋
c16cf9327c
@@ -2616,11 +2616,18 @@ static int _sde_encoder_rc_idle(struct drm_encoder *drm_enc,
|
||||
struct msm_drm_private *priv;
|
||||
struct sde_kms *sde_kms;
|
||||
struct drm_crtc *crtc = drm_enc->crtc;
|
||||
struct sde_crtc *sde_crtc = to_sde_crtc(crtc);
|
||||
struct sde_crtc *sde_crtc;
|
||||
struct sde_connector *sde_conn;
|
||||
int crtc_id = 0;
|
||||
|
||||
priv = drm_enc->dev->dev_private;
|
||||
|
||||
if (!crtc || !sde_enc->cur_master || !priv->kms) {
|
||||
SDE_ERROR("invalid args crtc:%d master:%d\n", !crtc, !sde_enc->cur_master);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
sde_crtc = to_sde_crtc(crtc);
|
||||
sde_kms = to_sde_kms(priv->kms);
|
||||
sde_conn = to_sde_connector(sde_enc->cur_master->connector);
|
||||
|
||||
@@ -2681,7 +2688,7 @@ static int _sde_encoder_rc_early_wakeup(struct drm_encoder *drm_enc,
|
||||
{
|
||||
bool autorefresh_enabled = false;
|
||||
struct msm_drm_thread *disp_thread;
|
||||
int ret = 0;
|
||||
int ret = 0, idle_pc_duration = 0;
|
||||
|
||||
if (!sde_enc->crtc ||
|
||||
sde_enc->crtc->index >= ARRAY_SIZE(priv->disp_thread)) {
|
||||
@@ -2709,11 +2716,14 @@ static int _sde_encoder_rc_early_wakeup(struct drm_encoder *drm_enc,
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (!sde_crtc_frame_pending(sde_enc->crtc))
|
||||
if (!sde_crtc_frame_pending(sde_enc->crtc)) {
|
||||
kthread_mod_delayed_work(&disp_thread->worker,
|
||||
&sde_enc->delayed_off_work,
|
||||
msecs_to_jiffies(
|
||||
IDLE_POWERCOLLAPSE_DURATION));
|
||||
idle_pc_duration = IDLE_POWERCOLLAPSE_DURATION;
|
||||
}
|
||||
|
||||
} else if (sde_enc->rc_state == SDE_ENC_RC_STATE_IDLE) {
|
||||
/* enable all the clks and resources */
|
||||
ret = _sde_encoder_resource_control_helper(drm_enc,
|
||||
@@ -2741,12 +2751,13 @@ static int _sde_encoder_rc_early_wakeup(struct drm_encoder *drm_enc,
|
||||
&sde_enc->delayed_off_work,
|
||||
msecs_to_jiffies(
|
||||
IDLE_POWERCOLLAPSE_IN_EARLY_WAKEUP));
|
||||
idle_pc_duration = IDLE_POWERCOLLAPSE_IN_EARLY_WAKEUP;
|
||||
|
||||
sde_enc->rc_state = SDE_ENC_RC_STATE_ON;
|
||||
}
|
||||
|
||||
SDE_EVT32(DRMID(drm_enc), sw_event, sde_enc->rc_state,
|
||||
SDE_ENC_RC_STATE_ON, SDE_EVTLOG_FUNC_CASE8);
|
||||
SDE_EVT32(DRMID(drm_enc), sw_event, sde_enc->rc_state, SDE_ENC_RC_STATE_ON,
|
||||
idle_pc_duration, SDE_EVTLOG_FUNC_CASE8);
|
||||
|
||||
end:
|
||||
mutex_unlock(&sde_enc->rc_lock);
|
||||
@@ -4804,8 +4815,13 @@ static void sde_encoder_input_event_work_handler(struct kthread_work *work)
|
||||
struct sde_encoder_virt *sde_enc = container_of(work,
|
||||
struct sde_encoder_virt, input_event_work);
|
||||
|
||||
if (!sde_enc) {
|
||||
SDE_ERROR("invalid sde encoder\n");
|
||||
if (!sde_enc || !sde_enc->input_handler) {
|
||||
SDE_ERROR("invalid args sde encoder\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!sde_enc->input_handler->private) {
|
||||
SDE_DEBUG_ENC(sde_enc, "input handler is unregistered\n");
|
||||
return;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user