hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
....@@ -2051,12 +2051,14 @@
20512051 drm_for_each_connector_iter(connector, &iter) {
20522052 aconnector = to_amdgpu_dm_connector(connector);
20532053
2054
+ if (!aconnector->dc_link)
2055
+ continue;
2056
+
20542057 /*
20552058 * this is the case when traversing through already created
20562059 * MST connectors, should be skipped
20572060 */
2058
- if (aconnector->dc_link &&
2059
- aconnector->dc_link->type == dc_connection_mst_branch)
2061
+ if (aconnector->dc_link->type == dc_connection_mst_branch)
20602062 continue;
20612063
20622064 mutex_lock(&aconnector->hpd_lock);
....@@ -4567,8 +4569,6 @@
45674569 timing_out->pix_clk_100hz = mode_in->crtc_clock * 10;
45684570 timing_out->aspect_ratio = get_aspect_ratio(mode_in);
45694571
4570
- stream->output_color_space = get_output_color_space(timing_out);
4571
-
45724572 stream->out_transfer_func->type = TF_TYPE_PREDEFINED;
45734573 stream->out_transfer_func->tf = TRANSFER_FUNCTION_SRGB;
45744574 if (stream->signal == SIGNAL_TYPE_HDMI_TYPE_A) {
....@@ -4579,6 +4579,8 @@
45794579 adjust_colour_depth_from_display_info(timing_out, info);
45804580 }
45814581 }
4582
+
4583
+ stream->output_color_space = get_output_color_space(timing_out);
45824584 }
45834585
45844586 static void fill_audio_info(struct audio_info *audio_info,
....@@ -6969,6 +6971,13 @@
69696971 attributes.rotation_angle = 0;
69706972 attributes.attribute_flags.value = 0;
69716973
6974
+ /* Enable cursor degamma ROM on DCN3+ for implicit sRGB degamma in DRM
6975
+ * legacy gamma setup.
6976
+ */
6977
+ if (crtc_state->cm_is_degamma_srgb &&
6978
+ adev->dm.dc->caps.color.dpp.gamma_corr)
6979
+ attributes.attribute_flags.bits.ENABLE_CURSOR_DEGAMMA = 1;
6980
+
69726981 attributes.pitch = attributes.width;
69736982
69746983 if (crtc_state->stream) {
....@@ -7246,6 +7255,8 @@
72467255 continue;
72477256
72487257 dc_plane = dm_new_plane_state->dc_state;
7258
+ if (!dc_plane)
7259
+ continue;
72497260
72507261 bundle->surface_updates[planes_count].surface = dc_plane;
72517262 if (new_pcrtc_state->color_mgmt_changed) {
....@@ -7426,6 +7437,12 @@
74267437 if (acrtc_state->abm_level != dm_old_crtc_state->abm_level)
74277438 bundle->stream_update.abm_level = &acrtc_state->abm_level;
74287439
7440
+ mutex_lock(&dm->dc_lock);
7441
+ if ((acrtc_state->update_type > UPDATE_TYPE_FAST) &&
7442
+ acrtc_state->stream->link->psr_settings.psr_allow_active)
7443
+ amdgpu_dm_psr_disable(acrtc_state->stream);
7444
+ mutex_unlock(&dm->dc_lock);
7445
+
74297446 /*
74307447 * If FreeSync state on the stream has changed then we need to
74317448 * re-adjust the min/max bounds now that DC doesn't handle this
....@@ -7440,9 +7457,6 @@
74407457 spin_unlock_irqrestore(&pcrtc->dev->event_lock, flags);
74417458 }
74427459 mutex_lock(&dm->dc_lock);
7443
- if ((acrtc_state->update_type > UPDATE_TYPE_FAST) &&
7444
- acrtc_state->stream->link->psr_settings.psr_allow_active)
7445
- amdgpu_dm_psr_disable(acrtc_state->stream);
74467460
74477461 dc_commit_updates_for_stream(dm->dc,
74487462 bundle->surface_updates,
....@@ -8560,8 +8574,9 @@
85608574 return -EINVAL;
85618575 }
85628576
8577
+ if (dm_old_plane_state->dc_state)
8578
+ dc_plane_state_release(dm_old_plane_state->dc_state);
85638579
8564
- dc_plane_state_release(dm_old_plane_state->dc_state);
85658580 dm_new_plane_state->dc_state = NULL;
85668581
85678582 *lock_and_validation_needed = true;
....@@ -8783,8 +8798,8 @@
87838798 goto fail;
87848799 }
87858800
8786
- if (dm_old_con_state->abm_level !=
8787
- dm_new_con_state->abm_level)
8801
+ if (dm_old_con_state->abm_level != dm_new_con_state->abm_level ||
8802
+ dm_old_con_state->scaling != dm_new_con_state->scaling)
87888803 new_crtc_state->connectors_changed = true;
87898804 }
87908805