Skip to content

Commit c460535

Browse files
committed
Merge tag 'drm-fixes-2025-07-18-1' of https://gitlab.freedesktop.org/drm/kernel
Pull drm fixes from Dave Airlie: "Seems like a quiet enough week, xe/amdgpu being the usual suspects, then mediatek with a few fixes, and otherwise just misc other bits. dp: - aux dpcd address fix xe: - SR-IOV fixes for GT reset and TLB invalidation - Fix memory copy direction during migration - Fix alignment check on migration - Fix MOCS and page fault init order to correctly account for topology amdgpu: - Fix a DC memory leak - DCN 4.0.1 degamma LUT fix - Fix reset counter handling for soft recovery - GC 8 fix radeon: - Drop console locks when suspending/resuming nouveau: - ioctl validation fix panfrost: - scheduler bug fix mediatek: - Add wait_event_timeout when disabling plane - only announce AFBC if really supported - mtk_dpi: Reorder output formats on MT8195/88" * tag 'drm-fixes-2025-07-18-1' of https://gitlab.freedesktop.org/drm/kernel: drm/mediatek: mtk_dpi: Reorder output formats on MT8195/88 drm/mediatek: only announce AFBC if really supported drm/mediatek: Add wait_event_timeout when disabling plane drm/xe/pf: Resend PF provisioning after GT reset drm/xe/pf: Prepare to stop SR-IOV support prior GT reset drm/xe/migrate: Fix alignment check drm/xe: Move page fault init after topology init drm/xe/mocs: Initialize MOCS index early drm/xe/migrate: fix copy direction in access_memory drm/xe: Dont skip TLB invalidations on VF drm/amdgpu/gfx8: reset compute ring wptr on the GPU on resume drm/amdgpu: Increase reset counter only on success drm/radeon: Do not hold console lock during resume drm/radeon: Do not hold console lock while suspending clients drm/amd/display: Disable CRTC degamma LUT for DCN401 drm/amd/display: Free memory allocation drm/dp: Change AUX DPCD probe address from LANE0_1_STATUS to TRAINING_PATTERN_SET drm/panfrost: Fix scheduler workqueue bug drm/nouveau: check ioctl command codes better
2 parents f0afb7b + 4d33ed6 commit c460535

23 files changed

+173
-55
lines changed

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,7 @@ bool amdgpu_ring_soft_recovery(struct amdgpu_ring *ring, unsigned int vmid,
427427
{
428428
unsigned long flags;
429429
ktime_t deadline;
430+
bool ret;
430431

431432
if (unlikely(ring->adev->debug_disable_soft_recovery))
432433
return false;
@@ -441,12 +442,16 @@ bool amdgpu_ring_soft_recovery(struct amdgpu_ring *ring, unsigned int vmid,
441442
dma_fence_set_error(fence, -ENODATA);
442443
spin_unlock_irqrestore(fence->lock, flags);
443444

444-
atomic_inc(&ring->adev->gpu_reset_counter);
445445
while (!dma_fence_is_signaled(fence) &&
446446
ktime_to_ns(ktime_sub(deadline, ktime_get())) > 0)
447447
ring->funcs->soft_recovery(ring, vmid);
448448

449-
return dma_fence_is_signaled(fence);
449+
ret = dma_fence_is_signaled(fence);
450+
/* increment the counter only if soft reset worked */
451+
if (ret)
452+
atomic_inc(&ring->adev->gpu_reset_counter);
453+
454+
return ret;
450455
}
451456

452457
/*

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4640,6 +4640,7 @@ static int gfx_v8_0_kcq_init_queue(struct amdgpu_ring *ring)
46404640
memcpy(mqd, adev->gfx.mec.mqd_backup[mqd_idx], sizeof(struct vi_mqd_allocation));
46414641
/* reset ring buffer */
46424642
ring->wptr = 0;
4643+
atomic64_set((atomic64_t *)ring->wptr_cpu_addr, 0);
46434644
amdgpu_ring_clear_ring(ring);
46444645
}
46454646
return 0;

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -728,7 +728,16 @@ int amdgpu_dm_crtc_init(struct amdgpu_display_manager *dm,
728728
* support programmable degamma anywhere.
729729
*/
730730
is_dcn = dm->adev->dm.dc->caps.color.dpp.dcn_arch;
731-
drm_crtc_enable_color_mgmt(&acrtc->base, is_dcn ? MAX_COLOR_LUT_ENTRIES : 0,
731+
/* Dont't enable DRM CRTC degamma property for DCN401 since the
732+
* pre-blending degamma LUT doesn't apply to cursor, and therefore
733+
* can't work similar to a post-blending degamma LUT as in other hw
734+
* versions.
735+
* TODO: revisit it once KMS plane color API is merged.
736+
*/
737+
drm_crtc_enable_color_mgmt(&acrtc->base,
738+
(is_dcn &&
739+
dm->adev->dm.dc->ctx->dce_version != DCN_VERSION_4_01) ?
740+
MAX_COLOR_LUT_ENTRIES : 0,
732741
true, MAX_COLOR_LUT_ENTRIES);
733742

734743
drm_mode_crtc_set_gamma_size(&acrtc->base, MAX_COLOR_LEGACY_LUT_ENTRIES);

drivers/gpu/drm/amd/display/dc/clk_mgr/dcn401/dcn401_clk_mgr.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1565,7 +1565,7 @@ struct clk_mgr_internal *dcn401_clk_mgr_construct(
15651565
clk_mgr->base.bw_params = kzalloc(sizeof(*clk_mgr->base.bw_params), GFP_KERNEL);
15661566
if (!clk_mgr->base.bw_params) {
15671567
BREAK_TO_DEBUGGER();
1568-
kfree(clk_mgr);
1568+
kfree(clk_mgr401);
15691569
return NULL;
15701570
}
15711571

@@ -1576,6 +1576,7 @@ struct clk_mgr_internal *dcn401_clk_mgr_construct(
15761576
if (!clk_mgr->wm_range_table) {
15771577
BREAK_TO_DEBUGGER();
15781578
kfree(clk_mgr->base.bw_params);
1579+
kfree(clk_mgr401);
15791580
return NULL;
15801581
}
15811582

drivers/gpu/drm/display/drm_dp_helper.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -725,7 +725,7 @@ ssize_t drm_dp_dpcd_read(struct drm_dp_aux *aux, unsigned int offset,
725725
* monitor doesn't power down exactly after the throw away read.
726726
*/
727727
if (!aux->is_remote) {
728-
ret = drm_dp_dpcd_probe(aux, DP_LANE0_1_STATUS);
728+
ret = drm_dp_dpcd_probe(aux, DP_TRAINING_PATTERN_SET);
729729
if (ret < 0)
730730
return ret;
731731
}

drivers/gpu/drm/mediatek/mtk_crtc.c

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -719,6 +719,39 @@ int mtk_crtc_plane_check(struct drm_crtc *crtc, struct drm_plane *plane,
719719
return 0;
720720
}
721721

722+
void mtk_crtc_plane_disable(struct drm_crtc *crtc, struct drm_plane *plane)
723+
{
724+
#if IS_REACHABLE(CONFIG_MTK_CMDQ)
725+
struct mtk_crtc *mtk_crtc = to_mtk_crtc(crtc);
726+
struct mtk_plane_state *plane_state = to_mtk_plane_state(plane->state);
727+
int i;
728+
729+
/* no need to wait for disabling the plane by CPU */
730+
if (!mtk_crtc->cmdq_client.chan)
731+
return;
732+
733+
if (!mtk_crtc->enabled)
734+
return;
735+
736+
/* set pending plane state to disabled */
737+
for (i = 0; i < mtk_crtc->layer_nr; i++) {
738+
struct drm_plane *mtk_plane = &mtk_crtc->planes[i];
739+
struct mtk_plane_state *mtk_plane_state = to_mtk_plane_state(mtk_plane->state);
740+
741+
if (mtk_plane->index == plane->index) {
742+
memcpy(mtk_plane_state, plane_state, sizeof(*plane_state));
743+
break;
744+
}
745+
}
746+
mtk_crtc_update_config(mtk_crtc, false);
747+
748+
/* wait for planes to be disabled by CMDQ */
749+
wait_event_timeout(mtk_crtc->cb_blocking_queue,
750+
mtk_crtc->cmdq_vblank_cnt == 0,
751+
msecs_to_jiffies(500));
752+
#endif
753+
}
754+
722755
void mtk_crtc_async_update(struct drm_crtc *crtc, struct drm_plane *plane,
723756
struct drm_atomic_state *state)
724757
{
@@ -930,7 +963,8 @@ static int mtk_crtc_init_comp_planes(struct drm_device *drm_dev,
930963
mtk_ddp_comp_supported_rotations(comp),
931964
mtk_ddp_comp_get_blend_modes(comp),
932965
mtk_ddp_comp_get_formats(comp),
933-
mtk_ddp_comp_get_num_formats(comp), i);
966+
mtk_ddp_comp_get_num_formats(comp),
967+
mtk_ddp_comp_is_afbc_supported(comp), i);
934968
if (ret)
935969
return ret;
936970

drivers/gpu/drm/mediatek/mtk_crtc.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ int mtk_crtc_create(struct drm_device *drm_dev, const unsigned int *path,
2121
unsigned int num_conn_routes);
2222
int mtk_crtc_plane_check(struct drm_crtc *crtc, struct drm_plane *plane,
2323
struct mtk_plane_state *state);
24+
void mtk_crtc_plane_disable(struct drm_crtc *crtc, struct drm_plane *plane);
2425
void mtk_crtc_async_update(struct drm_crtc *crtc, struct drm_plane *plane,
2526
struct drm_atomic_state *plane_state);
2627
struct device *mtk_crtc_dma_dev_get(struct drm_crtc *crtc);

drivers/gpu/drm/mediatek/mtk_ddp_comp.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,7 @@ static const struct mtk_ddp_comp_funcs ddp_ovl = {
366366
.get_blend_modes = mtk_ovl_get_blend_modes,
367367
.get_formats = mtk_ovl_get_formats,
368368
.get_num_formats = mtk_ovl_get_num_formats,
369+
.is_afbc_supported = mtk_ovl_is_afbc_supported,
369370
};
370371

371372
static const struct mtk_ddp_comp_funcs ddp_postmask = {

drivers/gpu/drm/mediatek/mtk_ddp_comp.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ struct mtk_ddp_comp_funcs {
8383
u32 (*get_blend_modes)(struct device *dev);
8484
const u32 *(*get_formats)(struct device *dev);
8585
size_t (*get_num_formats)(struct device *dev);
86+
bool (*is_afbc_supported)(struct device *dev);
8687
void (*connect)(struct device *dev, struct device *mmsys_dev, unsigned int next);
8788
void (*disconnect)(struct device *dev, struct device *mmsys_dev, unsigned int next);
8889
void (*add)(struct device *dev, struct mtk_mutex *mutex);
@@ -294,6 +295,14 @@ size_t mtk_ddp_comp_get_num_formats(struct mtk_ddp_comp *comp)
294295
return 0;
295296
}
296297

298+
static inline bool mtk_ddp_comp_is_afbc_supported(struct mtk_ddp_comp *comp)
299+
{
300+
if (comp->funcs && comp->funcs->is_afbc_supported)
301+
return comp->funcs->is_afbc_supported(comp->dev);
302+
303+
return false;
304+
}
305+
297306
static inline bool mtk_ddp_comp_add(struct mtk_ddp_comp *comp, struct mtk_mutex *mutex)
298307
{
299308
if (comp->funcs && comp->funcs->add) {

drivers/gpu/drm/mediatek/mtk_disp_drv.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ void mtk_ovl_disable_vblank(struct device *dev);
106106
u32 mtk_ovl_get_blend_modes(struct device *dev);
107107
const u32 *mtk_ovl_get_formats(struct device *dev);
108108
size_t mtk_ovl_get_num_formats(struct device *dev);
109+
bool mtk_ovl_is_afbc_supported(struct device *dev);
109110

110111
void mtk_ovl_adaptor_add_comp(struct device *dev, struct mtk_mutex *mutex);
111112
void mtk_ovl_adaptor_remove_comp(struct device *dev, struct mtk_mutex *mutex);

0 commit comments

Comments
 (0)