Skip to content

Commit 8afe6f0

Browse files
committed
Merge tag 'drm-fixes-2023-12-22' of git://anongit.freedesktop.org/drm/drm
Pull drm fixes from Dave Airlie: "Pretty quiet for this week, just i915 and amdgpu fixes, I think the misc tree got lost this week, but didn't seem to have too much in it, so it can wait. I've also got a bunch of nouveau GSP fixes sailing around that'll probably land next time as well. amdgpu: - DCN 3.5 fixes - DCN 3.2 SubVP fix - GPUVM fix amdkfd: - SVM fix for APUs i915: - Fix state readout and check for DSC and bigjoiner combo - Fix a potential integer overflow - Reject async flips with bigjoiner - Fix MTL HDMI/DP PLL clock selection - Fix various issues by disabling pipe DMC events" * tag 'drm-fixes-2023-12-22' of git://anongit.freedesktop.org/drm/drm: drm/amdgpu: re-create idle bo's PTE during VM state machine reset drm/amd/display: dereference variable before checking for zero drm/amd/display: get dprefclk ss info from integration info table drm/amd/display: Add case for dcn35 to support usb4 dmub hpd event drm/amd/display: disable FPO and SubVP for older DMUB versions on DCN32x drm/amdkfd: svm range always mapped flag not working on APU drm/amd/display: Revert " drm/amd/display: Use channel_width = 2 for vram table 3.0" drm/i915/dmc: Don't enable any pipe DMC events drm/i915/mtl: Fix HDMI/DP PLL clock selection drm/i915: Reject async flips with bigjoiner drm/i915/hwmon: Fix static analysis tool reported issues drm/i915/display: Get bigjoiner config before dsc config during readout
2 parents 93a165c + d4b6e7f commit 8afe6f0

File tree

11 files changed

+112
-33
lines changed

11 files changed

+112
-33
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,7 @@ static void amdgpu_vm_bo_reset_state_machine(struct amdgpu_vm *vm)
285285
list_for_each_entry_safe(vm_bo, tmp, &vm->idle, vm_status) {
286286
struct amdgpu_bo *bo = vm_bo->bo;
287287

288+
vm_bo->moved = true;
288289
if (!bo || bo->tbo.type != ttm_bo_type_kernel)
289290
list_move(&vm_bo->vm_status, &vm_bo->vm->moved);
290291
else if (bo->parent)

drivers/gpu/drm/amd/amdkfd/kfd_svm.c

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1653,18 +1653,24 @@ static int svm_range_validate_and_map(struct mm_struct *mm,
16531653
if (test_bit(gpuidx, prange->bitmap_access))
16541654
bitmap_set(ctx->bitmap, gpuidx, 1);
16551655
}
1656+
1657+
/*
1658+
* If prange is already mapped or with always mapped flag,
1659+
* update mapping on GPUs with ACCESS attribute
1660+
*/
1661+
if (bitmap_empty(ctx->bitmap, MAX_GPU_INSTANCE)) {
1662+
if (prange->mapped_to_gpu ||
1663+
prange->flags & KFD_IOCTL_SVM_FLAG_GPU_ALWAYS_MAPPED)
1664+
bitmap_copy(ctx->bitmap, prange->bitmap_access, MAX_GPU_INSTANCE);
1665+
}
16561666
} else {
16571667
bitmap_or(ctx->bitmap, prange->bitmap_access,
16581668
prange->bitmap_aip, MAX_GPU_INSTANCE);
16591669
}
16601670

16611671
if (bitmap_empty(ctx->bitmap, MAX_GPU_INSTANCE)) {
1662-
bitmap_copy(ctx->bitmap, prange->bitmap_access, MAX_GPU_INSTANCE);
1663-
if (!prange->mapped_to_gpu ||
1664-
bitmap_empty(ctx->bitmap, MAX_GPU_INSTANCE)) {
1665-
r = 0;
1666-
goto free_ctx;
1667-
}
1672+
r = 0;
1673+
goto free_ctx;
16681674
}
16691675

16701676
if (prange->actual_loc && !prange->ttm_res) {

drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1014,13 +1014,20 @@ static enum bp_result get_ss_info_v4_5(
10141014
DC_LOG_BIOS("AS_SIGNAL_TYPE_HDMI ss_percentage: %d\n", ss_info->spread_spectrum_percentage);
10151015
break;
10161016
case AS_SIGNAL_TYPE_DISPLAY_PORT:
1017-
ss_info->spread_spectrum_percentage =
1017+
if (bp->base.integrated_info) {
1018+
DC_LOG_BIOS("gpuclk_ss_percentage (unit of 0.001 percent): %d\n", bp->base.integrated_info->gpuclk_ss_percentage);
1019+
ss_info->spread_spectrum_percentage =
1020+
bp->base.integrated_info->gpuclk_ss_percentage;
1021+
ss_info->type.CENTER_MODE =
1022+
bp->base.integrated_info->gpuclk_ss_type;
1023+
} else {
1024+
ss_info->spread_spectrum_percentage =
10181025
disp_cntl_tbl->dp_ss_percentage;
1019-
ss_info->spread_spectrum_range =
1026+
ss_info->spread_spectrum_range =
10201027
disp_cntl_tbl->dp_ss_rate_10hz * 10;
1021-
if (disp_cntl_tbl->dp_ss_mode & ATOM_SS_CENTRE_SPREAD_MODE)
1022-
ss_info->type.CENTER_MODE = true;
1023-
1028+
if (disp_cntl_tbl->dp_ss_mode & ATOM_SS_CENTRE_SPREAD_MODE)
1029+
ss_info->type.CENTER_MODE = true;
1030+
}
10241031
DC_LOG_BIOS("AS_SIGNAL_TYPE_DISPLAY_PORT ss_percentage: %d\n", ss_info->spread_spectrum_percentage);
10251032
break;
10261033
case AS_SIGNAL_TYPE_GPU_PLL:
@@ -2386,13 +2393,7 @@ static enum bp_result get_vram_info_v30(
23862393
return BP_RESULT_BADBIOSTABLE;
23872394

23882395
info->num_chans = info_v30->channel_num;
2389-
/* As suggested by VBIOS we should always use
2390-
* dram_channel_width_bytes = 2 when using VRAM
2391-
* table version 3.0. This is because the channel_width
2392-
* param in the VRAM info table is changed in 7000 series and
2393-
* no longer represents the memory channel width.
2394-
*/
2395-
info->dram_channel_width_bytes = 2;
2396+
info->dram_channel_width_bytes = (1 << info_v30->channel_width) / 8;
23962397

23972398
return result;
23982399
}
@@ -2820,6 +2821,8 @@ static enum bp_result get_integrated_info_v2_2(
28202821
info->ma_channel_number = info_v2_2->umachannelnumber;
28212822
info->dp_ss_control =
28222823
le16_to_cpu(info_v2_2->reserved1);
2824+
info->gpuclk_ss_percentage = info_v2_2->gpuclk_ss_percentage;
2825+
info->gpuclk_ss_type = info_v2_2->gpuclk_ss_type;
28232826

28242827
for (i = 0; i < NUMBER_OF_UCHAR_FOR_GUID; ++i) {
28252828
info->ext_disp_conn_info.gu_id[i] =

drivers/gpu/drm/amd/display/dc/core/dc.c

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5095,18 +5095,28 @@ void dc_mclk_switch_using_fw_based_vblank_stretch_shut_down(struct dc *dc)
50955095
*/
50965096
bool dc_is_dmub_outbox_supported(struct dc *dc)
50975097
{
5098-
/* DCN31 B0 USB4 DPIA needs dmub notifications for interrupts */
5099-
if (dc->ctx->asic_id.chip_family == FAMILY_YELLOW_CARP &&
5100-
dc->ctx->asic_id.hw_internal_rev == YELLOW_CARP_B0 &&
5101-
!dc->debug.dpia_debug.bits.disable_dpia)
5102-
return true;
5098+
switch (dc->ctx->asic_id.chip_family) {
51035099

5104-
if (dc->ctx->asic_id.chip_family == AMDGPU_FAMILY_GC_11_0_1 &&
5105-
!dc->debug.dpia_debug.bits.disable_dpia)
5106-
return true;
5100+
case FAMILY_YELLOW_CARP:
5101+
/* DCN31 B0 USB4 DPIA needs dmub notifications for interrupts */
5102+
if (dc->ctx->asic_id.hw_internal_rev == YELLOW_CARP_B0 &&
5103+
!dc->debug.dpia_debug.bits.disable_dpia)
5104+
return true;
5105+
break;
5106+
5107+
case AMDGPU_FAMILY_GC_11_0_1:
5108+
case AMDGPU_FAMILY_GC_11_5_0:
5109+
if (!dc->debug.dpia_debug.bits.disable_dpia)
5110+
return true;
5111+
break;
5112+
5113+
default:
5114+
break;
5115+
}
51075116

51085117
/* dmub aux needs dmub notifications to be enabled */
51095118
return dc->debug.enable_dmub_aux_for_legacy_ddc;
5119+
51105120
}
51115121

51125122
/**

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5420,7 +5420,7 @@ static void CalculateOutputLink(
54205420
*OutBpp = TruncToValidBPP((1 - Downspreading / 100) * 13500, OutputLinkDPLanes, HTotal, HActive, PixelClockBackEnd, ForcedOutputLinkBPP, LinkDSCEnable, Output,
54215421
OutputFormat, DSCInputBitPerComponent, NumberOfDSCSlices, (dml_uint_t)AudioSampleRate, AudioSampleLayout, ODMModeNoDSC, ODMModeDSC, RequiredSlots);
54225422

5423-
if (OutBpp == 0 && PHYCLKD32PerState < 20000 / 32 && DSCEnable == dml_dsc_enable_if_necessary && ForcedOutputLinkBPP == 0) {
5423+
if (*OutBpp == 0 && PHYCLKD32PerState < 20000 / 32 && DSCEnable == dml_dsc_enable_if_necessary && ForcedOutputLinkBPP == 0) {
54245424
*RequiresDSC = true;
54255425
LinkDSCEnable = true;
54265426
*OutBpp = TruncToValidBPP((1 - Downspreading / 100) * 13500, OutputLinkDPLanes, HTotal, HActive, PixelClockBackEnd, ForcedOutputLinkBPP, LinkDSCEnable, Output,

drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -960,6 +960,12 @@ void dcn32_init_hw(struct dc *dc)
960960
dc->caps.dmub_caps.subvp_psr = dc->ctx->dmub_srv->dmub->feature_caps.subvp_psr_support;
961961
dc->caps.dmub_caps.gecc_enable = dc->ctx->dmub_srv->dmub->feature_caps.gecc_enable;
962962
dc->caps.dmub_caps.mclk_sw = dc->ctx->dmub_srv->dmub->feature_caps.fw_assisted_mclk_switch;
963+
964+
if (dc->ctx->dmub_srv->dmub->fw_version <
965+
DMUB_FW_VERSION(7, 0, 35)) {
966+
dc->debug.force_disable_subvp = true;
967+
dc->debug.disable_fpo_optimizations = true;
968+
}
963969
}
964970
}
965971

drivers/gpu/drm/amd/display/include/grph_object_ctrl_defs.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,8 @@ struct integrated_info {
417417
/* V2.1 */
418418
struct edp_info edp1_info;
419419
struct edp_info edp2_info;
420+
uint32_t gpuclk_ss_percentage;
421+
uint32_t gpuclk_ss_type;
420422
};
421423

422424
/*

drivers/gpu/drm/i915/display/intel_cx0_phy.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2465,7 +2465,8 @@ static void intel_program_port_clock_ctl(struct intel_encoder *encoder,
24652465

24662466
val |= XELPDP_FORWARD_CLOCK_UNGATE;
24672467

2468-
if (is_hdmi_frl(crtc_state->port_clock))
2468+
if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_HDMI) &&
2469+
is_hdmi_frl(crtc_state->port_clock))
24692470
val |= XELPDP_DDI_CLOCK_SELECT(XELPDP_DDI_CLOCK_SELECT_DIV18CLK);
24702471
else
24712472
val |= XELPDP_DDI_CLOCK_SELECT(XELPDP_DDI_CLOCK_SELECT_MAXPCLK);

drivers/gpu/drm/i915/display/intel_display.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3747,8 +3747,8 @@ static bool hsw_get_pipe_config(struct intel_crtc *crtc,
37473747
if (!active)
37483748
goto out;
37493749

3750-
intel_dsc_get_config(pipe_config);
37513750
intel_bigjoiner_get_config(pipe_config);
3751+
intel_dsc_get_config(pipe_config);
37523752

37533753
if (!transcoder_is_dsi(pipe_config->cpu_transcoder) ||
37543754
DISPLAY_VER(dev_priv) >= 11)
@@ -6033,6 +6033,17 @@ static int intel_async_flip_check_uapi(struct intel_atomic_state *state,
60336033
return -EINVAL;
60346034
}
60356035

6036+
/*
6037+
* FIXME: Bigjoiner+async flip is busted currently.
6038+
* Remove this check once the issues are fixed.
6039+
*/
6040+
if (new_crtc_state->bigjoiner_pipes) {
6041+
drm_dbg_kms(&i915->drm,
6042+
"[CRTC:%d:%s] async flip disallowed with bigjoiner\n",
6043+
crtc->base.base.id, crtc->base.name);
6044+
return -EINVAL;
6045+
}
6046+
60366047
for_each_oldnew_intel_plane_in_state(state, plane, old_plane_state,
60376048
new_plane_state, i) {
60386049
if (plane->pipe != crtc->pipe)

drivers/gpu/drm/i915/display/intel_dmc.c

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ disable_all_flip_queue_events(struct drm_i915_private *i915)
389389
enum intel_dmc_id dmc_id;
390390

391391
/* TODO: check if the following applies to all D13+ platforms. */
392-
if (!IS_DG2(i915) && !IS_TIGERLAKE(i915))
392+
if (!IS_TIGERLAKE(i915))
393393
return;
394394

395395
for_each_dmc_id(dmc_id) {
@@ -493,6 +493,45 @@ void intel_dmc_disable_pipe(struct drm_i915_private *i915, enum pipe pipe)
493493
intel_de_rmw(i915, PIPEDMC_CONTROL(pipe), PIPEDMC_ENABLE, 0);
494494
}
495495

496+
static bool is_dmc_evt_ctl_reg(struct drm_i915_private *i915,
497+
enum intel_dmc_id dmc_id, i915_reg_t reg)
498+
{
499+
u32 offset = i915_mmio_reg_offset(reg);
500+
u32 start = i915_mmio_reg_offset(DMC_EVT_CTL(i915, dmc_id, 0));
501+
u32 end = i915_mmio_reg_offset(DMC_EVT_CTL(i915, dmc_id, DMC_EVENT_HANDLER_COUNT_GEN12));
502+
503+
return offset >= start && offset < end;
504+
}
505+
506+
static bool disable_dmc_evt(struct drm_i915_private *i915,
507+
enum intel_dmc_id dmc_id,
508+
i915_reg_t reg, u32 data)
509+
{
510+
if (!is_dmc_evt_ctl_reg(i915, dmc_id, reg))
511+
return false;
512+
513+
/* keep all pipe DMC events disabled by default */
514+
if (dmc_id != DMC_FW_MAIN)
515+
return true;
516+
517+
return false;
518+
}
519+
520+
static u32 dmc_mmiodata(struct drm_i915_private *i915,
521+
struct intel_dmc *dmc,
522+
enum intel_dmc_id dmc_id, int i)
523+
{
524+
if (disable_dmc_evt(i915, dmc_id,
525+
dmc->dmc_info[dmc_id].mmioaddr[i],
526+
dmc->dmc_info[dmc_id].mmiodata[i]))
527+
return REG_FIELD_PREP(DMC_EVT_CTL_TYPE_MASK,
528+
DMC_EVT_CTL_TYPE_EDGE_0_1) |
529+
REG_FIELD_PREP(DMC_EVT_CTL_EVENT_ID_MASK,
530+
DMC_EVT_CTL_EVENT_ID_FALSE);
531+
else
532+
return dmc->dmc_info[dmc_id].mmiodata[i];
533+
}
534+
496535
/**
497536
* intel_dmc_load_program() - write the firmware from memory to register.
498537
* @i915: i915 drm device.
@@ -532,7 +571,7 @@ void intel_dmc_load_program(struct drm_i915_private *i915)
532571
for_each_dmc_id(dmc_id) {
533572
for (i = 0; i < dmc->dmc_info[dmc_id].mmio_count; i++) {
534573
intel_de_write(i915, dmc->dmc_info[dmc_id].mmioaddr[i],
535-
dmc->dmc_info[dmc_id].mmiodata[i]);
574+
dmc_mmiodata(i915, dmc, dmc_id, i));
536575
}
537576
}
538577

0 commit comments

Comments
 (0)