summaryrefslogtreecommitdiff
path: root/driver/xf86-video-intel/src/xvmc/intel_xvmc_dump.c
diff options
context:
space:
mode:
authorOwain Ainsworth <oga@cvs.openbsd.org>2010-05-10 22:32:31 +0000
committerOwain Ainsworth <oga@cvs.openbsd.org>2010-05-10 22:32:31 +0000
commit874c3f202a3a8633ba9af4ae0920c6e4b419085d (patch)
treea8a85f244568acbdb79508a538ee73b0451fa718 /driver/xf86-video-intel/src/xvmc/intel_xvmc_dump.c
parentb3e95d7d69646862364768b6a4aa6ed0b54e17ff (diff)
Update the intel driver to 2.9.1 plus backports.
2.9.1 is the last version of the intel DDX that supports UMS (User modesetting), with 2.10 onwards being purely KMS only. As such, this driver contains backports of almost every correctness or performance related fix to the rendering layer in later intel drivers. This driver *REQUIRES* a GEM enabled kernel. it claims to support non-gem mode but this is essentially unmaintained and due to the way the abstraciton works is slow, if it works at all (it often does not). You have been warned. tested by many many people on tech over the last few weeks.
Diffstat (limited to 'driver/xf86-video-intel/src/xvmc/intel_xvmc_dump.c')
-rw-r--r--driver/xf86-video-intel/src/xvmc/intel_xvmc_dump.c211
1 files changed, 110 insertions, 101 deletions
diff --git a/driver/xf86-video-intel/src/xvmc/intel_xvmc_dump.c b/driver/xf86-video-intel/src/xvmc/intel_xvmc_dump.c
index 419bd0d82..015d4828c 100644
--- a/driver/xf86-video-intel/src/xvmc/intel_xvmc_dump.c
+++ b/driver/xf86-video-intel/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 */
- }
-
}