Commit 486291a0 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'drm-fixes-2024-03-30' of https://gitlab.freedesktop.org/drm/kernel

Pull drm fixes from Dave Airlie:
 "Regular fixes for rc2, quite a few i915/amdgpu as usual, some xe, and
  then mostly scattered around. rc3 might be quieter with the holidays
  but we shall see.

  bridge:
   - select DRM_KMS_HELPER

  dma-buf:
   - fix NULL-pointer deref

  dp:
   - fix div-by-zero in DP MST unplug code

  fbdev:
   - select FB_IOMEM_FOPS for SBus

  sched:
   - fix NULL-pointer deref

  xe:
   - Fix build on mips
   - Fix wrong bound checks
   - Fix use of msec rather than jiffies
   - Remove dead code

  amdgpu:
   - SMU 14.0.1 updates
   - DCN 3.5.x updates
   - VPE fix
   - eDP panel flickering fix
   - Suspend fix
   - PSR fix
   - DCN 3.0+ fix
   - VCN 4.0.6 updates
   - debugfs fix

  amdkfd:
   - DMA-Buf fix
   - GFX 9.4.2 TLB flush fix
   - CP interrupt fix

  i915:
   - Fix for BUG_ON/BUILD_BUG_ON IN I915_memcpy.c
   - Update a MTL workaround
   - Fix locking inversion in hwmon's sysfs
   - Remove a bogus error message around PXP
   - Fix UAF on VMA
   - Reset queue_priority_hint on parking
   - Display Fixes:
   - Remove duplicated audio enable/disable on SDVO and DP
   - Disable AuxCCS for Xe driver
   - Revert init order of MIPI DSI
   - DRRS debugfs fix with an extra refactor patch
   - VRR related fixes
   - Fix a JSL eDP corruption
   - Fix the cursor physical dma address
   - BIOS VBT related fix

  nouveau:
   - dmem: handle kcalloc() allocation failures

  qxl:
   - remove unused variables

  rockchip:
   - vop2: remove support for AR30 and AB30 formats

  vmwgfx:
   - debugfs: create ttm_resource_manager entry only if needed"

* tag 'drm-fixes-2024-03-30' of https://gitlab.freedesktop.org/drm/kernel: (55 commits)
  drm/i915/bios: Tolerate devdata==NULL in intel_bios_encoder_supports_dp_dual_mode()
  drm/i915: Pre-populate the cursor physical dma address
  drm/i915/gt: Reset queue_priority_hint on parking
  drm/i915/vma: Fix UAF on destroy against retire race
  drm/i915: Do not print 'pxp init failed with 0' when it succeed
  drm/i915: Do not match JSL in ehl_combo_pll_div_frac_wa_needed()
  drm/i915/hwmon: Fix locking inversion in sysfs getter
  drm/i915/dsb: Fix DSB vblank waits when using VRR
  drm/i915/vrr: Generate VRR "safe window" for DSB
  drm/i915/display/debugfs: Fix duplicate checks in i915_drrs_status
  drm/i915/drrs: Refactor CPU transcoder DRRS check
  drm/i915/mtl: Update workaround 14018575942
  drm/i915/dsi: Go back to the previous INIT_OTP/DISPLAY_ON order, mostly
  drm/i915/display: Disable AuxCCS framebuffers if built for Xe
  drm/i915: Stop doing double audio enable/disable on SDVO and g4x+ DP
  drm/i915: Add includes for BUG_ON/BUILD_BUG_ON in i915_memcpy.c
  drm/qxl: remove unused variable from `qxl_process_single_command()`
  drm/qxl: remove unused `count` variable from `qxl_surface_id_alloc()`
  drm/i915: add bug.h include to i915_memcpy.c
  drm/vmwgfx: Create debugfs ttm_resource_manager entry only if needed
  ...
parents 1ab5c8a3 b01f596a
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -84,10 +84,10 @@ static int sanitycheck(void *arg)
		return -ENOMEM;

	chain = mock_chain(NULL, f, 1);
	if (!chain)
		err = -ENOMEM;

	if (chain)
		dma_fence_enable_sw_signaling(chain);
	else
		err = -ENOMEM;

	dma_fence_signal(f);
	dma_fence_put(f);
+2 −0
Original line number Diff line number Diff line
@@ -4539,6 +4539,8 @@ int amdgpu_device_prepare(struct drm_device *dev)
	if (r)
		goto unprepare;

	flush_delayed_work(&adev->gfx.gfx_off_delay_work);

	for (i = 0; i < adev->num_ip_blocks; i++) {
		if (!adev->ip_blocks[i].status.valid)
			continue;
+1 −0
Original line number Diff line number Diff line
@@ -2237,6 +2237,7 @@ static int amdgpu_discovery_set_umsch_mm_ip_blocks(struct amdgpu_device *adev)
{
	switch (amdgpu_ip_version(adev, VCN_HWIP, 0)) {
	case IP_VERSION(4, 0, 5):
	case IP_VERSION(4, 0, 6):
		if (amdgpu_umsch_mm & 0x1) {
			amdgpu_device_ip_block_add(adev, &umsch_mm_v4_0_ip_block);
			adev->enable_umsch_mm = true;
+29 −17
Original line number Diff line number Diff line
@@ -524,46 +524,58 @@ static ssize_t amdgpu_debugfs_mqd_read(struct file *f, char __user *buf,
{
	struct amdgpu_ring *ring = file_inode(f)->i_private;
	volatile u32 *mqd;
	int r;
	u32 *kbuf;
	int r, i;
	uint32_t value, result;

	if (*pos & 3 || size & 3)
		return -EINVAL;

	result = 0;
	kbuf = kmalloc(ring->mqd_size, GFP_KERNEL);
	if (!kbuf)
		return -ENOMEM;

	r = amdgpu_bo_reserve(ring->mqd_obj, false);
	if (unlikely(r != 0))
		return r;
		goto err_free;

	r = amdgpu_bo_kmap(ring->mqd_obj, (void **)&mqd);
	if (r) {
	if (r)
		goto err_unreserve;

	/*
	 * Copy to local buffer to avoid put_user(), which might fault
	 * and acquire mmap_sem, under reservation_ww_class_mutex.
	 */
	for (i = 0; i < ring->mqd_size/sizeof(u32); i++)
		kbuf[i] = mqd[i];

	amdgpu_bo_kunmap(ring->mqd_obj);
	amdgpu_bo_unreserve(ring->mqd_obj);
		return r;
	}

	result = 0;
	while (size) {
		if (*pos >= ring->mqd_size)
			goto done;
			break;

		value = mqd[*pos/4];
		value = kbuf[*pos/4];
		r = put_user(value, (uint32_t *)buf);
		if (r)
			goto done;
			goto err_free;
		buf += 4;
		result += 4;
		size -= 4;
		*pos += 4;
	}

done:
	amdgpu_bo_kunmap(ring->mqd_obj);
	mqd = NULL;
	kfree(kbuf);
	return result;

err_unreserve:
	amdgpu_bo_unreserve(ring->mqd_obj);
	if (r)
err_free:
	kfree(kbuf);
	return r;

	return result;
}

static const struct file_operations amdgpu_debugfs_mqd_fops = {
+10 −2
Original line number Diff line number Diff line
@@ -189,10 +189,13 @@ static void setup_vpe_queue(struct amdgpu_device *adev,
	mqd->rptr_val = 0;
	mqd->unmapped = 1;

	if (adev->vpe.collaborate_mode)
		memcpy(++mqd, test->mqd_data_cpu_addr, sizeof(struct MQD_INFO));

	qinfo->mqd_addr = test->mqd_data_gpu_addr;
	qinfo->csa_addr = test->ctx_data_gpu_addr +
		offsetof(struct umsch_mm_test_ctx_data, vpe_ctx_csa);
	qinfo->doorbell_offset_0 = (adev->doorbell_index.vpe_ring + 1) << 1;
	qinfo->doorbell_offset_0 = 0;
	qinfo->doorbell_offset_1 = 0;
}

@@ -287,7 +290,10 @@ static int submit_vpe_queue(struct amdgpu_device *adev, struct umsch_mm_test *te
	ring[5] = 0;

	mqd->wptr_val = (6 << 2);
	// WDOORBELL32(adev->umsch_mm.agdb_index[CONTEXT_PRIORITY_LEVEL_NORMAL], mqd->wptr_val);
	if (adev->vpe.collaborate_mode)
		(++mqd)->wptr_val = (6 << 2);

	WDOORBELL32(adev->umsch_mm.agdb_index[CONTEXT_PRIORITY_LEVEL_NORMAL], mqd->wptr_val);

	for (i = 0; i < adev->usec_timeout; i++) {
		if (*fence == test_pattern)
@@ -571,6 +577,7 @@ int amdgpu_umsch_mm_init_microcode(struct amdgpu_umsch_mm *umsch)

	switch (amdgpu_ip_version(adev, VCN_HWIP, 0)) {
	case IP_VERSION(4, 0, 5):
	case IP_VERSION(4, 0, 6):
		fw_name = "amdgpu/umsch_mm_4_0_0.bin";
		break;
	default:
@@ -750,6 +757,7 @@ static int umsch_mm_early_init(void *handle)

	switch (amdgpu_ip_version(adev, VCN_HWIP, 0)) {
	case IP_VERSION(4, 0, 5):
	case IP_VERSION(4, 0, 6):
		umsch_mm_v4_0_set_funcs(&adev->umsch_mm);
		break;
	default:
Loading