• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

hardware/intel/intel-driver


Commit MetaInfo

Révision8bb367b05ac09b3358cb8defe2a39d5ba98a4a78 (tree)
l'heure2015-09-06 16:13:58
AuteurZhao Yakui <yakui.zhao@inte...>
CommiterXiang, Haihao

Message de Log

Call wrapped driver to handle config/context related with VP9 decoding

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Sean V Kelley <seanvk@posteo.de>
(cherry picked from commit 815d17f944b13ebc1eca62572dbec0c49ea01999)

Change Summary

Modification

--- a/src/i965_drv_video.c
+++ b/src/i965_drv_video.c
@@ -421,6 +421,8 @@ va_enc_packed_type_to_idx(int packed_type)
421421 return idx;
422422 }
423423
424+#define CALL_VTABLE(vawr, status, param) status = (vawr->vtable->param)
425+
424426 VAStatus
425427 i965_QueryConfigProfiles(VADriverContextP ctx,
426428 VAProfile *profile_list, /* out */
@@ -901,6 +903,22 @@ i965_CreateConfig(VADriverContextP ctx,
901903 vaStatus = VA_STATUS_ERROR_UNSUPPORTED_RT_FORMAT;
902904 }
903905
906+ if ((vaStatus == VA_STATUS_SUCCESS) &&
907+ (profile == VAProfileVP9Profile0)) {
908+
909+ if (i965->wrapper_pdrvctx) {
910+ VAGenericID wrapper_config;
911+
912+ CALL_VTABLE(i965->wrapper_pdrvctx, vaStatus,
913+ vaCreateConfig(i965->wrapper_pdrvctx, profile,
914+ entrypoint, attrib_list,
915+ num_attribs, &wrapper_config));
916+
917+ if (vaStatus == VA_STATUS_SUCCESS)
918+ obj_config->wrapper_config = wrapper_config;
919+ }
920+ }
921+
904922 /* Error recovery */
905923 if (VA_STATUS_SUCCESS != vaStatus) {
906924 i965_destroy_config(&i965->config_heap, (struct object_base *)obj_config);
@@ -923,6 +941,14 @@ i965_DestroyConfig(VADriverContextP ctx, VAConfigID config_id)
923941 return vaStatus;
924942 }
925943
944+ if ((obj_config->wrapper_config != VA_INVALID_ID) &&
945+ i965->wrapper_pdrvctx) {
946+ CALL_VTABLE(i965->wrapper_pdrvctx, vaStatus,
947+ vaDestroyConfig(i965->wrapper_pdrvctx,
948+ obj_config->wrapper_config));
949+ obj_config->wrapper_config = VA_INVALID_ID;
950+ }
951+
926952 i965_destroy_config(&i965->config_heap, (struct object_base *)obj_config);
927953 return VA_STATUS_SUCCESS;
928954 }
@@ -1948,6 +1974,30 @@ i965_CreateContext(VADriverContextP ctx,
19481974 return VA_STATUS_ERROR_INVALID_CONFIG;
19491975 obj_context->codec_state.base.chroma_formats = attrib->value;
19501976
1977+ if (obj_config->wrapper_config != VA_INVALID_ID) {
1978+ /* The wrapper_pdrvctx should exist when wrapper_config is valid.
1979+ * So it won't check i965->wrapper_pdrvctx again.
1980+ * Fixme if it is incorrect.
1981+ */
1982+ VAGenericID wrapper_context;
1983+
1984+ /*
1985+ * The render_surface is not passed when calling
1986+ * vaCreateContext.
1987+ * If it is needed, we must get the wrapped surface
1988+ * for the corresponding Surface_list.
1989+ * So the wrapped surface conversion is deferred.
1990+ */
1991+ CALL_VTABLE(i965->wrapper_pdrvctx, vaStatus,
1992+ vaCreateContext(i965->wrapper_pdrvctx,
1993+ obj_config->wrapper_config,
1994+ picture_width, picture_height,
1995+ flag, NULL, 0,
1996+ &wrapper_context));
1997+
1998+ if (vaStatus == VA_STATUS_SUCCESS)
1999+ obj_context->wrapper_context = wrapper_context;
2000+ }
19512001 /* Error recovery */
19522002 if (VA_STATUS_SUCCESS != vaStatus) {
19532003 i965_destroy_context(&i965->context_heap, (struct object_base *)obj_context);
@@ -1963,15 +2013,25 @@ i965_DestroyContext(VADriverContextP ctx, VAContextID context)
19632013 {
19642014 struct i965_driver_data *i965 = i965_driver_data(ctx);
19652015 struct object_context *obj_context = CONTEXT(context);
2016+ VAStatus va_status = VA_STATUS_SUCCESS;
19662017
19672018 ASSERT_RET(obj_context, VA_STATUS_ERROR_INVALID_CONTEXT);
19682019
19692020 if (i965->current_context_id == context)
19702021 i965->current_context_id = VA_INVALID_ID;
19712022
2023+ if ((obj_context->wrapper_context != VA_INVALID_ID) &&
2024+ i965->wrapper_pdrvctx) {
2025+ CALL_VTABLE(i965->wrapper_pdrvctx, va_status,
2026+ vaDestroyContext(i965->wrapper_pdrvctx,
2027+ obj_context->wrapper_context));
2028+
2029+ obj_context->wrapper_context = VA_INVALID_ID;
2030+ }
2031+
19722032 i965_destroy_context(&i965->context_heap, (struct object_base *)obj_context);
19732033
1974- return VA_STATUS_SUCCESS;
2034+ return va_status;
19752035 }
19762036
19772037 static void