summaryrefslogtreecommitdiff
path: root/src/xvmc/intel_xvmc_dump.c
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2009-10-06 16:30:08 -0700
committerEric Anholt <eric@anholt.net>2009-10-06 17:10:31 -0700
commit8ae0e44e42db645abe6d385f561260d2ae4a1960 (patch)
tree2002c65e2d302a32ec5d0b19a8708c3c7264b7c6 /src/xvmc/intel_xvmc_dump.c
parentb9b159c49854d8d9d2207946bb583537bb0d48d6 (diff)
Move to kernel coding style.
We've talked about doing this since the start of the project, putting it off until "some convenient time". Just after removing a third of the driver seems like a convenient time, when backporting's probably not happening much anyway.
Diffstat (limited to 'src/xvmc/intel_xvmc_dump.c')
-rw-r--r--src/xvmc/intel_xvmc_dump.c211
1 files changed, 110 insertions, 101 deletions
diff --git a/src/xvmc/intel_xvmc_dump.c b/src/xvmc/intel_xvmc_dump.c
index 419bd0d8..015d4828 100644
--- a/src/xvmc/intel_xvmc_dump.c
+++ b/src/xvmc/intel_xvmc_dump.c
@@ -33,117 +33,126 @@ static FILE *fp = NULL;
void intel_xvmc_dump_open(void)
{
- char *d = NULL;
+ char *d = NULL;
- if (xvmc_dump)
- return;
+ if (xvmc_dump)
+ return;
- if (d = getenv("INTEL_XVMC_DUMP"))
- xvmc_dump = 1;
+ if (d = getenv("INTEL_XVMC_DUMP"))
+ xvmc_dump = 1;
- if (xvmc_dump) {
- fp = fopen(DUMPFILE, "a");
- if (!fp)
- xvmc_dump = 0;
- }
+ if (xvmc_dump) {
+ fp = fopen(DUMPFILE, "a");
+ if (!fp)
+ xvmc_dump = 0;
+ }
}
void intel_xvmc_dump_close(void)
{
- if (xvmc_dump) {
- fclose(fp);
- xvmc_dump = 0;
- }
+ if (xvmc_dump) {
+ fclose(fp);
+ xvmc_dump = 0;
+ }
}
-void intel_xvmc_dump_render(XvMCContext *context, unsigned int picture_structure,
- XvMCSurface *target, XvMCSurface *past, XvMCSurface *future, unsigned int flags,
- unsigned int num_macroblocks, unsigned int first_macroblock,
- XvMCMacroBlockArray *macroblock_array, XvMCBlockArray *blocks)
+void intel_xvmc_dump_render(XvMCContext * context,
+ unsigned int picture_structure,
+ XvMCSurface * target, XvMCSurface * past,
+ XvMCSurface * future, unsigned int flags,
+ unsigned int num_macroblocks,
+ unsigned int first_macroblock,
+ XvMCMacroBlockArray * macroblock_array,
+ XvMCBlockArray * blocks)
{
- int i;
- XvMCMacroBlock *mb;
-
- if (!xvmc_dump)
- return;
-
- fprintf(fp, "========== new surface rendering ==========\n");
- fprintf(fp, "Context (id:%d) (surface_type_id:%d) (width:%d) (height:%d)\n",
- context->context_id, context->surface_type_id, context->width, context->height);
-
- if (picture_structure == XVMC_FRAME_PICTURE)
- fprintf(fp, "picture structure: frame picture\n");
- else if (picture_structure == XVMC_TOP_FIELD)
- fprintf(fp, "picture structure: top field picture (%s)\n",
- (flags == XVMC_SECOND_FIELD)?"second":"first");
- else if (picture_structure == XVMC_BOTTOM_FIELD)
- fprintf(fp, "picture structure: bottom field picture (%s)\n",
- (flags == XVMC_SECOND_FIELD)?"second":"first");
-
- if (!past && !future)
- fprintf(fp, "picture type: I\n");
- else if (past && !future)
- fprintf(fp, "picture type: P\n");
- else if (past && future)
- fprintf(fp, "picture type: B\n");
- else
- fprintf(fp, "picture type: Bad!\n");
-
- fprintf(fp, "target picture: id (%d) width (%d) height (%d)\n", target->surface_id,
- target->width, target->height);
- if (past)
- fprintf(fp, "past picture: id (%d) width (%d) height (%d)\n", past->surface_id,
- past->width, past->height);
- if (future)
- fprintf(fp, "future picture: id (%d) width (%d) height (%d)\n", future->surface_id,
- future->width, future->height);
-
- fprintf(fp, "num macroblocks: %d, first macroblocks %d\n", num_macroblocks, first_macroblock);
-
- for (i = first_macroblock; i < (first_macroblock + num_macroblocks); i++) {
- mb = &macroblock_array->macro_blocks[i];
-
- fprintf(fp, "- MB(%d): ", i);
- fprintf(fp, "x (%d) y (%d) ", mb->x, mb->y);
- fprintf(fp, "macroblock type (");
- if (mb->macroblock_type & XVMC_MB_TYPE_MOTION_FORWARD)
- fprintf(fp, "motion_forward ");
- if (mb->macroblock_type & XVMC_MB_TYPE_MOTION_BACKWARD)
- fprintf(fp, "motion_backward ");
- if (mb->macroblock_type & XVMC_MB_TYPE_PATTERN)
- fprintf(fp, "pattern ");
- if (mb->macroblock_type & XVMC_MB_TYPE_INTRA)
- fprintf(fp, "intra ");
- fprintf(fp, ") ");
- fprintf(fp, "mc type ");
- if (picture_structure == XVMC_FRAME_PICTURE) {
- if (mb->motion_type & XVMC_PREDICTION_FIELD)
- fprintf(fp, "(field) ");
- else if (mb->motion_type & XVMC_PREDICTION_FRAME)
- fprintf(fp, "(frame) ");
- else if (mb->motion_type & XVMC_PREDICTION_DUAL_PRIME)
- fprintf(fp, "(dual-prime) ");
- else
- fprintf(fp, "(unknown %d) ", mb->motion_type);
- } else { /* field */
- if (mb->motion_type & XVMC_PREDICTION_FIELD)
- fprintf(fp, "(field) ");
- else if (mb->motion_type & XVMC_PREDICTION_DUAL_PRIME)
- fprintf(fp, "(dual-prime) ");
- else if (mb->motion_type & XVMC_PREDICTION_16x8)
- fprintf(fp, "(16x8) ");
- else
- fprintf(fp, "(unknown %d) ", mb->motion_type);
+ int i;
+ XvMCMacroBlock *mb;
+
+ if (!xvmc_dump)
+ return;
+
+ fprintf(fp, "========== new surface rendering ==========\n");
+ fprintf(fp,
+ "Context (id:%d) (surface_type_id:%d) (width:%d) (height:%d)\n",
+ context->context_id, context->surface_type_id, context->width,
+ context->height);
+
+ if (picture_structure == XVMC_FRAME_PICTURE)
+ fprintf(fp, "picture structure: frame picture\n");
+ else if (picture_structure == XVMC_TOP_FIELD)
+ fprintf(fp, "picture structure: top field picture (%s)\n",
+ (flags == XVMC_SECOND_FIELD) ? "second" : "first");
+ else if (picture_structure == XVMC_BOTTOM_FIELD)
+ fprintf(fp, "picture structure: bottom field picture (%s)\n",
+ (flags == XVMC_SECOND_FIELD) ? "second" : "first");
+
+ if (!past && !future)
+ fprintf(fp, "picture type: I\n");
+ else if (past && !future)
+ fprintf(fp, "picture type: P\n");
+ else if (past && future)
+ fprintf(fp, "picture type: B\n");
+ else
+ fprintf(fp, "picture type: Bad!\n");
+
+ fprintf(fp, "target picture: id (%d) width (%d) height (%d)\n",
+ target->surface_id, target->width, target->height);
+ if (past)
+ fprintf(fp, "past picture: id (%d) width (%d) height (%d)\n",
+ past->surface_id, past->width, past->height);
+ if (future)
+ fprintf(fp, "future picture: id (%d) width (%d) height (%d)\n",
+ future->surface_id, future->width, future->height);
+
+ fprintf(fp, "num macroblocks: %d, first macroblocks %d\n",
+ num_macroblocks, first_macroblock);
+
+ for (i = first_macroblock; i < (first_macroblock + num_macroblocks);
+ i++) {
+ mb = &macroblock_array->macro_blocks[i];
+
+ fprintf(fp, "- MB(%d): ", i);
+ fprintf(fp, "x (%d) y (%d) ", mb->x, mb->y);
+ fprintf(fp, "macroblock type (");
+ if (mb->macroblock_type & XVMC_MB_TYPE_MOTION_FORWARD)
+ fprintf(fp, "motion_forward ");
+ if (mb->macroblock_type & XVMC_MB_TYPE_MOTION_BACKWARD)
+ fprintf(fp, "motion_backward ");
+ if (mb->macroblock_type & XVMC_MB_TYPE_PATTERN)
+ fprintf(fp, "pattern ");
+ if (mb->macroblock_type & XVMC_MB_TYPE_INTRA)
+ fprintf(fp, "intra ");
+ fprintf(fp, ") ");
+ fprintf(fp, "mc type ");
+ if (picture_structure == XVMC_FRAME_PICTURE) {
+ if (mb->motion_type & XVMC_PREDICTION_FIELD)
+ fprintf(fp, "(field) ");
+ else if (mb->motion_type & XVMC_PREDICTION_FRAME)
+ fprintf(fp, "(frame) ");
+ else if (mb->motion_type & XVMC_PREDICTION_DUAL_PRIME)
+ fprintf(fp, "(dual-prime) ");
+ else
+ fprintf(fp, "(unknown %d) ", mb->motion_type);
+ } else { /* field */
+ if (mb->motion_type & XVMC_PREDICTION_FIELD)
+ fprintf(fp, "(field) ");
+ else if (mb->motion_type & XVMC_PREDICTION_DUAL_PRIME)
+ fprintf(fp, "(dual-prime) ");
+ else if (mb->motion_type & XVMC_PREDICTION_16x8)
+ fprintf(fp, "(16x8) ");
+ else
+ fprintf(fp, "(unknown %d) ", mb->motion_type);
+ }
+
+ if (mb->dct_type == XVMC_DCT_TYPE_FRAME)
+ fprintf(fp, "dct type (frame) ");
+ else if (mb->dct_type == XVMC_DCT_TYPE_FIELD)
+ fprintf(fp, "dct type (field) ");
+
+ fprintf(fp, "coded_block_pattern (0x%x)\n",
+ mb->coded_block_pattern);
+
+ /* XXX mv dump */
}
- if (mb->dct_type == XVMC_DCT_TYPE_FRAME)
- fprintf(fp, "dct type (frame) ");
- else if (mb->dct_type == XVMC_DCT_TYPE_FIELD)
- fprintf(fp, "dct type (field) ");
-
- fprintf(fp, "coded_block_pattern (0x%x)\n", mb->coded_block_pattern);
-
- /* XXX mv dump */
- }
-
}