diff options
author | Sean V Kelley <seanvk@posteo.de> | 2017-01-17 15:01:18 -0800 |
---|---|---|
committer | Sean V Kelley <seanvk@posteo.de> | 2017-01-17 15:01:18 -0800 |
commit | cbe1f62bf8b4dd59c1bf6c5470ddc8c8b449790f (patch) | |
tree | 0fe613027d3b68f7a3def72f77e80a60a971cd82 /src | |
parent | 0adad3981a87de10ba4e4b0e7e7aba05bb5f024a (diff) |
Revert "ENC: kernel init/destroy function for AVC encoder"
This reverts commit aa3ebbb345874da6e438c4ccc86026817c746fa0.
Diffstat (limited to 'src')
-rwxr-xr-x | src/gen9_avc_encoder.c | 306 |
1 files changed, 0 insertions, 306 deletions
diff --git a/src/gen9_avc_encoder.c b/src/gen9_avc_encoder.c index f8dc45c..ea83cbd 100755 --- a/src/gen9_avc_encoder.c +++ b/src/gen9_avc_encoder.c @@ -4489,309 +4489,3 @@ gen9_avc_kernel_sfd(VADriverContextP ctx, return VA_STATUS_SUCCESS; } - -/* -kernel related function:init/destroy etc -*/ -static void -gen9_avc_kernel_init_scaling(VADriverContextP ctx, - struct generic_encoder_context *generic_context, - struct gen9_avc_scaling_context *kernel_context) -{ - struct i965_gpe_context *gpe_context = NULL; - struct encoder_kernel_parameter kernel_param ; - struct encoder_scoreboard_parameter scoreboard_param; - struct i965_kernel common_kernel; - - /* 4x scaling kernel*/ - kernel_param.curbe_size = sizeof(gen9_avc_scaling4x_curbe_data); - kernel_param.inline_data_size = sizeof(gen9_avc_scaling4x_curbe_data); - kernel_param.sampler_size = 0; - - memset(&scoreboard_param, 0, sizeof(scoreboard_param)); - scoreboard_param.mask = 0xFF; - scoreboard_param.enable = generic_context->use_hw_scoreboard; - scoreboard_param.type = generic_context->use_hw_non_stalling_scoreboard; - scoreboard_param.walkpat_flag = 0; - - gpe_context = &kernel_context->gpe_contexts[GEN9_AVC_KERNEL_SCALING_4X_IDX]; - gen9_init_gpe_context_avc(ctx, gpe_context, &kernel_param); - gen9_init_vfe_scoreboard_avc(gpe_context, &scoreboard_param); - - memset(&common_kernel, 0, sizeof(common_kernel)); - - intel_avc_get_kernel_header_and_size((void *)media_avc_kernels, - sizeof(media_avc_kernels), - INTEL_GENERIC_ENC_SCALING4X, - 0, - &common_kernel); - - gen8_gpe_load_kernels(ctx, - gpe_context, - &common_kernel, - 1); - - /*2x scaling kernel*/ - kernel_param.curbe_size = sizeof(gen9_avc_scaling2x_curbe_data); - kernel_param.inline_data_size = 0; - kernel_param.sampler_size = 0; - - gpe_context = &kernel_context->gpe_contexts[GEN9_AVC_KERNEL_SCALING_2X_IDX]; - gen9_init_gpe_context_avc(ctx, gpe_context, &kernel_param); - gen9_init_vfe_scoreboard_avc(gpe_context, &scoreboard_param); - - memset(&common_kernel, 0, sizeof(common_kernel)); - - intel_avc_get_kernel_header_and_size((void *)media_avc_kernels, - sizeof(media_avc_kernels), - INTEL_GENERIC_ENC_SCALING2X, - 0, - &common_kernel); - - gen8_gpe_load_kernels(ctx, - gpe_context, - &common_kernel, - 1); - -} - -static void -gen9_avc_kernel_init_me(VADriverContextP ctx, - struct generic_encoder_context *generic_context, - struct gen9_avc_me_context *kernel_context) -{ - struct i965_gpe_context *gpe_context = NULL; - struct encoder_kernel_parameter kernel_param ; - struct encoder_scoreboard_parameter scoreboard_param; - struct i965_kernel common_kernel; - int i = 0; - - kernel_param.curbe_size = sizeof(gen9_avc_me_curbe_data); - kernel_param.inline_data_size = 0; - kernel_param.sampler_size = 0; - - memset(&scoreboard_param, 0, sizeof(scoreboard_param)); - scoreboard_param.mask = 0xFF; - scoreboard_param.enable = generic_context->use_hw_scoreboard; - scoreboard_param.type = generic_context->use_hw_non_stalling_scoreboard; - scoreboard_param.walkpat_flag = 0; - - for (i = 0; i < 2; i++) { - gpe_context = &kernel_context->gpe_contexts[i]; - gen9_init_gpe_context_avc(ctx, gpe_context, &kernel_param); - gen9_init_vfe_scoreboard_avc(gpe_context, &scoreboard_param); - - memset(&common_kernel, 0, sizeof(common_kernel)); - - intel_avc_get_kernel_header_and_size((void *)media_avc_kernels, - sizeof(media_avc_kernels), - INTEL_GENERIC_ENC_ME, - i, - &common_kernel); - - gen8_gpe_load_kernels(ctx, - gpe_context, - &common_kernel, - 1); - } - -} - -static void -gen9_avc_kernel_init_mbenc(VADriverContextP ctx, - struct generic_encoder_context *generic_context, - struct gen9_avc_mbenc_context *kernel_context) -{ - struct i965_gpe_context *gpe_context = NULL; - struct encoder_kernel_parameter kernel_param ; - struct encoder_scoreboard_parameter scoreboard_param; - struct i965_kernel common_kernel; - int i = 0; - - kernel_param.curbe_size = sizeof(gen9_avc_mbenc_curbe_data); - kernel_param.inline_data_size = 0; - kernel_param.sampler_size = 0; - - memset(&scoreboard_param, 0, sizeof(scoreboard_param)); - scoreboard_param.mask = 0xFF; - scoreboard_param.enable = generic_context->use_hw_scoreboard; - scoreboard_param.type = generic_context->use_hw_non_stalling_scoreboard; - scoreboard_param.walkpat_flag = 0; - - for (i = 0; i < NUM_GEN9_AVC_KERNEL_MBENC ; i++) { - gpe_context = &kernel_context->gpe_contexts[i]; - gen9_init_gpe_context_avc(ctx, gpe_context, &kernel_param); - gen9_init_vfe_scoreboard_avc(gpe_context, &scoreboard_param); - - memset(&common_kernel, 0, sizeof(common_kernel)); - - intel_avc_get_kernel_header_and_size((void *)media_avc_kernels, - sizeof(media_avc_kernels), - INTEL_GENERIC_ENC_MBENC, - i, - &common_kernel); - - gen8_gpe_load_kernels(ctx, - gpe_context, - &common_kernel, - 1); - } - -} - -static void -gen9_avc_kernel_init_brc(VADriverContextP ctx, - struct generic_encoder_context *generic_context, - struct gen9_avc_brc_context *kernel_context) -{ - struct i965_gpe_context *gpe_context = NULL; - struct encoder_kernel_parameter kernel_param ; - struct encoder_scoreboard_parameter scoreboard_param; - struct i965_kernel common_kernel; - int i = 0; - - static const int brc_curbe_size[NUM_GEN9_AVC_KERNEL_BRC] = { - (sizeof(gen9_avc_brc_init_reset_curbe_data)), - (sizeof(gen9_avc_frame_brc_update_curbe_data)), - (sizeof(gen9_avc_brc_init_reset_curbe_data)), - (sizeof(gen9_avc_mbenc_curbe_data)), - 0, - (sizeof(gen9_avc_mb_brc_curbe_data)) - }; - - kernel_param.inline_data_size = 0; - kernel_param.sampler_size = 0; - - memset(&scoreboard_param, 0, sizeof(scoreboard_param)); - scoreboard_param.mask = 0xFF; - scoreboard_param.enable = generic_context->use_hw_scoreboard; - scoreboard_param.type = generic_context->use_hw_non_stalling_scoreboard; - scoreboard_param.walkpat_flag = 0; - - for (i = 0; i < NUM_GEN9_AVC_KERNEL_BRC; i++) { - kernel_param.curbe_size = brc_curbe_size[i]; - gpe_context = &kernel_context->gpe_contexts[i]; - gen9_init_gpe_context_avc(ctx, gpe_context, &kernel_param); - gen9_init_vfe_scoreboard_avc(gpe_context, &scoreboard_param); - - memset(&common_kernel, 0, sizeof(common_kernel)); - - intel_avc_get_kernel_header_and_size((void *)media_avc_kernels, - sizeof(media_avc_kernels), - INTEL_GENERIC_ENC_BRC, - i, - &common_kernel); - - gen8_gpe_load_kernels(ctx, - gpe_context, - &common_kernel, - 1); - } - -} - -static void -gen9_avc_kernel_init_wp(VADriverContextP ctx, - struct generic_encoder_context *generic_context, - struct gen9_avc_wp_context *kernel_context) -{ - struct i965_gpe_context *gpe_context = NULL; - struct encoder_kernel_parameter kernel_param ; - struct encoder_scoreboard_parameter scoreboard_param; - struct i965_kernel common_kernel; - - kernel_param.curbe_size = sizeof(gen9_avc_wp_curbe_data); - kernel_param.inline_data_size = 0; - kernel_param.sampler_size = 0; - - memset(&scoreboard_param, 0, sizeof(scoreboard_param)); - scoreboard_param.mask = 0xFF; - scoreboard_param.enable = generic_context->use_hw_scoreboard; - scoreboard_param.type = generic_context->use_hw_non_stalling_scoreboard; - scoreboard_param.walkpat_flag = 0; - - gpe_context = &kernel_context->gpe_contexts; - gen9_init_gpe_context_avc(ctx, gpe_context, &kernel_param); - gen9_init_vfe_scoreboard_avc(gpe_context, &scoreboard_param); - - memset(&common_kernel, 0, sizeof(common_kernel)); - - intel_avc_get_kernel_header_and_size((void *)media_avc_kernels, - sizeof(media_avc_kernels), - INTEL_GENERIC_ENC_WP, - 0, - &common_kernel); - - gen8_gpe_load_kernels(ctx, - gpe_context, - &common_kernel, - 1); - -} - -static void -gen9_avc_kernel_init_sfd(VADriverContextP ctx, - struct generic_encoder_context *generic_context, - struct gen9_avc_sfd_context *kernel_context) -{ - struct i965_gpe_context *gpe_context = NULL; - struct encoder_kernel_parameter kernel_param ; - struct encoder_scoreboard_parameter scoreboard_param; - struct i965_kernel common_kernel; - - kernel_param.curbe_size = sizeof(gen9_avc_sfd_curbe_data); - kernel_param.inline_data_size = 0; - kernel_param.sampler_size = 0; - - memset(&scoreboard_param, 0, sizeof(scoreboard_param)); - scoreboard_param.mask = 0xFF; - scoreboard_param.enable = generic_context->use_hw_scoreboard; - scoreboard_param.type = generic_context->use_hw_non_stalling_scoreboard; - scoreboard_param.walkpat_flag = 0; - - gpe_context = &kernel_context->gpe_contexts; - gen9_init_gpe_context_avc(ctx, gpe_context, &kernel_param); - gen9_init_vfe_scoreboard_avc(gpe_context, &scoreboard_param); - - memset(&common_kernel, 0, sizeof(common_kernel)); - - intel_avc_get_kernel_header_and_size((void *)media_avc_kernels, - sizeof(media_avc_kernels), - INTEL_GENERIC_ENC_SFD, - 0, - &common_kernel); - - gen8_gpe_load_kernels(ctx, - gpe_context, - &common_kernel, - 1); - -} - -static void -gen9_avc_kernel_destroy(struct encoder_vme_mfc_context * vme_context) -{ - - struct gen9_avc_encoder_context * avc_ctx = (struct gen9_avc_encoder_context * )vme_context->private_enc_ctx; - - int i = 0; - - gen9_avc_free_resources(vme_context); - - for(i = 0; i < NUM_GEN9_AVC_KERNEL_SCALING; i++) - gen8_gpe_context_destroy(&avc_ctx->context_scaling.gpe_contexts[i]); - - for(i = 0; i < NUM_GEN9_AVC_KERNEL_BRC; i++) - gen8_gpe_context_destroy(&avc_ctx->context_brc.gpe_contexts[i]); - - for(i = 0; i < NUM_GEN9_AVC_KERNEL_ME; i++) - gen8_gpe_context_destroy(&avc_ctx->context_me.gpe_contexts[i]); - - for(i = 0; i < NUM_GEN9_AVC_KERNEL_MBENC; i++) - gen8_gpe_context_destroy(&avc_ctx->context_mbenc.gpe_contexts[i]); - - gen8_gpe_context_destroy(&avc_ctx->context_wp.gpe_contexts); - - gen8_gpe_context_destroy(&avc_ctx->context_sfd.gpe_contexts); - -} |