drm/msm/shd: update base display mode at enable stage

Currently the base display mode for shared display is updated
at probe stage, which will be lost during lastclose. This change
will update base display mode at enable stage to fix the problem.

Change-Id: I0ce446d67da5cc4a57ae1c5c554e7e3798591acc
Signed-off-by: Xiaowen Wu <wxiaowen@codeaurora.org>
tirimbino
Xiaowen Wu 6 years ago
parent e7ac403f09
commit f94f6c6a2a
  1. 21
      drivers/gpu/drm/msm/shd/shd_drm.c

@ -166,10 +166,9 @@ static int shd_display_init_base_crtc(struct drm_device *dev,
struct shd_display_base *base)
{
struct drm_crtc *crtc = NULL;
struct drm_display_mode *drm_mode;
struct msm_drm_private *priv;
int crtc_idx;
int rc = 0, i;
int i;
priv = dev->dev_private;
@ -194,19 +193,7 @@ static int shd_display_init_base_crtc(struct drm_device *dev,
base->crtc = crtc;
SDE_DEBUG("found base crtc %d\n", crtc->base.id);
/* fixed mode is used */
drm_mode = &base->mode;
/* update crtc drm structure */
rc = drm_atomic_set_mode_for_crtc(crtc->state, drm_mode);
if (rc) {
SDE_ERROR("Failed: set mode for crtc. rc = %d\n", rc);
return rc;
}
drm_mode_copy(&crtc->state->adjusted_mode, drm_mode);
drm_mode_copy(&crtc->mode, drm_mode);
return rc;
return 0;
}
static void shd_display_setup_base_mixer_out(struct shd_display_base *base)
@ -275,6 +262,10 @@ static void shd_display_enable_base(struct drm_device *dev,
conn_state->best_encoder = base->encoder;
connector->encoder = base->encoder;
drm_atomic_set_mode_for_crtc(crtc_state, &base->mode);
drm_mode_copy(&crtc_state->adjusted_mode, &base->mode);
drm_mode_copy(&base->crtc->mode, &base->mode);
if (conn_funcs->atomic_best_encoder) {
conn_funcs->atomic_best_encoder(base->connector,
conn_state);

Loading…
Cancel
Save