Skip to content

Commit 3c6f5af

Browse files
committed
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 <[email protected]> From: Alex Deucher <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 parents 2879b48 + d041726 commit 3c6f5af

File tree

6 files changed

+59
-4
lines changed

6 files changed

+59
-4
lines changed

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10048,6 +10048,7 @@ static int dm_update_crtc_state(struct amdgpu_display_manager *dm,
1004810048
}
1004910049

1005010050
/* Update Freesync settings. */
10051+
reset_freesync_config_for_crtc(dm_new_crtc_state);
1005110052
get_freesync_config_for_crtc(dm_new_crtc_state,
1005210053
dm_new_conn_state);
1005310054

@@ -11181,6 +11182,49 @@ static bool parse_edid_cea(struct amdgpu_dm_connector *aconnector,
1118111182
return ret;
1118211183
}
1118311184

11185+
static void parse_edid_displayid_vrr(struct drm_connector *connector,
11186+
struct edid *edid)
11187+
{
11188+
u8 *edid_ext = NULL;
11189+
int i;
11190+
int j = 0;
11191+
u16 min_vfreq;
11192+
u16 max_vfreq;
11193+
11194+
if (edid == NULL || edid->extensions == 0)
11195+
return;
11196+
11197+
/* Find DisplayID extension */
11198+
for (i = 0; i < edid->extensions; i++) {
11199+
edid_ext = (void *)(edid + (i + 1));
11200+
if (edid_ext[0] == DISPLAYID_EXT)
11201+
break;
11202+
}
11203+
11204+
if (edid_ext == NULL)
11205+
return;
11206+
11207+
while (j < EDID_LENGTH) {
11208+
/* Get dynamic video timing range from DisplayID if available */
11209+
if (EDID_LENGTH - j > 13 && edid_ext[j] == 0x25 &&
11210+
(edid_ext[j+1] & 0xFE) == 0 && (edid_ext[j+2] == 9)) {
11211+
min_vfreq = edid_ext[j+9];
11212+
if (edid_ext[j+1] & 7)
11213+
max_vfreq = edid_ext[j+10] + ((edid_ext[j+11] & 3) << 8);
11214+
else
11215+
max_vfreq = edid_ext[j+10];
11216+
11217+
if (max_vfreq && min_vfreq) {
11218+
connector->display_info.monitor_range.max_vfreq = max_vfreq;
11219+
connector->display_info.monitor_range.min_vfreq = min_vfreq;
11220+
11221+
return;
11222+
}
11223+
}
11224+
j++;
11225+
}
11226+
}
11227+
1118411228
static int parse_amd_vsdb(struct amdgpu_dm_connector *aconnector,
1118511229
struct edid *edid, struct amdgpu_hdmi_vsdb_info *vsdb_info)
1118611230
{
@@ -11302,16 +11346,23 @@ void amdgpu_dm_update_freesync_caps(struct drm_connector *connector,
1130211346
if (!adev->dm.freesync_module)
1130311347
goto update;
1130411348

11349+
/* Some eDP panels only have the refresh rate range info in DisplayID */
11350+
if ((connector->display_info.monitor_range.min_vfreq == 0 ||
11351+
connector->display_info.monitor_range.max_vfreq == 0))
11352+
parse_edid_displayid_vrr(connector, edid);
11353+
1130511354
if (edid && (sink->sink_signal == SIGNAL_TYPE_DISPLAY_PORT ||
1130611355
sink->sink_signal == SIGNAL_TYPE_EDP)) {
1130711356
bool edid_check_required = false;
1130811357

1130911358
if (is_dp_capable_without_timing_msa(adev->dm.dc,
1131011359
amdgpu_dm_connector)) {
1131111360
if (edid->features & DRM_EDID_FEATURE_CONTINUOUS_FREQ) {
11312-
freesync_capable = true;
1131311361
amdgpu_dm_connector->min_vfreq = connector->display_info.monitor_range.min_vfreq;
1131411362
amdgpu_dm_connector->max_vfreq = connector->display_info.monitor_range.max_vfreq;
11363+
if (amdgpu_dm_connector->max_vfreq -
11364+
amdgpu_dm_connector->min_vfreq > 10)
11365+
freesync_capable = true;
1131511366
} else {
1131611367
edid_check_required = edid->version > 1 ||
1131711368
(edid->version == 1 &&

drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_32.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3364,6 +3364,9 @@ void dml32_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l
33643364
&mode_lib->vba.UrgentBurstFactorLumaPre[k],
33653365
&mode_lib->vba.UrgentBurstFactorChromaPre[k],
33663366
&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];
33673370
}
33683371

33693372
{

drivers/gpu/drm/amd/display/dc/dml2/dml2_translation_helper.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ void dml2_init_socbb_params(struct dml2_context *dml2, const struct dc *in_dc, s
234234
out->round_trip_ping_latency_dcfclk_cycles = 106;
235235
out->smn_latency_us = 2;
236236
out->dispclk_dppclk_vco_speed_mhz = 3600;
237+
out->pct_ideal_dram_bw_after_urgent_pixel_only = 65.0;
237238
break;
238239

239240
}

drivers/gpu/drm/amd/display/dc/dml2/dml2_utils.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ void dml2_calculate_rq_and_dlg_params(const struct dc *dc, struct dc_state *cont
294294
context->bw_ctx.bw.dcn.clk.dcfclk_deep_sleep_khz = (unsigned int)in_ctx->v20.dml_core_ctx.mp.DCFCLKDeepSleep * 1000;
295295
context->bw_ctx.bw.dcn.clk.dppclk_khz = 0;
296296

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)
298298
context->bw_ctx.bw.dcn.clk.fclk_p_state_change_support = false;
299299
else
300300
context->bw_ctx.bw.dcn.clk.fclk_p_state_change_support = true;

drivers/gpu/drm/amd/include/atomfirmware.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -734,7 +734,7 @@ struct atom_gpio_pin_lut_v2_1
734734
{
735735
struct atom_common_table_header table_header;
736736
/*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[];
738738
};
739739

740740

drivers/gpu/drm/radeon/radeon_gem.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,7 @@ static void radeon_gem_va_update_vm(struct radeon_device *rdev,
642642
if (r)
643643
goto error_unlock;
644644

645-
if (bo_va->it.start)
645+
if (bo_va->it.start && bo_va->bo)
646646
r = radeon_vm_bo_update(rdev, bo_va, bo_va->bo->tbo.resource);
647647

648648
error_unlock:

0 commit comments

Comments
 (0)