aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2018-06-02 16:13:57 -0400
committerDave Airlie <airlied@redhat.com>2018-06-02 16:13:57 -0400
commit012cfaced00b7a9498227504c4d37a1c4619403d (patch)
treeb083803242e6146e0f810159ad4512148c35b9fc
parent0e333751cff1dd7383be15372960a1be6e2b4e47 (diff)
parentbc13f2f88eae63af943ab967cb14bb602f8f2eeb (diff)
Merge branch 'drm-fixes-4.17' of git://people.freedesktop.org/~agd5f/linux into drm-fixes
Two last minute DC fixes for 4.17. A fix for underscan on fiji and a fix for gamma settings getting after dpms. * 'drm-fixes-4.17' of git://people.freedesktop.org/~agd5f/linux: drm/amd/display: Update color props when modeset is required drm/amd/display: Make atomic-check validate underscan changes
-rw-r--r--drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c31
1 files changed, 22 insertions, 9 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..27579443cdc5 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,8 +4712,17 @@ next_crtc:
4708 */ 4712 */
4709 BUG_ON(dm_new_crtc_state->stream == NULL); 4713 BUG_ON(dm_new_crtc_state->stream == NULL);
4710 4714
4711 /* Color managment settings */ 4715 /* Scaling or underscan settings */
4712 if (dm_new_crtc_state->base.color_mgmt_changed) { 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
4720 /*
4721 * Color management settings. We also update color properties
4722 * when a modeset is needed, to ensure it gets reprogrammed.
4723 */
4724 if (dm_new_crtc_state->base.color_mgmt_changed ||
4725 drm_atomic_crtc_needs_modeset(new_crtc_state)) {
4713 ret = amdgpu_dm_set_regamma_lut(dm_new_crtc_state); 4726 ret = amdgpu_dm_set_regamma_lut(dm_new_crtc_state);
4714 if (ret) 4727 if (ret)
4715 goto fail; 4728 goto fail;