• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

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

Revisión228bc307097e6b13e3d14453d9679c5a8a06ffeb (tree)
Tiempo2014-11-19 22:13:06
AutorSirisha Muppavarapu <sirisha.muppavarapu@inte...>
CommiterXiang, Haihao

Log Message

JPEG Encode: Bypass VME for JPEG Encode

(cherry picked from commit 2910b0ca5357d871d1d8d60b05aeab24218eb2e9)

Cambiar Resumen

Diferencia incremental

--- a/src/gen8_vme.c
+++ b/src/gen8_vme.c
@@ -1155,7 +1155,7 @@ gen8_vme_context_destroy(void *context)
11551155
11561156 Bool gen8_vme_context_init(VADriverContextP ctx, struct intel_encoder_context *encoder_context)
11571157 {
1158- struct gen6_vme_context *vme_context = calloc(1, sizeof(struct gen6_vme_context));
1158+ struct gen6_vme_context *vme_context = NULL;
11591159 struct i965_kernel *vme_kernel_list = NULL;
11601160 int i965_kernel_num;
11611161
@@ -1171,7 +1171,13 @@ Bool gen8_vme_context_init(VADriverContextP ctx, struct intel_encoder_context *e
11711171 vme_kernel_list = gen8_vme_mpeg2_kernels;
11721172 encoder_context->vme_pipeline = gen8_vme_mpeg2_pipeline;
11731173 i965_kernel_num = sizeof(gen8_vme_mpeg2_kernels) / sizeof(struct i965_kernel);
1174+ break;
11741175
1176+ case CODEC_JPEG:
1177+ //JPEG encode doesnt have vme. So, set the corresponding fields to NULL.
1178+ encoder_context->vme_context = NULL;
1179+ encoder_context->vme_pipeline = NULL;
1180+ encoder_context->vme_context_destroy = NULL;
11751181 break;
11761182
11771183 default:
@@ -1180,35 +1186,40 @@ Bool gen8_vme_context_init(VADriverContextP ctx, struct intel_encoder_context *e
11801186
11811187 break;
11821188 }
1183- vme_context->vme_kernel_sum = i965_kernel_num;
1184- vme_context->gpe_context.surface_state_binding_table.length = (SURFACE_STATE_PADDED_SIZE + sizeof(unsigned int)) * MAX_MEDIA_SURFACES_GEN6;
11851189
1186- vme_context->gpe_context.idrt_size = sizeof(struct gen8_interface_descriptor_data) * MAX_INTERFACE_DESC_GEN6;
1187- vme_context->gpe_context.curbe_size = CURBE_TOTAL_DATA_LENGTH;
1188- vme_context->gpe_context.sampler_size = 0;
1190+ //If the codec is JPEG, bypass VME
1191+ if(encoder_context->codec != CODEC_JPEG) {
1192+ vme_context = calloc(1, sizeof(struct gen6_vme_context));
1193+ vme_context->vme_kernel_sum = i965_kernel_num;
1194+ vme_context->gpe_context.surface_state_binding_table.length = (SURFACE_STATE_PADDED_SIZE + sizeof(unsigned int)) * MAX_MEDIA_SURFACES_GEN6;
1195+
1196+ vme_context->gpe_context.idrt_size = sizeof(struct gen8_interface_descriptor_data) * MAX_INTERFACE_DESC_GEN6;
1197+ vme_context->gpe_context.curbe_size = CURBE_TOTAL_DATA_LENGTH;
1198+ vme_context->gpe_context.sampler_size = 0;
11891199
11901200
1191- vme_context->gpe_context.vfe_state.max_num_threads = 60 - 1;
1192- vme_context->gpe_context.vfe_state.num_urb_entries = 64;
1193- vme_context->gpe_context.vfe_state.gpgpu_mode = 0;
1194- vme_context->gpe_context.vfe_state.urb_entry_size = 16;
1195- vme_context->gpe_context.vfe_state.curbe_allocation_size = CURBE_ALLOCATION_SIZE - 1;
1201+ vme_context->gpe_context.vfe_state.max_num_threads = 60 - 1;
1202+ vme_context->gpe_context.vfe_state.num_urb_entries = 64;
1203+ vme_context->gpe_context.vfe_state.gpgpu_mode = 0;
1204+ vme_context->gpe_context.vfe_state.urb_entry_size = 16;
1205+ vme_context->gpe_context.vfe_state.curbe_allocation_size = CURBE_ALLOCATION_SIZE - 1;
11961206
1197- gen7_vme_scoreboard_init(ctx, vme_context);
1207+ gen7_vme_scoreboard_init(ctx, vme_context);
11981208
1199- gen8_gpe_load_kernels(ctx,
1209+ gen8_gpe_load_kernels(ctx,
12001210 &vme_context->gpe_context,
12011211 vme_kernel_list,
12021212 i965_kernel_num);
1203- vme_context->vme_surface2_setup = gen8_gpe_surface2_setup;
1204- vme_context->vme_media_rw_surface_setup = gen8_gpe_media_rw_surface_setup;
1205- vme_context->vme_buffer_suface_setup = gen8_gpe_buffer_suface_setup;
1206- vme_context->vme_media_chroma_surface_setup = gen8_gpe_media_chroma_surface_setup;
1213+ vme_context->vme_surface2_setup = gen8_gpe_surface2_setup;
1214+ vme_context->vme_media_rw_surface_setup = gen8_gpe_media_rw_surface_setup;
1215+ vme_context->vme_buffer_suface_setup = gen8_gpe_buffer_suface_setup;
1216+ vme_context->vme_media_chroma_surface_setup = gen8_gpe_media_chroma_surface_setup;
12071217
1208- encoder_context->vme_context = vme_context;
1209- encoder_context->vme_context_destroy = gen8_vme_context_destroy;
1218+ encoder_context->vme_context = vme_context;
1219+ encoder_context->vme_context_destroy = gen8_vme_context_destroy;
12101220
1211- vme_context->vme_state_message = malloc(VME_MSG_LENGTH * sizeof(int));
1221+ vme_context->vme_state_message = malloc(VME_MSG_LENGTH * sizeof(int));
1222+ }
12121223
12131224 return True;
12141225 }