[Libva] [Libva-intel-driver PATCH 27/27] Add the override flag to assure that HEVC video command always uses BSD ring0 for SKL GT3 machine

Xiang, Haihao haihao.xiang at intel.com
Wed Nov 19 07:05:42 PST 2014


From: Zhao Yakui <yakui.zhao at intel.com>

The SKL GT3 machine has two BSD video rings,which can dispatch the video
command.But the HEVC command is an exception, which can't be handled by
the second BSD video ring. So we need to assure that the HEVC command always
uses the first BSD video ring.

Reviewed-by: Xiang Haihao <haihao.xiang at intel.com>
Signed-off-by: Zhao Yakui <yakui.zhao at intel.com>
---
 src/gen9_mfd.c     |  6 +++++-
 src/intel_driver.c | 15 ++++++++++++++-
 src/intel_driver.h |  1 +
 3 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/src/gen9_mfd.c b/src/gen9_mfd.c
index 03ae052..68e3ffc 100644
--- a/src/gen9_mfd.c
+++ b/src/gen9_mfd.c
@@ -859,6 +859,7 @@ gen9_hcpd_hevc_decode_picture(VADriverContextP ctx,
                               struct gen9_hcpd_context *gen9_hcpd_context)
 {
     VAStatus vaStatus;
+    struct i965_driver_data *i965 = i965_driver_data(ctx);
     struct intel_batchbuffer *batch = gen9_hcpd_context->base.batch;
     VAPictureParameterBufferHEVC *pic_param;
     VASliceParameterBufferHEVC *slice_param, *next_slice_param, *next_slice_group_param;
@@ -873,7 +874,10 @@ gen9_hcpd_hevc_decode_picture(VADriverContextP ctx,
     assert(decode_state->pic_param && decode_state->pic_param->buffer);
     pic_param = (VAPictureParameterBufferHEVC *)decode_state->pic_param->buffer;
 
-    intel_batchbuffer_start_atomic_bcs(batch, 0x1000);
+    if (i965->intel.has_bsd2)
+        intel_batchbuffer_start_atomic_bcs_override(batch, 0x1000, BSD_RING0);
+    else
+        intel_batchbuffer_start_atomic_bcs(batch, 0x1000);
     intel_batchbuffer_emit_mi_flush(batch);
 
     gen9_hcpd_pipe_mode_select(ctx, decode_state, HCP_CODEC_HEVC, gen9_hcpd_context);
diff --git a/src/intel_driver.c b/src/intel_driver.c
index 994e64c..2e6fae3 100644
--- a/src/intel_driver.c
+++ b/src/intel_driver.c
@@ -36,6 +36,14 @@
 #include "intel_driver.h"
 uint32_t g_intel_debug_option_flags = 0;
 
+#ifdef I915_PARAM_HAS_BSD2
+#define LOCAL_I915_PARAM_HAS_BSD2 I915_PARAM_HAS_BSD2
+#endif
+
+#ifndef LOCAL_I915_PARAM_HAS_BSD2
+#define LOCAL_I915_PARAM_HAS_BSD2	30
+#endif
+
 static Bool
 intel_driver_get_param(struct intel_driver_data *intel, int param, int *value)
 {
@@ -77,6 +85,7 @@ intel_driver_init(VADriverContextP ctx)
     struct drm_state * const drm_state = (struct drm_state *)ctx->drm_state;
     int has_exec2 = 0, has_bsd = 0, has_blt = 0, has_vebox = 0;
     char *env_str = NULL;
+    int ret_value = 0;
 
     g_intel_debug_option_flags = 0;
     if ((env_str = getenv("VA_INTEL_DEBUG")))
@@ -115,7 +124,11 @@ intel_driver_init(VADriverContextP ctx)
         intel->has_blt = has_blt;
     if (intel_driver_get_param(intel, I915_PARAM_HAS_VEBOX, &has_vebox))
         intel->has_vebox = !!has_vebox;
-   
+
+    intel->has_bsd2 = 0;
+    if (intel_driver_get_param(intel, LOCAL_I915_PARAM_HAS_BSD2, &ret_value))
+        intel->has_bsd2 = !!ret_value;
+
     intel_driver_get_revid(intel, &intel->revision);
     intel_memman_init(intel);
     return true;
diff --git a/src/intel_driver.h b/src/intel_driver.h
index 164e55a..f2a991e 100644
--- a/src/intel_driver.h
+++ b/src/intel_driver.h
@@ -155,6 +155,7 @@ struct intel_driver_data
     unsigned int has_bsd    : 1; /* Flag: has bitstream decoder for H.264? */
     unsigned int has_blt    : 1; /* Flag: has BLT unit? */
     unsigned int has_vebox  : 1; /* Flag: has VEBOX unit */
+    unsigned int has_bsd2   : 1; /* Flag: has the second BSD video ring unit */
 
     const struct intel_device_info *device_info;
 };
-- 
1.9.1



More information about the Libva mailing list