Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'amd-drm-fixes-6.10-2024-07-03' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes

amd-drm-fixes-6.10-2024-07-03:

amdgpu:
- Freesync fixes
- DML1 bandwidth fix
- DCN 3.5 fixes
- DML2 fix
- Silence an UBSAN warning

radeon:
- GPUVM fix

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
From: Alex Deucher <alexander.deucher@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240703184723.1981997-1-alexander.deucher@amd.com

+59 -4
+52 -1
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
··· 10048 10048 } 10049 10049 10050 10050 /* Update Freesync settings. */ 10051 + reset_freesync_config_for_crtc(dm_new_crtc_state); 10051 10052 get_freesync_config_for_crtc(dm_new_crtc_state, 10052 10053 dm_new_conn_state); 10053 10054 ··· 11182 11181 return ret; 11183 11182 } 11184 11183 11184 + static void parse_edid_displayid_vrr(struct drm_connector *connector, 11185 + struct edid *edid) 11186 + { 11187 + u8 *edid_ext = NULL; 11188 + int i; 11189 + int j = 0; 11190 + u16 min_vfreq; 11191 + u16 max_vfreq; 11192 + 11193 + if (edid == NULL || edid->extensions == 0) 11194 + return; 11195 + 11196 + /* Find DisplayID extension */ 11197 + for (i = 0; i < edid->extensions; i++) { 11198 + edid_ext = (void *)(edid + (i + 1)); 11199 + if (edid_ext[0] == DISPLAYID_EXT) 11200 + break; 11201 + } 11202 + 11203 + if (edid_ext == NULL) 11204 + return; 11205 + 11206 + while (j < EDID_LENGTH) { 11207 + /* Get dynamic video timing range from DisplayID if available */ 11208 + if (EDID_LENGTH - j > 13 && edid_ext[j] == 0x25 && 11209 + (edid_ext[j+1] & 0xFE) == 0 && (edid_ext[j+2] == 9)) { 11210 + min_vfreq = edid_ext[j+9]; 11211 + if (edid_ext[j+1] & 7) 11212 + max_vfreq = edid_ext[j+10] + ((edid_ext[j+11] & 3) << 8); 11213 + else 11214 + max_vfreq = edid_ext[j+10]; 11215 + 11216 + if (max_vfreq && min_vfreq) { 11217 + connector->display_info.monitor_range.max_vfreq = max_vfreq; 11218 + connector->display_info.monitor_range.min_vfreq = min_vfreq; 11219 + 11220 + return; 11221 + } 11222 + } 11223 + j++; 11224 + } 11225 + } 11226 + 11185 11227 static int parse_amd_vsdb(struct amdgpu_dm_connector *aconnector, 11186 11228 struct edid *edid, struct amdgpu_hdmi_vsdb_info *vsdb_info) 11187 11229 { ··· 11346 11302 if (!adev->dm.freesync_module) 11347 11303 goto update; 11348 11304 11305 + /* Some eDP panels only have the refresh rate range info in DisplayID */ 11306 + if ((connector->display_info.monitor_range.min_vfreq == 0 || 11307 + connector->display_info.monitor_range.max_vfreq == 0)) 11308 + parse_edid_displayid_vrr(connector, edid); 11309 + 11349 11310 if (edid && (sink->sink_signal == SIGNAL_TYPE_DISPLAY_PORT || 11350 11311 sink->sink_signal == SIGNAL_TYPE_EDP)) { 11351 11312 bool edid_check_required = false; ··· 11358 11309 if (is_dp_capable_without_timing_msa(adev->dm.dc, 11359 11310 amdgpu_dm_connector)) { 11360 11311 if (edid->features & DRM_EDID_FEATURE_CONTINUOUS_FREQ) { 11361 - freesync_capable = true; 11362 11312 amdgpu_dm_connector->min_vfreq = connector->display_info.monitor_range.min_vfreq; 11363 11313 amdgpu_dm_connector->max_vfreq = connector->display_info.monitor_range.max_vfreq; 11314 + if (amdgpu_dm_connector->max_vfreq - 11315 + amdgpu_dm_connector->min_vfreq > 10) 11316 + freesync_capable = true; 11364 11317 } else { 11365 11318 edid_check_required = edid->version > 1 || 11366 11319 (edid->version == 1 &&
+3
drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_32.c
··· 3364 3364 &mode_lib->vba.UrgentBurstFactorLumaPre[k], 3365 3365 &mode_lib->vba.UrgentBurstFactorChromaPre[k], 3366 3366 &mode_lib->vba.NotUrgentLatencyHidingPre[k]); 3367 + 3368 + v->cursor_bw_pre[k] = mode_lib->vba.NumberOfCursors[k] * mode_lib->vba.CursorWidth[k][0] * mode_lib->vba.CursorBPP[k][0] / 3369 + 8.0 / (mode_lib->vba.HTotal[k] / mode_lib->vba.PixelClock[k]) * v->VRatioPreY[i][j][k]; 3367 3370 } 3368 3371 3369 3372 {
+1
drivers/gpu/drm/amd/display/dc/dml2/dml2_translation_helper.c
··· 234 234 out->round_trip_ping_latency_dcfclk_cycles = 106; 235 235 out->smn_latency_us = 2; 236 236 out->dispclk_dppclk_vco_speed_mhz = 3600; 237 + out->pct_ideal_dram_bw_after_urgent_pixel_only = 65.0; 237 238 break; 238 239 239 240 }
+1 -1
drivers/gpu/drm/amd/display/dc/dml2/dml2_utils.c
··· 294 294 context->bw_ctx.bw.dcn.clk.dcfclk_deep_sleep_khz = (unsigned int)in_ctx->v20.dml_core_ctx.mp.DCFCLKDeepSleep * 1000; 295 295 context->bw_ctx.bw.dcn.clk.dppclk_khz = 0; 296 296 297 - if (in_ctx->v20.dml_core_ctx.ms.support.FCLKChangeSupport[in_ctx->v20.scratch.mode_support_params.out_lowest_state_idx] == dml_fclock_change_unsupported) 297 + if (in_ctx->v20.dml_core_ctx.ms.support.FCLKChangeSupport[0] == dml_fclock_change_unsupported) 298 298 context->bw_ctx.bw.dcn.clk.fclk_p_state_change_support = false; 299 299 else 300 300 context->bw_ctx.bw.dcn.clk.fclk_p_state_change_support = true;
+1 -1
drivers/gpu/drm/amd/include/atomfirmware.h
··· 734 734 { 735 735 struct atom_common_table_header table_header; 736 736 /*the real number of this included in the structure is calcualted by using the (whole structure size - the header size)/size of atom_gpio_pin_lut */ 737 - struct atom_gpio_pin_assignment gpio_pin[8]; 737 + struct atom_gpio_pin_assignment gpio_pin[]; 738 738 }; 739 739 740 740
+1 -1
drivers/gpu/drm/radeon/radeon_gem.c
··· 642 642 if (r) 643 643 goto error_unlock; 644 644 645 - if (bo_va->it.start) 645 + if (bo_va->it.start && bo_va->bo) 646 646 r = radeon_vm_bo_update(rdev, bo_va, bo_va->bo->tbo.resource); 647 647 648 648 error_unlock: