Fix the interface for internal context initialization
authorXiang, Haihao <haihao.xiang@intel.com>
Wed, 22 Feb 2012 02:33:28 +0000 (10:33 +0800)
committerXiang, Haihao <haihao.xiang@intel.com>
Wed, 22 Feb 2012 02:33:28 +0000 (10:33 +0800)
Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
src/gen6_mfd.c
src/gen7_mfd.c
src/i965_drv_video.c
src/i965_drv_video.h
src/i965_encoder.c
src/i965_media.c
src/i965_post_processing.c

index 4e7d307..a826d1e 100644 (file)
@@ -2030,7 +2030,7 @@ gen6_mfd_context_destroy(void *hw_context)
 }
 
 struct hw_context *
-gen6_dec_hw_context_init(VADriverContextP ctx, VAProfile profile)
+gen6_dec_hw_context_init(VADriverContextP ctx, struct object_config *obj_config)
 {
     struct intel_driver_data *intel = intel_driver_data(ctx);
     struct gen6_mfd_context *gen6_mfd_context = calloc(1, sizeof(struct gen6_mfd_context));
index 42be942..cd7ffd8 100644 (file)
@@ -2796,7 +2796,7 @@ gen7_mfd_context_destroy(void *hw_context)
 }
 
 struct hw_context *
-gen7_dec_hw_context_init(VADriverContextP ctx, VAProfile profile)
+gen7_dec_hw_context_init(VADriverContextP ctx, struct object_config *obj_config)
 {
     struct intel_driver_data *intel = intel_driver_data(ctx);
     struct gen7_mfd_context *gen7_mfd_context = calloc(1, sizeof(struct gen7_mfd_context));
@@ -2813,7 +2813,7 @@ gen7_dec_hw_context_init(VADriverContextP ctx, VAProfile profile)
 
     gen7_mfd_context->jpeg_wa_surface_id = VA_INVALID_SURFACE;
 
-    switch (profile) {
+    switch (obj_config->profile) {
     case VAProfileH264Baseline:
     case VAProfileH264Main:
     case VAProfileH264High:
index c41d35e..d662cab 100644 (file)
@@ -149,31 +149,31 @@ get_subpic_format(const VAImageFormat *va_format)
     return NULL;
 }
 
-extern struct hw_context *i965_proc_context_init(VADriverContextP, VAProfile);
-extern struct hw_context *g4x_dec_hw_context_init(VADriverContextP, VAProfile);
+extern struct hw_context *i965_proc_context_init(VADriverContextP, struct object_config *);
+extern struct hw_context *g4x_dec_hw_context_init(VADriverContextP, struct object_config *);
 static struct hw_codec_info g4x_hw_codec_info = {
     .dec_hw_context_init = g4x_dec_hw_context_init,
     .enc_hw_context_init = NULL,
     .proc_hw_context_init = NULL,
 };
 
-extern struct hw_context *ironlake_dec_hw_context_init(VADriverContextP, VAProfile);
+extern struct hw_context *ironlake_dec_hw_context_init(VADriverContextP, struct object_config *);
 static struct hw_codec_info ironlake_hw_codec_info = {
     .dec_hw_context_init = ironlake_dec_hw_context_init,
     .enc_hw_context_init = NULL,
     .proc_hw_context_init = i965_proc_context_init,
 };
 
-extern struct hw_context *gen6_dec_hw_context_init(VADriverContextP, VAProfile);
-extern struct hw_context *gen6_enc_hw_context_init(VADriverContextP, VAProfile);
+extern struct hw_context *gen6_dec_hw_context_init(VADriverContextP, struct object_config *);
+extern struct hw_context *gen6_enc_hw_context_init(VADriverContextP, struct object_config *);
 static struct hw_codec_info gen6_hw_codec_info = {
     .dec_hw_context_init = gen6_dec_hw_context_init,
     .enc_hw_context_init = gen6_enc_hw_context_init,
     .proc_hw_context_init = i965_proc_context_init,
 };
 
-extern struct hw_context *gen7_dec_hw_context_init(VADriverContextP, VAProfile);
-extern struct hw_context *gen7_enc_hw_context_init(VADriverContextP, VAProfile);
+extern struct hw_context *gen7_dec_hw_context_init(VADriverContextP, struct object_config *);
+extern struct hw_context *gen7_enc_hw_context_init(VADriverContextP, struct object_config *);
 static struct hw_codec_info gen7_hw_codec_info = {
     .dec_hw_context_init = gen7_dec_hw_context_init,
     .enc_hw_context_init = gen7_enc_hw_context_init,
@@ -987,7 +987,7 @@ i965_CreateContext(VADriverContextP ctx,
             memset(&obj_context->codec_state.proc, 0, sizeof(obj_context->codec_state.proc));
             obj_context->codec_state.proc.current_render_target = VA_INVALID_ID;
             assert(i965->codec_info->proc_hw_context_init);
-            obj_context->hw_context = i965->codec_info->proc_hw_context_init(ctx, obj_config->profile);
+            obj_context->hw_context = i965->codec_info->proc_hw_context_init(ctx, obj_config);
         } else if (VAEntrypointEncSlice == obj_config->entrypoint) { /*encode routin only*/
             obj_context->codec_type = CODEC_ENC;
             memset(&obj_context->codec_state.encode, 0, sizeof(obj_context->codec_state.encode));
@@ -996,7 +996,7 @@ i965_CreateContext(VADriverContextP ctx,
             obj_context->codec_state.encode.slice_params = calloc(obj_context->codec_state.encode.max_slice_params,
                                                                sizeof(*obj_context->codec_state.encode.slice_params));
             assert(i965->codec_info->enc_hw_context_init);
-            obj_context->hw_context = i965->codec_info->enc_hw_context_init(ctx, obj_config->profile);
+            obj_context->hw_context = i965->codec_info->enc_hw_context_init(ctx, obj_config);
         } else {
             obj_context->codec_type = CODEC_DEC;
             memset(&obj_context->codec_state.decode, 0, sizeof(obj_context->codec_state.decode));
@@ -1009,7 +1009,7 @@ i965_CreateContext(VADriverContextP ctx,
                                                               sizeof(*obj_context->codec_state.decode.slice_datas));
 
             assert(i965->codec_info->dec_hw_context_init);
-            obj_context->hw_context = i965->codec_info->dec_hw_context_init(ctx, obj_config->profile);
+            obj_context->hw_context = i965->codec_info->dec_hw_context_init(ctx, obj_config);
         }
     }
 
index 6a1ba8d..2622c23 100644 (file)
@@ -245,9 +245,9 @@ struct object_subpic
 
 struct hw_codec_info
 {
-    struct hw_context *(*dec_hw_context_init)(VADriverContextP, VAProfile);
-    struct hw_context *(*enc_hw_context_init)(VADriverContextP, VAProfile);
-    struct hw_context *(*proc_hw_context_init)(VADriverContextP, VAProfile);
+    struct hw_context *(*dec_hw_context_init)(VADriverContextP, struct object_config *);
+    struct hw_context *(*enc_hw_context_init)(VADriverContextP, struct object_config *);
+    struct hw_context *(*proc_hw_context_init)(VADriverContextP, struct object_config *);
 };
 
 
index 0723cbf..27b1a08 100644 (file)
@@ -149,7 +149,7 @@ intel_encoder_context_destroy(void *hw_context)
 }
 
 struct hw_context *
-gen6_enc_hw_context_init(VADriverContextP ctx, VAProfile profile)
+gen6_enc_hw_context_init(VADriverContextP ctx, struct object_config *obj_config)
 {
     struct intel_driver_data *intel = intel_driver_data(ctx);
     struct intel_encoder_context *encoder_context = calloc(1, sizeof(struct intel_encoder_context));
@@ -172,7 +172,7 @@ gen6_enc_hw_context_init(VADriverContextP ctx, VAProfile profile)
 }
 
 struct hw_context *
-gen7_enc_hw_context_init(VADriverContextP ctx, VAProfile profile)
+gen7_enc_hw_context_init(VADriverContextP ctx, struct object_config *obj_config)
 {
     struct intel_driver_data *intel = intel_driver_data(ctx);
     struct intel_encoder_context *encoder_context = calloc(1, sizeof(struct intel_encoder_context));
index f43feed..2b940c7 100644 (file)
@@ -321,7 +321,7 @@ i965_media_context_destroy(void *hw_context)
 }
 
 struct hw_context *
-g4x_dec_hw_context_init(VADriverContextP ctx, VAProfile profile)
+g4x_dec_hw_context_init(VADriverContextP ctx, struct object_config *obj_config)
 {
     struct intel_driver_data *intel = intel_driver_data(ctx);
     struct i965_media_context *media_context = calloc(1, sizeof(struct i965_media_context));
@@ -330,7 +330,7 @@ g4x_dec_hw_context_init(VADriverContextP ctx, VAProfile profile)
     media_context->base.run = i965_media_decode_picture;
     media_context->base.batch = intel_batchbuffer_new(intel, I915_EXEC_RENDER);
 
-    switch (profile) {
+    switch (obj_config->profile) {
     case VAProfileMPEG2Simple:
     case VAProfileMPEG2Main:
         i965_media_mpeg2_dec_context_init(ctx, media_context);
@@ -351,7 +351,7 @@ g4x_dec_hw_context_init(VADriverContextP ctx, VAProfile profile)
 }
 
 struct hw_context *
-ironlake_dec_hw_context_init(VADriverContextP ctx, VAProfile profile)
+ironlake_dec_hw_context_init(VADriverContextP ctx, struct object_config *obj_config)
 {
     struct intel_driver_data *intel = intel_driver_data(ctx);
     struct i965_media_context *media_context = calloc(1, sizeof(struct i965_media_context));
@@ -360,7 +360,7 @@ ironlake_dec_hw_context_init(VADriverContextP ctx, VAProfile profile)
     media_context->base.run = i965_media_decode_picture;
     media_context->base.batch = intel_batchbuffer_new(intel, I915_EXEC_RENDER);
 
-    switch (profile) {
+    switch (obj_config->profile) {
     case VAProfileMPEG2Simple:
     case VAProfileMPEG2Main:
         i965_media_mpeg2_dec_context_init(ctx, media_context);
index 1aadcdb..169e81a 100644 (file)
@@ -4055,7 +4055,7 @@ i965_proc_context_destroy(void *hw_context)
 }
 
 struct hw_context *
-i965_proc_context_init(VADriverContextP ctx, VAProfile profile)
+i965_proc_context_init(VADriverContextP ctx, struct object_config *obj_config)
 {
     struct intel_driver_data *intel = intel_driver_data(ctx);
     struct i965_proc_context *proc_context = calloc(1, sizeof(struct i965_proc_context));