124f90d66SChris Wilson /* SPDX-License-Identifier: MIT */ 22006058eSChris Wilson /* 32006058eSChris Wilson * Copyright © 2014 Intel Corporation 42006058eSChris Wilson */ 52006058eSChris Wilson 62006058eSChris Wilson #ifndef _INTEL_RENDERSTATE_H_ 72006058eSChris Wilson #define _INTEL_RENDERSTATE_H_ 82006058eSChris Wilson 92006058eSChris Wilson #include <linux/types.h> 10bfdf8b1dSMaarten Lankhorst #include "i915_gem.h" 11*5c43ec5dSThomas Hellström #include "i915_gem_ww.h" 122006058eSChris Wilson 132006058eSChris Wilson struct i915_request; 14bfdf8b1dSMaarten Lankhorst struct intel_context; 1542d10511SChris Wilson struct i915_vma; 162006058eSChris Wilson 172006058eSChris Wilson struct intel_renderstate_rodata { 182006058eSChris Wilson const u32 *reloc; 192006058eSChris Wilson const u32 *batch; 202006058eSChris Wilson const u32 batch_items; 212006058eSChris Wilson }; 222006058eSChris Wilson 232006058eSChris Wilson #define RO_RENDERSTATE(_g) \ 242006058eSChris Wilson const struct intel_renderstate_rodata gen ## _g ## _null_state = { \ 252006058eSChris Wilson .reloc = gen ## _g ## _null_state_relocs, \ 262006058eSChris Wilson .batch = gen ## _g ## _null_state_batch, \ 272006058eSChris Wilson .batch_items = sizeof(gen ## _g ## _null_state_batch)/4, \ 282006058eSChris Wilson } 292006058eSChris Wilson 302006058eSChris Wilson extern const struct intel_renderstate_rodata gen6_null_state; 312006058eSChris Wilson extern const struct intel_renderstate_rodata gen7_null_state; 322006058eSChris Wilson extern const struct intel_renderstate_rodata gen8_null_state; 332006058eSChris Wilson extern const struct intel_renderstate_rodata gen9_null_state; 342006058eSChris Wilson 3542d10511SChris Wilson struct intel_renderstate { 36bfdf8b1dSMaarten Lankhorst struct i915_gem_ww_ctx ww; 3742d10511SChris Wilson const struct intel_renderstate_rodata *rodata; 3842d10511SChris Wilson struct i915_vma *vma; 3942d10511SChris Wilson u32 batch_offset; 4042d10511SChris Wilson u32 batch_size; 4142d10511SChris Wilson u32 aux_offset; 4242d10511SChris Wilson u32 aux_size; 4342d10511SChris Wilson }; 4442d10511SChris Wilson 4542d10511SChris Wilson int intel_renderstate_init(struct intel_renderstate *so, 46bfdf8b1dSMaarten Lankhorst struct intel_context *ce); 4742d10511SChris Wilson int intel_renderstate_emit(struct intel_renderstate *so, 4842d10511SChris Wilson struct i915_request *rq); 49bfdf8b1dSMaarten Lankhorst void intel_renderstate_fini(struct intel_renderstate *so, 50bfdf8b1dSMaarten Lankhorst struct intel_context *ce); 512006058eSChris Wilson 522006058eSChris Wilson #endif /* _INTEL_RENDERSTATE_H_ */ 53