Merge "disp: msm: send power_on event in dual display composer kill scenario"
This commit is contained in:

committed by
Gerrit - the friendly Code Review server

commit
8c4fd05ac2
@@ -1130,8 +1130,19 @@ static void msm_lastclose(struct drm_device *dev)
|
|||||||
* commit then ignore the last close call
|
* commit then ignore the last close call
|
||||||
*/
|
*/
|
||||||
if (kms->funcs && kms->funcs->check_for_splash
|
if (kms->funcs && kms->funcs->check_for_splash
|
||||||
&& kms->funcs->check_for_splash(kms))
|
&& kms->funcs->check_for_splash(kms)) {
|
||||||
|
msm_wait_event_timeout(priv->pending_crtcs_event, !priv->pending_crtcs,
|
||||||
|
LASTCLOSE_TIMEOUT_MS, rc);
|
||||||
|
if (!rc)
|
||||||
|
DRM_INFO("wait for crtc mask 0x%x failed, commit anyway...\n",
|
||||||
|
priv->pending_crtcs);
|
||||||
|
|
||||||
|
rc = kms->funcs->trigger_null_flush(kms);
|
||||||
|
if (rc) {
|
||||||
|
DRM_ERROR("null flush commit failure during lastclose\n");
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* clean up vblank disable immediately as this is the last close.
|
* clean up vblank disable immediately as this is the last close.
|
||||||
@@ -1574,8 +1585,15 @@ static int msm_release(struct inode *inode, struct file *filp)
|
|||||||
* refcount > 1. This operation is not triggered from upstream
|
* refcount > 1. This operation is not triggered from upstream
|
||||||
* drm as msm_driver does not support DRIVER_LEGACY feature.
|
* drm as msm_driver does not support DRIVER_LEGACY feature.
|
||||||
*/
|
*/
|
||||||
if (drm_is_current_master(file_priv))
|
if (drm_is_current_master(file_priv)) {
|
||||||
|
msm_wait_event_timeout(priv->pending_crtcs_event, !priv->pending_crtcs,
|
||||||
|
LASTCLOSE_TIMEOUT_MS, ret);
|
||||||
|
if (!ret)
|
||||||
|
DRM_INFO("wait for crtc mask 0x%x failed, commit anyway...\n",
|
||||||
|
priv->pending_crtcs);
|
||||||
|
|
||||||
msm_preclose(dev, file_priv);
|
msm_preclose(dev, file_priv);
|
||||||
|
}
|
||||||
|
|
||||||
ret = drm_release(inode, filp);
|
ret = drm_release(inode, filp);
|
||||||
filp->private_data = NULL;
|
filp->private_data = NULL;
|
||||||
|
@@ -131,6 +131,8 @@ struct msm_kms_funcs {
|
|||||||
struct drm_atomic_state *state);
|
struct drm_atomic_state *state);
|
||||||
/* check for continuous splash status */
|
/* check for continuous splash status */
|
||||||
bool (*check_for_splash)(struct msm_kms *kms);
|
bool (*check_for_splash)(struct msm_kms *kms);
|
||||||
|
/*trigger null flush if stuck in cont splash*/
|
||||||
|
int (*trigger_null_flush)(struct msm_kms *kms);
|
||||||
/* topology lm information */
|
/* topology lm information */
|
||||||
int (*get_mixer_count)(const struct msm_kms *kms,
|
int (*get_mixer_count)(const struct msm_kms *kms,
|
||||||
const struct drm_display_mode *mode,
|
const struct drm_display_mode *mode,
|
||||||
|
@@ -2542,6 +2542,7 @@ static int sde_kms_set_crtc_for_conn(struct drm_device *dev,
|
|||||||
}
|
}
|
||||||
|
|
||||||
crtc_state->active = true;
|
crtc_state->active = true;
|
||||||
|
crtc_state->enable = true;
|
||||||
ret = drm_atomic_set_crtc_for_connector(conn_state, enc->crtc);
|
ret = drm_atomic_set_crtc_for_connector(conn_state, enc->crtc);
|
||||||
if (ret)
|
if (ret)
|
||||||
SDE_ERROR("error %d setting the crtc\n", ret);
|
SDE_ERROR("error %d setting the crtc\n", ret);
|
||||||
@@ -3800,7 +3801,7 @@ static int sde_kms_get_dsc_count(const struct msm_kms *kms,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void _sde_kms_null_commit(struct drm_device *dev,
|
static int _sde_kms_null_commit(struct drm_device *dev,
|
||||||
struct drm_encoder *enc)
|
struct drm_encoder *enc)
|
||||||
{
|
{
|
||||||
struct drm_modeset_acquire_ctx ctx;
|
struct drm_modeset_acquire_ctx ctx;
|
||||||
@@ -3843,6 +3844,8 @@ end:
|
|||||||
|
|
||||||
drm_modeset_drop_locks(&ctx);
|
drm_modeset_drop_locks(&ctx);
|
||||||
drm_modeset_acquire_fini(&ctx);
|
drm_modeset_acquire_fini(&ctx);
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -3871,6 +3874,36 @@ void sde_kms_display_early_wakeup(struct drm_device *dev,
|
|||||||
|
|
||||||
drm_connector_list_iter_end(&conn_iter);
|
drm_connector_list_iter_end(&conn_iter);
|
||||||
}
|
}
|
||||||
|
static int sde_kms_trigger_null_flush(struct msm_kms *kms)
|
||||||
|
{
|
||||||
|
struct sde_kms *sde_kms;
|
||||||
|
struct sde_splash_display *splash_display;
|
||||||
|
int i, rc = 0;
|
||||||
|
|
||||||
|
if (!kms) {
|
||||||
|
SDE_ERROR("invalid kms\n");
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
sde_kms = to_sde_kms(kms);
|
||||||
|
|
||||||
|
if (!sde_kms->splash_data.num_splash_displays ||
|
||||||
|
sde_kms->dsi_display_count == sde_kms->splash_data.num_splash_displays)
|
||||||
|
return rc;
|
||||||
|
|
||||||
|
for (i = 0; i < MAX_DSI_DISPLAYS; i++) {
|
||||||
|
splash_display = &sde_kms->splash_data.splash_display[i];
|
||||||
|
|
||||||
|
if (splash_display->cont_splash_enabled && splash_display->encoder) {
|
||||||
|
SDE_DEBUG("triggering null commit on enc:%d\n",
|
||||||
|
DRMID(splash_display->encoder));
|
||||||
|
SDE_EVT32(DRMID(splash_display->encoder), SDE_EVTLOG_FUNC_ENTRY);
|
||||||
|
rc = _sde_kms_null_commit(sde_kms->dev, splash_display->encoder);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
static void _sde_kms_pm_suspend_idle_helper(struct sde_kms *sde_kms,
|
static void _sde_kms_pm_suspend_idle_helper(struct sde_kms *sde_kms,
|
||||||
struct device *dev)
|
struct device *dev)
|
||||||
@@ -4180,6 +4213,7 @@ static const struct msm_kms_funcs kms_funcs = {
|
|||||||
.get_address_space_device = _sde_kms_get_address_space_device,
|
.get_address_space_device = _sde_kms_get_address_space_device,
|
||||||
.postopen = _sde_kms_post_open,
|
.postopen = _sde_kms_post_open,
|
||||||
.check_for_splash = sde_kms_check_for_splash,
|
.check_for_splash = sde_kms_check_for_splash,
|
||||||
|
.trigger_null_flush = sde_kms_trigger_null_flush,
|
||||||
.get_mixer_count = sde_kms_get_mixer_count,
|
.get_mixer_count = sde_kms_get_mixer_count,
|
||||||
.get_dsc_count = sde_kms_get_dsc_count,
|
.get_dsc_count = sde_kms_get_dsc_count,
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user