diff options
author | Zhao Yakui <yakui.zhao@intel.com> | 2016-05-24 08:00:30 -0400 |
---|---|---|
committer | Xiang, Haihao <haihao.xiang@intel.com> | 2016-05-26 12:54:42 +0800 |
commit | 36a3e77037a4457c7595b733810bfd37c992b004 (patch) | |
tree | 6d5e2eba3372d418aa5d018ed3c9ccd772f50f92 | |
parent | 1984e3bbfe6a3d06fa045f7f2cf7bceb0a49695b (diff) |
Use the buffer allocated externally to configure dynamic state for gpe_context on Gen8+
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Reviewed-by: Sean V Kelley <sean.v.kelley@intel.com>
-rw-r--r-- | src/i965_gpe_utils.c | 20 | ||||
-rw-r--r-- | src/i965_gpe_utils.h | 13 |
2 files changed, 33 insertions, 0 deletions
diff --git a/src/i965_gpe_utils.c b/src/i965_gpe_utils.c index bcf5dcf..7f0f86e 100644 --- a/src/i965_gpe_utils.c +++ b/src/i965_gpe_utils.c @@ -1571,3 +1571,23 @@ gen9_gpe_mi_batch_buffer_start(VADriverContextP ctx, I915_GEM_DOMAIN_RENDER | I915_GEM_DOMAIN_INSTRUCTION, 0, params->offset); } + +void +gen8_gpe_context_set_dynamic_buffer(VADriverContextP ctx, + struct i965_gpe_context *gpe_context, + struct gpe_dynamic_state_parameter *ds) +{ + if (!ds->bo || !gpe_context) + return; + + dri_bo_unreference(gpe_context->dynamic_state.bo); + gpe_context->dynamic_state.bo = ds->bo; + dri_bo_reference(gpe_context->dynamic_state.bo); + gpe_context->dynamic_state.bo_size = ds->bo_size; + + gpe_context->curbe_offset = ds->curbe_offset; + gpe_context->idrt_offset = ds->idrt_offset; + gpe_context->sampler_offset = ds->sampler_offset; + + return; +} diff --git a/src/i965_gpe_utils.h b/src/i965_gpe_utils.h index f3164b4..07d1ae3 100644 --- a/src/i965_gpe_utils.h +++ b/src/i965_gpe_utils.h @@ -64,6 +64,15 @@ struct i965_gpe_resource uint32_t y_cb_offset; }; +struct gpe_dynamic_state_parameter +{ + dri_bo *bo; + int bo_size; + unsigned int curbe_offset; + unsigned int idrt_offset; + unsigned int sampler_offset; +}; + struct i965_gpe_context { struct { @@ -295,6 +304,10 @@ extern void gen8_gpe_media_chroma_surface_setup(VADriverContextP ctx, void gen8_gpe_pipeline_setup(VADriverContextP ctx, struct i965_gpe_context *gpe_context, struct intel_batchbuffer *batch); +extern void +gen8_gpe_context_set_dynamic_buffer(VADriverContextP ctx, + struct i965_gpe_context *gpe_context, + struct gpe_dynamic_state_parameter *ds); void gen8_gpe_context_destroy(struct i965_gpe_context *gpe_context); |