Skip to content

Commit b7ffd9d

Browse files
committed
Merge tag 'drm-intel-fixes-2022-11-10' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes
- Fix sg_table handling in map_dma_buf (Matthew Auld) - Send PSR update also on invalidate (Jouni Högander) - Do not set cache_dirty for DGFX (Niranjana Vishwanathapura) - Restore userptr probe_range behaviour (Matthew Auld) Signed-off-by: Dave Airlie <[email protected]> From: Tvrtko Ursulin <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/Y2zCy5q85qE9W0J8@tursulin-desk
2 parents 42bf3ce + 178e31c commit b7ffd9d

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed

drivers/gpu/drm/i915/display/intel_psr.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2201,8 +2201,11 @@ static void _psr_invalidate_handle(struct intel_dp *intel_dp)
22012201
if (intel_dp->psr.psr2_sel_fetch_enabled) {
22022202
u32 val;
22032203

2204-
if (intel_dp->psr.psr2_sel_fetch_cff_enabled)
2204+
if (intel_dp->psr.psr2_sel_fetch_cff_enabled) {
2205+
/* Send one update otherwise lag is observed in screen */
2206+
intel_de_write(dev_priv, CURSURFLIVE(intel_dp->psr.pipe), 0);
22052207
return;
2208+
}
22062209

22072210
val = man_trk_ctl_enable_bit_get(dev_priv) |
22082211
man_trk_ctl_partial_frame_bit_get(dev_priv) |

drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@ static struct sg_table *i915_gem_map_dma_buf(struct dma_buf_attachment *attachme
4040
goto err;
4141
}
4242

43-
ret = sg_alloc_table(st, obj->mm.pages->nents, GFP_KERNEL);
43+
ret = sg_alloc_table(st, obj->mm.pages->orig_nents, GFP_KERNEL);
4444
if (ret)
4545
goto err_free;
4646

4747
src = obj->mm.pages->sgl;
4848
dst = st->sgl;
49-
for (i = 0; i < obj->mm.pages->nents; i++) {
49+
for (i = 0; i < obj->mm.pages->orig_nents; i++) {
5050
sg_set_page(dst, sg_page(src), src->length, 0);
5151
dst = sg_next(dst);
5252
src = sg_next(src);

drivers/gpu/drm/i915/gem/i915_gem_shmem.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,14 +369,14 @@ __i915_gem_object_release_shmem(struct drm_i915_gem_object *obj,
369369

370370
__start_cpu_write(obj);
371371
/*
372-
* On non-LLC platforms, force the flush-on-acquire if this is ever
372+
* On non-LLC igfx platforms, force the flush-on-acquire if this is ever
373373
* swapped-in. Our async flush path is not trust worthy enough yet(and
374374
* happens in the wrong order), and with some tricks it's conceivable
375375
* for userspace to change the cache-level to I915_CACHE_NONE after the
376376
* pages are swapped-in, and since execbuf binds the object before doing
377377
* the async flush, we have a race window.
378378
*/
379-
if (!HAS_LLC(i915))
379+
if (!HAS_LLC(i915) && !IS_DGFX(i915))
380380
obj->cache_dirty = true;
381381
}
382382

drivers/gpu/drm/i915/gem/i915_gem_userptr.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -428,9 +428,10 @@ probe_range(struct mm_struct *mm, unsigned long addr, unsigned long len)
428428
{
429429
VMA_ITERATOR(vmi, mm, addr);
430430
struct vm_area_struct *vma;
431+
unsigned long end = addr + len;
431432

432433
mmap_read_lock(mm);
433-
for_each_vma_range(vmi, vma, addr + len) {
434+
for_each_vma_range(vmi, vma, end) {
434435
/* Check for holes, note that we also update the addr below */
435436
if (vma->vm_start > addr)
436437
break;
@@ -442,7 +443,7 @@ probe_range(struct mm_struct *mm, unsigned long addr, unsigned long len)
442443
}
443444
mmap_read_unlock(mm);
444445

445-
if (vma)
446+
if (vma || addr < end)
446447
return -EFAULT;
447448
return 0;
448449
}

0 commit comments

Comments
 (0)