Commit 17793c9a authored by Chris Wilson's avatar Chris Wilson Committed by Daniel Vetter

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: default avatarChris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: default avatarBrad Volkin <bradley.d.volkin@intel.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 2fae6a86
...@@ -510,12 +510,10 @@ i915_gem_shmem_pread(struct drm_device *dev, ...@@ -510,12 +510,10 @@ i915_gem_shmem_pread(struct drm_device *dev,
mutex_lock(&dev->struct_mutex); mutex_lock(&dev->struct_mutex);
next_page:
mark_page_accessed(page);
if (ret) if (ret)
goto out; goto out;
next_page:
remain -= page_length; remain -= page_length;
user_data += page_length; user_data += page_length;
offset += page_length; offset += page_length;
...@@ -831,13 +829,10 @@ i915_gem_shmem_pwrite(struct drm_device *dev, ...@@ -831,13 +829,10 @@ i915_gem_shmem_pwrite(struct drm_device *dev,
mutex_lock(&dev->struct_mutex); mutex_lock(&dev->struct_mutex);
next_page:
set_page_dirty(page);
mark_page_accessed(page);
if (ret) if (ret)
goto out; goto out;
next_page:
remain -= page_length; remain -= page_length;
user_data += page_length; user_data += page_length;
offset += page_length; offset += page_length;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment