Re: [PATCH v8 5/6] drm/i915/guc: Check the locking status of GuC WOPCM registers

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

 





On 02/06/2018 02:56 PM, Michal Wajdeczko wrote:

+    /* Explicitly cast the return value to bool. */
+    return !!(I915_READ(reg) & GUC_WOPCM_REG_LOCKED);

you should avoid reusing bits defined for one register in others

it's a common bit. use BIT(0) instead?


+    offset &= DMA_GUC_WOPCM_OFFSET_MASK;

maybe like this for easier reading:

u32 reg;

reg = I915_READ(GUC_WOPCM_SIZE);
size = reg & PAGE_MASK;

reg = I915_READ(DMA_GUC_WOPCM_OFFSET);
offset = reg & DMA_GUC_WOPCM_OFFSET_MASK;
hmm, this will clear the HUC_LOADING_AGENT_GUC.
guc_loads_huc = reg & HUC_LOADING_AGENT_GUC;

+
+    return guc_loads_huc && (size == guc->wopcm.size) &&

what if we run in !USES_HUC() mode?

Do you mean the HUC_LOADING_AGENT bit?

this patch series is trying to align with the current driver logic. this bit
is current set regardless USES_HUC()

Are you suggest we should not set this bit for !USE_HUC() mode?
+        (offset == guc->wopcm.offset);
  #define GEN9_GUC_WOPCM_OFFSET        (0x24000)
  +/* GuC WOPCM flags */
+#define INTEL_GUC_WOPCM_VALID        BIT(0)
+#define INTEL_GUC_WOPCM_HW_UPDATED    BIT(1)

maybe just

bool valid:1;
bool hw_updated:1;

I was trying to avoid bool in struct (really struggling with it actual size), maybe
u32 valid:1;
u32 hw_updated:1

Regards,
-Jackie


_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux