| .. | .. |
|---|
| 2051 | 2051 | drm_for_each_connector_iter(connector, &iter) { |
|---|
| 2052 | 2052 | aconnector = to_amdgpu_dm_connector(connector); |
|---|
| 2053 | 2053 | |
|---|
| 2054 | + if (!aconnector->dc_link) |
|---|
| 2055 | + continue; |
|---|
| 2056 | + |
|---|
| 2054 | 2057 | /* |
|---|
| 2055 | 2058 | * this is the case when traversing through already created |
|---|
| 2056 | 2059 | * MST connectors, should be skipped |
|---|
| 2057 | 2060 | */ |
|---|
| 2058 | | - if (aconnector->dc_link && |
|---|
| 2059 | | - aconnector->dc_link->type == dc_connection_mst_branch) |
|---|
| 2061 | + if (aconnector->dc_link->type == dc_connection_mst_branch) |
|---|
| 2060 | 2062 | continue; |
|---|
| 2061 | 2063 | |
|---|
| 2062 | 2064 | mutex_lock(&aconnector->hpd_lock); |
|---|
| .. | .. |
|---|
| 4567 | 4569 | timing_out->pix_clk_100hz = mode_in->crtc_clock * 10; |
|---|
| 4568 | 4570 | timing_out->aspect_ratio = get_aspect_ratio(mode_in); |
|---|
| 4569 | 4571 | |
|---|
| 4570 | | - stream->output_color_space = get_output_color_space(timing_out); |
|---|
| 4571 | | - |
|---|
| 4572 | 4572 | stream->out_transfer_func->type = TF_TYPE_PREDEFINED; |
|---|
| 4573 | 4573 | stream->out_transfer_func->tf = TRANSFER_FUNCTION_SRGB; |
|---|
| 4574 | 4574 | if (stream->signal == SIGNAL_TYPE_HDMI_TYPE_A) { |
|---|
| .. | .. |
|---|
| 4579 | 4579 | adjust_colour_depth_from_display_info(timing_out, info); |
|---|
| 4580 | 4580 | } |
|---|
| 4581 | 4581 | } |
|---|
| 4582 | + |
|---|
| 4583 | + stream->output_color_space = get_output_color_space(timing_out); |
|---|
| 4582 | 4584 | } |
|---|
| 4583 | 4585 | |
|---|
| 4584 | 4586 | static void fill_audio_info(struct audio_info *audio_info, |
|---|
| .. | .. |
|---|
| 6969 | 6971 | attributes.rotation_angle = 0; |
|---|
| 6970 | 6972 | attributes.attribute_flags.value = 0; |
|---|
| 6971 | 6973 | |
|---|
| 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 | + |
|---|
| 6972 | 6981 | attributes.pitch = attributes.width; |
|---|
| 6973 | 6982 | |
|---|
| 6974 | 6983 | if (crtc_state->stream) { |
|---|
| .. | .. |
|---|
| 7246 | 7255 | continue; |
|---|
| 7247 | 7256 | |
|---|
| 7248 | 7257 | dc_plane = dm_new_plane_state->dc_state; |
|---|
| 7258 | + if (!dc_plane) |
|---|
| 7259 | + continue; |
|---|
| 7249 | 7260 | |
|---|
| 7250 | 7261 | bundle->surface_updates[planes_count].surface = dc_plane; |
|---|
| 7251 | 7262 | if (new_pcrtc_state->color_mgmt_changed) { |
|---|
| .. | .. |
|---|
| 7426 | 7437 | if (acrtc_state->abm_level != dm_old_crtc_state->abm_level) |
|---|
| 7427 | 7438 | bundle->stream_update.abm_level = &acrtc_state->abm_level; |
|---|
| 7428 | 7439 | |
|---|
| 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 | + |
|---|
| 7429 | 7446 | /* |
|---|
| 7430 | 7447 | * If FreeSync state on the stream has changed then we need to |
|---|
| 7431 | 7448 | * re-adjust the min/max bounds now that DC doesn't handle this |
|---|
| .. | .. |
|---|
| 7440 | 7457 | spin_unlock_irqrestore(&pcrtc->dev->event_lock, flags); |
|---|
| 7441 | 7458 | } |
|---|
| 7442 | 7459 | 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); |
|---|
| 7446 | 7460 | |
|---|
| 7447 | 7461 | dc_commit_updates_for_stream(dm->dc, |
|---|
| 7448 | 7462 | bundle->surface_updates, |
|---|
| .. | .. |
|---|
| 8560 | 8574 | return -EINVAL; |
|---|
| 8561 | 8575 | } |
|---|
| 8562 | 8576 | |
|---|
| 8577 | + if (dm_old_plane_state->dc_state) |
|---|
| 8578 | + dc_plane_state_release(dm_old_plane_state->dc_state); |
|---|
| 8563 | 8579 | |
|---|
| 8564 | | - dc_plane_state_release(dm_old_plane_state->dc_state); |
|---|
| 8565 | 8580 | dm_new_plane_state->dc_state = NULL; |
|---|
| 8566 | 8581 | |
|---|
| 8567 | 8582 | *lock_and_validation_needed = true; |
|---|
| .. | .. |
|---|
| 8783 | 8798 | goto fail; |
|---|
| 8784 | 8799 | } |
|---|
| 8785 | 8800 | |
|---|
| 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) |
|---|
| 8788 | 8803 | new_crtc_state->connectors_changed = true; |
|---|
| 8789 | 8804 | } |
|---|
| 8790 | 8805 | |
|---|