Skip to content

Commit 2af3e53

Browse files
committed
Merge tag 'drm-fixes-2023-04-21' of git://anongit.freedesktop.org/drm/drm
Pull drm fixes from Dave Airlie: "This is the regular and hopefully last round of fixes for 6.3. Pretty small, a few amdgpu, one i915, one nouveau, one rockchip and one gpu scheduler fix: nouveau: - fix dma-resv timeout rockchip: - fix suspend/resume sched: - fix timeout handling i915: - Fix fast wake AUX sync len amdgpu: - GPU reset fix - DCN 3.1.5 line buffer fix - Display fix for single channel memory configs - Fix a possible divide by 0" * tag 'drm-fixes-2023-04-21' of git://anongit.freedesktop.org/drm/drm: drm/amd/display: fix a divided-by-zero error drm/amd/display: limit timing for single dimm memory drm/amd/display: set dcn315 lb bpp to 48 drm/amdgpu: Fix desktop freezed after gpu-reset drm/rockchip: vop2: Use regcache_sync() to fix suspend/resume drm/nouveau: fix incorrect conversion to dma_resv_wait_timeout() drm/rockchip: vop2: fix suspend/resume drm/i915: Fix fast wake AUX sync len drm/sched: Check scheduler ready before calling timeout handling
2 parents b7bc77e + 00a4bd0 commit 2af3e53

File tree

9 files changed

+61
-12
lines changed

9 files changed

+61
-12
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -596,6 +596,9 @@ int amdgpu_irq_put(struct amdgpu_device *adev, struct amdgpu_irq_src *src,
596596
if (!src->enabled_types || !src->funcs->set)
597597
return -EINVAL;
598598

599+
if (WARN_ON(!amdgpu_irq_enabled(adev, src, type)))
600+
return -EINVAL;
601+
599602
if (atomic_dec_and_test(&src->enabled_types[type]))
600603
return amdgpu_irq_update(adev, src, type);
601604

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

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,21 @@ static inline int dm_set_vblank(struct drm_crtc *crtc, bool enable)
169169
if (rc)
170170
return rc;
171171

172-
irq_source = IRQ_TYPE_VBLANK + acrtc->otg_inst;
172+
if (amdgpu_in_reset(adev)) {
173+
irq_source = IRQ_TYPE_VBLANK + acrtc->otg_inst;
174+
/* During gpu-reset we disable and then enable vblank irq, so
175+
* don't use amdgpu_irq_get/put() to avoid refcount change.
176+
*/
177+
if (!dc_interrupt_set(adev->dm.dc, irq_source, enable))
178+
rc = -EBUSY;
179+
} else {
180+
rc = (enable)
181+
? amdgpu_irq_get(adev, &adev->crtc_irq, acrtc->crtc_id)
182+
: amdgpu_irq_put(adev, &adev->crtc_irq, acrtc->crtc_id);
183+
}
173184

174-
if (!dc_interrupt_set(adev->dm.dc, irq_source, enable))
175-
return -EBUSY;
185+
if (rc)
186+
return rc;
176187

177188
skip:
178189
if (amdgpu_in_reset(adev))

drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1697,6 +1697,23 @@ static void dcn314_get_panel_config_defaults(struct dc_panel_config *panel_confi
16971697
*panel_config = panel_config_defaults;
16981698
}
16991699

1700+
static bool filter_modes_for_single_channel_workaround(struct dc *dc,
1701+
struct dc_state *context)
1702+
{
1703+
// Filter 2K@240Hz+8K@24fps above combination timing if memory only has single dimm LPDDR
1704+
if (dc->clk_mgr->bw_params->vram_type == 34 && dc->clk_mgr->bw_params->num_channels < 2) {
1705+
int total_phy_pix_clk = 0;
1706+
1707+
for (int i = 0; i < context->stream_count; i++)
1708+
if (context->res_ctx.pipe_ctx[i].stream)
1709+
total_phy_pix_clk += context->res_ctx.pipe_ctx[i].stream->phy_pix_clk;
1710+
1711+
if (total_phy_pix_clk >= (1148928+826260)) //2K@240Hz+8K@24fps
1712+
return true;
1713+
}
1714+
return false;
1715+
}
1716+
17001717
bool dcn314_validate_bandwidth(struct dc *dc,
17011718
struct dc_state *context,
17021719
bool fast_validate)
@@ -1712,6 +1729,9 @@ bool dcn314_validate_bandwidth(struct dc *dc,
17121729

17131730
BW_VAL_TRACE_COUNT();
17141731

1732+
if (filter_modes_for_single_channel_workaround(dc, context))
1733+
goto validate_fail;
1734+
17151735
DC_FP_START();
17161736
// do not support self refresh only
17171737
out = dcn30_internal_validate_bw(dc, context, pipes, &pipe_cnt, &vlevel, fast_validate, false);

drivers/gpu/drm/amd/display/dc/dml/dcn31/dcn31_fpu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ struct _vcs_dpi_ip_params_st dcn3_15_ip = {
222222
.maximum_dsc_bits_per_component = 10,
223223
.dsc422_native_support = false,
224224
.is_line_buffer_bpp_fixed = true,
225-
.line_buffer_fixed_bpp = 49,
225+
.line_buffer_fixed_bpp = 48,
226226
.line_buffer_size_bits = 789504,
227227
.max_line_buffer_lines = 12,
228228
.writeback_interface_buffer_size_kbytes = 90,

drivers/gpu/drm/amd/display/modules/power/power_helpers.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -934,6 +934,10 @@ bool psr_su_set_dsc_slice_height(struct dc *dc, struct dc_link *link,
934934

935935
pic_height = stream->timing.v_addressable +
936936
stream->timing.v_border_top + stream->timing.v_border_bottom;
937+
938+
if (stream->timing.dsc_cfg.num_slices_v == 0)
939+
return false;
940+
937941
slice_height = pic_height / stream->timing.dsc_cfg.num_slices_v;
938942
config->dsc_slice_height = slice_height;
939943

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ static u32 skl_get_aux_send_ctl(struct intel_dp *intel_dp,
163163
DP_AUX_CH_CTL_TIME_OUT_MAX |
164164
DP_AUX_CH_CTL_RECEIVE_ERROR |
165165
(send_bytes << DP_AUX_CH_CTL_MESSAGE_SIZE_SHIFT) |
166-
DP_AUX_CH_CTL_FW_SYNC_PULSE_SKL(32) |
166+
DP_AUX_CH_CTL_FW_SYNC_PULSE_SKL(24) |
167167
DP_AUX_CH_CTL_SYNC_PULSE_SKL(32);
168168

169169
if (intel_tc_port_in_tbt_alt_mode(dig_port))

drivers/gpu/drm/nouveau/nouveau_gem.c

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -645,14 +645,15 @@ nouveau_gem_pushbuf_reloc_apply(struct nouveau_cli *cli,
645645
struct drm_nouveau_gem_pushbuf_reloc *reloc,
646646
struct drm_nouveau_gem_pushbuf_bo *bo)
647647
{
648-
long ret = 0;
648+
int ret = 0;
649649
unsigned i;
650650

651651
for (i = 0; i < req->nr_relocs; i++) {
652652
struct drm_nouveau_gem_pushbuf_reloc *r = &reloc[i];
653653
struct drm_nouveau_gem_pushbuf_bo *b;
654654
struct nouveau_bo *nvbo;
655655
uint32_t data;
656+
long lret;
656657

657658
if (unlikely(r->bo_index >= req->nr_buffers)) {
658659
NV_PRINTK(err, cli, "reloc bo index invalid\n");
@@ -703,13 +704,18 @@ nouveau_gem_pushbuf_reloc_apply(struct nouveau_cli *cli,
703704
data |= r->vor;
704705
}
705706

706-
ret = dma_resv_wait_timeout(nvbo->bo.base.resv,
707-
DMA_RESV_USAGE_BOOKKEEP,
708-
false, 15 * HZ);
709-
if (ret == 0)
707+
lret = dma_resv_wait_timeout(nvbo->bo.base.resv,
708+
DMA_RESV_USAGE_BOOKKEEP,
709+
false, 15 * HZ);
710+
if (!lret)
710711
ret = -EBUSY;
712+
else if (lret > 0)
713+
ret = 0;
714+
else
715+
ret = lret;
716+
711717
if (ret) {
712-
NV_PRINTK(err, cli, "reloc wait_idle failed: %ld\n",
718+
NV_PRINTK(err, cli, "reloc wait_idle failed: %d\n",
713719
ret);
714720
break;
715721
}

drivers/gpu/drm/rockchip/rockchip_drm_vop2.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -839,6 +839,8 @@ static void vop2_enable(struct vop2 *vop2)
839839
return;
840840
}
841841

842+
regcache_sync(vop2->map);
843+
842844
if (vop2->data->soc_id == 3566)
843845
vop2_writel(vop2, RK3568_OTP_WIN_EN, 1);
844846

@@ -867,6 +869,8 @@ static void vop2_disable(struct vop2 *vop2)
867869

868870
pm_runtime_put_sync(vop2->dev);
869871

872+
regcache_mark_dirty(vop2->map);
873+
870874
clk_disable_unprepare(vop2->aclk);
871875
clk_disable_unprepare(vop2->hclk);
872876
}

drivers/gpu/drm/scheduler/sched_main.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,8 @@ static void drm_sched_start_timeout(struct drm_gpu_scheduler *sched)
308308
*/
309309
void drm_sched_fault(struct drm_gpu_scheduler *sched)
310310
{
311-
mod_delayed_work(sched->timeout_wq, &sched->work_tdr, 0);
311+
if (sched->ready)
312+
mod_delayed_work(sched->timeout_wq, &sched->work_tdr, 0);
312313
}
313314
EXPORT_SYMBOL(drm_sched_fault);
314315

0 commit comments

Comments
 (0)