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>
#ifndef INTEL_BUFMGR_H
#define INTEL_BUFMGR_H
#ifndef INTEL_BUFMGR_H
#define INTEL_BUFMGR_H
#include <stdint.h>
struct drm_clip_rect;
#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);
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);
void drm_intel_decode(struct drm_intel_decode *ctx);
/* Struct for tracking drm_intel_decode state. */
struct drm_intel_decode {
/* 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;
/** PCI device ID. */
uint32_t devid;
return NULL;
ctx->devid = devid;
return NULL;
ctx->devid = devid;
+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.
*
/**
* Decodes an i830-i915 batch buffer, writing the output to stdout.
*
devid = ctx->devid;
head_offset = ctx->head;
tail_offset = ctx->tail;
devid = ctx->devid;
head_offset = ctx->head;
tail_offset = ctx->tail;
saved_s2_set = 0;
saved_s4_set = 1;
saved_s2_set = 0;
saved_s4_set = 1;
while (index < count) {
switch ((data[index] & 0xe0000000) >> 29) {
case 0x0:
while (index < count) {
switch ((data[index] & 0xe0000000) >> 29) {
case 0x0: