Lines Matching +full:pre +full:- +full:programmed

1 // SPDX-License-Identifier: MIT
3 * Copyright © 2017-2019 Intel Corporation
26 * | Size +--------------------+
28 * | | +--------------------+
30 * | | +------------------- +
34 * | +------------------- + <== HuC Firmware Top
73 * intel_wopcm_init_early() - Early initialization of the WOPCM.
81 struct drm_i915_private *i915 = gt->i915; in intel_wopcm_init_early()
87 wopcm->size = GEN11_WOPCM_SIZE; in intel_wopcm_init_early()
89 wopcm->size = GEN9_WOPCM_SIZE; in intel_wopcm_init_early()
91 drm_dbg(&i915->drm, "WOPCM: %uK\n", wopcm->size / 1024); in intel_wopcm_init_early()
116 (guc_wopcm_size - offset) < sizeof(u32)) { in gen9_check_dword_gap()
117 drm_err(&i915->drm, in gen9_check_dword_gap()
135 if (huc_fw_size > guc_wopcm_size - GUC_WOPCM_RESERVED) { in gen9_check_huc_fw_fits()
136 drm_err(&i915->drm, "WOPCM: no space for %s: %uK < %uK\n", in gen9_check_huc_fw_fits()
138 (guc_wopcm_size - GUC_WOPCM_RESERVED) / SZ_1K, in gen9_check_huc_fw_fits()
165 struct drm_i915_private *i915 = gt->i915; in __check_layout()
169 size = wopcm_size - ctx_rsvd; in __check_layout()
171 drm_err(&i915->drm, in __check_layout()
180 drm_err(&i915->drm, "WOPCM: no space for %s: %uK < %uK\n", in __check_layout()
186 if (intel_uc_supports_huc(&gt->uc)) { in __check_layout()
189 drm_err(&i915->drm, "WOPCM: no space for %s: %uK < %uK\n", in __check_layout()
217 if (!HAS_GUC_DEPRIVILEGE(uncore->i915)) in __wopcm_regs_writable()
224 * intel_wopcm_init() - Initialize the WOPCM structure.
236 struct drm_i915_private *i915 = gt->i915; in intel_wopcm_init()
237 u32 guc_fw_size = intel_uc_fw_get_upload_size(&gt->uc.guc.fw); in intel_wopcm_init()
238 u32 huc_fw_size = intel_uc_fw_get_upload_size(&gt->uc.huc.fw); in intel_wopcm_init()
240 u32 wopcm_size = wopcm->size; in intel_wopcm_init()
248 GEM_BUG_ON(wopcm->guc.base); in intel_wopcm_init()
249 GEM_BUG_ON(wopcm->guc.size); in intel_wopcm_init()
257 if (__wopcm_regs_locked(gt->uncore, &guc_wopcm_base, &guc_wopcm_size)) { in intel_wopcm_init()
258 drm_dbg(&i915->drm, "GuC WOPCM is already locked [%uK, %uK)\n", in intel_wopcm_init()
266 * writable from i915 and are instead pre-programmed by the in intel_wopcm_init()
269 * programmed values make sense and disable the relevant check in intel_wopcm_init()
272 * were pre-programmed with an invalid value, we will still in intel_wopcm_init()
275 if (!__wopcm_regs_writable(gt->uncore)) in intel_wopcm_init()
287 * pre-locked and therefore we don't have to do the math ourselves. in intel_wopcm_init()
289 if (unlikely(i915->media_gt)) { in intel_wopcm_init()
290 drm_err(&i915->drm, "Unlocked WOPCM regs with media GT\n"); in intel_wopcm_init()
305 guc_wopcm_base = min(guc_wopcm_base, wopcm_size - ctx_rsvd); in intel_wopcm_init()
308 guc_wopcm_size = wopcm_size - ctx_rsvd - guc_wopcm_base; in intel_wopcm_init()
311 drm_dbg(&i915->drm, "Calculated GuC WOPCM [%uK, %uK)\n", in intel_wopcm_init()
317 wopcm->guc.base = guc_wopcm_base; in intel_wopcm_init()
318 wopcm->guc.size = guc_wopcm_size; in intel_wopcm_init()
319 GEM_BUG_ON(!wopcm->guc.base); in intel_wopcm_init()
320 GEM_BUG_ON(!wopcm->guc.size); in intel_wopcm_init()