* [PATCH] drm/i915: Do an initial lockless wait for render completion before pread/pwrite
@ 2012-12-16 17:51 Chris Wilson
2012-12-16 18:29 ` Chris Wilson
0 siblings, 1 reply; 2+ messages in thread
From: Chris Wilson @ 2012-12-16 17:51 UTC (permalink / raw)
To: intel-gfx
Before performing the domain transition for pread/pwrite, and so a locked
completion if still required, wait for any pending rendering locklessly.
This should reduce contention when reading back results from the GPU, for
example.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
drivers/gpu/drm/i915/i915_gem.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index a831641..447ad9d 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -599,6 +599,10 @@ i915_gem_pread_ioctl(struct drm_device *dev, void *data,
trace_i915_gem_object_pread(obj, args->offset, args->size);
+ ret = i915_gem_object_wait_rendering__nonblocking(obj, true);
+ if (ret)
+ goto out;
+
ret = i915_gem_shmem_pread(dev, obj, args, file);
out:
@@ -1001,6 +1005,10 @@ i915_gem_pwrite_ioctl(struct drm_device *dev, void *data,
goto out;
}
+ ret = i915_gem_object_wait_rendering__nonblocking(obj, false);
+ if (ret)
+ goto out;
+
if (obj->cache_level == I915_CACHE_NONE &&
obj->tiling_mode == I915_TILING_NONE &&
obj->base.write_domain != I915_GEM_DOMAIN_CPU) {
--
1.7.10.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] drm/i915: Do an initial lockless wait for render completion before pread/pwrite
2012-12-16 17:51 [PATCH] drm/i915: Do an initial lockless wait for render completion before pread/pwrite Chris Wilson
@ 2012-12-16 18:29 ` Chris Wilson
0 siblings, 0 replies; 2+ messages in thread
From: Chris Wilson @ 2012-12-16 18:29 UTC (permalink / raw)
To: intel-gfx
On Sun, 16 Dec 2012 17:51:55 +0000, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> Before performing the domain transition for pread/pwrite, and so a locked
> completion if still required, wait for any pending rendering locklessly.
> This should reduce contention when reading back results from the GPU, for
> example.
Meh, the pwrite side messes around with the ret=-EFAULT and so screws up
the shmem_write patch.
-Chris
>
--
Chris Wilson, Intel Open Source Technology Centre
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-12-16 18:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-16 17:51 [PATCH] drm/i915: Do an initial lockless wait for render completion before pread/pwrite Chris Wilson
2012-12-16 18:29 ` Chris Wilson
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.