Skip to content

Commit c76b766

Browse files
committed
Merge tag 'drm-fixes-2024-02-09' of git://anongit.freedesktop.org/drm/drm
Pull drm fixes from Dave Airlie: "Regular weekly fixes, xe, amdgpu and msm are most of them, with some misc in i915, ivpu and nouveau, scattered but nothing too intense at this point. i915: - gvt: docs fix, uninit var, MAINTAINERS ivpu: - add aborted job status - disable d3 hot delay - mmu fixes nouveau: - fix gsp rpc size request - fix dma buffer leaks - use common code for gsp mem ctor xe: - Fix a loop in an error path - Fix a missing dma-fence reference - Fix a retry path on userptr REMAP - Workaround for a false gcc warning - Fix missing map of the usm batch buffer in the migrate vm. - Fix a memory leak. - Fix a bad assumption of used page size - Fix hitting a BUG() due to zero pages to map. - Remove some leftover async bind queue relics amdgpu: - Misc NULL/bounds check fixes - ODM pipe policy fix - Aborted suspend fixes - JPEG 4.0.5 fix - DCN 3.5 fixes - PSP fix - DP MST fix - Phantom pipe fix - VRAM vendor fix - Clang fix - SR-IOV fix msm: - DPU: - fix for kernel doc warnings and smatch warnings in dpu_encoder - fix for smatch warning in dpu_encoder - fix the bus bandwidth value for SDM670 - DP: - fixes to handle unknown bpc case correctly for DP - fix for MISC0 programming - GPU: - dmabuf vmap fix - a610 UBWC corruption fix (incorrect hbb) - revert a commit that was making GPU recovery unreliable" * tag 'drm-fixes-2024-02-09' of git://anongit.freedesktop.org/drm/drm: (43 commits) drm/xe: Remove TEST_VM_ASYNC_OPS_ERROR drm/xe/vm: don't ignore error when in_kthread drm/xe: Assume large page size if VMA not yet bound drm/xe/display: Fix memleak in display initialization drm/xe: Map both mem.kernel_bb_pool and usm.bb_pool drm/xe: circumvent bogus stringop-overflow warning drm/xe: Pick correct userptr VMA to repin on REMAP op failure drm/xe: Take a reference in xe_exec_queue_last_fence_get() drm/xe: Fix loop in vm_bind_ioctl_ops_unwind drm/amdgpu: Fix HDP flush for VFs on nbio v7.9 drm/amd/display: Implement bounds check for stream encoder creation in DCN301 drm/amd/display: Increase frame-larger-than for all display_mode_vba files drm/amd/display: Clear phantom stream count and plane count drm/amdgpu: Avoid fetching VRAM vendor info drm/amd/display: Disable ODM by default for DCN35 drm/amd/display: Update phantom pipe enable / disable sequence drm/amd/display: Fix MST Null Ptr for RV drm/amdgpu: Fix shared buff copy to user drm/amd/display: Increase eval/entry delay for DCN35 drm/amdgpu: remove asymmetrical irq disabling in jpeg 4.0.5 suspend ...
2 parents 1f719a2 + 3115208 commit c76b766

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+390
-253
lines changed

MAINTAINERS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10801,11 +10801,11 @@ F: drivers/gpio/gpio-tangier.h
1080110801

1080210802
INTEL GVT-g DRIVERS (Intel GPU Virtualization)
1080310803
M: Zhenyu Wang <zhenyuw@linux.intel.com>
10804-
M: Zhi Wang <zhi.a.wang@intel.com>
10804+
M: Zhi Wang <zhi.wang.linux@gmail.com>
1080510805
L: intel-gvt-dev@lists.freedesktop.org
1080610806
L: intel-gfx@lists.freedesktop.org
1080710807
S: Supported
10808-
W: https://01.org/igvt-g
10808+
W: https://github.com/intel/gvt-linux/wiki
1080910809
T: git https://github.com/intel/gvt-linux.git
1081010810
F: drivers/gpu/drm/i915/gvt/
1081110811

drivers/accel/ivpu/ivpu_drv.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -480,9 +480,8 @@ static int ivpu_pci_init(struct ivpu_device *vdev)
480480
/* Clear any pending errors */
481481
pcie_capability_clear_word(pdev, PCI_EXP_DEVSTA, 0x3f);
482482

483-
/* VPU 37XX does not require 10m D3hot delay */
484-
if (ivpu_hw_gen(vdev) == IVPU_HW_37XX)
485-
pdev->d3hot_delay = 0;
483+
/* NPU does not require 10m D3hot delay */
484+
pdev->d3hot_delay = 0;
486485

487486
ret = pcim_enable_device(pdev);
488487
if (ret) {

drivers/accel/ivpu/ivpu_fw.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,6 @@ ivpu_fw_init_wa(struct ivpu_device *vdev)
222222
const struct vpu_firmware_header *fw_hdr = (const void *)vdev->fw->file->data;
223223

224224
if (IVPU_FW_CHECK_API_VER_LT(vdev, fw_hdr, BOOT, 3, 17) ||
225-
(ivpu_hw_gen(vdev) > IVPU_HW_37XX) ||
226225
(ivpu_test_mode & IVPU_TEST_MODE_D0I3_MSG_DISABLE))
227226
vdev->wa.disable_d0i3_msg = true;
228227

drivers/accel/ivpu/ivpu_hw_37xx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ static void ivpu_boot_no_snoop_enable(struct ivpu_device *vdev)
525525
u32 val = REGV_RD32(VPU_37XX_HOST_IF_TCU_PTW_OVERRIDES);
526526

527527
val = REG_SET_FLD(VPU_37XX_HOST_IF_TCU_PTW_OVERRIDES, NOSNOOP_OVERRIDE_EN, val);
528-
val = REG_SET_FLD(VPU_37XX_HOST_IF_TCU_PTW_OVERRIDES, AW_NOSNOOP_OVERRIDE, val);
528+
val = REG_CLR_FLD(VPU_37XX_HOST_IF_TCU_PTW_OVERRIDES, AW_NOSNOOP_OVERRIDE, val);
529529
val = REG_SET_FLD(VPU_37XX_HOST_IF_TCU_PTW_OVERRIDES, AR_NOSNOOP_OVERRIDE, val);
530530

531531
REGV_WR32(VPU_37XX_HOST_IF_TCU_PTW_OVERRIDES, val);

drivers/accel/ivpu/ivpu_hw_40xx.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ static void ivpu_boot_no_snoop_enable(struct ivpu_device *vdev)
530530
u32 val = REGV_RD32(VPU_40XX_HOST_IF_TCU_PTW_OVERRIDES);
531531

532532
val = REG_SET_FLD(VPU_40XX_HOST_IF_TCU_PTW_OVERRIDES, SNOOP_OVERRIDE_EN, val);
533-
val = REG_CLR_FLD(VPU_40XX_HOST_IF_TCU_PTW_OVERRIDES, AW_SNOOP_OVERRIDE, val);
533+
val = REG_SET_FLD(VPU_40XX_HOST_IF_TCU_PTW_OVERRIDES, AW_SNOOP_OVERRIDE, val);
534534
val = REG_CLR_FLD(VPU_40XX_HOST_IF_TCU_PTW_OVERRIDES, AR_SNOOP_OVERRIDE, val);
535535

536536
REGV_WR32(VPU_40XX_HOST_IF_TCU_PTW_OVERRIDES, val);
@@ -704,7 +704,6 @@ static int ivpu_hw_40xx_info_init(struct ivpu_device *vdev)
704704
{
705705
struct ivpu_hw_info *hw = vdev->hw;
706706
u32 tile_disable;
707-
u32 tile_enable;
708707
u32 fuse;
709708

710709
fuse = REGB_RD32(VPU_40XX_BUTTRESS_TILE_FUSE);
@@ -725,10 +724,6 @@ static int ivpu_hw_40xx_info_init(struct ivpu_device *vdev)
725724
else
726725
ivpu_dbg(vdev, MISC, "Fuse: All %d tiles enabled\n", TILE_MAX_NUM);
727726

728-
tile_enable = (~tile_disable) & TILE_MAX_MASK;
729-
730-
hw->sku = REG_SET_FLD_NUM(SKU, HW_ID, LNL_HW_ID, hw->sku);
731-
hw->sku = REG_SET_FLD_NUM(SKU, TILE, tile_enable, hw->sku);
732727
hw->tile_fuse = tile_disable;
733728
hw->pll.profiling_freq = PLL_PROFILING_FREQ_DEFAULT;
734729

drivers/accel/ivpu/ivpu_job.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ static int ivpu_job_signal_and_destroy(struct ivpu_device *vdev, u32 job_id, u32
294294
return -ENOENT;
295295

296296
if (job->file_priv->has_mmu_faults)
297-
job_status = VPU_JSM_STATUS_ABORTED;
297+
job_status = DRM_IVPU_JOB_STATUS_ABORTED;
298298

299299
job->bos[CMD_BUF_IDX]->job_status = job_status;
300300
dma_fence_signal(job->done_fence);
@@ -315,7 +315,7 @@ void ivpu_jobs_abort_all(struct ivpu_device *vdev)
315315
unsigned long id;
316316

317317
xa_for_each(&vdev->submitted_jobs_xa, id, job)
318-
ivpu_job_signal_and_destroy(vdev, id, VPU_JSM_STATUS_ABORTED);
318+
ivpu_job_signal_and_destroy(vdev, id, DRM_IVPU_JOB_STATUS_ABORTED);
319319
}
320320

321321
static int ivpu_job_submit(struct ivpu_job *job)

drivers/accel/ivpu/ivpu_mmu.c

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,10 @@
7272

7373
#define IVPU_MMU_Q_COUNT_LOG2 4 /* 16 entries */
7474
#define IVPU_MMU_Q_COUNT ((u32)1 << IVPU_MMU_Q_COUNT_LOG2)
75-
#define IVPU_MMU_Q_WRAP_BIT (IVPU_MMU_Q_COUNT << 1)
76-
#define IVPU_MMU_Q_WRAP_MASK (IVPU_MMU_Q_WRAP_BIT - 1)
77-
#define IVPU_MMU_Q_IDX_MASK (IVPU_MMU_Q_COUNT - 1)
75+
#define IVPU_MMU_Q_WRAP_MASK GENMASK(IVPU_MMU_Q_COUNT_LOG2, 0)
76+
#define IVPU_MMU_Q_IDX_MASK (IVPU_MMU_Q_COUNT - 1)
7877
#define IVPU_MMU_Q_IDX(val) ((val) & IVPU_MMU_Q_IDX_MASK)
78+
#define IVPU_MMU_Q_WRP(val) ((val) & IVPU_MMU_Q_COUNT)
7979

8080
#define IVPU_MMU_CMDQ_CMD_SIZE 16
8181
#define IVPU_MMU_CMDQ_SIZE (IVPU_MMU_Q_COUNT * IVPU_MMU_CMDQ_CMD_SIZE)
@@ -475,20 +475,32 @@ static int ivpu_mmu_cmdq_wait_for_cons(struct ivpu_device *vdev)
475475
return 0;
476476
}
477477

478+
static bool ivpu_mmu_queue_is_full(struct ivpu_mmu_queue *q)
479+
{
480+
return ((IVPU_MMU_Q_IDX(q->prod) == IVPU_MMU_Q_IDX(q->cons)) &&
481+
(IVPU_MMU_Q_WRP(q->prod) != IVPU_MMU_Q_WRP(q->cons)));
482+
}
483+
484+
static bool ivpu_mmu_queue_is_empty(struct ivpu_mmu_queue *q)
485+
{
486+
return ((IVPU_MMU_Q_IDX(q->prod) == IVPU_MMU_Q_IDX(q->cons)) &&
487+
(IVPU_MMU_Q_WRP(q->prod) == IVPU_MMU_Q_WRP(q->cons)));
488+
}
489+
478490
static int ivpu_mmu_cmdq_cmd_write(struct ivpu_device *vdev, const char *name, u64 data0, u64 data1)
479491
{
480-
struct ivpu_mmu_queue *q = &vdev->mmu->cmdq;
481-
u64 *queue_buffer = q->base;
482-
int idx = IVPU_MMU_Q_IDX(q->prod) * (IVPU_MMU_CMDQ_CMD_SIZE / sizeof(*queue_buffer));
492+
struct ivpu_mmu_queue *cmdq = &vdev->mmu->cmdq;
493+
u64 *queue_buffer = cmdq->base;
494+
int idx = IVPU_MMU_Q_IDX(cmdq->prod) * (IVPU_MMU_CMDQ_CMD_SIZE / sizeof(*queue_buffer));
483495

484-
if (!CIRC_SPACE(IVPU_MMU_Q_IDX(q->prod), IVPU_MMU_Q_IDX(q->cons), IVPU_MMU_Q_COUNT)) {
496+
if (ivpu_mmu_queue_is_full(cmdq)) {
485497
ivpu_err(vdev, "Failed to write MMU CMD %s\n", name);
486498
return -EBUSY;
487499
}
488500

489501
queue_buffer[idx] = data0;
490502
queue_buffer[idx + 1] = data1;
491-
q->prod = (q->prod + 1) & IVPU_MMU_Q_WRAP_MASK;
503+
cmdq->prod = (cmdq->prod + 1) & IVPU_MMU_Q_WRAP_MASK;
492504

493505
ivpu_dbg(vdev, MMU, "CMD write: %s data: 0x%llx 0x%llx\n", name, data0, data1);
494506

@@ -560,7 +572,6 @@ static int ivpu_mmu_reset(struct ivpu_device *vdev)
560572
mmu->cmdq.cons = 0;
561573

562574
memset(mmu->evtq.base, 0, IVPU_MMU_EVTQ_SIZE);
563-
clflush_cache_range(mmu->evtq.base, IVPU_MMU_EVTQ_SIZE);
564575
mmu->evtq.prod = 0;
565576
mmu->evtq.cons = 0;
566577

@@ -874,14 +885,10 @@ static u32 *ivpu_mmu_get_event(struct ivpu_device *vdev)
874885
u32 *evt = evtq->base + (idx * IVPU_MMU_EVTQ_CMD_SIZE);
875886

876887
evtq->prod = REGV_RD32(IVPU_MMU_REG_EVTQ_PROD_SEC);
877-
if (!CIRC_CNT(IVPU_MMU_Q_IDX(evtq->prod), IVPU_MMU_Q_IDX(evtq->cons), IVPU_MMU_Q_COUNT))
888+
if (ivpu_mmu_queue_is_empty(evtq))
878889
return NULL;
879890

880-
clflush_cache_range(evt, IVPU_MMU_EVTQ_CMD_SIZE);
881-
882891
evtq->cons = (evtq->cons + 1) & IVPU_MMU_Q_WRAP_MASK;
883-
REGV_WR32(IVPU_MMU_REG_EVTQ_CONS_SEC, evtq->cons);
884-
885892
return evt;
886893
}
887894

@@ -902,6 +909,7 @@ void ivpu_mmu_irq_evtq_handler(struct ivpu_device *vdev)
902909
}
903910

904911
ivpu_mmu_user_context_mark_invalid(vdev, ssid);
912+
REGV_WR32(IVPU_MMU_REG_EVTQ_CONS_SEC, vdev->mmu->evtq.cons);
905913
}
906914
}
907915

drivers/gpu/drm/amd/amdgpu/amdgpu.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1078,6 +1078,8 @@ struct amdgpu_device {
10781078
bool in_s3;
10791079
bool in_s4;
10801080
bool in_s0ix;
1081+
/* indicate amdgpu suspension status */
1082+
bool suspend_complete;
10811083

10821084
enum pp_mp1_state mp1_state;
10831085
struct amdgpu_doorbell_index doorbell_index;

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2476,6 +2476,7 @@ static int amdgpu_pmops_suspend(struct device *dev)
24762476
struct drm_device *drm_dev = dev_get_drvdata(dev);
24772477
struct amdgpu_device *adev = drm_to_adev(drm_dev);
24782478

2479+
adev->suspend_complete = false;
24792480
if (amdgpu_acpi_is_s0ix_active(adev))
24802481
adev->in_s0ix = true;
24812482
else if (amdgpu_acpi_is_s3_active(adev))
@@ -2490,6 +2491,7 @@ static int amdgpu_pmops_suspend_noirq(struct device *dev)
24902491
struct drm_device *drm_dev = dev_get_drvdata(dev);
24912492
struct amdgpu_device *adev = drm_to_adev(drm_dev);
24922493

2494+
adev->suspend_complete = true;
24932495
if (amdgpu_acpi_should_gpu_reset(adev))
24942496
return amdgpu_asic_reset(adev);
24952497

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ static ssize_t ta_if_invoke_debugfs_write(struct file *fp, const char *buf, size
362362
}
363363
}
364364

365-
if (copy_to_user((char *)buf, context->mem_context.shared_buf, shared_buf_len))
365+
if (copy_to_user((char *)&buf[copy_pos], context->mem_context.shared_buf, shared_buf_len))
366366
ret = -EFAULT;
367367

368368
err_free_shared_buf:

0 commit comments

Comments
 (0)