* [PATCH] drm/i915: Return a mask of the active rings in the high word of busy_ioctl
@ 2012-07-04 11:25 Chris Wilson
2012-07-04 11:42 ` Chris Wilson
0 siblings, 1 reply; 3+ messages in thread
From: Chris Wilson @ 2012-07-04 11:25 UTC (permalink / raw)
To: intel-gfx
The intention is to help select which engine to use for copies with
interoperating clients - such as a GL client making a request to the X
server to perform a SwapBuffers, which may require copying from the
active GL back buffer to the X front buffer.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
drivers/gpu/drm/i915/i915_gem.c | 6 ++++++
include/drm/i915_drm.h | 7 ++++++-
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 932b83e..a19a27d 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -3382,6 +3382,12 @@ i915_gem_busy_ioctl(struct drm_device *dev, void *data,
ret = i915_gem_object_flush_active(obj);
args->busy = obj->active;
+ if (obj->ring) {
+ BUILD_BUG_ON(I915_NUM_RINGS > 8);
+ args->busy |= intel_ring_flag(obj->ring) << 16;
+ if (obj->base.write_domain & I915_GEM_GPU_DOMAINS)
+ args->busy |= intel_ring_flag(obj->ring) << 24;
+ }
drm_gem_object_unreference(&obj->base);
unlock:
diff --git a/include/drm/i915_drm.h b/include/drm/i915_drm.h
index 8cc7083..564005e 100644
--- a/include/drm/i915_drm.h
+++ b/include/drm/i915_drm.h
@@ -698,7 +698,12 @@ struct drm_i915_gem_busy {
/** Handle of the buffer to check for busy */
__u32 handle;
- /** Return busy status (1 if busy, 0 if idle) */
+ /** Return busy status (1 if busy, 0 if idle).
+ * The high word is used to indicate on which rings the object
+ * currently resides:
+ * 16:23 - read rings (16 render, 17 bsd, 18 blt, etc)
+ * 24:31 - write ring (24 render, 25 bsd, 26 blt, etc)
+ */
__u32 busy;
};
--
1.7.10
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] drm/i915: Return a mask of the active rings in the high word of busy_ioctl
2012-07-04 11:25 [PATCH] drm/i915: Return a mask of the active rings in the high word of busy_ioctl Chris Wilson
@ 2012-07-04 11:42 ` Chris Wilson
2012-07-18 19:19 ` Daniel Vetter
0 siblings, 1 reply; 3+ messages in thread
From: Chris Wilson @ 2012-07-04 11:42 UTC (permalink / raw)
To: intel-gfx
On Wed, 4 Jul 2012 12:25:08 +0100, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> The intention is to help select which engine to use for copies with
> interoperating clients - such as a GL client making a request to the X
> server to perform a SwapBuffers, which may require copying from the
> active GL back buffer to the X front buffer.
We choose to report a mask of the active rings to future proof the
interface against any changes which may allow for the object to reside
upon multiple rings.
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] drm/i915: Return a mask of the active rings in the high word of busy_ioctl
2012-07-04 11:42 ` Chris Wilson
@ 2012-07-18 19:19 ` Daniel Vetter
0 siblings, 0 replies; 3+ messages in thread
From: Daniel Vetter @ 2012-07-18 19:19 UTC (permalink / raw)
To: Chris Wilson; +Cc: intel-gfx
On Wed, Jul 04, 2012 at 12:42:32PM +0100, Chris Wilson wrote:
> On Wed, 4 Jul 2012 12:25:08 +0100, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> > The intention is to help select which engine to use for copies with
> > interoperating clients - such as a GL client making a request to the X
> > server to perform a SwapBuffers, which may require copying from the
> > active GL back buffer to the X front buffer.
>
> We choose to report a mask of the active rings to future proof the
> interface against any changes which may allow for the object to reside
> upon multiple rings.
Queued for -next with the bikeshed applied as discussed on irc, thanks for
the patch. -Daniel
--
Daniel Vetter
Mail: daniel@ffwll.ch
Mobile: +41 (0)79 365 57 48
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-07-18 19:19 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-04 11:25 [PATCH] drm/i915: Return a mask of the active rings in the high word of busy_ioctl Chris Wilson
2012-07-04 11:42 ` Chris Wilson
2012-07-18 19:19 ` Daniel Vetter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox