Lines Matching refs:wopcm
17 * DOC: WOPCM Layout
19 * The layout of the WOPCM will be fixed after writing to GuC WOPCM size and
25 * +=========> +====================+ <== WOPCM Top
27 * | +===> +====================+ <== GuC WOPCM Top
32 * | WOPCM | |
34 * WOPCM | | GuC FW RSVD |
38 * | v | GuC WOPCM RSVD |
39 * | +===> +====================+ <== GuC WOPCM base
40 * | | WOPCM RSVD |
43 * +=========> +====================+ <== WOPCM Base
45 * GuC accessible WOPCM starts at GuC WOPCM base and ends at GuC WOPCM top.
46 * The top part of the WOPCM is reserved for hardware contexts (e.g. RC6
50 /* Default WOPCM size is 2MB from Gen11, 1MB on previous platforms */
53 /* 16KB WOPCM (RSVD WOPCM) is reserved from HuC firmware top. */
56 /* 16KB reserved at the beginning of GuC WOPCM. */
61 /* GuC WOPCM Offset value needs to be aligned to 16KB. */
64 /* 24KB at the end of WOPCM is reserved for RC6 CTX on BXT. */
66 /* 36KB WOPCM reserved at the end of WOPCM on CNL. */
73 static inline struct drm_i915_private *wopcm_to_i915(struct intel_wopcm *wopcm)
75 return container_of(wopcm, struct drm_i915_private, wopcm);
79 * intel_wopcm_init_early() - Early initialization of the WOPCM.
80 * @wopcm: pointer to intel_wopcm.
82 * Setup the size of WOPCM which will be used by later on WOPCM partitioning.
84 void intel_wopcm_init_early(struct intel_wopcm *wopcm)
86 struct drm_i915_private *i915 = wopcm_to_i915(wopcm);
92 wopcm->size = GEN11_WOPCM_SIZE;
94 wopcm->size = GEN9_WOPCM_SIZE;
96 DRM_DEV_DEBUG_DRIVER(i915->drm.dev, "WOPCM: %uK\n", wopcm->size / 1024);
115 * GuC WOPCM size shall be at least a dword larger than the offset from
116 * WOPCM base (GuC WOPCM offset from WOPCM base + GEN9_GUC_WOPCM_OFFSET)
123 "WOPCM: invalid GuC region size: %uK < %uK\n",
136 * On Gen9 & CNL A0, hardware requires the total available GuC WOPCM
141 dev_err(i915->drm.dev, "WOPCM: no space for %s: %uK < %uK\n",
177 "WOPCM: invalid GuC region layout: %uK + %uK > %uK\n",
185 dev_err(i915->drm.dev, "WOPCM: no space for %s: %uK < %uK\n",
193 dev_err(i915->drm.dev, "WOPCM: no space for %s: %uK < %uK\n",
219 * intel_wopcm_init() - Initialize the WOPCM structure.
220 * @wopcm: pointer to intel_wopcm.
222 * This function will partition WOPCM space based on GuC and HuC firmware sizes
224 * enforce platform dependent hardware restrictions on GuC WOPCM offset and
225 * size. It will fail the WOPCM init if any of these checks fail, so that the
226 * following WOPCM registers setup and GuC firmware uploading would be aborted.
228 void intel_wopcm_init(struct intel_wopcm *wopcm)
230 struct drm_i915_private *i915 = wopcm_to_i915(wopcm);
241 GEM_BUG_ON(!wopcm->size);
242 GEM_BUG_ON(wopcm->guc.base);
243 GEM_BUG_ON(wopcm->guc.size);
244 GEM_BUG_ON(guc_fw_size >= wopcm->size);
245 GEM_BUG_ON(huc_fw_size >= wopcm->size);
246 GEM_BUG_ON(ctx_rsvd + WOPCM_RESERVED_SIZE >= wopcm->size);
253 "GuC WOPCM is already locked [%uK, %uK)\n",
260 * Aligned value of guc_wopcm_base will determine available WOPCM space
268 * correct. Formal check of whole WOPCM layout will be done below.
270 guc_wopcm_base = min(guc_wopcm_base, wopcm->size - ctx_rsvd);
272 /* Aligned remainings of usable WOPCM space can be assigned to GuC. */
273 guc_wopcm_size = wopcm->size - ctx_rsvd - guc_wopcm_base;
276 DRM_DEV_DEBUG_DRIVER(i915->drm.dev, "Calculated GuC WOPCM [%uK, %uK)\n",
280 if (__check_layout(i915, wopcm->size, guc_wopcm_base, guc_wopcm_size,
282 wopcm->guc.base = guc_wopcm_base;
283 wopcm->guc.size = guc_wopcm_size;
284 GEM_BUG_ON(!wopcm->guc.base);
285 GEM_BUG_ON(!wopcm->guc.size);