disp: msm: sde: support qsync and vrr in same atomic commit
This change adds support to program both qsync and variable refresh rate in the same atomic commit. During vrr usecase, if qsync is enabled, avr ctrl gets programmed during prepare phase as well as after configuring timing engine. This change also handles such scenarios to prevent double programming of avr ctrl. Change-Id: I19461423b0ae08c8204b5edeb98e3d73ce16a21b Signed-off-by: Yashwanth <yvulapu@codeaurora.org>
Esse commit está contido em:
@@ -2340,6 +2340,7 @@ static int sde_connector_atomic_check(struct drm_connector *connector,
|
||||
struct sde_connector_state *c_state;
|
||||
bool qsync_dirty = false, has_modeset = false;
|
||||
struct drm_connector_state *new_conn_state;
|
||||
struct drm_crtc_state *new_crtc_state = NULL;
|
||||
|
||||
if (!connector) {
|
||||
SDE_ERROR("invalid connector\n");
|
||||
@@ -2355,6 +2356,9 @@ static int sde_connector_atomic_check(struct drm_connector *connector,
|
||||
}
|
||||
|
||||
c_state = to_sde_connector_state(new_conn_state);
|
||||
if (new_conn_state->crtc)
|
||||
new_crtc_state = drm_atomic_get_new_crtc_state(state,
|
||||
new_conn_state->crtc);
|
||||
|
||||
has_modeset = sde_crtc_atomic_check_has_modeset(new_conn_state->state,
|
||||
new_conn_state->crtc);
|
||||
@@ -2363,7 +2367,8 @@ static int sde_connector_atomic_check(struct drm_connector *connector,
|
||||
CONNECTOR_PROP_QSYNC_MODE);
|
||||
|
||||
SDE_DEBUG("has_modeset %d qsync_dirty %d\n", has_modeset, qsync_dirty);
|
||||
if (has_modeset && qsync_dirty) {
|
||||
if (has_modeset && qsync_dirty && new_crtc_state &&
|
||||
!msm_is_mode_seamless_vrr(&new_crtc_state->adjusted_mode)) {
|
||||
SDE_ERROR("invalid qsync update during modeset\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
@@ -1135,13 +1135,21 @@ static void sde_encoder_phys_vid_handle_post_kickoff(
|
||||
static void sde_encoder_phys_vid_prepare_for_commit(
|
||||
struct sde_encoder_phys *phys_enc)
|
||||
{
|
||||
struct drm_crtc *crtc;
|
||||
|
||||
if (!phys_enc) {
|
||||
if (!phys_enc || !phys_enc->parent) {
|
||||
SDE_ERROR("invalid encoder parameters\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if (sde_connector_is_qsync_updated(phys_enc->connector))
|
||||
crtc = phys_enc->parent->crtc;
|
||||
if (!crtc || !crtc->state) {
|
||||
SDE_ERROR("invalid crtc state\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!msm_is_mode_seamless_vrr(&crtc->state->adjusted_mode)
|
||||
&& sde_connector_is_qsync_updated(phys_enc->connector))
|
||||
_sde_encoder_phys_vid_avr_ctrl(phys_enc);
|
||||
|
||||
}
|
||||
|
Referência em uma nova issue
Block a user