summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a9dd34a)
raw | patch | inline | side by side (parent: a9dd34a)
author | Eric Anholt <eric@anholt.net> | |
Tue, 3 Jan 2012 21:05:57 +0000 (13:05 -0800) | ||
committer | Eric Anholt <eric@anholt.net> | |
Wed, 4 Jan 2012 22:49:44 +0000 (14:49 -0800) |
Consumers often want to choose stdout vs stderr, and for testing I
want to output to an open_memstream file.
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
want to output to an open_memstream file.
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
intel/intel_bufmgr.h | patch | blob | history | |
intel/intel_decode.c | patch | blob | history |
diff --git a/intel/intel_bufmgr.h b/intel/intel_bufmgr.h
index 68017a5433452b09b2213e76c67b11d6a148251d..85da8b9aa6e7b58e16b0d219a563f55bee493d72 100644 (file)
--- a/intel/intel_bufmgr.h
+++ b/intel/intel_bufmgr.h
#ifndef INTEL_BUFMGR_H
#define INTEL_BUFMGR_H
+#include <stdio.h>
#include <stdint.h>
struct drm_clip_rect;
int dump_past_end);
void drm_intel_decode_set_head_tail(struct drm_intel_decode *ctx,
uint32_t head, uint32_t tail);
+void drm_intel_decode_set_output_file(struct drm_intel_decode *ctx, FILE *out);
void drm_intel_decode(struct drm_intel_decode *ctx);
diff --git a/intel/intel_decode.c b/intel/intel_decode.c
index e80e8401fa4311764b9c0b6d30cb848f433773b5..81ef712e0f3ed96b6c23d2f2a07aa689e267aa32 100644 (file)
--- a/intel/intel_decode.c
+++ b/intel/intel_decode.c
/* Struct for tracking drm_intel_decode state. */
struct drm_intel_decode {
+ /** stdio file where the output should land. Defaults to stdout. */
+ FILE *out;
+
/** PCI device ID. */
uint32_t devid;
return NULL;
ctx->devid = devid;
+ ctx->out = stdout;
return ctx;
}
ctx->tail = tail;
}
+void
+drm_intel_decode_set_output_file(struct drm_intel_decode *ctx,
+ FILE *out)
+{
+ ctx->out = out;
+}
+
/**
* Decodes an i830-i915 batch buffer, writing the output to stdout.
*
devid = ctx->devid;
head_offset = ctx->head;
tail_offset = ctx->tail;
+ out = ctx->out;
saved_s2_set = 0;
saved_s4_set = 1;
- out = stdout;
-
while (index < count) {
switch ((data[index] & 0xe0000000) >> 29) {
case 0x0: