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

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

+61 -12
+3
drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
··· 596 596 if (!src->enabled_types || !src->funcs->set) 597 597 return -EINVAL; 598 598 599 + if (WARN_ON(!amdgpu_irq_enabled(adev, src, type))) 600 + return -EINVAL; 601 + 599 602 if (atomic_dec_and_test(&src->enabled_types[type])) 600 603 return amdgpu_irq_update(adev, src, type); 601 604
+14 -3
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c
··· 169 169 if (rc) 170 170 return rc; 171 171 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 + } 173 184 174 - if (!dc_interrupt_set(adev->dm.dc, irq_source, enable)) 175 - return -EBUSY; 185 + if (rc) 186 + return rc; 176 187 177 188 skip: 178 189 if (amdgpu_in_reset(adev))
+20
drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c
··· 1697 1697 *panel_config = panel_config_defaults; 1698 1698 } 1699 1699 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 + 1700 1717 bool dcn314_validate_bandwidth(struct dc *dc, 1701 1718 struct dc_state *context, 1702 1719 bool fast_validate) ··· 1728 1711 DC_LOGGER_INIT(dc->ctx->logger); 1729 1712 1730 1713 BW_VAL_TRACE_COUNT(); 1714 + 1715 + if (filter_modes_for_single_channel_workaround(dc, context)) 1716 + goto validate_fail; 1731 1717 1732 1718 DC_FP_START(); 1733 1719 // do not support self refresh only
+1 -1
drivers/gpu/drm/amd/display/dc/dml/dcn31/dcn31_fpu.c
··· 222 222 .maximum_dsc_bits_per_component = 10, 223 223 .dsc422_native_support = false, 224 224 .is_line_buffer_bpp_fixed = true, 225 - .line_buffer_fixed_bpp = 49, 225 + .line_buffer_fixed_bpp = 48, 226 226 .line_buffer_size_bits = 789504, 227 227 .max_line_buffer_lines = 12, 228 228 .writeback_interface_buffer_size_kbytes = 90,
+4
drivers/gpu/drm/amd/display/modules/power/power_helpers.c
··· 934 934 935 935 pic_height = stream->timing.v_addressable + 936 936 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 + 937 941 slice_height = pic_height / stream->timing.dsc_cfg.num_slices_v; 938 942 config->dsc_slice_height = slice_height; 939 943
+1 -1
drivers/gpu/drm/i915/display/intel_dp_aux.c
··· 163 163 DP_AUX_CH_CTL_TIME_OUT_MAX | 164 164 DP_AUX_CH_CTL_RECEIVE_ERROR | 165 165 (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) | 167 167 DP_AUX_CH_CTL_SYNC_PULSE_SKL(32); 168 168 169 169 if (intel_tc_port_in_tbt_alt_mode(dig_port))
+12 -6
drivers/gpu/drm/nouveau/nouveau_gem.c
··· 645 645 struct drm_nouveau_gem_pushbuf_reloc *reloc, 646 646 struct drm_nouveau_gem_pushbuf_bo *bo) 647 647 { 648 - long ret = 0; 648 + int ret = 0; 649 649 unsigned i; 650 650 651 651 for (i = 0; i < req->nr_relocs; i++) { ··· 653 653 struct drm_nouveau_gem_pushbuf_bo *b; 654 654 struct nouveau_bo *nvbo; 655 655 uint32_t data; 656 + long lret; 656 657 657 658 if (unlikely(r->bo_index >= req->nr_buffers)) { 658 659 NV_PRINTK(err, cli, "reloc bo index invalid\n"); ··· 704 703 data |= r->vor; 705 704 } 706 705 707 - ret = dma_resv_wait_timeout(nvbo->bo.base.resv, 708 - DMA_RESV_USAGE_BOOKKEEP, 709 - false, 15 * HZ); 710 - if (ret == 0) 706 + lret = dma_resv_wait_timeout(nvbo->bo.base.resv, 707 + DMA_RESV_USAGE_BOOKKEEP, 708 + false, 15 * HZ); 709 + if (!lret) 711 710 ret = -EBUSY; 711 + else if (lret > 0) 712 + ret = 0; 713 + else 714 + ret = lret; 715 + 712 716 if (ret) { 713 - NV_PRINTK(err, cli, "reloc wait_idle failed: %ld\n", 717 + NV_PRINTK(err, cli, "reloc wait_idle failed: %d\n", 714 718 ret); 715 719 break; 716 720 }
+4
drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
··· 839 839 return; 840 840 } 841 841 842 + regcache_sync(vop2->map); 843 + 842 844 if (vop2->data->soc_id == 3566) 843 845 vop2_writel(vop2, RK3568_OTP_WIN_EN, 1); 844 846 ··· 868 866 rockchip_drm_dma_detach_device(vop2->drm, vop2->dev); 869 867 870 868 pm_runtime_put_sync(vop2->dev); 869 + 870 + regcache_mark_dirty(vop2->map); 871 871 872 872 clk_disable_unprepare(vop2->aclk); 873 873 clk_disable_unprepare(vop2->hclk);
+2 -1
drivers/gpu/drm/scheduler/sched_main.c
··· 308 308 */ 309 309 void drm_sched_fault(struct drm_gpu_scheduler *sched) 310 310 { 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); 312 313 } 313 314 EXPORT_SYMBOL(drm_sched_fault); 314 315