[PATCH 13/15] drm/i915/huc: report HuC as loaded even if load still in progress

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The media driver uses this only as an indication that HuC is enabled and
they have a secondary check within their batches to verify if the HuC
is indeed loaded or not. They have therefore requested us to report this
as true if HuC loading is in progress.

Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@xxxxxxxxx>
Cc: Tony Ye <tony.ye@xxxxxxxxx>
---
 drivers/gpu/drm/i915/gt/uc/intel_huc.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/gt/uc/intel_huc.c b/drivers/gpu/drm/i915/gt/uc/intel_huc.c
index 075ec97b459d..33bfac91fa01 100644
--- a/drivers/gpu/drm/i915/gt/uc/intel_huc.c
+++ b/drivers/gpu/drm/i915/gt/uc/intel_huc.c
@@ -408,8 +408,8 @@ bool intel_huc_is_authenticated(struct intel_huc *huc)
  *  * -EOPNOTSUPP if HuC firmware is disabled,
  *  * -ENOPKG if HuC firmware was not installed,
  *  * -ENOEXEC if HuC firmware is invalid or mismatched,
- *  * 0 if HuC firmware is not running,
- *  * 1 if HuC firmware is authenticated and running.
+ *  * 1 if HuC firmware is authenticated and running or if delayed load is in progress,
+ *  * 0 if HuC firmware is not running and delayed load is not in progress
  */
 int intel_huc_check_status(struct intel_huc *huc)
 {
@@ -426,7 +426,10 @@ int intel_huc_check_status(struct intel_huc *huc)
 		break;
 	}
 
-	return intel_huc_is_authenticated(huc);
+	if (intel_huc_is_authenticated(huc))
+		return 1;
+
+	return !i915_sw_fence_done(&huc->delayed_load.fence);
 }
 
 static bool huc_has_delayed_load(struct intel_huc *huc)
-- 
2.25.1




[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux