diff options
author | Xiang, Haihao <haihao.xiang@intel.com> | 2013-04-24 16:54:09 +0800 |
---|---|---|
committer | Xiang, Haihao <haihao.xiang@intel.com> | 2013-04-24 16:54:09 +0800 |
commit | 5bd630d4ea732818728b0a464f45739c86e08be3 (patch) | |
tree | 2f8385716d56827e11b65578314f1865d70e91e8 /src | |
parent | 1fd62ffd336293dce7d091bcea8399a40ccea21e (diff) | |
download | vaapi-intel-driver-upstream.tar.gz vaapi-intel-driver-upstream.tar.bz2 vaapi-intel-driver-upstream.zip |
Clean up gen7_vme_context_init()upstream
Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/gen7_vme.c | 42 |
1 files changed, 16 insertions, 26 deletions
diff --git a/src/gen7_vme.c b/src/gen7_vme.c index 5da7b28..24a22c5 100644 --- a/src/gen7_vme.c +++ b/src/gen7_vme.c @@ -1045,8 +1045,8 @@ gen7_vme_context_destroy(void *context) Bool gen7_vme_context_init(VADriverContextP ctx, struct intel_encoder_context *encoder_context) { - struct i965_driver_data *i965 = i965_driver_data(ctx); struct gen6_vme_context *vme_context = calloc(1, sizeof(struct gen6_vme_context)); + struct i965_kernel *vme_kernel_list = NULL; vme_context->gpe_context.surface_state_binding_table.length = (SURFACE_STATE_PADDED_SIZE + sizeof(unsigned int)) * MAX_MEDIA_SURFACES_GEN6; @@ -1066,39 +1066,29 @@ Bool gen7_vme_context_init(VADriverContextP ctx, struct intel_encoder_context *e if(encoder_context->profile == VAProfileH264Baseline || encoder_context->profile == VAProfileH264Main || encoder_context->profile == VAProfileH264High ){ - vme_context->video_coding_type = VIDEO_CODING_AVC; - vme_context->vme_kernel_sum = AVC_VME_KERNEL_SUM; - + vme_kernel_list = gen7_vme_kernels; + vme_context->video_coding_type = VIDEO_CODING_AVC; + vme_context->vme_kernel_sum = AVC_VME_KERNEL_SUM; + encoder_context->vme_pipeline = gen7_vme_pipeline; } else if (encoder_context->profile == VAProfileMPEG2Simple || encoder_context->profile == VAProfileMPEG2Main ){ - vme_context->video_coding_type = VIDEO_CODING_MPEG2; - vme_context->vme_kernel_sum = MPEG2_VME_KERNEL_SUM; + vme_kernel_list = gen7_vme_mpeg2_kernels; + vme_context->video_coding_type = VIDEO_CODING_MPEG2; + vme_context->vme_kernel_sum = MPEG2_VME_KERNEL_SUM; + encoder_context->vme_pipeline = gen7_vme_mpeg2_pipeline; } else { /* Unsupported encoding profile */ assert(0); } - if (IS_GEN7(i965->intel.device_id)) { - if (vme_context->video_coding_type == VIDEO_CODING_AVC) { - i965_gpe_load_kernels(ctx, - &vme_context->gpe_context, - gen7_vme_kernels, - vme_context->vme_kernel_sum); - encoder_context->vme_pipeline = gen7_vme_pipeline; - - } else { - i965_gpe_load_kernels(ctx, - &vme_context->gpe_context, - gen7_vme_mpeg2_kernels, - vme_context->vme_kernel_sum); - encoder_context->vme_pipeline = gen7_vme_mpeg2_pipeline; - - } + i965_gpe_load_kernels(ctx, + &vme_context->gpe_context, + vme_kernel_list, + vme_context->vme_kernel_sum); - vme_context->vme_surface2_setup = gen7_gpe_surface2_setup; - vme_context->vme_media_rw_surface_setup = gen7_gpe_media_rw_surface_setup; - vme_context->vme_buffer_suface_setup = gen7_gpe_buffer_suface_setup; - } + vme_context->vme_surface2_setup = gen7_gpe_surface2_setup; + vme_context->vme_media_rw_surface_setup = gen7_gpe_media_rw_surface_setup; + vme_context->vme_buffer_suface_setup = gen7_gpe_buffer_suface_setup; encoder_context->vme_context = vme_context; encoder_context->vme_context_destroy = gen7_vme_context_destroy; |