Lines Matching refs:so
69 static int render_state_setup(struct intel_renderstate *so, in render_state_setup() argument
72 const struct intel_renderstate_rodata *rodata = so->rodata; in render_state_setup()
77 d = i915_gem_object_pin_map(so->vma->obj, I915_MAP_WB); in render_state_setup()
85 u64 r = s + so->vma->node.start; in render_state_setup()
107 so->batch_offset = i915_ggtt_offset(so->vma); in render_state_setup()
108 so->batch_size = rodata->batch_items * sizeof(u32); in render_state_setup()
113 so->aux_offset = i * sizeof(u32); in render_state_setup()
143 so->aux_size = i * sizeof(u32) - so->aux_offset; in render_state_setup()
144 so->aux_offset += so->batch_offset; in render_state_setup()
149 so->aux_size = ALIGN(so->aux_size, 8); in render_state_setup()
153 __i915_gem_object_flush_map(so->vma->obj, 0, i * sizeof(u32)); in render_state_setup()
154 __i915_gem_object_release_map(so->vma->obj); in render_state_setup()
160 int intel_renderstate_init(struct intel_renderstate *so, in intel_renderstate_init() argument
167 memset(so, 0, sizeof(*so)); in intel_renderstate_init()
169 so->rodata = render_state_get_rodata(engine); in intel_renderstate_init()
170 if (so->rodata) { in intel_renderstate_init()
171 if (so->rodata->batch_items * 4 > PAGE_SIZE) in intel_renderstate_init()
178 so->vma = i915_vma_instance(obj, &engine->gt->ggtt->vm, NULL); in intel_renderstate_init()
179 if (IS_ERR(so->vma)) { in intel_renderstate_init()
180 err = PTR_ERR(so->vma); in intel_renderstate_init()
185 i915_gem_ww_ctx_init(&so->ww, true); in intel_renderstate_init()
187 err = intel_context_pin_ww(ce, &so->ww); in intel_renderstate_init()
192 if (!err && !so->rodata) in intel_renderstate_init()
195 err = i915_gem_object_lock(so->vma->obj, &so->ww); in intel_renderstate_init()
199 err = i915_vma_pin(so->vma, 0, 0, PIN_GLOBAL | PIN_HIGH); in intel_renderstate_init()
203 err = render_state_setup(so, engine->i915); in intel_renderstate_init()
210 i915_vma_unpin(so->vma); in intel_renderstate_init()
215 err = i915_gem_ww_ctx_backoff(&so->ww); in intel_renderstate_init()
219 i915_gem_ww_ctx_fini(&so->ww); in intel_renderstate_init()
223 so->vma = NULL; in intel_renderstate_init()
227 int intel_renderstate_emit(struct intel_renderstate *so, in intel_renderstate_emit() argument
233 if (!so->vma) in intel_renderstate_emit()
236 err = i915_request_await_object(rq, so->vma->obj, false); in intel_renderstate_emit()
238 err = i915_vma_move_to_active(so->vma, rq, 0); in intel_renderstate_emit()
243 so->batch_offset, so->batch_size, in intel_renderstate_emit()
248 if (so->aux_size > 8) { in intel_renderstate_emit()
250 so->aux_offset, so->aux_size, in intel_renderstate_emit()
259 void intel_renderstate_fini(struct intel_renderstate *so, in intel_renderstate_fini() argument
262 if (so->vma) { in intel_renderstate_fini()
263 i915_vma_unpin(so->vma); in intel_renderstate_fini()
264 i915_vma_close(so->vma); in intel_renderstate_fini()
268 i915_gem_ww_ctx_fini(&so->ww); in intel_renderstate_fini()
270 if (so->vma) in intel_renderstate_fini()
271 i915_gem_object_put(so->vma->obj); in intel_renderstate_fini()