• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

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

hardware/intel/libva


Commit MetaInfo

Revisioncd08c78169c4b958f5c491fb409f09870f90ee5b (tree)
Zeit2013-06-19 15:24:12
AutorElaine Wang <elaine.wang@inte...>
CommiterXiang, Haihao

Log Message

vatrace: fix vatrace crash during video recording

Video recording crash when va trace is enabled. It's caused by
using wrong buffer type to trace slice buffer. This patch distinguish buffer
type VAEncSliceParameterBuffer from VAEncSliceParameterBufferH264 by
the buffer size.
Signed-off-by: Elaine Wang <elaine.wang@intel.com>

Change-Id: Ibc5c6a17b155e305151a25580b4e613702665ad1
(cherry picked from commit b5b1933f60dfec8cf2cff19082362accbe6fce1d)

Ändern Zusammenfassung

Diff

--- a/va/va_trace.c
+++ b/va/va_trace.c
@@ -1348,6 +1348,8 @@ static void va_TraceVAEncSliceParameterBufferH264(
13481348 DPY2INDEX(dpy);
13491349 int i;
13501350
1351+ if (!p)
1352+ return;
13511353 va_TraceMsg(idx, "VAEncSliceParameterBufferH264\n");
13521354 va_TraceMsg(idx, "\tmacroblock_address = %d\n", p->macroblock_address);
13531355 va_TraceMsg(idx, "\tnum_macroblocks = %d\n", p->num_macroblocks);
@@ -1366,12 +1368,12 @@ static void va_TraceVAEncSliceParameterBufferH264(
13661368
13671369 if (p->slice_type == 0 || p->slice_type == 1) {
13681370 va_TraceMsg(idx, "\tRefPicList0 =");
1369- for (i = 0; i < p->num_ref_idx_l0_active_minus1 + 1; i++) {
1371+ for (i = 0; i < p->num_ref_idx_l0_active_minus1 + 1 && i < 32; i++) {
13701372 va_TraceMsg(idx, "%d-%d-0x%08x-%d\n", p->RefPicList0[i].TopFieldOrderCnt, p->RefPicList0[i].BottomFieldOrderCnt, p->RefPicList0[i].picture_id, p->RefPicList0[i].frame_idx);
13711373 }
13721374 if (p->slice_type == 1) {
13731375 va_TraceMsg(idx, "\tRefPicList1 =");
1374- for (i = 0; i < p->num_ref_idx_l1_active_minus1 + 1; i++)
1376+ for (i = 0; i < p->num_ref_idx_l1_active_minus1 + 1 && i < 32; i++)
13751377 {
13761378 va_TraceMsg(idx, "%d-%d-0x%08x-%d\n", p->RefPicList1[i].TopFieldOrderCnt, p->RefPicList1[i].BottomFieldOrderCnt, p->RefPicList1[i].picture_id, p->RefPicList1[i].frame_idx);
13771379 }
@@ -1381,7 +1383,7 @@ static void va_TraceVAEncSliceParameterBufferH264(
13811383 va_TraceMsg(idx, "\tluma_log2_weight_denom = %d\n", p->luma_log2_weight_denom);
13821384 va_TraceMsg(idx, "\tchroma_log2_weight_denom = %d\n", p->chroma_log2_weight_denom);
13831385 va_TraceMsg(idx, "\tluma_weight_l0_flag = %d\n", p->luma_weight_l0_flag);
1384- if (p->luma_weight_l0_flag) {
1386+ if (p->luma_weight_l0_flag && p->num_ref_idx_l0_active_minus1 < 32) {
13851387 for (i = 0; i <= p->num_ref_idx_l0_active_minus1; i++) {
13861388 va_TraceMsg(idx, "\t%d ", p->luma_weight_l0[i]);
13871389 va_TraceMsg(idx, "\t%d ", p->luma_offset_l0[i]);
@@ -1389,7 +1391,7 @@ static void va_TraceVAEncSliceParameterBufferH264(
13891391 }
13901392
13911393 va_TraceMsg(idx, "\tchroma_weight_l0_flag = %d\n", p->chroma_weight_l0_flag);
1392- if (p->chroma_weight_l0_flag) {
1394+ if (p->chroma_weight_l0_flag && p->num_ref_idx_l0_active_minus1 < 32) {
13931395 for (i = 0; i <= p->num_ref_idx_l0_active_minus1; i++) {
13941396 va_TraceMsg(idx, "\t\t%d ", p->chroma_weight_l0[i][0]);
13951397 va_TraceMsg(idx, "\t\t%d ", p->chroma_offset_l0[i][0]);
@@ -1399,7 +1401,7 @@ static void va_TraceVAEncSliceParameterBufferH264(
13991401 }
14001402
14011403 va_TraceMsg(idx, "\tluma_weight_l1_flag = %d\n", p->luma_weight_l1_flag);
1402- if (p->luma_weight_l1_flag) {
1404+ if (p->luma_weight_l1_flag && p->num_ref_idx_l1_active_minus1 < 32) {
14031405 for (i = 0; i <= p->num_ref_idx_l1_active_minus1; i++) {
14041406 va_TraceMsg(idx, "\t\t%d ", p->luma_weight_l1[i]);
14051407 va_TraceMsg(idx, "\t\t%d ", p->luma_offset_l1[i]);
@@ -1407,7 +1409,7 @@ static void va_TraceVAEncSliceParameterBufferH264(
14071409 }
14081410
14091411 va_TraceMsg(idx, "\tchroma_weight_l1_flag = %d\n", p->chroma_weight_l1_flag);
1410- if (p->chroma_weight_l1_flag) {
1412+ if (p->chroma_weight_l1_flag && p->num_ref_idx_l1_active_minus1 < 32) {
14111413 for (i = 0; i <= p->num_ref_idx_l1_active_minus1; i++) {
14121414 va_TraceMsg(idx, "\t\t%d ", p->chroma_weight_l1[i][0]);
14131415 va_TraceMsg(idx, "\t\t%d ", p->chroma_offset_l1[i][0]);
@@ -2031,7 +2033,10 @@ static void va_TraceH264Buf(
20312033 va_TraceVAEncPictureParameterBufferH264(dpy, context, buffer, type, size, num_elements, pbuf);
20322034 break;
20332035 case VAEncSliceParameterBufferType:
2034- va_TraceVAEncSliceParameterBufferH264(dpy, context, buffer, type, size, num_elements, pbuf);
2036+ if (size == sizeof(VAEncSliceParameterBuffer))
2037+ va_TraceVAEncSliceParameterBuffer(dpy, context, buffer, type, size, num_elements, pbuf);
2038+ else
2039+ va_TraceVAEncSliceParameterBufferH264(dpy, context, buffer, type, size, num_elements, pbuf);
20352040 break;
20362041 case VAEncMiscParameterBufferType:
20372042 va_TraceVAEncMiscParameterBuffer(dpy, context, buffer, type, size, num_elements, pbuf);