[Intel-gfx] [PATCH 7/8] drm/i915/guc: Don't touch WOPCM if we're not using GuC
Yaodong Li
yaodong.li at intel.com
Fri Mar 23 22:08:14 UTC 2018
On 03/23/2018 05:34 AM, Michał Winiarski wrote:
> We probably shouldn't print out WOPCM size on platforms that don't have
> GuC. We also want to make sure we don't hit any asserts if user explicitly
> sets enable_guc != 0 on non-guc platforms.
>
> Signed-off-by: Michał Winiarski <michal.winiarski at intel.com>
> Cc: Chris Wilson <chris at chris-wilson.co.uk>
> Cc: Jackie Li <yaodong.li at intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>
> Cc: Michal Wajdeczko <michal.wajdeczko at intel.com>
> ---
> drivers/gpu/drm/i915/intel_wopcm.c | 10 ++++++++--
> 1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_wopcm.c b/drivers/gpu/drm/i915/intel_wopcm.c
> index be8fca80aeca..828800ca119c 100644
> --- a/drivers/gpu/drm/i915/intel_wopcm.c
> +++ b/drivers/gpu/drm/i915/intel_wopcm.c
> @@ -69,6 +69,9 @@
> */
> void intel_wopcm_init_early(struct intel_wopcm *wopcm)
> {
> + if (!HAS_GUC(wopcm_to_i915(wopcm)))
> + return;
> +
> wopcm->size = GEN9_WOPCM_SIZE;
>
> DRM_DEBUG_DRIVER("WOPCM size: %uKiB\n", wopcm->size / 1024);
> @@ -285,8 +288,12 @@ static int wopcm_guc_region_init(struct intel_wopcm *wopcm)
> */
> int intel_wopcm_init(struct intel_wopcm *wopcm)
> {
> + struct drm_i915_private *dev_priv = wopcm_to_i915(wopcm);
> int err;
>
> + if (!HAS_GUC(dev_priv) || !USES_GUC(dev_priv))
> + return 0;
> +
I guess I have to bring up an old question here: if we want to
use this only for enable_guc > 0. Why not make it as a part of
uc layer?
Regards,
-Jackie
More information about the Intel-gfx
mailing list