Skip to content

Commit c2831a9

Browse files
ickledanvet
authored andcommitted
drm/i915: Do not force non-caching copies for pwrite along shmem path
We don't always want to write into main memory with pwrite. The shmem fast path in particular is used for memory that is cacheable - under such circumstances forcing the cache eviction is undesirable. As we will always flush the cache when targeting incoherent buffers, we can rely on that second pass to apply the cache coherency rules and so benefit from in-cache copies otherwise. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Brad Volkin <bradley.d.volkin@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
1 parent 17793c9 commit c2831a9

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/gpu/drm/i915/i915_gem.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -693,9 +693,8 @@ shmem_pwrite_fast(struct page *page, int shmem_page_offset, int page_length,
693693
if (needs_clflush_before)
694694
drm_clflush_virt_range(vaddr + shmem_page_offset,
695695
page_length);
696-
ret = __copy_from_user_inatomic_nocache(vaddr + shmem_page_offset,
697-
user_data,
698-
page_length);
696+
ret = __copy_from_user_inatomic(vaddr + shmem_page_offset,
697+
user_data, page_length);
699698
if (needs_clflush_after)
700699
drm_clflush_virt_range(vaddr + shmem_page_offset,
701700
page_length);

0 commit comments

Comments
 (0)