summaryrefslogtreecommitdiff
path: root/lib/media_fill.h
diff options
context:
space:
mode:
authorXiang, Haihao <haihao.xiang@intel.com>2013-11-29 13:47:31 +0800
committerXiang, Haihao <haihao.xiang@intel.com>2013-12-06 15:11:03 +0800
commit641267dd735e0ab9a5b8d083b4e1a2392b41ae07 (patch)
treee9c2f9f3f2a487897223af54769b9b7430f0a774 /lib/media_fill.h
parent8ac7b93b218af1544988331cd68c69ba4102c29f (diff)
tests: add gem_media_fill
It is to check whether media pipeline on render ring works. Codes are copied and modified from the rendercopy case which uses 3D pipeline. However media pipeline is simpler than 3D pipeline and there is few changes between gen6,gen7 and gen8 Reviewed-by: Zhao Yakui <yakui.zhao@intel.com> Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
Diffstat (limited to 'lib/media_fill.h')
-rw-r--r--lib/media_fill.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/lib/media_fill.h b/lib/media_fill.h
new file mode 100644
index 00000000..2e058cb2
--- /dev/null
+++ b/lib/media_fill.h
@@ -0,0 +1,50 @@
+#ifndef RENDE_MEDIA_FILL_H
+#define RENDE_MEDIA_FILL_H
+
+#include <stdlib.h>
+#include <sys/ioctl.h>
+#include <stdio.h>
+#include <string.h>
+#include <assert.h>
+#include <fcntl.h>
+#include <inttypes.h>
+#include <errno.h>
+#include <sys/stat.h>
+#include <sys/time.h>
+#include <getopt.h>
+#include "drm.h"
+#include "i915_drm.h"
+#include "drmtest.h"
+#include "intel_bufmgr.h"
+#include "intel_batchbuffer.h"
+#include "intel_gpu_tools.h"
+
+struct scratch_buf {
+ drm_intel_bo *bo;
+ uint32_t stride;
+ uint32_t tiling;
+ uint32_t *data;
+ uint32_t *cpu_mapping;
+ uint32_t size;
+ unsigned num_tiles;
+};
+
+static inline unsigned buf_width(struct scratch_buf *buf)
+{
+ return buf->stride/sizeof(uint8_t);
+}
+
+static inline unsigned buf_height(struct scratch_buf *buf)
+{
+ return buf->size/buf->stride;
+}
+
+typedef void (*media_fillfunc_t)(struct intel_batchbuffer *batch,
+ struct scratch_buf *dst,
+ unsigned x, unsigned y,
+ unsigned width, unsigned height,
+ uint8_t color);
+
+media_fillfunc_t get_media_fillfunc(int devid);
+
+#endif /* RENDE_MEDIA_FILL_H */