Discussion:
[Libva-intel-driver][PATCH 1/2] Check whether there is a fully loaded HuC firmware
(too old to reply)
Xiang, Haihao
2016-09-28 00:42:00 UTC
Permalink
Signed-off-by: Xiang, Haihao <***@intel.com>
---
src/intel_driver.c | 12 ++++++++++++
src/intel_driver.h | 1 +
2 files changed, 13 insertions(+)

diff --git a/src/intel_driver.c b/src/intel_driver.c
index 96c1994..bb19401 100644
--- a/src/intel_driver.c
+++ b/src/intel_driver.c
@@ -44,6 +44,12 @@ uint32_t g_intel_debug_option_flags = 0;
#define LOCAL_I915_PARAM_HAS_BSD2 30
#endif

+#ifdef I915_PARAM_HAS_HUC
+#define LOCAL_I915_PARAM_HAS_HUC I915_PARAM_HAS_HUC
+#else
+#define LOCAL_I915_PARAM_HAS_HUC 42
+#endif
+
static Bool
intel_driver_get_param(struct intel_driver_data *intel, int param, int *value)
{
@@ -130,6 +136,12 @@ intel_driver_init(VADriverContextP ctx)
if (intel_driver_get_param(intel, LOCAL_I915_PARAM_HAS_BSD2, &ret_value))
intel->has_bsd2 = !!ret_value;

+ intel->has_huc = 0;
+ ret_value = 0;
+
+ if (intel_driver_get_param(intel, LOCAL_I915_PARAM_HAS_HUC, &ret_value))
+ intel->has_huc = !!ret_value;
+
intel_driver_get_revid(intel, &intel->revision);
return true;
}
diff --git a/src/intel_driver.h b/src/intel_driver.h
index c9a80c8..dcdc03b 100644
--- a/src/intel_driver.h
+++ b/src/intel_driver.h
@@ -181,6 +181,7 @@ struct intel_driver_data
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 */
+ unsigned int has_huc : 1; /* Flag: has a fully loaded HuC firmware? */

const struct intel_device_info *device_info;
};
--
1.9.1
Xiang, Haihao
2016-09-28 00:42:01 UTC
Permalink
CBR and VBR for low power encode depend on the fully loaded HuC firmware.

Signed-off-by: Xiang, Haihao <***@intel.com>
---
src/i965_device_info.c | 11 +++++++++++
1 file changed, 11 insertions(+)

diff --git a/src/i965_device_info.c b/src/i965_device_info.c
index dc16197..4db6c51 100644
--- a/src/i965_device_info.c
+++ b/src/i965_device_info.c
@@ -319,6 +319,8 @@ static struct hw_codec_info chv_hw_codec_info = {
},
};

+static void gen9_hw_codec_preinit(VADriverContextP ctx, struct hw_codec_info *codec_info);
+
extern struct hw_context *gen9_enc_hw_context_init(VADriverContextP, struct object_config *);
extern void gen9_post_processing_context_init(VADriverContextP, void *, struct intel_batchbuffer *);
extern void gen9_max_resolution(struct i965_driver_data *, struct object_config *, int *, int *);
@@ -329,6 +331,7 @@ static struct hw_codec_info skl_hw_codec_info = {
.render_init = gen9_render_init,
.post_processing_context_init = gen9_post_processing_context_init,
.max_resolution = gen9_max_resolution,
+ .preinit_hw_codec = gen9_hw_codec_preinit,

.max_width = 4096, /* default. See max_resolution */
.max_height = 4096, /* default. See max_resolution */
@@ -869,3 +872,11 @@ static void gen7_hw_codec_preinit(VADriverContextP ctx, struct hw_codec_info *co
}
return;
}
+
+static void gen9_hw_codec_preinit(VADriverContextP ctx, struct hw_codec_info *codec_info)
+{
+ struct i965_driver_data *i965 = i965_driver_data(ctx);
+
+ if (i965->intel.has_huc && codec_info->has_lp_h264_encoding)
+ codec_info->lp_h264_brc_mode |= (VA_RC_CBR | VA_RC_VBR);
+}
--
1.9.1
Zhao Yakui
2016-09-28 01:12:34 UTC
Permalink
Post by Xiang, Haihao
CBR and VBR for low power encode depend on the fully loaded HuC firmware.
This looks good to me.

Add: Reviewed-by: Zhao Yakui <***@intel.com>

Thanks
Yakui
Post by Xiang, Haihao
---
src/i965_device_info.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/src/i965_device_info.c b/src/i965_device_info.c
index dc16197..4db6c51 100644
--- a/src/i965_device_info.c
+++ b/src/i965_device_info.c
@@ -319,6 +319,8 @@ static struct hw_codec_info chv_hw_codec_info = {
},
};
+static void gen9_hw_codec_preinit(VADriverContextP ctx, struct hw_codec_info *codec_info);
+
extern struct hw_context *gen9_enc_hw_context_init(VADriverContextP, struct object_config *);
extern void gen9_post_processing_context_init(VADriverContextP, void *, struct intel_batchbuffer *);
extern void gen9_max_resolution(struct i965_driver_data *, struct object_config *, int *, int *);
@@ -329,6 +331,7 @@ static struct hw_codec_info skl_hw_codec_info = {
.render_init = gen9_render_init,
.post_processing_context_init = gen9_post_processing_context_init,
.max_resolution = gen9_max_resolution,
+ .preinit_hw_codec = gen9_hw_codec_preinit,
.max_width = 4096, /* default. See max_resolution */
.max_height = 4096, /* default. See max_resolution */
@@ -869,3 +872,11 @@ static void gen7_hw_codec_preinit(VADriverContextP ctx, struct hw_codec_info *co
}
return;
}
+
+static void gen9_hw_codec_preinit(VADriverContextP ctx, struct hw_codec_info *codec_info)
+{
+ struct i965_driver_data *i965 = i965_driver_data(ctx);
+
+ if (i965->intel.has_huc&& codec_info->has_lp_h264_encoding)
one space can be added.
Post by Xiang, Haihao
+ codec_info->lp_h264_brc_mode |= (VA_RC_CBR | VA_RC_VBR);
+}
Zhao Yakui
2016-09-28 00:53:21 UTC
Permalink
This looks good to me.

Add: Reviewed-by: Zhao Yakui <***@intel.com>

Thanks
Yakui
Post by Xiang, Haihao
---
src/intel_driver.c | 12 ++++++++++++
src/intel_driver.h | 1 +
2 files changed, 13 insertions(+)
diff --git a/src/intel_driver.c b/src/intel_driver.c
index 96c1994..bb19401 100644
--- a/src/intel_driver.c
+++ b/src/intel_driver.c
@@ -44,6 +44,12 @@ uint32_t g_intel_debug_option_flags = 0;
#define LOCAL_I915_PARAM_HAS_BSD2 30
#endif
+#ifdef I915_PARAM_HAS_HUC
+#define LOCAL_I915_PARAM_HAS_HUC I915_PARAM_HAS_HUC
+#else
+#define LOCAL_I915_PARAM_HAS_HUC 42
+#endif
+
static Bool
intel_driver_get_param(struct intel_driver_data *intel, int param, int *value)
{
@@ -130,6 +136,12 @@ intel_driver_init(VADriverContextP ctx)
if (intel_driver_get_param(intel, LOCAL_I915_PARAM_HAS_BSD2,&ret_value))
intel->has_bsd2 = !!ret_value;
+ intel->has_huc = 0;
+ ret_value = 0;
+
+ if (intel_driver_get_param(intel, LOCAL_I915_PARAM_HAS_HUC,&ret_value))
+ intel->has_huc = !!ret_value;
+
intel_driver_get_revid(intel,&intel->revision);
return true;
}
diff --git a/src/intel_driver.h b/src/intel_driver.h
index c9a80c8..dcdc03b 100644
--- a/src/intel_driver.h
+++ b/src/intel_driver.h
@@ -181,6 +181,7 @@ struct intel_driver_data
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 */
+ unsigned int has_huc : 1; /* Flag: has a fully loaded HuC firmware? */
const struct intel_device_info *device_info;
};
Sean V Kelley
2016-09-28 20:45:54 UTC
Permalink
lgtm, applied.

Now we just need the kernel patches merged and we should be good.

Thanks,

Sean
---
src/intel_driver.c | 12 ++++++++++++
src/intel_driver.h | 1 +
2 files changed, 13 insertions(+)

diff --git a/src/intel_driver.c b/src/intel_driver.c
index 96c1994..bb19401 100644
--- a/src/intel_driver.c
+++ b/src/intel_driver.c
@@ -44,6 +44,12 @@ uint32_t g_intel_debug_option_flags = 0;
#define LOCAL_I915_PARAM_HAS_BSD2 30
#endif

+#ifdef I915_PARAM_HAS_HUC
+#define LOCAL_I915_PARAM_HAS_HUC I915_PARAM_HAS_HUC
+#else
+#define LOCAL_I915_PARAM_HAS_HUC 42
+#endif
+
static Bool
intel_driver_get_param(struct intel_driver_data *intel, int param, int *value)
{
@@ -130,6 +136,12 @@ intel_driver_init(VADriverContextP ctx)
if (intel_driver_get_param(intel, LOCAL_I915_PARAM_HAS_BSD2, &ret_value))
intel->has_bsd2 = !!ret_value;

+ intel->has_huc = 0;
+ ret_value = 0;
+
+ if (intel_driver_get_param(intel, LOCAL_I915_PARAM_HAS_HUC, &ret_value))
+ intel->has_huc = !!ret_value;
+
intel_driver_get_revid(intel, &intel->revision);
return true;
}
diff --git a/src/intel_driver.h b/src/intel_driver.h
index c9a80c8..dcdc03b 100644
--- a/src/intel_driver.h
+++ b/src/intel_driver.h
@@ -181,6 +181,7 @@ struct intel_driver_data
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 */
+ unsigned int has_huc : 1; /* Flag: has a fully loaded HuC firmware? */

const struct intel_device_info *device_info;
};
Daniel Vetter
2017-01-23 06:04:09 UTC
Permalink
Post by Sean V Kelley
lgtm, applied.
Now we just need the kernel patches merged and we should be good.
Those just landed, you're good to go.

Cheers, Daniel
Post by Sean V Kelley
Thanks,
Sean
---
src/intel_driver.c | 12 ++++++++++++
src/intel_driver.h | 1 +
2 files changed, 13 insertions(+)
diff --git a/src/intel_driver.c b/src/intel_driver.c
index 96c1994..bb19401 100644
--- a/src/intel_driver.c
+++ b/src/intel_driver.c
@@ -44,6 +44,12 @@ uint32_t g_intel_debug_option_flags = 0;
#define LOCAL_I915_PARAM_HAS_BSD2 30
#endif
+#ifdef I915_PARAM_HAS_HUC
+#define LOCAL_I915_PARAM_HAS_HUC I915_PARAM_HAS_HUC
+#else
+#define LOCAL_I915_PARAM_HAS_HUC 42
+#endif
+
static Bool
intel_driver_get_param(struct intel_driver_data *intel, int param, int *value)
{
@@ -130,6 +136,12 @@ intel_driver_init(VADriverContextP ctx)
if (intel_driver_get_param(intel, LOCAL_I915_PARAM_HAS_BSD2, &ret_value))
intel->has_bsd2 = !!ret_value;
+ intel->has_huc = 0;
+ ret_value = 0;
+
+ if (intel_driver_get_param(intel, LOCAL_I915_PARAM_HAS_HUC, &ret_value))
+ intel->has_huc = !!ret_value;
+
intel_driver_get_revid(intel, &intel->revision);
return true;
}
diff --git a/src/intel_driver.h b/src/intel_driver.h
index c9a80c8..dcdc03b 100644
--- a/src/intel_driver.h
+++ b/src/intel_driver.h
@@ -181,6 +181,7 @@ struct intel_driver_data
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 */
+ unsigned int has_huc : 1; /* Flag: has a fully loaded HuC firmware? */
const struct intel_device_info *device_info;
};
_______________________________________________
Libva mailing list
https://lists.freedesktop.org/mailman/listinfo/libva
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
Xiang, Haihao
2017-01-24 03:26:36 UTC
Permalink
Post by Daniel Vetter
Post by Sean V Kelley
lgtm, applied.
Now we just need the kernel patches merged and we should be good.
Those just landed, you're good to go.
Thanks for the info. Besides the kernel patches, we need the HuC firmware too,
hope the firmware can be released soon.

Thanks
Haihao
Post by Daniel Vetter
Cheers, Daniel
Post by Sean V Kelley
Thanks,
Sean
---
 src/intel_driver.c | 12 ++++++++++++
 src/intel_driver.h |  1 +
 2 files changed, 13 insertions(+)
diff --git a/src/intel_driver.c b/src/intel_driver.c
index 96c1994..bb19401 100644
--- a/src/intel_driver.c
+++ b/src/intel_driver.c
@@ -44,6 +44,12 @@ uint32_t g_intel_debug_option_flags = 0;
 #define LOCAL_I915_PARAM_HAS_BSD2 30
 #endif
 
+#ifdef I915_PARAM_HAS_HUC
+#define LOCAL_I915_PARAM_HAS_HUC I915_PARAM_HAS_HUC
+#else
+#define LOCAL_I915_PARAM_HAS_HUC 42
+#endif
+
 static Bool
 intel_driver_get_param(struct intel_driver_data *intel, int param, int
*value)
 {
@@ -130,6 +136,12 @@ intel_driver_init(VADriverContextP ctx)
     if (intel_driver_get_param(intel, LOCAL_I915_PARAM_HAS_BSD2,
&ret_value))
         intel->has_bsd2 = !!ret_value;
 
+    intel->has_huc = 0;
+    ret_value = 0;
+
+    if (intel_driver_get_param(intel, LOCAL_I915_PARAM_HAS_HUC,
&ret_value))
+        intel->has_huc = !!ret_value;
+
     intel_driver_get_revid(intel, &intel->revision);
     return true;
 }
diff --git a/src/intel_driver.h b/src/intel_driver.h
index c9a80c8..dcdc03b 100644
--- a/src/intel_driver.h
+++ b/src/intel_driver.h
@@ -181,6 +181,7 @@ struct intel_driver_data
     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 */
+    unsigned int has_huc    : 1; /* Flag: has a fully loaded HuC firmware?
*/
 
     const struct intel_device_info *device_info;
 };
_______________________________________________
Libva mailing list
https://lists.freedesktop.org/mailman/listinfo/libva
Loading...