Commit fd979ca6 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'drm-fixes-2022-11-11' of git://anongit.freedesktop.org/drm/drm

Pull drm fixes from Dave Airlie:
 "Weekly pull request for graphics, mostly amdgpu and i915, with a
  couple of fixes for vc4 and panfrost, panel quirks and a kconfig
  change for rcar-du. Nothing seems to be too strange at this stage.

  amdgpu:
   - Fix s/r in amdgpu_vram_mgr_new
   - SMU 13.0.4 update
   - GPUVM TLB race fix
   - DCN 3.1.4 fixes
   - DCN 3.2.x fixes
   - Vega10 fan fix
   - BACO fix for Beige Goby board
   - PSR fix
   - GPU VM PT locking fixes

  amdkfd:
   - CRIU fixes

  vc4:
   - HDMI fixes to vc4.

  panfrost:
   - Make panfrost's uapi header compile with C++.
   - Handle 1 gb boundary correctly in panfrost mmu code.

  panel:
   - Add rotation quirks for 2 panels.

  rcar-du:
   - DSI Kconfig fix

  i915:
   - Fix sg_table handling in map_dma_buf
   - Send PSR update also on invalidate
   - Do not set cache_dirty for DGFX
   - Restore userptr probe_range behaviour"

* tag 'drm-fixes-2022-11-11' of git://anongit.freedesktop.org/drm/drm: (29 commits)
  drm/amd/display: only fill dirty rectangles when PSR is enabled
  drm/amdgpu: disable BACO on special BEIGE_GOBY card
  drm/amdgpu: Drop eviction lock when allocating PT BO
  drm/amdgpu: Unlock bo_list_mutex after error handling
  Revert "drm/amdgpu: Revert "drm/amdgpu: getting fan speed pwm for vega10 properly""
  drm/amd/display: Enforce minimum prefetch time for low memclk on DCN32
  drm/amd/display: Fix gpio port mapping issue
  drm/amd/display: Fix reg timeout in enc314_enable_fifo
  drm/amd/display: Fix FCLK deviation and tool compile issues
  drm/amd/display: Zeromem mypipe heap struct before using it
  drm/amd/display: Update SR watermarks for DCN314
  drm/amdgpu: workaround for TLB seq race
  drm/amdkfd: Fix error handling in criu_checkpoint
  drm/amdkfd: Fix error handling in kfd_criu_restore_events
  drm/amd/pm: update SMU IP v13.0.4 msg interface header
  drm: rcar-du: Fix Kconfig dependency between RCAR_DU and RCAR_MIPI_DSI
  drm/panfrost: Split io-pgtable requests properly
  drm/amdgpu: Fix the lpfn checking condition in drm buddy
  drm: panel-orientation-quirks: Add quirk for Acer Switch V 10 (SW5-017)
  drm: panel-orientation-quirks: Add quirk for Nanote UMPC-01
  ...
parents 4bbf3422 b7ffd9d9
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -992,6 +992,7 @@ static int amdgpu_cs_parser_bos(struct amdgpu_cs_parser *p,
		kvfree(e->user_pages);
		e->user_pages = NULL;
	}
	mutex_unlock(&p->bo_list->bo_list_mutex);
	return r;
}

+0 −26
Original line number Diff line number Diff line
@@ -143,32 +143,6 @@ int amdgpu_vm_set_pasid(struct amdgpu_device *adev, struct amdgpu_vm *vm,
	return 0;
}

/*
 * vm eviction_lock can be taken in MMU notifiers. Make sure no reclaim-FS
 * happens while holding this lock anywhere to prevent deadlocks when
 * an MMU notifier runs in reclaim-FS context.
 */
static inline void amdgpu_vm_eviction_lock(struct amdgpu_vm *vm)
{
	mutex_lock(&vm->eviction_lock);
	vm->saved_flags = memalloc_noreclaim_save();
}

static inline int amdgpu_vm_eviction_trylock(struct amdgpu_vm *vm)
{
	if (mutex_trylock(&vm->eviction_lock)) {
		vm->saved_flags = memalloc_noreclaim_save();
		return 1;
	}
	return 0;
}

static inline void amdgpu_vm_eviction_unlock(struct amdgpu_vm *vm)
{
	memalloc_noreclaim_restore(vm->saved_flags);
	mutex_unlock(&vm->eviction_lock);
}

/**
 * amdgpu_vm_bo_evicted - vm_bo is evicted
 *
+41 −0
Original line number Diff line number Diff line
@@ -492,7 +492,48 @@ void amdgpu_debugfs_vm_bo_info(struct amdgpu_vm *vm, struct seq_file *m);
 */
static inline uint64_t amdgpu_vm_tlb_seq(struct amdgpu_vm *vm)
{
	unsigned long flags;
	spinlock_t *lock;

	/*
	 * Workaround to stop racing between the fence signaling and handling
	 * the cb. The lock is static after initially setting it up, just make
	 * sure that the dma_fence structure isn't freed up.
	 */
	rcu_read_lock();
	lock = vm->last_tlb_flush->lock;
	rcu_read_unlock();

	spin_lock_irqsave(lock, flags);
	spin_unlock_irqrestore(lock, flags);

	return atomic64_read(&vm->tlb_seq);
}

/*
 * vm eviction_lock can be taken in MMU notifiers. Make sure no reclaim-FS
 * happens while holding this lock anywhere to prevent deadlocks when
 * an MMU notifier runs in reclaim-FS context.
 */
static inline void amdgpu_vm_eviction_lock(struct amdgpu_vm *vm)
{
	mutex_lock(&vm->eviction_lock);
	vm->saved_flags = memalloc_noreclaim_save();
}

static inline bool amdgpu_vm_eviction_trylock(struct amdgpu_vm *vm)
{
	if (mutex_trylock(&vm->eviction_lock)) {
		vm->saved_flags = memalloc_noreclaim_save();
		return true;
	}
	return false;
}

static inline void amdgpu_vm_eviction_unlock(struct amdgpu_vm *vm)
{
	memalloc_noreclaim_restore(vm->saved_flags);
	mutex_unlock(&vm->eviction_lock);
}

#endif
+2 −0
Original line number Diff line number Diff line
@@ -597,7 +597,9 @@ static int amdgpu_vm_pt_alloc(struct amdgpu_device *adev,
	if (entry->bo)
		return 0;

	amdgpu_vm_eviction_unlock(vm);
	r = amdgpu_vm_pt_create(adev, vm, cursor->level, immediate, &pt);
	amdgpu_vm_eviction_lock(vm);
	if (r)
		return r;

+1 −1
Original line number Diff line number Diff line
@@ -435,7 +435,7 @@ static int amdgpu_vram_mgr_new(struct ttm_resource_manager *man,
	if (place->flags & TTM_PL_FLAG_TOPDOWN)
		vres->flags |= DRM_BUDDY_TOPDOWN_ALLOCATION;

	if (fpfn || lpfn != man->size)
	if (fpfn || lpfn != mgr->mm.size)
		/* Allocate blocks in desired range */
		vres->flags |= DRM_BUDDY_RANGE_ALLOCATION;

Loading