@@ -37,6 +37,7 @@
#define GS_UKERNEL_READY (0xF0 << GS_UKERNEL_SHIFT)
#define GS_MIA_SHIFT 16
#define GS_MIA_MASK (0x07 << GS_MIA_SHIFT)
+#define GS_MIA_CORE_STATE (1 << GS_MIA_SHIFT)
#define SOFT_SCRATCH(n) (0xc180 + ((n) * 4))
@@ -209,9 +209,16 @@ static inline bool guc_ucode_response(struct drm_i915_private *dev_priv,
u32 *status)
{
u32 val = I915_READ(GUC_STATUS);
+ u32 uk_val = val & GS_UKERNEL_MASK;
*status = val;
- return ((val & GS_UKERNEL_MASK) == GS_UKERNEL_READY ||
- (val & GS_UKERNEL_MASK) == GS_UKERNEL_LAPIC_DONE);
+
+ /* If resuming from RC6, look for LAPIC_DONE */
+ if (val & GS_MIA_CORE_STATE)
+ if (uk_val == GS_UKERNEL_LAPIC_DONE)
+ return true;
+
+ /* Otherwise just check whether the uKernel is READY */
+ return uk_val == GS_UKERNEL_READY;
}
/*