Re: [PATCH] drm/i915: Add temporary ring->ctx backpointer

Daniel, Thomas
2014-08-14T16:34:34Z

> -----Original Message-----
> From: Daniel Vetter [mailto:daniel.vetter@ffwll.ch]
> Sent: Thursday, August 14, 2014 5:28 PM
> To: Intel Graphics Development
> Cc: Mateo Lozano, Oscar; Daniel, Thomas; Daniel Vetter
> Subject: [PATCH] drm/i915: Add temporary ring->ctx backpointer
>
> From: Oscar Mateo <oscar.mateo@intel.com>
>
> The execlist patches have a bit a convoluted and long history and due to that
> have the actual submission still misplaced deeply burried in the low-level
> ringbuffer handling code. This design goes back to the legacy ringbuffer code
> with its tricky lazy request and simple work submissiion using ring tail writes.
> For that reason they need a
> ring->ctx backpointer.
>
> The goal is to unburry that code and move it up into a level where the full
> execlist context is available so that we can ditch this backpointer. Until that's
> done make it really obvious that there's work still to be done.
>
> Cc: Oscar Mateo <oscar.mateo@intel.com>
> Cc: Thomas Daniel <thomas.daniel@intel.com>
> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
>
> --
>
> Thomas, please ack this patch and the general plan we've discussed.
Acked-by: Thomas Daniel <thomas.daniel@intel.com>

> Then I'll start pulling in more patches and I'll do the s/ctx/FIXME_lrc_ctx/ on
> the fly.
> -Daniel
> ---
> drivers/gpu/drm/i915/intel_lrc.c | 2 ++
> drivers/gpu/drm/i915/intel_ringbuffer.h | 7 +++++++
> 2 files changed, 9 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/intel_lrc.c
> b/drivers/gpu/drm/i915/intel_lrc.c
> index 6b5f416b5c0d..c2352d1b23fa 100644
> --- a/drivers/gpu/drm/i915/intel_lrc.c
> +++ b/drivers/gpu/drm/i915/intel_lrc.c
> @@ -1086,6 +1086,8 @@ int intel_lr_context_deferred_create(struct
> intel_context *ctx,
> }
>
> ringbuf->ring = ring;
> + ringbuf->FIXME_lrc_ctx = ctx;
> +
> ringbuf->size = 32 * PAGE_SIZE;
> ringbuf->effective_size = ringbuf->size;
> ringbuf->head = 0;
> diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.h
> b/drivers/gpu/drm/i915/intel_ringbuffer.h
> index 24437da91f77..26785ca72530 100644
> --- a/drivers/gpu/drm/i915/intel_ringbuffer.h
> +++ b/drivers/gpu/drm/i915/intel_ringbuffer.h
> @@ -99,6 +99,13 @@ struct intel_ringbuffer {
>
> struct intel_engine_cs *ring;
>
> + /*
> + * FIXME: This backpointer is an artifact of the history of how the
> + * execlist patches came into being. It will get removed once the basic
> + * code has landed.
> + */
> + struct intel_context *FIXME_lrc_ctx;
> +
> u32 head;
> u32 tail;
> int space;
> --
> 2.0.1