diff options
| author | David Francis <David.Francis@amd.com> | 2018-05-31 13:48:31 -0400 |
|---|---|---|
| committer | Alex Deucher <alexander.deucher@amd.com> | 2018-05-31 14:08:22 -0400 |
| commit | a9e8d27574f26700575473011cb607d4abdbda5f (patch) | |
| tree | 8916a18106034be7f7f6fd2788c17a72b2a1e307 | |
| parent | 0e333751cff1dd7383be15372960a1be6e2b4e47 (diff) | |
drm/amd/display: Make atomic-check validate underscan changes
When the underscan state was changed, atomic-check was triggering a
validation but passing the old underscan values. This change adds a
somewhat hacky check in dm_update_crtcs_state that will update the
stream if old and newunderscan values are different.
This was causing 4k on Fiji to allow underscan when it wasn't permitted.
Signed-off-by: David Francis <David.Francis@amd.com>
Reviewed-by: David Francis <David.Francis@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
| -rw-r--r-- | drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index ad1ad333012a..1a7e96ee6051 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | |||
| @@ -4555,8 +4555,8 @@ static int dm_update_crtcs_state(struct dc *dc, | |||
| 4555 | for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) { | 4555 | for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) { |
| 4556 | struct amdgpu_crtc *acrtc = NULL; | 4556 | struct amdgpu_crtc *acrtc = NULL; |
| 4557 | struct amdgpu_dm_connector *aconnector = NULL; | 4557 | struct amdgpu_dm_connector *aconnector = NULL; |
| 4558 | struct drm_connector_state *new_con_state = NULL; | 4558 | struct drm_connector_state *drm_new_conn_state = NULL, *drm_old_conn_state = NULL; |
| 4559 | struct dm_connector_state *dm_conn_state = NULL; | 4559 | struct dm_connector_state *dm_new_conn_state = NULL, *dm_old_conn_state = NULL; |
| 4560 | struct drm_plane_state *new_plane_state = NULL; | 4560 | struct drm_plane_state *new_plane_state = NULL; |
| 4561 | 4561 | ||
| 4562 | new_stream = NULL; | 4562 | new_stream = NULL; |
| @@ -4577,19 +4577,23 @@ static int dm_update_crtcs_state(struct dc *dc, | |||
| 4577 | /* TODO This hack should go away */ | 4577 | /* TODO This hack should go away */ |
| 4578 | if (aconnector && enable) { | 4578 | if (aconnector && enable) { |
| 4579 | // Make sure fake sink is created in plug-in scenario | 4579 | // Make sure fake sink is created in plug-in scenario |
| 4580 | new_con_state = drm_atomic_get_connector_state(state, | 4580 | drm_new_conn_state = drm_atomic_get_new_connector_state(state, |
| 4581 | &aconnector->base); | 4581 | &aconnector->base); |
| 4582 | drm_old_conn_state = drm_atomic_get_old_connector_state(state, | ||
| 4583 | &aconnector->base); | ||
| 4582 | 4584 | ||
| 4583 | if (IS_ERR(new_con_state)) { | 4585 | |
| 4584 | ret = PTR_ERR_OR_ZERO(new_con_state); | 4586 | if (IS_ERR(drm_new_conn_state)) { |
| 4587 | ret = PTR_ERR_OR_ZERO(drm_new_conn_state); | ||
| 4585 | break; | 4588 | break; |
| 4586 | } | 4589 | } |
| 4587 | 4590 | ||
| 4588 | dm_conn_state = to_dm_connector_state(new_con_state); | 4591 | dm_new_conn_state = to_dm_connector_state(drm_new_conn_state); |
| 4592 | dm_old_conn_state = to_dm_connector_state(drm_old_conn_state); | ||
| 4589 | 4593 | ||
| 4590 | new_stream = create_stream_for_sink(aconnector, | 4594 | new_stream = create_stream_for_sink(aconnector, |
| 4591 | &new_crtc_state->mode, | 4595 | &new_crtc_state->mode, |
| 4592 | dm_conn_state); | 4596 | dm_new_conn_state); |
| 4593 | 4597 | ||
| 4594 | /* | 4598 | /* |
| 4595 | * we can have no stream on ACTION_SET if a display | 4599 | * we can have no stream on ACTION_SET if a display |
| @@ -4708,6 +4712,11 @@ next_crtc: | |||
| 4708 | */ | 4712 | */ |
| 4709 | BUG_ON(dm_new_crtc_state->stream == NULL); | 4713 | BUG_ON(dm_new_crtc_state->stream == NULL); |
| 4710 | 4714 | ||
| 4715 | /* Scaling or underscan settings */ | ||
| 4716 | if (is_scaling_state_different(dm_old_conn_state, dm_new_conn_state)) | ||
| 4717 | update_stream_scaling_settings( | ||
| 4718 | &new_crtc_state->mode, dm_new_conn_state, dm_new_crtc_state->stream); | ||
| 4719 | |||
| 4711 | /* Color managment settings */ | 4720 | /* Color managment settings */ |
| 4712 | if (dm_new_crtc_state->base.color_mgmt_changed) { | 4721 | if (dm_new_crtc_state->base.color_mgmt_changed) { |
| 4713 | ret = amdgpu_dm_set_regamma_lut(dm_new_crtc_state); | 4722 | ret = amdgpu_dm_set_regamma_lut(dm_new_crtc_state); |
