aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_gem.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2014-03-07 03:30:36 -0500
committerDaniel Vetter <daniel.vetter@ffwll.ch>2014-03-07 18:03:01 -0500
commit17793c9a4659b272a9f892d44940062ed8b5fd0e (patch)
treefa3b63d7cab27dc45b94397cbcbb1f2e325ba5ce /drivers/gpu/drm/i915/i915_gem.c
parent2fae6a860ca9adb0c881f6dcd633df775c2520e9 (diff)
drm/i915: Process page flags once rather than per pwrite/pread
We used to lock individual pages inside the buffer object and so needed to update the page flags every time. However, we now pin the pages into the object for the duration of the pwrite/pread (and hopefully much longer) and so we can forgo the flag updates until we release all the pages. 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>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem.c')
-rw-r--r--drivers/gpu/drm/i915/i915_gem.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 177c20722656..da5d9ca98024 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -510,12 +510,10 @@ i915_gem_shmem_pread(struct drm_device *dev,
510 510
511 mutex_lock(&dev->struct_mutex); 511 mutex_lock(&dev->struct_mutex);
512 512
513next_page:
514 mark_page_accessed(page);
515
516 if (ret) 513 if (ret)
517 goto out; 514 goto out;
518 515
516next_page:
519 remain -= page_length; 517 remain -= page_length;
520 user_data += page_length; 518 user_data += page_length;
521 offset += page_length; 519 offset += page_length;
@@ -831,13 +829,10 @@ i915_gem_shmem_pwrite(struct drm_device *dev,
831 829
832 mutex_lock(&dev->struct_mutex); 830 mutex_lock(&dev->struct_mutex);
833 831
834next_page:
835 set_page_dirty(page);
836 mark_page_accessed(page);
837
838 if (ret) 832 if (ret)
839 goto out; 833 goto out;
840 834
835next_page:
841 remain -= page_length; 836 remain -= page_length;
842 user_data += page_length; 837 user_data += page_length;
843 offset += page_length; 838 offset += page_length;