Commit ce998b14 authored by Alexander Osin's avatar Alexander Osin Committed by Austin Yuan

Corrected trace prints (updated, change format, etc), replaced \t by spaces in source code

parent f7848e8f
/*
* Copyright (c) 2009 Intel Corporation. All Rights Reserved.
* Copyright (c) 2009-2011 Intel Corporation. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
......@@ -247,6 +247,7 @@ void va_TraceEnd(VADisplay dpy)
memset(&trace_context[idx], sizeof(struct _trace_context), 0);
}
static unsigned int file_size(FILE *fp)
{
struct stat buf;
......@@ -316,6 +317,7 @@ void va_TraceCodedBuf(VADisplay dpy)
vaUnmapBuffer(dpy,trace_context[idx].trace_codedbuf);
va_TraceMsg(idx, "\tchecksum = 0x%02x\n", check_sum);
va_TraceMsg(idx, NULL);
}
......@@ -342,6 +344,7 @@ void va_TraceSurface(VADisplay dpy)
va_TraceMsg(idx, "==========truncate file %s\n", trace_context[idx].trace_surface_fn);
truncate_file(trace_context[idx].trace_fp_surface);
}
va_TraceMsg(idx, NULL);
va_status = vaLockSurface(
dpy,
......@@ -368,11 +371,13 @@ void va_TraceSurface(VADisplay dpy)
if (buffer == NULL) {
va_TraceMsg(idx, "Error:vaLockSurface return NULL buffer\n");
va_TraceMsg(idx, NULL);
vaUnlockSurface(dpy, trace_context[idx].trace_rendertarget);
return;
}
va_TraceMsg(idx, "\tbuffer location = 0x%08x\n", buffer);
va_TraceMsg(idx, NULL);
Y_data = (unsigned char*)buffer;
UV_data = (unsigned char*)buffer + chroma_u_offset;
......@@ -404,6 +409,7 @@ void va_TraceSurface(VADisplay dpy)
vaUnlockSurface(dpy, trace_context[idx].trace_rendertarget);
va_TraceMsg(idx, "\tchecksum = 0x%02x\n", check_sum & 0xff);
va_TraceMsg(idx, NULL);
}
......@@ -447,6 +453,7 @@ void va_TraceCreateConfig(
va_TraceMsg(idx, "\t\tattrib_list[%d].type = 0x%08x\n", i, attrib_list[i].type);
va_TraceMsg(idx, "\t\tattrib_list[%d].value = 0x%08x\n", i, attrib_list[i].value);
}
va_TraceMsg(idx, NULL);
trace_context[idx].trace_profile = profile;
trace_context[idx].trace_entrypoint = entrypoint;
......@@ -474,6 +481,8 @@ void va_TraceCreateSurface(
for (i = 0; i < num_surfaces; i++)
va_TraceMsg(idx, "\t\tsurfaces[%d] = 0x%08x\n", i, surfaces[i]);
va_TraceMsg(idx, NULL);
}
......@@ -500,7 +509,7 @@ void va_TraceCreateContext(
for (i=0; i<num_render_targets; i++)
va_TraceMsg(idx, "\t\trender_targets[%d] = 0x%08x\n", i, render_targets[i]);
va_TraceMsg(idx, "\tcontext = 0x%08x\n", *context);
va_TraceMsg(idx, NULL);
trace_context[idx].trace_context = *context;
......@@ -574,6 +583,7 @@ void va_TraceMapBuffer (
buf_list = buf_list->next;
}
va_TraceMsg(idx, NULL);
}
static void va_TraceVABuffers(
......@@ -606,6 +616,7 @@ static void va_TraceVABuffers(
}
va_TraceMsg(idx, "\tchecksum = 0x%02x\n", check_sum & 0xff);
va_TraceMsg(idx, NULL);
return;
}
......@@ -644,6 +655,7 @@ static void va_TraceVAPictureParameterBufferMPEG2(
va_TraceMsg(idx,"\trepeat_first_field= %d\n", p->picture_coding_extension.bits.repeat_first_field);
va_TraceMsg(idx,"\tprogressive_frame= %d\n", p->picture_coding_extension.bits.progressive_frame);
va_TraceMsg(idx,"\tis_first_field= %d\n", p->picture_coding_extension.bits.is_first_field);
va_TraceMsg(idx, NULL);
return;
}
......@@ -671,6 +683,7 @@ static void va_TraceVAIQMatrixBufferMPEG2(
va_TraceMsg(idx,"\tnon_intra_quantiser_matrix = %d\n", p->non_intra_quantiser_matrix);
va_TraceMsg(idx,"\tchroma_intra_quantiser_matrix = %d\n", p->chroma_intra_quantiser_matrix);
va_TraceMsg(idx,"\tchroma_non_intra_quantiser_matrix = %d\n", p->chroma_non_intra_quantiser_matrix);
va_TraceMsg(idx, NULL);
return;
}
......@@ -703,12 +716,12 @@ static void va_TraceVASliceParameterBufferMPEG2(
va_TraceMsg(idx,"\tslice_vertical_position = %d\n", p->slice_vertical_position);
va_TraceMsg(idx,"\tquantiser_scale_code = %d\n", p->quantiser_scale_code);
va_TraceMsg(idx,"\tintra_slice_flag = %d\n", p->intra_slice_flag);
va_TraceMsg(idx, NULL);
return;
}
static void va_TraceVAPictureParameterBufferMPEG4(
VADisplay dpy,
VAContextID context,
......@@ -763,6 +776,7 @@ static void va_TraceVAPictureParameterBufferMPEG4(
va_TraceMsg(idx,"\tnum_macroblocks_in_gob = %d\n", p->num_macroblocks_in_gob);
va_TraceMsg(idx,"\tTRB = %d\n", p->TRB);
va_TraceMsg(idx,"\tTRD = %d\n", p->TRD);
va_TraceMsg(idx, NULL);
return;
}
......@@ -792,6 +806,7 @@ static void va_TraceVAIQMatrixBufferMPEG4(
va_TraceMsg(idx,"\tnon_intra_quant_mat =\n");
for(i=0;i<64;i++)
va_TraceMsg(idx,"\t\t%d\n", p->non_intra_quant_mat[i]);
va_TraceMsg(idx, NULL);
return;
}
......@@ -822,11 +837,24 @@ static void va_TraceVASliceParameterBufferMPEG4(
va_TraceMsg(idx,"\tmacroblock_offset = %d\n", p->macroblock_offset);
va_TraceMsg(idx,"\tmacroblock_number = %d\n", p->macroblock_number);
va_TraceMsg(idx,"\tquant_scale = %d\n", p->quant_scale);
va_TraceMsg(idx, NULL);
return;
}
static inline void va_TraceFlagIfNotZero(
int idx, /* in */
const char *name, /* in */
unsigned int flag /* in */
)
{
if (flag != 0) {
va_TraceMsg(idx, "%s = %x\n", name, flag);
}
}
static void va_TraceVAPictureParameterBufferH264(
VADisplay dpy,
VAContextID context,
......@@ -843,7 +871,7 @@ static void va_TraceVAPictureParameterBufferH264(
va_TraceMsg(idx, "VAPictureParameterBufferH264\n");
va_TraceMsg(idx, "\tCurrPic.picture_id = %d\n", p->CurrPic.picture_id);
va_TraceMsg(idx, "\tCurrPic.picture_id = 0x%08x\n", p->CurrPic.picture_id);
va_TraceMsg(idx, "\tCurrPic.frame_idx = %d\n", p->CurrPic.frame_idx);
va_TraceMsg(idx, "\tCurrPic.flags = %d\n", p->CurrPic.flags);
va_TraceMsg(idx, "\tCurrPic.TopFieldOrderCnt = %d\n", p->CurrPic.TopFieldOrderCnt);
......@@ -853,7 +881,7 @@ static void va_TraceVAPictureParameterBufferH264(
for (i = 0; i < 16; i++)
{
if (p->ReferenceFrames[i].flags != VA_PICTURE_H264_INVALID) {
va_TraceMsg(idx, "\t\t%d-%d-%d-%d\n",
va_TraceMsg(idx, "\t\t%d-%d-0x%08x-%d\n",
p->ReferenceFrames[i].TopFieldOrderCnt,
p->ReferenceFrames[i].BottomFieldOrderCnt,
p->ReferenceFrames[i].picture_id,
......@@ -882,14 +910,19 @@ static void va_TraceVAPictureParameterBufferH264(
va_TraceMsg(idx, "\tpic_init_qs_minus26 = %d\n", p->pic_init_qs_minus26);
va_TraceMsg(idx, "\tchroma_qp_index_offset = %d\n", p->chroma_qp_index_offset);
va_TraceMsg(idx, "\tsecond_chroma_qp_index_offset = %d\n", p->second_chroma_qp_index_offset);
va_TraceMsg(idx, "\tpic_fields = %d\n", p->pic_fields.value);
va_TraceMsg(idx, "\tentropy_coding_mode_flag = %d\n", p->pic_fields.bits.entropy_coding_mode_flag);
va_TraceMsg(idx, "\tweighted_pred_flag = %d\n", p->pic_fields.bits.weighted_pred_flag);
va_TraceMsg(idx, "\tweighted_bipred_idc = %d\n", p->pic_fields.bits.weighted_bipred_idc);
va_TraceMsg(idx, "\ttransform_8x8_mode_flag = %d\n", p->pic_fields.bits.transform_8x8_mode_flag);
va_TraceMsg(idx, "\tfield_pic_flag = %d\n", p->pic_fields.bits.field_pic_flag);
va_TraceMsg(idx, "\tconstrained_intra_pred_flag = %d\n", p->pic_fields.bits.constrained_intra_pred_flag);
va_TraceMsg(idx, "\tpic_fields = 0x%03x\n", p->pic_fields.value);
va_TraceFlagIfNotZero(idx, "\t\tentropy_coding_mode_flag", p->pic_fields.bits.entropy_coding_mode_flag);
va_TraceFlagIfNotZero(idx, "\t\tweighted_pred_flag", p->pic_fields.bits.weighted_pred_flag);
va_TraceFlagIfNotZero(idx, "\t\tweighted_bipred_idc", p->pic_fields.bits.weighted_bipred_idc);
va_TraceFlagIfNotZero(idx, "\t\ttransform_8x8_mode_flag", p->pic_fields.bits.transform_8x8_mode_flag);
va_TraceFlagIfNotZero(idx, "\t\tfield_pic_flag", p->pic_fields.bits.field_pic_flag);
va_TraceFlagIfNotZero(idx, "\t\tconstrained_intra_pred_flag", p->pic_fields.bits.constrained_intra_pred_flag);
va_TraceFlagIfNotZero(idx, "\t\tpic_order_present_flag", p->pic_fields.bits.pic_order_present_flag);
va_TraceFlagIfNotZero(idx, "\t\tdeblocking_filter_control_present_flag", p->pic_fields.bits.deblocking_filter_control_present_flag);
va_TraceFlagIfNotZero(idx, "\t\tredundant_pic_cnt_present_flag", p->pic_fields.bits.redundant_pic_cnt_present_flag);
va_TraceFlagIfNotZero(idx, "\t\treference_pic_flag", p->pic_fields.bits.reference_pic_flag);
va_TraceMsg(idx, "\tframe_num = %d\n", p->frame_num);
va_TraceMsg(idx, NULL);
return;
}
......@@ -929,13 +962,13 @@ static void va_TraceVASliceParameterBufferH264(
if (p->slice_type == 0 || p->slice_type == 1) {
va_TraceMsg(idx, "\tRefPicList0 =");
for (i = 0; i < p->num_ref_idx_l0_active_minus1 + 1; i++) {
va_TraceMsg(idx, "%d-%d-%d-%d\n", p->RefPicList0[i].TopFieldOrderCnt, p->RefPicList0[i].BottomFieldOrderCnt, p->RefPicList0[i].picture_id, p->RefPicList0[i].frame_idx);
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);
}
if (p->slice_type == 1) {
va_TraceMsg(idx, "\tRefPicList1 =");
for (i = 0; i < p->num_ref_idx_l1_active_minus1 + 1; i++)
{
va_TraceMsg(idx, "%d-%d-%d-%d\n", p->RefPicList1[i].TopFieldOrderCnt, p->RefPicList1[i].BottomFieldOrderCnt, p->RefPicList1[i].picture_id, p->RefPicList1[i].frame_idx);
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);
}
}
}
......@@ -978,6 +1011,7 @@ static void va_TraceVASliceParameterBufferH264(
}
va_TraceMsg(idx, "\n");
}
va_TraceMsg(idx, NULL);
}
static void va_TraceVAIQMatrixBufferH264(
......@@ -1014,6 +1048,8 @@ static void va_TraceVAIQMatrixBufferH264(
va_TraceMsg(idx, "\n");
}
}
va_TraceMsg(idx, NULL);
}
static void va_TraceVAEncSequenceParameterBufferH264(
......@@ -1043,6 +1079,7 @@ static void va_TraceVAEncSequenceParameterBufferH264(
va_TraceMsg(idx, "\tmin_qp = %d\n", p->min_qp);
va_TraceMsg(idx, "\tbasic_unit_size = %d\n", p->basic_unit_size);
va_TraceMsg(idx, "\tvui_flag = %d\n", p->vui_flag);
va_TraceMsg(idx, NULL);
/* start a new sequce, coded log file can be truncated */
trace_context[idx].trace_sequence_start = 1;
......@@ -1069,6 +1106,7 @@ static void va_TraceVAEncPictureParameterBufferH264(
va_TraceMsg(idx, "\tpicture_width = %d\n", p->picture_width);
va_TraceMsg(idx, "\tpicture_height = %d\n", p->picture_height);
va_TraceMsg(idx, "\tlast_picture = 0x%08x\n", p->last_picture);
va_TraceMsg(idx, NULL);
trace_context[idx].trace_codedbuf = p->coded_buf;
......@@ -1096,6 +1134,7 @@ static void va_TraceVAEncSliceParameterBuffer(
va_TraceMsg(idx, "\tslice_flags.disable_deblocking_filter_idc = %d\n", p->slice_flags.bits.disable_deblocking_filter_idc);
va_TraceMsg(idx, "\tslice_flags.uses_long_term_ref = %d\n", p->slice_flags.bits.uses_long_term_ref);
va_TraceMsg(idx, "\tslice_flags.is_long_term_ref = %d\n", p->slice_flags.bits.is_long_term_ref);
va_TraceMsg(idx, NULL);
return;
}
......@@ -1154,6 +1193,7 @@ static void va_TraceVAEncMiscParameterBuffer(
va_TraceMsg(idx, "invalid VAEncMiscParameterBuffer type = %d\n", tmp->type);
break;
}
va_TraceMsg(idx, NULL);
return;
}
......@@ -1188,6 +1228,7 @@ static void va_TraceVAPictureParameterBufferVC1(
va_TraceMsg(idx, "\tsyncmarker = %d\n", p->sequence_fields.bits.syncmarker);
va_TraceMsg(idx, "\trangered = %d\n", p->sequence_fields.bits.rangered);
va_TraceMsg(idx, "\tmax_b_frames = %d\n", p->sequence_fields.bits.max_b_frames);
va_TraceMsg(idx, "\tprofile = %d\n", p->sequence_fields.bits.profile);
va_TraceMsg(idx, "\tcoded_width = %d\n", p->coded_width);
va_TraceMsg(idx, "\tcoded_height = %d\n", p->coded_height);
va_TraceMsg(idx, "\tclosed_entry = %d\n", p->entrypoint_fields.bits.closed_entry);
......@@ -1260,6 +1301,7 @@ static void va_TraceVAPictureParameterBufferVC1(
va_TraceMsg(idx, "\ttransform_ac_codingset_idx1 = %d\n", p->transform_fields.bits.transform_ac_codingset_idx1);
va_TraceMsg(idx, "\ttransform_ac_codingset_idx2 = %d\n", p->transform_fields.bits.transform_ac_codingset_idx2);
va_TraceMsg(idx, "\tintra_transform_dc_table = %d\n", p->transform_fields.bits.intra_transform_dc_table);
va_TraceMsg(idx, NULL);
}
static void va_TraceVASliceParameterBufferVC1(
......@@ -1284,6 +1326,7 @@ static void va_TraceVASliceParameterBufferVC1(
va_TraceMsg(idx, "\tslice_data_flag = %d\n", p->slice_data_flag);
va_TraceMsg(idx, "\tmacroblock_offset = %d\n", p->macroblock_offset);
va_TraceMsg(idx, "\tslice_vertical_position = %d\n", p->slice_vertical_position);
va_TraceMsg(idx, NULL);
}
void va_TraceBeginPicture(
......@@ -1299,6 +1342,7 @@ void va_TraceBeginPicture(
va_TraceMsg(idx, "\tcontext = 0x%08x\n", context);
va_TraceMsg(idx, "\trender_targets = 0x%08x\n", render_target);
va_TraceMsg(idx, "\tframe_count = #%d\n", trace_context[idx].trace_frame_no);
va_TraceMsg(idx, NULL);
trace_context[idx].trace_rendertarget = render_target; /* for surface data dump after vaEndPicture */
......@@ -1645,6 +1689,8 @@ void va_TraceRenderPicture(
vaUnmapBuffer(dpy, buffers[i]);
}
va_TraceMsg(idx, NULL);
}
......@@ -1660,7 +1706,6 @@ void va_TraceEndPicture(
va_TraceMsg(idx, "\tcontext = 0x%08x\n", context);
va_TraceMsg(idx, "\trender_targets = 0x%08x\n", trace_context[idx].trace_rendertarget);
/* want to trace codedbuf, and it is encode */
if (trace_context[idx].trace_fp_codedbuf &&
((trace_context[idx].trace_entrypoint == VAEntrypointEncSlice) ||
......@@ -1677,6 +1722,8 @@ void va_TraceEndPicture(
va_TraceSurface(dpy);
}
va_TraceMsg(idx, NULL);
}
void va_TraceSyncSurface(
......@@ -1689,6 +1736,7 @@ void va_TraceSyncSurface(
TRACE_FUNCNAME(idx);
va_TraceMsg(idx, "\trender_target = 0x%08x\n", render_target);
va_TraceMsg(idx, NULL);
}
......@@ -1704,6 +1752,7 @@ void va_TraceQuerySurfaceStatus(
va_TraceMsg(idx, "\trender_target = 0x%08x\n", render_target);
va_TraceMsg(idx, "\tstatus = 0x%08x\n", *status);
va_TraceMsg(idx, NULL);
}
......@@ -1728,6 +1777,7 @@ void va_TraceQuerySurfaceError(
p++; /* next error record */
}
}
va_TraceMsg(idx, NULL);
}
void va_TraceMaxNumDisplayAttributes (
......@@ -1740,6 +1790,7 @@ void va_TraceMaxNumDisplayAttributes (
TRACE_FUNCNAME(idx);
va_TraceMsg(idx, "\tmax_display_attributes = %d\n", number);
va_TraceMsg(idx, NULL);
}
void va_TraceQueryDisplayAttributes (
......@@ -1762,6 +1813,7 @@ void va_TraceQueryDisplayAttributes (
va_TraceMsg(idx, "\t value = %d\n", attr_list[i].value);
va_TraceMsg(idx, "\t flags = %d\n", attr_list[i].flags);
}
va_TraceMsg(idx, NULL);
}
......@@ -1784,6 +1836,7 @@ static void va_TraceDisplayAttributes (
va_TraceMsg(idx, "\t value = %d\n", attr_list[i].value);
va_TraceMsg(idx, "\t flags = %d\n", attr_list[i].flags);
}
va_TraceMsg(idx, NULL);
}
......@@ -1848,4 +1901,5 @@ void va_TracePutSurface (
va_TraceMsg(idx, "\tcliprects = 0x%08x\n", cliprects);
va_TraceMsg(idx, "\tnumber_cliprects = %d\n", number_cliprects);
va_TraceMsg(idx, "\tflags = 0x%08x\n", flags);
va_TraceMsg(idx, NULL);
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment