From 7dc0001f3db58af82f7e34c83a9fdb5fe90baccd Mon Sep 17 00:00:00 2001 From: Daniel Vetter Date: Sat, 22 Mar 2014 15:31:15 +0100 Subject: lib: make rendercopy.h an internal header And move the public interfaces into intel_batchbuffer.[hc]. A bit messy since we are fairly inconsistent with our header #include handling. Also exclude rendercopy.h from the documentation. Signed-off-by: Daniel Vetter --- lib/intel_batchbuffer.c | 19 ++++++++++++++++++ lib/intel_batchbuffer.h | 29 ++++++++++++++++++++++++++++ lib/media_fill.h | 20 ------------------- lib/rendercopy.h | 51 ------------------------------------------------- lib/rendercopy_gen6.c | 20 +++++++++++++++++-- lib/rendercopy_gen7.c | 20 +++++++++++++++++-- lib/rendercopy_gen8.c | 20 +++++++++++++++++-- lib/rendercopy_i830.c | 36 +++++++++++++++++----------------- lib/rendercopy_i915.c | 18 +++++++++++++++++ 9 files changed, 138 insertions(+), 95 deletions(-) (limited to 'lib') diff --git a/lib/intel_batchbuffer.c b/lib/intel_batchbuffer.c index 195f1b29..df036013 100644 --- a/lib/intel_batchbuffer.c +++ b/lib/intel_batchbuffer.c @@ -37,6 +37,7 @@ #include "intel_bufmgr.h" #include "intel_chipset.h" #include "intel_reg.h" +#include "rendercopy.h" #include /** @@ -384,3 +385,21 @@ intel_copy_bo(struct intel_batchbuffer *batch, dst_bo, 0, 0, 4096, 4096/4, size/4096, 32); } + +render_copyfunc_t get_render_copyfunc(int devid) +{ + render_copyfunc_t copy = NULL; + + if (IS_GEN2(devid)) + copy = gen2_render_copyfunc; + else if (IS_GEN3(devid)) + copy = gen3_render_copyfunc; + else if (IS_GEN6(devid)) + copy = gen6_render_copyfunc; + else if (IS_GEN7(devid)) + copy = gen7_render_copyfunc; + else if (IS_GEN8(devid)) + copy = gen8_render_copyfunc; + + return copy; +} diff --git a/lib/intel_batchbuffer.h b/lib/intel_batchbuffer.h index 10088c2e..5e02269c 100644 --- a/lib/intel_batchbuffer.h +++ b/lib/intel_batchbuffer.h @@ -2,6 +2,7 @@ #define INTEL_BATCHBUFFER_H #include +#include #include "intel_bufmgr.h" #define BATCH_SZ 4096 @@ -195,4 +196,32 @@ void intel_copy_bo(struct intel_batchbuffer *batch, drm_intel_bo *dst_bo, drm_intel_bo *src_bo, long int size); +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(uint32_t); +} + +static inline unsigned buf_height(struct scratch_buf *buf) +{ + return buf->size/buf->stride; +} + +typedef void (*render_copyfunc_t)(struct intel_batchbuffer *batch, + drm_intel_context *context, + struct scratch_buf *src, unsigned src_x, unsigned src_y, + unsigned width, unsigned height, + struct scratch_buf *dst, unsigned dst_x, unsigned dst_y); + +render_copyfunc_t get_render_copyfunc(int devid); + #endif diff --git a/lib/media_fill.h b/lib/media_fill.h index 719eb54a..9115776a 100644 --- a/lib/media_fill.h +++ b/lib/media_fill.h @@ -19,26 +19,6 @@ #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, diff --git a/lib/rendercopy.h b/lib/rendercopy.h index 6312cc32..92691fcf 100644 --- a/lib/rendercopy.h +++ b/lib/rendercopy.h @@ -1,34 +1,3 @@ -#ifndef RENDERCOPY_H -#define RENDERCOPY_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#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 void emit_vertex_2s(struct intel_batchbuffer *batch, int16_t x, int16_t y) { @@ -51,24 +20,6 @@ static inline void emit_vertex_normalized(struct intel_batchbuffer *batch, OUT_BATCH(u.ui); } -static inline unsigned buf_width(struct scratch_buf *buf) -{ - return buf->stride/sizeof(uint32_t); -} - -static inline unsigned buf_height(struct scratch_buf *buf) -{ - return buf->size/buf->stride; -} - -typedef void (*render_copyfunc_t)(struct intel_batchbuffer *batch, - drm_intel_context *context, - struct scratch_buf *src, unsigned src_x, unsigned src_y, - unsigned width, unsigned height, - struct scratch_buf *dst, unsigned dst_x, unsigned dst_y); - -render_copyfunc_t get_render_copyfunc(int devid); - void gen8_render_copyfunc(struct intel_batchbuffer *batch, drm_intel_context *context, struct scratch_buf *src, unsigned src_x, unsigned src_y, @@ -94,5 +45,3 @@ void gen2_render_copyfunc(struct intel_batchbuffer *batch, struct scratch_buf *src, unsigned src_x, unsigned src_y, unsigned width, unsigned height, struct scratch_buf *dst, unsigned dst_x, unsigned dst_y); - -#endif /* RENDERCOPY_H */ diff --git a/lib/rendercopy_gen6.c b/lib/rendercopy_gen6.c index 457cb354..092a312b 100644 --- a/lib/rendercopy_gen6.c +++ b/lib/rendercopy_gen6.c @@ -1,8 +1,24 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "drm.h" +#include "i915_drm.h" +#include "drmtest.h" +#include "intel_bufmgr.h" +#include "intel_batchbuffer.h" +#include "intel_gpu_tools.h" #include "rendercopy.h" #include "gen6_render.h" -#include - #define ALIGN(x, y) (((x) + (y)-1) & ~((y)-1)) #define VERTEX_SIZE (3*4) diff --git a/lib/rendercopy_gen7.c b/lib/rendercopy_gen7.c index f6981c7d..04bc6906 100644 --- a/lib/rendercopy_gen7.c +++ b/lib/rendercopy_gen7.c @@ -1,8 +1,24 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "drm.h" +#include "i915_drm.h" +#include "drmtest.h" +#include "intel_bufmgr.h" +#include "intel_batchbuffer.h" +#include "intel_gpu_tools.h" #include "rendercopy.h" #include "gen7_render.h" -#include - #define ALIGN(x, y) (((x) + (y)-1) & ~((y)-1)) static const uint32_t ps_kernel[][4] = { diff --git a/lib/rendercopy_gen8.c b/lib/rendercopy_gen8.c index 45a134c3..09d9fe4e 100644 --- a/lib/rendercopy_gen8.c +++ b/lib/rendercopy_gen8.c @@ -1,8 +1,24 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "drm.h" +#include "i915_drm.h" +#include "drmtest.h" +#include "intel_bufmgr.h" +#include "intel_batchbuffer.h" +#include "intel_gpu_tools.h" #include "rendercopy.h" #include "gen8_render.h" -#include - #include #define ALIGN(x, y) (((x) + (y)-1) & ~((y)-1)) diff --git a/lib/rendercopy_i830.c b/lib/rendercopy_i830.c index 73edcfa5..cb9088e2 100644 --- a/lib/rendercopy_i830.c +++ b/lib/rendercopy_i830.c @@ -1,3 +1,21 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "drm.h" +#include "i915_drm.h" +#include "drmtest.h" +#include "intel_bufmgr.h" +#include "intel_batchbuffer.h" +#include "intel_gpu_tools.h" + #include "i830_reg.h" #include "rendercopy.h" @@ -228,21 +246,3 @@ void gen2_render_copyfunc(struct intel_batchbuffer *batch, intel_batchbuffer_flush(batch); } - -render_copyfunc_t get_render_copyfunc(int devid) -{ - render_copyfunc_t copy = NULL; - - if (IS_GEN2(devid)) - copy = gen2_render_copyfunc; - else if (IS_GEN3(devid)) - copy = gen3_render_copyfunc; - else if (IS_GEN6(devid)) - copy = gen6_render_copyfunc; - else if (IS_GEN7(devid)) - copy = gen7_render_copyfunc; - else if (IS_GEN8(devid)) - copy = gen8_render_copyfunc; - - return copy; -} diff --git a/lib/rendercopy_i915.c b/lib/rendercopy_i915.c index 33e027e0..f7de2662 100644 --- a/lib/rendercopy_i915.c +++ b/lib/rendercopy_i915.c @@ -1,3 +1,21 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "drm.h" +#include "i915_drm.h" +#include "drmtest.h" +#include "intel_bufmgr.h" +#include "intel_batchbuffer.h" +#include "intel_gpu_tools.h" + #include "i915_reg.h" #include "i915_3d.h" #include "rendercopy.h" -- cgit v1.2.3