[Intel-gfx] [PATCH v3] drm/i915/guc: Expose (intel)_lr_context_size()
Daniel Vetter
daniel at ffwll.ch
Tue Jan 5 23:38:24 PST 2016
On Tue, Jan 05, 2016 at 10:33:02AM -0800, yu.dai at intel.com wrote:
> From: Dave Gordon <david.s.gordon at intel.com>
>
> The GuC code needs to know the size of a logical context, so we
> expose get_lr_context_size(), renaming it intel_lr_context__size()
> to fit the naming conventions for nonstatic functions.
>
> Add comments or kerneldoc (Daniel Vetter)
>
> For: VIZ-2021
> Signed-off-by: Dave Gordon <david.s.gordon at intel.com>
> Signed-off-by: Alex Dai <yu.dai at intel.com>
Dave Gordon was faster, I already pulled in his follow-up. Note that with
commit rights dinq became non-rebasing, so as soon as a patch landed it's
frozen. Only follow-up patches are possible with this new process.
-Daniel
> ---
> drivers/gpu/drm/i915/intel_lrc.c | 13 +++++++++++--
> drivers/gpu/drm/i915/intel_lrc.h | 1 +
> 2 files changed, 12 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
> index e095058..9be9835 100644
> --- a/drivers/gpu/drm/i915/intel_lrc.c
> +++ b/drivers/gpu/drm/i915/intel_lrc.c
> @@ -2399,7 +2399,16 @@ void intel_lr_context_free(struct intel_context *ctx)
> }
> }
>
> -static uint32_t get_lr_context_size(struct intel_engine_cs *ring)
> +/**
> + * intel_lr_context_size() - get the LRC state pages size
> + * @ring: engine to be used to get ring id
> + *
> + * The LRC state pages size varies for different engines. This function is used
> + * in ExecList / GuC mode to get LRC state pages size.
> + *
> + * Return: size of the LRC state pages. zero on unknown engine.
> + */
> +uint32_t intel_lr_context_size(struct intel_engine_cs *ring)
> {
> int ret = 0;
>
> @@ -2467,7 +2476,7 @@ int intel_lr_context_deferred_alloc(struct intel_context *ctx,
> WARN_ON(ctx->legacy_hw_ctx.rcs_state != NULL);
> WARN_ON(ctx->engine[ring->id].state);
>
> - context_size = round_up(get_lr_context_size(ring), 4096);
> + context_size = round_up(intel_lr_context_size(ring), 4096);
>
> /* One extra page as the sharing data between driver and GuC */
> context_size += PAGE_SIZE * LRC_PPHWSP_PN;
> diff --git a/drivers/gpu/drm/i915/intel_lrc.h b/drivers/gpu/drm/i915/intel_lrc.h
> index 0b821b9..ae90f86 100644
> --- a/drivers/gpu/drm/i915/intel_lrc.h
> +++ b/drivers/gpu/drm/i915/intel_lrc.h
> @@ -84,6 +84,7 @@ static inline void intel_logical_ring_emit_reg(struct intel_ringbuffer *ringbuf,
> #define LRC_STATE_PN (LRC_PPHWSP_PN + 1)
>
> void intel_lr_context_free(struct intel_context *ctx);
> +uint32_t intel_lr_context_size(struct intel_engine_cs *ring);
> int intel_lr_context_deferred_alloc(struct intel_context *ctx,
> struct intel_engine_cs *ring);
> void intel_lr_context_unpin(struct drm_i915_gem_request *req);
> --
> 2.5.0
>
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
More information about the Intel-gfx
mailing list