[Libva] [LIBVA-INTEL-DRIVER][PATCH 04/12] Use the buffer allocated externally to configure dynamic state for gpe_context on Gen8+

Zhao Yakui yakui.zhao at intel.com
Tue May 24 12:00:30 UTC 2016


Signed-off-by: Zhao Yakui <yakui.zhao at intel.com>
Reviewed-by: Sean V Kelley <sean.v.kelley at intel.com>
---
 src/i965_gpe_utils.c | 21 +++++++++++++++++++++
 src/i965_gpe_utils.h | 13 +++++++++++++
 2 files changed, 34 insertions(+)

diff --git a/src/i965_gpe_utils.c b/src/i965_gpe_utils.c
index bcf5dcf..c2772ad 100644
--- a/src/i965_gpe_utils.c
+++ b/src/i965_gpe_utils.c
@@ -1571,3 +1571,24 @@ 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);
-- 
1.8.2.1



More information about the Libva mailing list