drm/i915: Process page flags once rather than per pwrite/pread
authorChris Wilson <chris@chris-wilson.co.uk>
Fri, 7 Mar 2014 08:30:36 +0000 (08:30 +0000)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 7 Mar 2014 23:03:01 +0000 (00:03 +0100)
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>
drivers/gpu/drm/i915/i915_gem.c

index 177c20722656ef347d7263d41ed0946c88904a14..da5d9ca98024d018ae2e12851726ca083f77d3dd 100644 (file)
@@ -510,12 +510,10 @@ i915_gem_shmem_pread(struct drm_device *dev,
 
                mutex_lock(&dev->struct_mutex);
 
-next_page:
-               mark_page_accessed(page);
-
                if (ret)
                        goto out;
 
+next_page:
                remain -= page_length;
                user_data += page_length;
                offset += page_length;
@@ -831,13 +829,10 @@ i915_gem_shmem_pwrite(struct drm_device *dev,
 
                mutex_lock(&dev->struct_mutex);
 
-next_page:
-               set_page_dirty(page);
-               mark_page_accessed(page);
-
                if (ret)
                        goto out;
 
+next_page:
                remain -= page_length;
                user_data += page_length;
                offset += page_length;