diff mbox series

[4/7] drm/i915: Don't try to partition WOPCM without GuC firmware

Message ID 20190807170034.8440-5-michal.wajdeczko@intel.com (mailing list archive)
State New, archived
Headers show
Series Hardening firmware fetch | expand

Commit Message

Michal Wajdeczko Aug. 7, 2019, 5 p.m. UTC
For meaningful WOPCM partitioning we need GuC (and optionally HuC)
firmware size(s) and we shouldn't just rely on GuC support flag,
as we might fail to fetch GuC firmware and it's size will be 0
and all calculations will be just wrong/useless.

Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/intel_wopcm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Chris Wilson Aug. 7, 2019, 5:31 p.m. UTC | #1
Quoting Michal Wajdeczko (2019-08-07 18:00:31)
> For meaningful WOPCM partitioning we need GuC (and optionally HuC)
> firmware size(s) and we shouldn't just rely on GuC support flag,
> as we might fail to fetch GuC firmware and it's size will be 0
> and all calculations will be just wrong/useless.
> 
> Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> ---
>  drivers/gpu/drm/i915/intel_wopcm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_wopcm.c b/drivers/gpu/drm/i915/intel_wopcm.c
> index 4c22143ee84f..5e5c3fd3472d 100644
> --- a/drivers/gpu/drm/i915/intel_wopcm.c
> +++ b/drivers/gpu/drm/i915/intel_wopcm.c
> @@ -170,7 +170,7 @@ void intel_wopcm_init(struct intel_wopcm *wopcm)
>         u32 guc_wopcm_rsvd;
>         int err;
>  
> -       if (!USES_GUC(i915))
> +       if (!guc_fw_size)
>                 return;

It looks like the calculations with huc_fw_size=0 are fine, just hope
the fw agrees.

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/intel_wopcm.c b/drivers/gpu/drm/i915/intel_wopcm.c
index 4c22143ee84f..5e5c3fd3472d 100644
--- a/drivers/gpu/drm/i915/intel_wopcm.c
+++ b/drivers/gpu/drm/i915/intel_wopcm.c
@@ -170,7 +170,7 @@  void intel_wopcm_init(struct intel_wopcm *wopcm)
 	u32 guc_wopcm_rsvd;
 	int err;
 
-	if (!USES_GUC(i915))
+	if (!guc_fw_size)
 		return;
 
 	GEM_BUG_ON(!wopcm->size);