Skip to content

Commit 6de6674

Browse files
committed
Merge tag 'drm-fixes-2025-05-03' of https://gitlab.freedesktop.org/drm/kernel
Pull drm fixes from Dave Airlie: "Weekly drm fixes, amdgpu and xe as usual, the new adp driver has a bunch of vblank fixes, then a bunch of small fixes across the board. Seems about the right level for this time in the release cycle. ttm: - docs warning fix kunit - fix leak in shmem tests fdinfo: - driver unbind race fix amdgpu: - Fix possible UAF in HDCP - XGMI dma-buf fix - NBIO 7.11 fix - VCN 5.0.1 fix xe: - EU stall locking fix and disabling on VF - Documentation fix kernel version supporting hwmon entries - SVM fixes on error handling i915: - Fix build for CONFIG_DRM_I915_PXP=n nouveau: - fix race condition in fence handling ivpu: - interrupt handling fix - D0i2 test mode fix adp: - vblank fixes mipi-dbi: - timing fix" * tag 'drm-fixes-2025-05-03' of https://gitlab.freedesktop.org/drm/kernel: (23 commits) drm/gpusvm: set has_dma_mapping inside mapping loop drm/xe/hwmon: Fix kernel version documentation for temperature drm/xe/eustall: Do not support EU stall on SRIOV VF drm/xe/eustall: Resolve a possible circular locking dependency drm/amdgpu: Add DPG pause for VCN v5.0.1 drm/amdgpu: Fix offset for HDP remap in nbio v7.11 drm/amdgpu: Fail DMABUF map of XGMI-accessible memory drm/amd/display: Fix slab-use-after-free in hdcp drm/mipi-dbi: Fix blanking for non-16 bit formats drm/tests: shmem: Fix memleak drm/xe/guc: Fix capture of steering registers drm/xe/svm: fix dereferencing error pointer in drm_gpusvm_range_alloc() drm: Select DRM_KMS_HELPER from DRM_DEBUG_DP_MST_TOPOLOGY_REFS drm: adp: Remove pointless irq_lock spin lock drm: adp: Enable vblank interrupts in crtc's .atomic_enable drm: adp: Handle drm_crtc_vblank_get() errors drm: adp: Use spin_lock_irqsave for drm device event_lock drm/fdinfo: Protect against driver unbind drm/ttm: fix the warning for hit_low and evict_low accel/ivpu: Fix the D0i2 disable test mode ...
2 parents 00b827f + 4e6de6b commit 6de6674

File tree

21 files changed

+146
-42
lines changed

21 files changed

+146
-42
lines changed

Documentation/ABI/testing/sysfs-driver-intel-xe-hwmon

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,15 +111,15 @@ Description: RO. Package current voltage in millivolt.
111111

112112
What: /sys/bus/pci/drivers/xe/.../hwmon/hwmon<i>/temp2_input
113113
Date: March 2025
114-
KernelVersion: 6.14
114+
KernelVersion: 6.15
115115
Contact: intel-xe@lists.freedesktop.org
116116
Description: RO. Package temperature in millidegree Celsius.
117117

118118
Only supported for particular Intel Xe graphics platforms.
119119

120120
What: /sys/bus/pci/drivers/xe/.../hwmon/hwmon<i>/temp3_input
121121
Date: March 2025
122-
KernelVersion: 6.14
122+
KernelVersion: 6.15
123123
Contact: intel-xe@lists.freedesktop.org
124124
Description: RO. VRAM temperature in millidegree Celsius.
125125

drivers/accel/ivpu/ivpu_fw.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ static void ivpu_fw_boot_params_print(struct ivpu_device *vdev, struct vpu_boot_
544544
boot_params->d0i3_entry_vpu_ts);
545545
ivpu_dbg(vdev, FW_BOOT, "boot_params.system_time_us = %llu\n",
546546
boot_params->system_time_us);
547-
ivpu_dbg(vdev, FW_BOOT, "boot_params.power_profile = %u\n",
547+
ivpu_dbg(vdev, FW_BOOT, "boot_params.power_profile = 0x%x\n",
548548
boot_params->power_profile);
549549
}
550550

@@ -646,7 +646,7 @@ void ivpu_fw_boot_params_setup(struct ivpu_device *vdev, struct vpu_boot_params
646646
boot_params->d0i3_residency_time_us = 0;
647647
boot_params->d0i3_entry_vpu_ts = 0;
648648
if (IVPU_WA(disable_d0i2))
649-
boot_params->power_profile = 1;
649+
boot_params->power_profile |= BIT(1);
650650

651651
boot_params->system_time_us = ktime_to_us(ktime_get_real());
652652
wmb(); /* Flush WC buffers after writing bootparams */

drivers/accel/ivpu/ivpu_hw_btrs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#define PLL_PROFILING_FREQ_DEFAULT 38400000
1515
#define PLL_PROFILING_FREQ_HIGH 400000000
1616

17-
#define DCT_DEFAULT_ACTIVE_PERCENT 15u
17+
#define DCT_DEFAULT_ACTIVE_PERCENT 30u
1818
#define DCT_PERIOD_US 35300u
1919

2020
int ivpu_hw_btrs_info_init(struct ivpu_device *vdev);

drivers/accel/ivpu/ivpu_pm.c

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -428,32 +428,34 @@ int ivpu_pm_dct_enable(struct ivpu_device *vdev, u8 active_percent)
428428
active_us = (DCT_PERIOD_US * active_percent) / 100;
429429
inactive_us = DCT_PERIOD_US - active_us;
430430

431+
vdev->pm->dct_active_percent = active_percent;
432+
433+
ivpu_dbg(vdev, PM, "DCT requested %u%% (D0: %uus, D0i2: %uus)\n",
434+
active_percent, active_us, inactive_us);
435+
431436
ret = ivpu_jsm_dct_enable(vdev, active_us, inactive_us);
432437
if (ret) {
433438
ivpu_err_ratelimited(vdev, "Failed to enable DCT: %d\n", ret);
434439
return ret;
435440
}
436441

437-
vdev->pm->dct_active_percent = active_percent;
438-
439-
ivpu_dbg(vdev, PM, "DCT set to %u%% (D0: %uus, D0i2: %uus)\n",
440-
active_percent, active_us, inactive_us);
441442
return 0;
442443
}
443444

444445
int ivpu_pm_dct_disable(struct ivpu_device *vdev)
445446
{
446447
int ret;
447448

449+
vdev->pm->dct_active_percent = 0;
450+
451+
ivpu_dbg(vdev, PM, "DCT requested to be disabled\n");
452+
448453
ret = ivpu_jsm_dct_disable(vdev);
449454
if (ret) {
450455
ivpu_err_ratelimited(vdev, "Failed to disable DCT: %d\n", ret);
451456
return ret;
452457
}
453458

454-
vdev->pm->dct_active_percent = 0;
455-
456-
ivpu_dbg(vdev, PM, "DCT disabled\n");
457459
return 0;
458460
}
459461

@@ -466,7 +468,7 @@ void ivpu_pm_irq_dct_work_fn(struct work_struct *work)
466468
if (ivpu_hw_btrs_dct_get_request(vdev, &enable))
467469
return;
468470

469-
if (vdev->pm->dct_active_percent)
471+
if (enable)
470472
ret = ivpu_pm_dct_enable(vdev, DCT_DEFAULT_ACTIVE_PERCENT);
471473
else
472474
ret = ivpu_pm_dct_disable(vdev);

drivers/gpu/drm/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ config DRM_DEBUG_DP_MST_TOPOLOGY_REFS
188188
bool "Enable refcount backtrace history in the DP MST helpers"
189189
depends on STACKTRACE_SUPPORT
190190
select STACKDEPOT
191-
depends on DRM_KMS_HELPER
191+
select DRM_KMS_HELPER
192192
depends on DEBUG_KERNEL
193193
depends on EXPERT
194194
help

drivers/gpu/drm/adp/adp_drv.c

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ struct adp_drv_private {
121121
dma_addr_t mask_iova;
122122
int be_irq;
123123
int fe_irq;
124-
spinlock_t irq_lock;
125124
struct drm_pending_vblank_event *event;
126125
};
127126

@@ -288,6 +287,7 @@ static void adp_crtc_atomic_enable(struct drm_crtc *crtc,
288287
writel(BIT(0), adp->be + ADBE_BLEND_EN3);
289288
writel(BIT(0), adp->be + ADBE_BLEND_BYPASS);
290289
writel(BIT(0), adp->be + ADBE_BLEND_EN4);
290+
drm_crtc_vblank_on(crtc);
291291
}
292292

293293
static void adp_crtc_atomic_disable(struct drm_crtc *crtc,
@@ -310,6 +310,7 @@ static void adp_crtc_atomic_flush(struct drm_crtc *crtc,
310310
struct drm_atomic_state *state)
311311
{
312312
u32 frame_num = 1;
313+
unsigned long flags;
313314
struct adp_drv_private *adp = crtc_to_adp(crtc);
314315
struct drm_crtc_state *new_state = drm_atomic_get_new_crtc_state(state, crtc);
315316
u64 new_size = ALIGN(new_state->mode.hdisplay *
@@ -330,13 +331,19 @@ static void adp_crtc_atomic_flush(struct drm_crtc *crtc,
330331
}
331332
writel(ADBE_FIFO_SYNC | frame_num, adp->be + ADBE_FIFO);
332333
//FIXME: use adbe flush interrupt
333-
spin_lock_irq(&crtc->dev->event_lock);
334334
if (crtc->state->event) {
335-
drm_crtc_vblank_get(crtc);
336-
adp->event = crtc->state->event;
335+
struct drm_pending_vblank_event *event = crtc->state->event;
336+
337+
crtc->state->event = NULL;
338+
spin_lock_irqsave(&crtc->dev->event_lock, flags);
339+
340+
if (drm_crtc_vblank_get(crtc) != 0)
341+
drm_crtc_send_vblank_event(crtc, event);
342+
else
343+
adp->event = event;
344+
345+
spin_unlock_irqrestore(&crtc->dev->event_lock, flags);
337346
}
338-
crtc->state->event = NULL;
339-
spin_unlock_irq(&crtc->dev->event_lock);
340347
}
341348

342349
static const struct drm_crtc_funcs adp_crtc_funcs = {
@@ -482,8 +489,6 @@ static irqreturn_t adp_fe_irq(int irq, void *arg)
482489
u32 int_status;
483490
u32 int_ctl;
484491

485-
spin_lock(&adp->irq_lock);
486-
487492
int_status = readl(adp->fe + ADP_INT_STATUS);
488493
if (int_status & ADP_INT_STATUS_VBLANK) {
489494
drm_crtc_handle_vblank(&adp->crtc);
@@ -501,7 +506,6 @@ static irqreturn_t adp_fe_irq(int irq, void *arg)
501506

502507
writel(int_status, adp->fe + ADP_INT_STATUS);
503508

504-
spin_unlock(&adp->irq_lock);
505509

506510
return IRQ_HANDLED;
507511
}
@@ -512,8 +516,7 @@ static int adp_drm_bind(struct device *dev)
512516
struct adp_drv_private *adp = to_adp(drm);
513517
int err;
514518

515-
adp_disable_vblank(adp);
516-
writel(ADP_CTRL_FIFO_ON | ADP_CTRL_VBLANK_ON, adp->fe + ADP_CTRL);
519+
writel(ADP_CTRL_FIFO_ON, adp->fe + ADP_CTRL);
517520

518521
adp->next_bridge = drmm_of_get_bridge(&adp->drm, dev->of_node, 0, 0);
519522
if (IS_ERR(adp->next_bridge)) {
@@ -567,8 +570,6 @@ static int adp_probe(struct platform_device *pdev)
567570
if (IS_ERR(adp))
568571
return PTR_ERR(adp);
569572

570-
spin_lock_init(&adp->irq_lock);
571-
572573
dev_set_drvdata(&pdev->dev, &adp->drm);
573574

574575
err = adp_parse_of(pdev, adp);

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,11 @@ static struct sg_table *amdgpu_dma_buf_map(struct dma_buf_attachment *attach,
199199
break;
200200

201201
case TTM_PL_VRAM:
202+
/* XGMI-accessible memory should never be DMA-mapped */
203+
if (WARN_ON(amdgpu_dmabuf_is_xgmi_accessible(
204+
dma_buf_attach_adev(attach), bo)))
205+
return ERR_PTR(-EINVAL);
206+
202207
r = amdgpu_vram_mgr_alloc_sgt(adev, bo->tbo.resource, 0,
203208
bo->tbo.base.size, attach->dev,
204209
dir, &sgt);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ static void nbio_v7_11_get_clockgating_state(struct amdgpu_device *adev,
360360
*flags |= AMD_CG_SUPPORT_BIF_LS;
361361
}
362362

363-
#define MMIO_REG_HOLE_OFFSET (0x80000 - PAGE_SIZE)
363+
#define MMIO_REG_HOLE_OFFSET 0x44000
364364

365365
static void nbio_v7_11_set_reg_remap(struct amdgpu_device *adev)
366366
{

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

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,52 @@ static void vcn_v5_0_1_enable_clock_gating(struct amdgpu_vcn_inst *vinst)
502502
{
503503
}
504504

505+
/**
506+
* vcn_v5_0_1_pause_dpg_mode - VCN pause with dpg mode
507+
*
508+
* @vinst: VCN instance
509+
* @new_state: pause state
510+
*
511+
* Pause dpg mode for VCN block
512+
*/
513+
static int vcn_v5_0_1_pause_dpg_mode(struct amdgpu_vcn_inst *vinst,
514+
struct dpg_pause_state *new_state)
515+
{
516+
struct amdgpu_device *adev = vinst->adev;
517+
uint32_t reg_data = 0;
518+
int vcn_inst;
519+
520+
vcn_inst = GET_INST(VCN, vinst->inst);
521+
522+
/* pause/unpause if state is changed */
523+
if (vinst->pause_state.fw_based != new_state->fw_based) {
524+
DRM_DEV_DEBUG(adev->dev, "dpg pause state changed %d -> %d %s\n",
525+
vinst->pause_state.fw_based, new_state->fw_based,
526+
new_state->fw_based ? "VCN_DPG_STATE__PAUSE" : "VCN_DPG_STATE__UNPAUSE");
527+
reg_data = RREG32_SOC15(VCN, vcn_inst, regUVD_DPG_PAUSE) &
528+
(~UVD_DPG_PAUSE__NJ_PAUSE_DPG_ACK_MASK);
529+
530+
if (new_state->fw_based == VCN_DPG_STATE__PAUSE) {
531+
/* pause DPG */
532+
reg_data |= UVD_DPG_PAUSE__NJ_PAUSE_DPG_REQ_MASK;
533+
WREG32_SOC15(VCN, vcn_inst, regUVD_DPG_PAUSE, reg_data);
534+
535+
/* wait for ACK */
536+
SOC15_WAIT_ON_RREG(VCN, vcn_inst, regUVD_DPG_PAUSE,
537+
UVD_DPG_PAUSE__NJ_PAUSE_DPG_ACK_MASK,
538+
UVD_DPG_PAUSE__NJ_PAUSE_DPG_ACK_MASK);
539+
} else {
540+
/* unpause DPG, no need to wait */
541+
reg_data &= ~UVD_DPG_PAUSE__NJ_PAUSE_DPG_REQ_MASK;
542+
WREG32_SOC15(VCN, vcn_inst, regUVD_DPG_PAUSE, reg_data);
543+
}
544+
vinst->pause_state.fw_based = new_state->fw_based;
545+
}
546+
547+
return 0;
548+
}
549+
550+
505551
/**
506552
* vcn_v5_0_1_start_dpg_mode - VCN start with dpg mode
507553
*
@@ -518,6 +564,7 @@ static int vcn_v5_0_1_start_dpg_mode(struct amdgpu_vcn_inst *vinst,
518564
volatile struct amdgpu_vcn5_fw_shared *fw_shared =
519565
adev->vcn.inst[inst_idx].fw_shared.cpu_addr;
520566
struct amdgpu_ring *ring;
567+
struct dpg_pause_state state = {.fw_based = VCN_DPG_STATE__PAUSE};
521568
int vcn_inst;
522569
uint32_t tmp;
523570

@@ -582,6 +629,9 @@ static int vcn_v5_0_1_start_dpg_mode(struct amdgpu_vcn_inst *vinst,
582629
if (indirect)
583630
amdgpu_vcn_psp_update_sram(adev, inst_idx, AMDGPU_UCODE_ID_VCN0_RAM);
584631

632+
/* Pause dpg */
633+
vcn_v5_0_1_pause_dpg_mode(vinst, &state);
634+
585635
ring = &adev->vcn.inst[inst_idx].ring_enc[0];
586636

587637
WREG32_SOC15(VCN, vcn_inst, regUVD_RB_BASE_LO, lower_32_bits(ring->gpu_addr));
@@ -775,9 +825,13 @@ static void vcn_v5_0_1_stop_dpg_mode(struct amdgpu_vcn_inst *vinst)
775825
int inst_idx = vinst->inst;
776826
uint32_t tmp;
777827
int vcn_inst;
828+
struct dpg_pause_state state = {.fw_based = VCN_DPG_STATE__UNPAUSE};
778829

779830
vcn_inst = GET_INST(VCN, inst_idx);
780831

832+
/* Unpause dpg */
833+
vcn_v5_0_1_pause_dpg_mode(vinst, &state);
834+
781835
/* Wait for power status to be 1 */
782836
SOC15_WAIT_ON_RREG(VCN, vcn_inst, regUVD_POWER_STATUS, 1,
783837
UVD_POWER_STATUS__UVD_POWER_STATUS_MASK);

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

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,9 @@ void hdcp_update_display(struct hdcp_workqueue *hdcp_work,
173173
unsigned int conn_index = aconnector->base.index;
174174

175175
guard(mutex)(&hdcp_w->mutex);
176+
drm_connector_get(&aconnector->base);
177+
if (hdcp_w->aconnector[conn_index])
178+
drm_connector_put(&hdcp_w->aconnector[conn_index]->base);
176179
hdcp_w->aconnector[conn_index] = aconnector;
177180

178181
memset(&link_adjust, 0, sizeof(link_adjust));
@@ -220,7 +223,6 @@ static void hdcp_remove_display(struct hdcp_workqueue *hdcp_work,
220223
unsigned int conn_index = aconnector->base.index;
221224

222225
guard(mutex)(&hdcp_w->mutex);
223-
hdcp_w->aconnector[conn_index] = aconnector;
224226

225227
/* the removal of display will invoke auth reset -> hdcp destroy and
226228
* we'd expect the Content Protection (CP) property changed back to
@@ -236,7 +238,10 @@ static void hdcp_remove_display(struct hdcp_workqueue *hdcp_work,
236238
}
237239

238240
mod_hdcp_remove_display(&hdcp_w->hdcp, aconnector->base.index, &hdcp_w->output);
239-
241+
if (hdcp_w->aconnector[conn_index]) {
242+
drm_connector_put(&hdcp_w->aconnector[conn_index]->base);
243+
hdcp_w->aconnector[conn_index] = NULL;
244+
}
240245
process_output(hdcp_w);
241246
}
242247

@@ -254,6 +259,10 @@ void hdcp_reset_display(struct hdcp_workqueue *hdcp_work, unsigned int link_inde
254259
for (conn_index = 0; conn_index < AMDGPU_DM_MAX_DISPLAY_INDEX; conn_index++) {
255260
hdcp_w->encryption_status[conn_index] =
256261
MOD_HDCP_ENCRYPTION_STATUS_HDCP_OFF;
262+
if (hdcp_w->aconnector[conn_index]) {
263+
drm_connector_put(&hdcp_w->aconnector[conn_index]->base);
264+
hdcp_w->aconnector[conn_index] = NULL;
265+
}
257266
}
258267

259268
process_output(hdcp_w);
@@ -488,6 +497,7 @@ static void update_config(void *handle, struct cp_psp_stream_config *config)
488497
struct hdcp_workqueue *hdcp_work = handle;
489498
struct amdgpu_dm_connector *aconnector = config->dm_stream_ctx;
490499
int link_index = aconnector->dc_link->link_index;
500+
unsigned int conn_index = aconnector->base.index;
491501
struct mod_hdcp_display *display = &hdcp_work[link_index].display;
492502
struct mod_hdcp_link *link = &hdcp_work[link_index].link;
493503
struct hdcp_workqueue *hdcp_w = &hdcp_work[link_index];
@@ -544,7 +554,10 @@ static void update_config(void *handle, struct cp_psp_stream_config *config)
544554
guard(mutex)(&hdcp_w->mutex);
545555

546556
mod_hdcp_add_display(&hdcp_w->hdcp, link, display, &hdcp_w->output);
547-
557+
drm_connector_get(&aconnector->base);
558+
if (hdcp_w->aconnector[conn_index])
559+
drm_connector_put(&hdcp_w->aconnector[conn_index]->base);
560+
hdcp_w->aconnector[conn_index] = aconnector;
548561
process_output(hdcp_w);
549562
}
550563

0 commit comments

Comments
 (0)