mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2026-08-21 21:32:56 +00:00
lib/intel_batchbuffer: igt_ namespace for the buffer structure
Step one to properly namespace the rendercpy/mediafill functions. Als give the buf_height/width helpers a proper igt_ prefix. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
@@ -387,12 +387,12 @@ intel_copy_bo(struct intel_batchbuffer *batch,
|
||||
4096/4, size/4096, 32);
|
||||
}
|
||||
|
||||
unsigned buf_width(struct scratch_buf *buf)
|
||||
unsigned igt_buf_width(struct igt_buf *buf)
|
||||
{
|
||||
return buf->stride/sizeof(uint32_t);
|
||||
}
|
||||
|
||||
unsigned buf_height(struct scratch_buf *buf)
|
||||
unsigned igt_buf_height(struct igt_buf *buf)
|
||||
{
|
||||
return buf->size/buf->stride;
|
||||
}
|
||||
|
||||
@@ -196,7 +196,7 @@ void intel_copy_bo(struct intel_batchbuffer *batch,
|
||||
drm_intel_bo *dst_bo, drm_intel_bo *src_bo,
|
||||
long int size);
|
||||
|
||||
struct scratch_buf {
|
||||
struct igt_buf {
|
||||
drm_intel_bo *bo;
|
||||
uint32_t stride;
|
||||
uint32_t tiling;
|
||||
@@ -206,19 +206,19 @@ struct scratch_buf {
|
||||
unsigned num_tiles;
|
||||
};
|
||||
|
||||
unsigned buf_width(struct scratch_buf *buf);
|
||||
unsigned buf_height(struct scratch_buf *buf);
|
||||
unsigned igt_buf_width(struct igt_buf *buf);
|
||||
unsigned igt_buf_height(struct igt_buf *buf);
|
||||
|
||||
typedef void (*render_copyfunc_t)(struct intel_batchbuffer *batch,
|
||||
drm_intel_context *context,
|
||||
struct scratch_buf *src, unsigned src_x, unsigned src_y,
|
||||
struct igt_buf *src, unsigned src_x, unsigned src_y,
|
||||
unsigned width, unsigned height,
|
||||
struct scratch_buf *dst, unsigned dst_x, unsigned dst_y);
|
||||
struct igt_buf *dst, unsigned dst_x, unsigned dst_y);
|
||||
|
||||
render_copyfunc_t get_render_copyfunc(int devid);
|
||||
|
||||
typedef void (*media_fillfunc_t)(struct intel_batchbuffer *batch,
|
||||
struct scratch_buf *dst,
|
||||
struct igt_buf *dst,
|
||||
unsigned x, unsigned y,
|
||||
unsigned width, unsigned height,
|
||||
uint8_t color);
|
||||
|
||||
+2
-2
@@ -21,14 +21,14 @@
|
||||
|
||||
void
|
||||
gen8_media_fillfunc(struct intel_batchbuffer *batch,
|
||||
struct scratch_buf *dst,
|
||||
struct igt_buf *dst,
|
||||
unsigned x, unsigned y,
|
||||
unsigned width, unsigned height,
|
||||
uint8_t color);
|
||||
|
||||
void
|
||||
gen7_media_fillfunc(struct intel_batchbuffer *batch,
|
||||
struct scratch_buf *dst,
|
||||
struct igt_buf *dst,
|
||||
unsigned x, unsigned y,
|
||||
unsigned width, unsigned height,
|
||||
uint8_t color);
|
||||
|
||||
@@ -82,7 +82,7 @@ gen7_fill_curbe_buffer_data(struct intel_batchbuffer *batch,
|
||||
|
||||
static uint32_t
|
||||
gen7_fill_surface_state(struct intel_batchbuffer *batch,
|
||||
struct scratch_buf *buf,
|
||||
struct igt_buf *buf,
|
||||
uint32_t format,
|
||||
int is_dst)
|
||||
{
|
||||
@@ -116,8 +116,8 @@ gen7_fill_surface_state(struct intel_batchbuffer *batch,
|
||||
read_domain, write_domain);
|
||||
assert(ret == 0);
|
||||
|
||||
ss->ss2.height = buf_height(buf) - 1;
|
||||
ss->ss2.width = buf_width(buf) - 1;
|
||||
ss->ss2.height = igt_buf_height(buf) - 1;
|
||||
ss->ss2.width = igt_buf_width(buf) - 1;
|
||||
|
||||
ss->ss3.pitch = buf->stride - 1;
|
||||
|
||||
@@ -131,7 +131,7 @@ gen7_fill_surface_state(struct intel_batchbuffer *batch,
|
||||
|
||||
static uint32_t
|
||||
gen7_fill_binding_table(struct intel_batchbuffer *batch,
|
||||
struct scratch_buf *dst)
|
||||
struct igt_buf *dst)
|
||||
{
|
||||
uint32_t *binding_table, offset;
|
||||
|
||||
@@ -156,7 +156,7 @@ gen7_fill_media_kernel(struct intel_batchbuffer *batch,
|
||||
}
|
||||
|
||||
static uint32_t
|
||||
gen7_fill_interface_descriptor(struct intel_batchbuffer *batch, struct scratch_buf *dst)
|
||||
gen7_fill_interface_descriptor(struct intel_batchbuffer *batch, struct igt_buf *dst)
|
||||
{
|
||||
struct gen7_interface_descriptor_data *idd;
|
||||
uint32_t offset;
|
||||
@@ -311,7 +311,7 @@ gen7_emit_media_objects(struct intel_batchbuffer *batch,
|
||||
|
||||
void
|
||||
gen7_media_fillfunc(struct intel_batchbuffer *batch,
|
||||
struct scratch_buf *dst,
|
||||
struct igt_buf *dst,
|
||||
unsigned x, unsigned y,
|
||||
unsigned width, unsigned height,
|
||||
uint8_t color)
|
||||
|
||||
@@ -82,7 +82,7 @@ gen8_fill_curbe_buffer_data(struct intel_batchbuffer *batch,
|
||||
|
||||
static uint32_t
|
||||
gen8_fill_surface_state(struct intel_batchbuffer *batch,
|
||||
struct scratch_buf *buf,
|
||||
struct igt_buf *buf,
|
||||
uint32_t format,
|
||||
int is_dst)
|
||||
{
|
||||
@@ -119,8 +119,8 @@ gen8_fill_surface_state(struct intel_batchbuffer *batch,
|
||||
read_domain, write_domain);
|
||||
assert(ret == 0);
|
||||
|
||||
ss->ss2.height = buf_height(buf) - 1;
|
||||
ss->ss2.width = buf_width(buf) - 1;
|
||||
ss->ss2.height = igt_buf_height(buf) - 1;
|
||||
ss->ss2.width = igt_buf_width(buf) - 1;
|
||||
ss->ss3.pitch = buf->stride - 1;
|
||||
|
||||
ss->ss7.shader_chanel_select_r = 4;
|
||||
@@ -133,7 +133,7 @@ gen8_fill_surface_state(struct intel_batchbuffer *batch,
|
||||
|
||||
static uint32_t
|
||||
gen8_fill_binding_table(struct intel_batchbuffer *batch,
|
||||
struct scratch_buf *dst)
|
||||
struct igt_buf *dst)
|
||||
{
|
||||
uint32_t *binding_table, offset;
|
||||
|
||||
@@ -158,7 +158,7 @@ gen8_fill_media_kernel(struct intel_batchbuffer *batch,
|
||||
}
|
||||
|
||||
static uint32_t
|
||||
gen8_fill_interface_descriptor(struct intel_batchbuffer *batch, struct scratch_buf *dst)
|
||||
gen8_fill_interface_descriptor(struct intel_batchbuffer *batch, struct igt_buf *dst)
|
||||
{
|
||||
struct gen8_interface_descriptor_data *idd;
|
||||
uint32_t offset;
|
||||
@@ -334,7 +334,7 @@ gen8_emit_media_objects(struct intel_batchbuffer *batch,
|
||||
|
||||
void
|
||||
gen8_media_fillfunc(struct intel_batchbuffer *batch,
|
||||
struct scratch_buf *dst,
|
||||
struct igt_buf *dst,
|
||||
unsigned x, unsigned y,
|
||||
unsigned width, unsigned height,
|
||||
uint8_t color)
|
||||
|
||||
+10
-10
@@ -22,26 +22,26 @@ static inline void emit_vertex_normalized(struct intel_batchbuffer *batch,
|
||||
|
||||
void gen8_render_copyfunc(struct intel_batchbuffer *batch,
|
||||
drm_intel_context *context,
|
||||
struct scratch_buf *src, unsigned src_x, unsigned src_y,
|
||||
struct igt_buf *src, unsigned src_x, unsigned src_y,
|
||||
unsigned width, unsigned height,
|
||||
struct scratch_buf *dst, unsigned dst_x, unsigned dst_y);
|
||||
struct igt_buf *dst, unsigned dst_x, unsigned dst_y);
|
||||
void gen7_render_copyfunc(struct intel_batchbuffer *batch,
|
||||
drm_intel_context *context,
|
||||
struct scratch_buf *src, unsigned src_x, unsigned src_y,
|
||||
struct igt_buf *src, unsigned src_x, unsigned src_y,
|
||||
unsigned width, unsigned height,
|
||||
struct scratch_buf *dst, unsigned dst_x, unsigned dst_y);
|
||||
struct igt_buf *dst, unsigned dst_x, unsigned dst_y);
|
||||
void gen6_render_copyfunc(struct intel_batchbuffer *batch,
|
||||
drm_intel_context *context,
|
||||
struct scratch_buf *src, unsigned src_x, unsigned src_y,
|
||||
struct igt_buf *src, unsigned src_x, unsigned src_y,
|
||||
unsigned width, unsigned height,
|
||||
struct scratch_buf *dst, unsigned dst_x, unsigned dst_y);
|
||||
struct igt_buf *dst, unsigned dst_x, unsigned dst_y);
|
||||
void gen3_render_copyfunc(struct intel_batchbuffer *batch,
|
||||
drm_intel_context *context,
|
||||
struct scratch_buf *src, unsigned src_x, unsigned src_y,
|
||||
struct igt_buf *src, unsigned src_x, unsigned src_y,
|
||||
unsigned width, unsigned height,
|
||||
struct scratch_buf *dst, unsigned dst_x, unsigned dst_y);
|
||||
struct igt_buf *dst, unsigned dst_x, unsigned dst_y);
|
||||
void gen2_render_copyfunc(struct intel_batchbuffer *batch,
|
||||
drm_intel_context *context,
|
||||
struct scratch_buf *src, unsigned src_x, unsigned src_y,
|
||||
struct igt_buf *src, unsigned src_x, unsigned src_y,
|
||||
unsigned width, unsigned height,
|
||||
struct scratch_buf *dst, unsigned dst_x, unsigned dst_y);
|
||||
struct igt_buf *dst, unsigned dst_x, unsigned dst_y);
|
||||
|
||||
+15
-15
@@ -107,7 +107,7 @@ gen6_render_flush(struct intel_batchbuffer *batch,
|
||||
}
|
||||
|
||||
static uint32_t
|
||||
gen6_bind_buf(struct intel_batchbuffer *batch, struct scratch_buf *buf,
|
||||
gen6_bind_buf(struct intel_batchbuffer *batch, struct igt_buf *buf,
|
||||
uint32_t format, int is_dst)
|
||||
{
|
||||
struct gen6_surface_state *ss;
|
||||
@@ -135,8 +135,8 @@ gen6_bind_buf(struct intel_batchbuffer *batch, struct scratch_buf *buf,
|
||||
read_domain, write_domain);
|
||||
assert(ret == 0);
|
||||
|
||||
ss->ss2.height = buf_height(buf) - 1;
|
||||
ss->ss2.width = buf_width(buf) - 1;
|
||||
ss->ss2.height = igt_buf_height(buf) - 1;
|
||||
ss->ss2.width = igt_buf_width(buf) - 1;
|
||||
ss->ss3.pitch = buf->stride - 1;
|
||||
ss->ss3.tiled_surface = buf->tiling != I915_TILING_NONE;
|
||||
ss->ss3.tile_walk = buf->tiling == I915_TILING_Y;
|
||||
@@ -146,8 +146,8 @@ gen6_bind_buf(struct intel_batchbuffer *batch, struct scratch_buf *buf,
|
||||
|
||||
static uint32_t
|
||||
gen6_bind_surfaces(struct intel_batchbuffer *batch,
|
||||
struct scratch_buf *src,
|
||||
struct scratch_buf *dst)
|
||||
struct igt_buf *src,
|
||||
struct igt_buf *dst)
|
||||
{
|
||||
uint32_t *binding_table;
|
||||
|
||||
@@ -376,11 +376,11 @@ gen6_emit_binding_table(struct intel_batchbuffer *batch, uint32_t wm_table)
|
||||
}
|
||||
|
||||
static void
|
||||
gen6_emit_drawing_rectangle(struct intel_batchbuffer *batch, struct scratch_buf *dst)
|
||||
gen6_emit_drawing_rectangle(struct intel_batchbuffer *batch, struct igt_buf *dst)
|
||||
{
|
||||
OUT_BATCH(GEN6_3DSTATE_DRAWING_RECTANGLE | (4 - 2));
|
||||
OUT_BATCH(0);
|
||||
OUT_BATCH((buf_height(dst) - 1) << 16 | (buf_width(dst) - 1));
|
||||
OUT_BATCH((igt_buf_height(dst) - 1) << 16 | (igt_buf_width(dst) - 1));
|
||||
OUT_BATCH(0);
|
||||
}
|
||||
|
||||
@@ -547,9 +547,9 @@ static uint32_t gen6_emit_primitive(struct intel_batchbuffer *batch)
|
||||
|
||||
void gen6_render_copyfunc(struct intel_batchbuffer *batch,
|
||||
drm_intel_context *context,
|
||||
struct scratch_buf *src, unsigned src_x, unsigned src_y,
|
||||
struct igt_buf *src, unsigned src_x, unsigned src_y,
|
||||
unsigned width, unsigned height,
|
||||
struct scratch_buf *dst, unsigned dst_x, unsigned dst_y)
|
||||
struct igt_buf *dst, unsigned dst_x, unsigned dst_y)
|
||||
{
|
||||
uint32_t wm_state, wm_kernel, wm_table;
|
||||
uint32_t cc_vp, cc_blend, offset;
|
||||
@@ -601,16 +601,16 @@ void gen6_render_copyfunc(struct intel_batchbuffer *batch,
|
||||
batch_round_upto(batch, VERTEX_SIZE)/VERTEX_SIZE;
|
||||
|
||||
emit_vertex_2s(batch, dst_x + width, dst_y + height);
|
||||
emit_vertex_normalized(batch, src_x + width, buf_width(src));
|
||||
emit_vertex_normalized(batch, src_y + height, buf_height(src));
|
||||
emit_vertex_normalized(batch, src_x + width, igt_buf_width(src));
|
||||
emit_vertex_normalized(batch, src_y + height, igt_buf_height(src));
|
||||
|
||||
emit_vertex_2s(batch, dst_x, dst_y + height);
|
||||
emit_vertex_normalized(batch, src_x, buf_width(src));
|
||||
emit_vertex_normalized(batch, src_y + height, buf_height(src));
|
||||
emit_vertex_normalized(batch, src_x, igt_buf_width(src));
|
||||
emit_vertex_normalized(batch, src_y + height, igt_buf_height(src));
|
||||
|
||||
emit_vertex_2s(batch, dst_x, dst_y);
|
||||
emit_vertex_normalized(batch, src_x, buf_width(src));
|
||||
emit_vertex_normalized(batch, src_y, buf_height(src));
|
||||
emit_vertex_normalized(batch, src_x, igt_buf_width(src));
|
||||
emit_vertex_normalized(batch, src_y, igt_buf_height(src));
|
||||
|
||||
gen6_render_flush(batch, context, batch_end);
|
||||
intel_batchbuffer_reset(batch);
|
||||
|
||||
+11
-11
@@ -93,7 +93,7 @@ gen7_tiling_bits(uint32_t tiling)
|
||||
|
||||
static uint32_t
|
||||
gen7_bind_buf(struct intel_batchbuffer *batch,
|
||||
struct scratch_buf *buf,
|
||||
struct igt_buf *buf,
|
||||
uint32_t format,
|
||||
int is_dst)
|
||||
{
|
||||
@@ -114,8 +114,8 @@ gen7_bind_buf(struct intel_batchbuffer *batch,
|
||||
gen7_tiling_bits(buf->tiling) |
|
||||
format << GEN7_SURFACE_FORMAT_SHIFT);
|
||||
ss[1] = buf->bo->offset;
|
||||
ss[2] = ((buf_width(buf) - 1) << GEN7_SURFACE_WIDTH_SHIFT |
|
||||
(buf_height(buf) - 1) << GEN7_SURFACE_HEIGHT_SHIFT);
|
||||
ss[2] = ((igt_buf_width(buf) - 1) << GEN7_SURFACE_WIDTH_SHIFT |
|
||||
(igt_buf_height(buf) - 1) << GEN7_SURFACE_HEIGHT_SHIFT);
|
||||
ss[3] = (buf->stride - 1) << GEN7_SURFACE_PITCH_SHIFT;
|
||||
ss[4] = 0;
|
||||
ss[5] = 0;
|
||||
@@ -220,8 +220,8 @@ static void gen7_emit_vertex_buffer(struct intel_batchbuffer *batch,
|
||||
|
||||
static uint32_t
|
||||
gen7_bind_surfaces(struct intel_batchbuffer *batch,
|
||||
struct scratch_buf *src,
|
||||
struct scratch_buf *dst)
|
||||
struct igt_buf *src,
|
||||
struct igt_buf *dst)
|
||||
{
|
||||
uint32_t *binding_table;
|
||||
|
||||
@@ -237,19 +237,19 @@ gen7_bind_surfaces(struct intel_batchbuffer *batch,
|
||||
|
||||
static void
|
||||
gen7_emit_binding_table(struct intel_batchbuffer *batch,
|
||||
struct scratch_buf *src,
|
||||
struct scratch_buf *dst)
|
||||
struct igt_buf *src,
|
||||
struct igt_buf *dst)
|
||||
{
|
||||
OUT_BATCH(GEN7_3DSTATE_BINDING_TABLE_POINTERS_PS | (2 - 2));
|
||||
OUT_BATCH(gen7_bind_surfaces(batch, src, dst));
|
||||
}
|
||||
|
||||
static void
|
||||
gen7_emit_drawing_rectangle(struct intel_batchbuffer *batch, struct scratch_buf *dst)
|
||||
gen7_emit_drawing_rectangle(struct intel_batchbuffer *batch, struct igt_buf *dst)
|
||||
{
|
||||
OUT_BATCH(GEN7_3DSTATE_DRAWING_RECTANGLE | (4 - 2));
|
||||
OUT_BATCH(0);
|
||||
OUT_BATCH((buf_height(dst) - 1) << 16 | (buf_width(dst) - 1));
|
||||
OUT_BATCH((igt_buf_height(dst) - 1) << 16 | (igt_buf_width(dst) - 1));
|
||||
OUT_BATCH(0);
|
||||
}
|
||||
|
||||
@@ -531,9 +531,9 @@ gen7_emit_null_depth_buffer(struct intel_batchbuffer *batch)
|
||||
#define BATCH_STATE_SPLIT 2048
|
||||
void gen7_render_copyfunc(struct intel_batchbuffer *batch,
|
||||
drm_intel_context *context,
|
||||
struct scratch_buf *src, unsigned src_x, unsigned src_y,
|
||||
struct igt_buf *src, unsigned src_x, unsigned src_y,
|
||||
unsigned width, unsigned height,
|
||||
struct scratch_buf *dst, unsigned dst_x, unsigned dst_y)
|
||||
struct igt_buf *dst, unsigned dst_x, unsigned dst_y)
|
||||
{
|
||||
uint32_t batch_end;
|
||||
|
||||
|
||||
+16
-16
@@ -177,7 +177,7 @@ gen6_render_flush(struct intel_batchbuffer *batch,
|
||||
|
||||
/* Mostly copy+paste from gen6, except height, width, pitch moved */
|
||||
static uint32_t
|
||||
gen8_bind_buf(struct intel_batchbuffer *batch, struct scratch_buf *buf,
|
||||
gen8_bind_buf(struct intel_batchbuffer *batch, struct igt_buf *buf,
|
||||
uint32_t format, int is_dst) {
|
||||
struct gen8_surface_state *ss;
|
||||
uint32_t write_domain, read_domain, offset;
|
||||
@@ -213,8 +213,8 @@ gen8_bind_buf(struct intel_batchbuffer *batch, struct scratch_buf *buf,
|
||||
read_domain, write_domain);
|
||||
assert(ret == 0);
|
||||
|
||||
ss->ss2.height = buf_height(buf) - 1;
|
||||
ss->ss2.width = buf_width(buf) - 1;
|
||||
ss->ss2.height = igt_buf_height(buf) - 1;
|
||||
ss->ss2.width = igt_buf_width(buf) - 1;
|
||||
ss->ss3.pitch = buf->stride - 1;
|
||||
|
||||
ss->ss7.shader_chanel_select_r = 4;
|
||||
@@ -227,8 +227,8 @@ gen8_bind_buf(struct intel_batchbuffer *batch, struct scratch_buf *buf,
|
||||
|
||||
static uint32_t
|
||||
gen8_bind_surfaces(struct intel_batchbuffer *batch,
|
||||
struct scratch_buf *src,
|
||||
struct scratch_buf *dst)
|
||||
struct igt_buf *src,
|
||||
struct igt_buf *dst)
|
||||
{
|
||||
uint32_t *binding_table, offset;
|
||||
|
||||
@@ -295,7 +295,7 @@ gen8_fill_ps(struct intel_batchbuffer *batch,
|
||||
*/
|
||||
static uint32_t
|
||||
gen7_fill_vertex_buffer_data(struct intel_batchbuffer *batch,
|
||||
struct scratch_buf *src,
|
||||
struct igt_buf *src,
|
||||
uint32_t src_x, uint32_t src_y,
|
||||
uint32_t dst_x, uint32_t dst_y,
|
||||
uint32_t width, uint32_t height)
|
||||
@@ -307,16 +307,16 @@ gen7_fill_vertex_buffer_data(struct intel_batchbuffer *batch,
|
||||
start = batch->ptr;
|
||||
|
||||
emit_vertex_2s(batch, dst_x + width, dst_y + height);
|
||||
emit_vertex_normalized(batch, src_x + width, buf_width(src));
|
||||
emit_vertex_normalized(batch, src_y + height, buf_height(src));
|
||||
emit_vertex_normalized(batch, src_x + width, igt_buf_width(src));
|
||||
emit_vertex_normalized(batch, src_y + height, igt_buf_height(src));
|
||||
|
||||
emit_vertex_2s(batch, dst_x, dst_y + height);
|
||||
emit_vertex_normalized(batch, src_x, buf_width(src));
|
||||
emit_vertex_normalized(batch, src_y + height, buf_height(src));
|
||||
emit_vertex_normalized(batch, src_x, igt_buf_width(src));
|
||||
emit_vertex_normalized(batch, src_y + height, igt_buf_height(src));
|
||||
|
||||
emit_vertex_2s(batch, dst_x, dst_y);
|
||||
emit_vertex_normalized(batch, src_x, buf_width(src));
|
||||
emit_vertex_normalized(batch, src_y, buf_height(src));
|
||||
emit_vertex_normalized(batch, src_x, igt_buf_width(src));
|
||||
emit_vertex_normalized(batch, src_y, igt_buf_height(src));
|
||||
|
||||
offset = batch_offset(batch, start);
|
||||
annotation_add_state(&aub_annotations, AUB_TRACE_VERTEX_BUFFER,
|
||||
@@ -843,11 +843,11 @@ gen7_emit_clear(struct intel_batchbuffer *batch) {
|
||||
}
|
||||
|
||||
static void
|
||||
gen6_emit_drawing_rectangle(struct intel_batchbuffer *batch, struct scratch_buf *dst)
|
||||
gen6_emit_drawing_rectangle(struct intel_batchbuffer *batch, struct igt_buf *dst)
|
||||
{
|
||||
OUT_BATCH(GEN6_3DSTATE_DRAWING_RECTANGLE | (4 - 2));
|
||||
OUT_BATCH(0);
|
||||
OUT_BATCH((buf_height(dst) - 1) << 16 | (buf_width(dst) - 1));
|
||||
OUT_BATCH((igt_buf_height(dst) - 1) << 16 | (igt_buf_width(dst) - 1));
|
||||
OUT_BATCH(0);
|
||||
}
|
||||
|
||||
@@ -907,9 +907,9 @@ static void gen8_emit_primitive(struct intel_batchbuffer *batch, uint32_t offset
|
||||
|
||||
void gen8_render_copyfunc(struct intel_batchbuffer *batch,
|
||||
drm_intel_context *context,
|
||||
struct scratch_buf *src, unsigned src_x, unsigned src_y,
|
||||
struct igt_buf *src, unsigned src_x, unsigned src_y,
|
||||
unsigned width, unsigned height,
|
||||
struct scratch_buf *dst, unsigned dst_x, unsigned dst_y)
|
||||
struct igt_buf *dst, unsigned dst_x, unsigned dst_y)
|
||||
{
|
||||
uint32_t ps_sampler_state, ps_kernel_off, ps_binding_table;
|
||||
uint32_t scissor_state;
|
||||
|
||||
+14
-14
@@ -134,7 +134,7 @@ static void gen2_emit_invariant(struct intel_batchbuffer *batch)
|
||||
}
|
||||
|
||||
static void gen2_emit_target(struct intel_batchbuffer *batch,
|
||||
struct scratch_buf *dst)
|
||||
struct igt_buf *dst)
|
||||
{
|
||||
uint32_t tiling;
|
||||
|
||||
@@ -156,13 +156,13 @@ static void gen2_emit_target(struct intel_batchbuffer *batch,
|
||||
OUT_BATCH(_3DSTATE_DRAW_RECT_CMD);
|
||||
OUT_BATCH(0);
|
||||
OUT_BATCH(0); /* ymin, xmin */
|
||||
OUT_BATCH(DRAW_YMAX(buf_height(dst) - 1) |
|
||||
DRAW_XMAX(buf_width(dst) - 1));
|
||||
OUT_BATCH(DRAW_YMAX(igt_buf_height(dst) - 1) |
|
||||
DRAW_XMAX(igt_buf_width(dst) - 1));
|
||||
OUT_BATCH(0); /* yorig, xorig */
|
||||
}
|
||||
|
||||
static void gen2_emit_texture(struct intel_batchbuffer *batch,
|
||||
struct scratch_buf *src,
|
||||
struct igt_buf *src,
|
||||
int unit)
|
||||
{
|
||||
uint32_t tiling;
|
||||
@@ -175,8 +175,8 @@ static void gen2_emit_texture(struct intel_batchbuffer *batch,
|
||||
|
||||
OUT_BATCH(_3DSTATE_LOAD_STATE_IMMEDIATE_2 | LOAD_TEXTURE_MAP(unit) | 4);
|
||||
OUT_RELOC(src->bo, I915_GEM_DOMAIN_SAMPLER, 0, 0);
|
||||
OUT_BATCH((buf_height(src) - 1) << TM0S1_HEIGHT_SHIFT |
|
||||
(buf_width(src) - 1) << TM0S1_WIDTH_SHIFT |
|
||||
OUT_BATCH((igt_buf_height(src) - 1) << TM0S1_HEIGHT_SHIFT |
|
||||
(igt_buf_width(src) - 1) << TM0S1_WIDTH_SHIFT |
|
||||
MAPSURF_32BIT | MT_32BIT_ARGB8888 | tiling);
|
||||
OUT_BATCH((src->stride / 4 - 1) << TM0S2_PITCH_SHIFT | TM0S2_MAP_2D);
|
||||
OUT_BATCH(FILTER_NEAREST << TM0S3_MAG_FILTER_SHIFT |
|
||||
@@ -210,9 +210,9 @@ static void gen2_emit_copy_pipeline(struct intel_batchbuffer *batch)
|
||||
|
||||
void gen2_render_copyfunc(struct intel_batchbuffer *batch,
|
||||
drm_intel_context *context,
|
||||
struct scratch_buf *src, unsigned src_x, unsigned src_y,
|
||||
struct igt_buf *src, unsigned src_x, unsigned src_y,
|
||||
unsigned width, unsigned height,
|
||||
struct scratch_buf *dst, unsigned dst_x, unsigned dst_y)
|
||||
struct igt_buf *dst, unsigned dst_x, unsigned dst_y)
|
||||
{
|
||||
gen2_emit_invariant(batch);
|
||||
gen2_emit_copy_pipeline(batch);
|
||||
@@ -231,18 +231,18 @@ void gen2_render_copyfunc(struct intel_batchbuffer *batch,
|
||||
OUT_BATCH(PRIM3D_INLINE | PRIM3D_RECTLIST | (3*4 -1));
|
||||
emit_vertex(batch, dst_x + width);
|
||||
emit_vertex(batch, dst_y + height);
|
||||
emit_vertex_normalized(batch, src_x + width, buf_width(src));
|
||||
emit_vertex_normalized(batch, src_y + height, buf_height(src));
|
||||
emit_vertex_normalized(batch, src_x + width, igt_buf_width(src));
|
||||
emit_vertex_normalized(batch, src_y + height, igt_buf_height(src));
|
||||
|
||||
emit_vertex(batch, dst_x);
|
||||
emit_vertex(batch, dst_y + height);
|
||||
emit_vertex_normalized(batch, src_x, buf_width(src));
|
||||
emit_vertex_normalized(batch, src_y + height, buf_height(src));
|
||||
emit_vertex_normalized(batch, src_x, igt_buf_width(src));
|
||||
emit_vertex_normalized(batch, src_y + height, igt_buf_height(src));
|
||||
|
||||
emit_vertex(batch, dst_x);
|
||||
emit_vertex(batch, dst_y);
|
||||
emit_vertex_normalized(batch, src_x, buf_width(src));
|
||||
emit_vertex_normalized(batch, src_y, buf_height(src));
|
||||
emit_vertex_normalized(batch, src_x, igt_buf_width(src));
|
||||
emit_vertex_normalized(batch, src_y, igt_buf_height(src));
|
||||
|
||||
intel_batchbuffer_flush(batch);
|
||||
}
|
||||
|
||||
@@ -22,9 +22,9 @@
|
||||
|
||||
void gen3_render_copyfunc(struct intel_batchbuffer *batch,
|
||||
drm_intel_context *context,
|
||||
struct scratch_buf *src, unsigned src_x, unsigned src_y,
|
||||
struct igt_buf *src, unsigned src_x, unsigned src_y,
|
||||
unsigned width, unsigned height,
|
||||
struct scratch_buf *dst, unsigned dst_x, unsigned dst_y)
|
||||
struct igt_buf *dst, unsigned dst_x, unsigned dst_y)
|
||||
{
|
||||
/* invariant state */
|
||||
{
|
||||
@@ -96,8 +96,8 @@ void gen3_render_copyfunc(struct intel_batchbuffer *batch,
|
||||
OUT_RELOC(src->bo, I915_GEM_DOMAIN_SAMPLER, 0, 0);
|
||||
OUT_BATCH(MAPSURF_32BIT | MT_32BIT_ARGB8888 |
|
||||
tiling_bits |
|
||||
(buf_height(src) - 1) << MS3_HEIGHT_SHIFT |
|
||||
(buf_width(src) - 1) << MS3_WIDTH_SHIFT);
|
||||
(igt_buf_height(src) - 1) << MS3_HEIGHT_SHIFT |
|
||||
(igt_buf_width(src) - 1) << MS3_WIDTH_SHIFT);
|
||||
OUT_BATCH((src->stride/4-1) << MS4_PITCH_SHIFT);
|
||||
|
||||
OUT_BATCH(_3DSTATE_SAMPLER_STATE | (3 * TEX_COUNT));
|
||||
@@ -133,8 +133,8 @@ void gen3_render_copyfunc(struct intel_batchbuffer *batch,
|
||||
OUT_BATCH(_3DSTATE_DRAW_RECT_CMD);
|
||||
OUT_BATCH(0x00000000);
|
||||
OUT_BATCH(0x00000000); /* ymin, xmin */
|
||||
OUT_BATCH(DRAW_YMAX(buf_height(dst) - 1) |
|
||||
DRAW_XMAX(buf_width(dst) - 1));
|
||||
OUT_BATCH(DRAW_YMAX(igt_buf_height(dst) - 1) |
|
||||
DRAW_XMAX(igt_buf_width(dst) - 1));
|
||||
/* yorig, xorig (relate to color buffer?) */
|
||||
OUT_BATCH(0x00000000);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user