[Intel-gfx] [CI 18/25] drm/i915: Replace the pinned context address with its unique ID
Dave Gordon
david.s.gordon at intel.com
Thu Apr 28 15:23:47 UTC 2016
On 28/04/16 09:56, Chris Wilson wrote:
> Rather than reuse the current location of the context in the global GTT
> for its hardware identifier, use the context's unique ID assigned to it
> for its whole lifetime.
>
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
> ---
> drivers/gpu/drm/i915/i915_debugfs.c | 12 +++++-------
> drivers/gpu/drm/i915/intel_lrc.c | 39 +++++++++----------------------------
> drivers/gpu/drm/i915/intel_lrc.h | 3 ---
> 3 files changed, 14 insertions(+), 40 deletions(-)
[snip]
> @@ -315,14 +316,14 @@ static void
> intel_lr_context_descriptor_update(struct intel_context *ctx,
> struct intel_engine_cs *engine)
> {
> - uint64_t lrca, desc;
> + u64 desc;
>
> - lrca = ctx->engine[engine->id].lrc_vma->node.start +
> - LRC_PPHWSP_PN * PAGE_SIZE;
> + BUILD_BUG_ON(MAX_CONTEXT_HW_ID > (1<<GEN8_CTX_ID_WIDTH));
>
> - desc = engine->ctx_desc_template; /* bits 0-11 */
> - desc |= lrca; /* bits 12-31 */
> - desc |= (lrca >> PAGE_SHIFT) << GEN8_CTX_ID_SHIFT; /* bits 32-52 */
> + desc = engine->ctx_desc_template; /* bits 0-11 */
> + desc |= ctx->engine[engine->id].lrc_vma->node.start + /* bits 12-31 */
> + LRC_PPHWSP_PN * PAGE_SIZE;
> + desc |= (u64)ctx->hw_id << GEN8_CTX_ID_SHIFT; /* bits 32-52 */
I'd prefer to see the LRCA mentioned and explicitly computed in a local
variable first, rather than hide the calculation in the middle of
assembling the descriptor! In other words, as it was before -- the only
line of this function that needed changing was the last one above.
.Dave.
More information about the Intel-gfx
mailing list