lib: rename igt_media_fillfunc_t typedef to igt_fillfunc_t
PATCH 1/3 lib: rename igt_media_fillfunc_t typedef to igt_fillfunc_t
This makes fill function more general to prepare for other fill method using GPGPU pipeline.
--- lib/intel_batchbuffer.c | 4 ++-- lib/intel_batchbuffer.h | 24 ++++++++++++------------ tests/gem_media_fill.c | 2 +- 3 files changed, 15 insertions(+), 15 deletions(-)
lib/intel_batchbuffer.c +2 -2
@@ -496,9 +496,9 @@ igt_render_copyfunc_t igt_get_render_copyfunc(int devid)* The platform-specific media fill function pointer for the device specified * with @devid. Will return NULL when no media fill function is implemented. */ -igt_media_fillfunc_t igt_get_media_fillfunc (int devid) +igt_fillfunc_t igt_get_media_fillfunc (int devid) { -igt_media_fillfunc_t fill =NULL ; +igt_fillfunc_t fill =NULL ;if (IS_GEN9 (devid)) fill = gen9_media_fillfunc;
lib/intel_batchbuffer.h +12 -12
@@ -195,7 +195,7 @@ void intel_copy_bo(struct intel_batchbuffer *batch,* * This is a i-g-t buffer object wrapper structure which augments the baseline * libdrm buffer object with suitable data needed by the render copy and the -* media fill functions. +* fill functions. */ struct igt_buf {drm_intel_bo *bo;
@@ -240,7 +240,7 @@ typedef void (*igt_render_copyfunc_t)(struct intel_batchbuffer *batch,igt_render_copyfunc_t igt_get_render_copyfunc (int devid);/** -* igt_media_fillfunc_t: +* igt_fillfunc_t: * @batch: batchbuffer object * @dst: destination i-g-t buffer object * @x: destination pixel x-coordination
@@ -249,19 +249,19 @@ igt_render_copyfunc_t igt_get_render_copyfunc(int devid);* @height: height of the filled rectangle * @color: fill color to use * -* This is the type of the per-platform media fill functions. The -* platform-specific implementation can be obtained by calling -* igt_get_media_fillfunc(). +* This is the type of the per-platform fill functions using media +* pipeline. The platform-specific implementation can be obtained +* by calling igt_get_media_fillfunc(). * -* A media fill function will emit a batchbuffer to the kernel which executes +* A fill function will emit a batchbuffer to the kernel which executes * the specified blit fill operation using the media engine. */ -typedef void (*igt_media_fillfunc_t )(struct intel_batchbuffer *batch, -struct igt_buf *dst, -unsigned x,unsigned y, -unsigned width,unsigned height, -uint8_t color); +typedef void (*igt_fillfunc_t )(struct intel_batchbuffer *batch, +struct igt_buf *dst, +unsigned x,unsigned y, +unsigned width,unsigned height, +uint8_t color); -igt_media_fillfunc_t igt_get_media_fillfunc (int devid); +igt_fillfunc_t igt_get_media_fillfunc (int devid);#endif
tests/gem_media_fill.c +1 -1
@@ -101,7 +101,7 @@ igt_simple_maindata_t data = {0 , };struct intel_batchbuffer *batch =NULL ;struct igt_buf dst; -igt_media_fillfunc_t media_fill =NULL ; +igt_fillfunc_t media_fill =NULL ;int i, j; data.drm_fd =drm_open_any_render ();
Signature · 6 lines
2.1.3 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 2/3 lib: Add GPGPU fill
This is to add fill operation using GPGPU pipeline which is similar to current media fill. This can be used to simply verify GPGPU pipeline and help to enable it on newer HW, currently it works on Gen7 only and will add support on later platform.
Now this sets very simply thread group dispatch for one thread per thread group on SIMD16 dispatch. So the fill shader just uses thread group ID for buffer offset.
v2: No new fill func typedef but adapt to igt_fillfunc_t.
--- lib/gen7_media.h | 2 + lib/intel_batchbuffer.c | 19 +++++ lib/intel_batchbuffer.h | 7 +- lib/media_fill.h | 7 ++ lib/media_fill_gen7.c | 161 +++++++++++++++++++++++++++++++++++++++++-- shaders/gpgpu/README | 4 ++ shaders/gpgpu/gpgpu_fill.gxa | 51 ++++++++++++++ 7 files changed, 244 insertions(+), 7 deletions(-) create mode 100644 shaders/gpgpu/README create mode 100644 shaders/gpgpu/gpgpu_fill.gxa
lib/gen7_media.h +2 -0
@@ -179,6 +179,7 @@#define GEN7_PIPELINE_SELECT GFXPIPE(1, 1, 4)# define PIPELINE_SELECT_3D (0 << 0)# define PIPELINE_SELECT_MEDIA (1 << 0) +# define PIPELINE_SELECT_GPGPU (2 << 0)#define GEN7_STATE_BASE_ADDRESS GFXPIPE(0, 1, 1)# define BASE_ADDRESS_MODIFY (1 << 0)
@@ -187,6 +188,7 @@#define GEN7_MEDIA_CURBE_LOAD GFXPIPE(2, 0, 1)#define GEN7_MEDIA_INTERFACE_DESCRIPTOR_LOAD GFXPIPE(2, 0, 2)#define GEN7_MEDIA_OBJECT GFXPIPE(2, 1, 0) +#define GEN7_GPGPU_WALKER GFXPIPE(2, 1, 5)struct gen7_interface_descriptor_data {
lib/intel_batchbuffer.c +19 -0
@@ -511,3 +511,22 @@ igt_fillfunc_t igt_get_media_fillfunc(int devid)return fill; } + +/** +* igt_get_gpgpu_fillfunc: +* @devid: pci device id +* +* Returns: +* +* The platform-specific gpgpu fill function pointer for the device specified +* with @devid. Will return NULL when no gpgpu fill function is implemented. +*/ +igt_fillfunc_t igt_get_gpgpu_fillfunc (int devid) +{ +igt_fillfunc_t fill =NULL ; + +if (IS_GEN7 (devid)) + fill = gen7_gpgpu_fillfunc; + +return fill; +}
lib/intel_batchbuffer.h +4 -3
@@ -250,11 +250,11 @@ igt_render_copyfunc_t igt_get_render_copyfunc(int devid);* @color: fill color to use * * This is the type of the per-platform fill functions using media -* pipeline. The platform-specific implementation can be obtained -* by calling igt_get_media_fillfunc(). +* or gpgpu pipeline. The platform-specific implementation can be obtained +* by calling igt_get_media_fillfunc() or igt_get_gpgpu_fillfunc(). * * A fill function will emit a batchbuffer to the kernel which executes -* the specified blit fill operation using the media engine. +* the specified blit fill operation using the media/gpgpu engine. */ typedef void (*igt_fillfunc_t)(struct intel_batchbuffer *batch, struct igt_buf *dst,
@@ -263,5 +263,6 @@ typedef void (*igt_fillfunc_t)(struct intel_batchbuffer *batch, uint8_t color);igt_fillfunc_t igt_get_media_fillfunc (int devid); +igt_fillfunc_t igt_get_gpgpu_fillfunc (int devid);#endif
lib/media_fill.h +7 -0
@@ -32,4 +32,11 @@ gen9_media_fillfunc(struct intel_batchbuffer *batch, unsigned width, unsigned height, uint8_t color); +void +gen7_gpgpu_fillfunc (struct intel_batchbuffer *batch, +struct igt_buf *dst, +unsigned x,unsigned y, +unsigned width,unsigned height, +uint8_t color); +#endif /* RENDE_MEDIA_FILL_H */
lib/media_fill_gen7.c +157 -4
194 lines not on this page · raw message
shaders/gpgpu/README new file +4 -0
@@ -0,0 +1,4 @@ + +Commands used to generate the shader on gen7 +$> m4 gpgpu_fill.gxa > gpgpu_fill.gxm +$> intel-gen4asm -g 7 -o <output> gpgpu_fill.gxm
shaders/gpgpu/gpgpu_fill.gxa new file +51 -0
51 lines not on this page · raw message
Signature · 6 lines
2.1.3 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 3/3 tests: Add gem_gpgpu_fill
In reply to Zhenyu WangThis is simply a copy of gem_media_fill but using new GPGPU fill operation.
v2: Use general fill func pointer.
--- tests/Makefile.sources | 1 + tests/gem_gpgpu_fill.c | 141 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 142 insertions(+) create mode 100644 tests/gem_gpgpu_fill.c
tests/Makefile.sources +1 -0
@@ -112,6 +112,7 @@ TESTS_progs = \ gem_lut_handle \ gem_mmap_offset_exhaustion \ gem_media_fill \ + gem_gpgpu_fill \ gem_pin \ gem_reg_read \ gem_render_copy \
tests/gem_gpgpu_fill.c new file +141 -0
141 lines not on this page · raw message
Signature · 6 lines
2.1.3 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 4 lines · Zhenyu Wang
This makes fill function more general to prepare for other fill method using GPGPU pipeline.
Signed-off-by Zhenyu Wang <[email protected]>
Series lgtm, please push.
-Daniel
Quoted 94 lines
--- lib/intel_batchbuffer.c | 4 ++-- lib/intel_batchbuffer.h | 24 ++++++++++++------------ tests/gem_media_fill.c | 2 +- 3 files changed, 15 insertions(+), 15 deletions(-)lib/intel_batchbuffer.c +2
-2@@ -496,9 +496,9 @@ igt_render_copyfunc_t igt_get_render_copyfunc(int devid)* The platform-specific media fill function pointer for the device specified * with @devid. Will return NULL when no media fill function is implemented. */ -igt_media_fillfunc_t igt_get_media_fillfunc (int devid) +igt_fillfunc_t igt_get_media_fillfunc (int devid) { -igt_media_fillfunc_t fill =NULL ; +igt_fillfunc_t fill =NULL ;if (IS_GEN9 (devid)) fill = gen9_media_fillfunc;lib/intel_batchbuffer.h +12
-12@@ -195,7 +195,7 @@ void intel_copy_bo(struct intel_batchbuffer *batch,* * This is a i-g-t buffer object wrapper structure which augments the baseline * libdrm buffer object with suitable data needed by the render copy and the -* media fill functions. +* fill functions. */ struct igt_buf {drm_intel_bo *bo;@@ -240,7 +240,7 @@ typedef void (*igt_render_copyfunc_t)(struct intel_batchbuffer *batch,igt_render_copyfunc_t igt_get_render_copyfunc (int devid);/** -* igt_media_fillfunc_t: +* igt_fillfunc_t: * @batch: batchbuffer object * @dst: destination i-g-t buffer object * @x: destination pixel x-coordination @@ -249,19 +249,19 @@ igt_render_copyfunc_t igt_get_render_copyfunc(int devid);* @height: height of the filled rectangle * @color: fill color to use * -* This is the type of the per-platform media fill functions. The -* platform-specific implementation can be obtained by calling -* igt_get_media_fillfunc(). +* This is the type of the per-platform fill functions using media +* pipeline. The platform-specific implementation can be obtained +* by calling igt_get_media_fillfunc(). * -* A media fill function will emit a batchbuffer to the kernel which executes +* A fill function will emit a batchbuffer to the kernel which executes * the specified blit fill operation using the media engine. */ -typedef void (*igt_media_fillfunc_t )(struct intel_batchbuffer *batch, -struct igt_buf *dst, -unsigned x,unsigned y, -unsigned width,unsigned height, -uint8_t color); +typedef void (*igt_fillfunc_t )(struct intel_batchbuffer *batch, +struct igt_buf *dst, +unsigned x,unsigned y, +unsigned width,unsigned height, +uint8_t color); -igt_media_fillfunc_t igt_get_media_fillfunc (int devid); +igt_fillfunc_t igt_get_media_fillfunc (int devid);#endif tests/gem_media_fill.c +1
-1@@ -101,7 +101,7 @@ igt_simple_maindata_t data = {0 , };struct intel_batchbuffer *batch =NULL ;struct igt_buf dst; -igt_media_fillfunc_t media_fill =NULL ; +igt_fillfunc_t media_fill =NULL ;int i, j; data.drm_fd =drm_open_any_render ();Signature · 6 lines
2.1.3 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 7 lines · Daniel Vetter
Quoted 4 lines · Zhenyu Wang
This makes fill function more general to prepare for other fill method using GPGPU pipeline.
Signed-off-by Zhenyu Wang <[email protected]>Series lgtm, please push.
Just pushed, thanks for the review.
Signature · 3 lines
Open Source Technology Center, Intel ltd. $gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx