[igt-dev] [PATCH i-g-t 2/7] lib: Constify igt_buf
Ville Syrjala
ville.syrjala at linux.intel.com
Wed Jul 4 16:16:41 UTC 2018
From: Ville Syrjälä <ville.syrjala at linux.intel.com>
No one generally needs to modify the igt_bufs we pass around,
so make them const.
Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
---
lib/gpgpu_fill.c | 8 ++++----
lib/gpgpu_fill.h | 6 +++---
lib/gpu_cmds.c | 12 +++++++-----
lib/gpu_cmds.h | 12 +++++++-----
lib/intel_batchbuffer.c | 8 ++++----
lib/intel_batchbuffer.h | 16 ++++++++--------
lib/media_fill.c | 8 ++++----
lib/media_fill.h | 6 +++---
lib/media_spin.c | 4 ++--
lib/media_spin.h | 4 ++--
lib/rendercopy.h | 24 ++++++++++++------------
lib/rendercopy_gen6.c | 12 ++++++------
lib/rendercopy_gen7.c | 16 ++++++++--------
lib/rendercopy_gen8.c | 14 +++++++-------
lib/rendercopy_gen9.c | 14 +++++++-------
lib/rendercopy_i830.c | 8 ++++----
lib/rendercopy_i915.c | 4 ++--
17 files changed, 90 insertions(+), 86 deletions(-)
diff --git a/lib/gpgpu_fill.c b/lib/gpgpu_fill.c
index 26212842491d..a276e9d0ccd6 100644
--- a/lib/gpgpu_fill.c
+++ b/lib/gpgpu_fill.c
@@ -105,7 +105,7 @@ static const uint32_t gen9_gpgpu_kernel[][4] = {
void
gen7_gpgpu_fillfunc(struct intel_batchbuffer *batch,
- struct igt_buf *dst,
+ const struct igt_buf *dst,
unsigned int x, unsigned int y,
unsigned int width, unsigned int height,
uint8_t color)
@@ -154,7 +154,7 @@ gen7_gpgpu_fillfunc(struct intel_batchbuffer *batch,
void
gen8_gpgpu_fillfunc(struct intel_batchbuffer *batch,
- struct igt_buf *dst,
+ const struct igt_buf *dst,
unsigned int x, unsigned int y,
unsigned int width, unsigned int height,
uint8_t color)
@@ -202,7 +202,7 @@ gen8_gpgpu_fillfunc(struct intel_batchbuffer *batch,
static void
__gen9_gpgpu_fillfunc(struct intel_batchbuffer *batch,
- struct igt_buf *dst,
+ const struct igt_buf *dst,
unsigned int x, unsigned int y,
unsigned int width, unsigned int height,
uint8_t color, const uint32_t kernel[][4],
@@ -251,7 +251,7 @@ __gen9_gpgpu_fillfunc(struct intel_batchbuffer *batch,
}
void gen9_gpgpu_fillfunc(struct intel_batchbuffer *batch,
- struct igt_buf *dst,
+ const struct igt_buf *dst,
unsigned int x, unsigned int y,
unsigned int width, unsigned int height,
uint8_t color)
diff --git a/lib/gpgpu_fill.h b/lib/gpgpu_fill.h
index 0190bfc1cab1..40246d1a79f6 100644
--- a/lib/gpgpu_fill.h
+++ b/lib/gpgpu_fill.h
@@ -31,21 +31,21 @@
void
gen7_gpgpu_fillfunc(struct intel_batchbuffer *batch,
- struct igt_buf *dst,
+ const struct igt_buf *dst,
unsigned int x, unsigned int y,
unsigned int width, unsigned int height,
uint8_t color);
void
gen8_gpgpu_fillfunc(struct intel_batchbuffer *batch,
- struct igt_buf *dst,
+ const struct igt_buf *dst,
unsigned int x, unsigned int y,
unsigned int width, unsigned int height,
uint8_t color);
void
gen9_gpgpu_fillfunc(struct intel_batchbuffer *batch,
- struct igt_buf *dst,
+ const struct igt_buf *dst,
unsigned int x, unsigned int y,
unsigned int width, unsigned int height,
uint8_t color);
diff --git a/lib/gpu_cmds.c b/lib/gpu_cmds.c
index 323b03f643e3..556a94c6f0b6 100644
--- a/lib/gpu_cmds.c
+++ b/lib/gpu_cmds.c
@@ -54,7 +54,7 @@ gen7_fill_curbe_buffer_data(struct intel_batchbuffer *batch,
uint32_t
gen7_fill_surface_state(struct intel_batchbuffer *batch,
- struct igt_buf *buf,
+ const struct igt_buf *buf,
uint32_t format,
int is_dst)
{
@@ -103,7 +103,7 @@ gen7_fill_surface_state(struct intel_batchbuffer *batch,
uint32_t
gen7_fill_binding_table(struct intel_batchbuffer *batch,
- struct igt_buf *dst)
+ const struct igt_buf *dst)
{
uint32_t *binding_table, offset;
@@ -133,7 +133,8 @@ gen7_fill_kernel(struct intel_batchbuffer *batch,
uint32_t
gen7_fill_interface_descriptor(struct intel_batchbuffer *batch,
- struct igt_buf *dst, const uint32_t kernel[][4],
+ const struct igt_buf *dst,
+ const uint32_t kernel[][4],
size_t size)
{
struct gen7_interface_descriptor_data *idd;
@@ -335,7 +336,7 @@ gen8_spin_curbe_buffer_data(struct intel_batchbuffer *batch,
uint32_t
gen8_fill_surface_state(struct intel_batchbuffer *batch,
- struct igt_buf *buf,
+ const struct igt_buf *buf,
uint32_t format,
int is_dst)
{
@@ -385,7 +386,8 @@ gen8_fill_surface_state(struct intel_batchbuffer *batch,
uint32_t
gen8_fill_interface_descriptor(struct intel_batchbuffer *batch,
- struct igt_buf *dst, const uint32_t kernel[][4],
+ const struct igt_buf *dst,
+ const uint32_t kernel[][4],
size_t size)
{
struct gen8_interface_descriptor_data *idd;
diff --git a/lib/gpu_cmds.h b/lib/gpu_cmds.h
index 3d71494e1c7c..79bc4d6473ba 100644
--- a/lib/gpu_cmds.h
+++ b/lib/gpu_cmds.h
@@ -46,13 +46,13 @@ gen7_fill_curbe_buffer_data(struct intel_batchbuffer *batch,
uint32_t
gen7_fill_surface_state(struct intel_batchbuffer *batch,
- struct igt_buf *buf,
+ const struct igt_buf *buf,
uint32_t format,
int is_dst);
uint32_t
gen7_fill_binding_table(struct intel_batchbuffer *batch,
- struct igt_buf *dst);
+ const struct igt_buf *dst);
uint32_t
gen7_fill_kernel(struct intel_batchbuffer *batch,
@@ -61,7 +61,8 @@ gen7_fill_kernel(struct intel_batchbuffer *batch,
uint32_t
gen7_fill_interface_descriptor(struct intel_batchbuffer *batch,
- struct igt_buf *dst, const uint32_t kernel[][4],
+ const struct igt_buf *dst,
+ const uint32_t kernel[][4],
size_t size);
void
@@ -95,13 +96,14 @@ gen8_spin_curbe_buffer_data(struct intel_batchbuffer *batch,
uint32_t
gen8_fill_surface_state(struct intel_batchbuffer *batch,
- struct igt_buf *buf,
+ const struct igt_buf *buf,
uint32_t format,
int is_dst);
uint32_t
gen8_fill_interface_descriptor(struct intel_batchbuffer *batch,
- struct igt_buf *dst, const uint32_t kernel[][4],
+ const struct igt_buf *dst,
+ const uint32_t kernel[][4],
size_t size);
void
diff --git a/lib/intel_batchbuffer.c b/lib/intel_batchbuffer.c
index a85c760c6242..dfc2ce96207a 100644
--- a/lib/intel_batchbuffer.c
+++ b/lib/intel_batchbuffer.c
@@ -509,7 +509,7 @@ intel_copy_bo(struct intel_batchbuffer *batch,
* Returns:
* The width of the buffer.
*/
-unsigned igt_buf_width(struct igt_buf *buf)
+unsigned igt_buf_width(const struct igt_buf *buf)
{
return buf->stride/sizeof(uint32_t);
}
@@ -523,7 +523,7 @@ unsigned igt_buf_width(struct igt_buf *buf)
* Returns:
* The height of the buffer.
*/
-unsigned igt_buf_height(struct igt_buf *buf)
+unsigned igt_buf_height(const struct igt_buf *buf)
{
return buf->size/buf->stride;
}
@@ -775,11 +775,11 @@ void igt_blitter_fast_copy__raw(int fd,
* The source and destination surfaces cannot overlap.
*/
void igt_blitter_fast_copy(struct intel_batchbuffer *batch,
- struct igt_buf *src, unsigned src_delta,
+ const struct igt_buf *src, unsigned src_delta,
unsigned src_x, unsigned src_y,
unsigned width, unsigned height,
int bpp,
- struct igt_buf *dst, unsigned dst_delta,
+ const struct igt_buf *dst, unsigned dst_delta,
unsigned dst_x, unsigned dst_y)
{
uint32_t src_pitch, dst_pitch;
diff --git a/lib/intel_batchbuffer.h b/lib/intel_batchbuffer.h
index 1b8e831dac86..8acfdbbfc875 100644
--- a/lib/intel_batchbuffer.h
+++ b/lib/intel_batchbuffer.h
@@ -232,15 +232,15 @@ struct igt_buf {
unsigned num_tiles;
};
-unsigned igt_buf_width(struct igt_buf *buf);
-unsigned igt_buf_height(struct igt_buf *buf);
+unsigned igt_buf_width(const struct igt_buf *buf);
+unsigned igt_buf_height(const struct igt_buf *buf);
void igt_blitter_fast_copy(struct intel_batchbuffer *batch,
- struct igt_buf *src, unsigned src_delta,
+ const struct igt_buf *src, unsigned src_delta,
unsigned src_x, unsigned src_y,
unsigned width, unsigned height,
int bpp,
- struct igt_buf *dst, unsigned dst_delta,
+ const struct igt_buf *dst, unsigned dst_delta,
unsigned dst_x, unsigned dst_y);
void igt_blitter_fast_copy__raw(int fd,
@@ -287,9 +287,9 @@ void igt_blitter_fast_copy__raw(int fd,
*/
typedef void (*igt_render_copyfunc_t)(struct intel_batchbuffer *batch,
drm_intel_context *context,
- struct igt_buf *src, unsigned src_x, unsigned src_y,
+ const struct igt_buf *src, unsigned src_x, unsigned src_y,
unsigned width, unsigned height,
- struct igt_buf *dst, unsigned dst_x, unsigned dst_y);
+ const struct igt_buf *dst, unsigned dst_x, unsigned dst_y);
igt_render_copyfunc_t igt_get_render_copyfunc(int devid);
@@ -311,7 +311,7 @@ igt_render_copyfunc_t igt_get_render_copyfunc(int devid);
* the specified blit fill operation using the media/gpgpu engine.
*/
typedef void (*igt_fillfunc_t)(struct intel_batchbuffer *batch,
- struct igt_buf *dst,
+ const struct igt_buf *dst,
unsigned x, unsigned y,
unsigned width, unsigned height,
uint8_t color);
@@ -337,7 +337,7 @@ igt_fillfunc_t igt_get_gpgpu_fillfunc(int devid);
* to keep the render engine busy for a set time for various tests.
*/
typedef void (*igt_media_spinfunc_t)(struct intel_batchbuffer *batch,
- struct igt_buf *dst, uint32_t spins);
+ const struct igt_buf *dst, uint32_t spins);
igt_media_spinfunc_t igt_get_media_spinfunc(int devid);
diff --git a/lib/media_fill.c b/lib/media_fill.c
index 0223c0bb7d17..4942229505ff 100644
--- a/lib/media_fill.c
+++ b/lib/media_fill.c
@@ -91,7 +91,7 @@ static const uint32_t gen8_media_kernel[][4] = {
void
gen7_media_fillfunc(struct intel_batchbuffer *batch,
- struct igt_buf *dst,
+ const struct igt_buf *dst,
unsigned int x, unsigned int y,
unsigned int width, unsigned int height,
uint8_t color)
@@ -135,7 +135,7 @@ gen7_media_fillfunc(struct intel_batchbuffer *batch,
void
gen8_media_fillfunc(struct intel_batchbuffer *batch,
- struct igt_buf *dst,
+ const struct igt_buf *dst,
unsigned int x, unsigned int y,
unsigned int width, unsigned int height,
uint8_t color)
@@ -179,7 +179,7 @@ gen8_media_fillfunc(struct intel_batchbuffer *batch,
static void
__gen9_media_fillfunc(struct intel_batchbuffer *batch,
- struct igt_buf *dst,
+ const struct igt_buf *dst,
unsigned int x, unsigned int y,
unsigned int width, unsigned int height,
uint8_t color, const uint32_t kernel[][4],
@@ -235,7 +235,7 @@ __gen9_media_fillfunc(struct intel_batchbuffer *batch,
void
gen9_media_fillfunc(struct intel_batchbuffer *batch,
- struct igt_buf *dst,
+ const struct igt_buf *dst,
unsigned int x, unsigned int y,
unsigned int width, unsigned int height,
uint8_t color)
diff --git a/lib/media_fill.h b/lib/media_fill.h
index 7863ae843fe0..e365da9e47d2 100644
--- a/lib/media_fill.h
+++ b/lib/media_fill.h
@@ -30,21 +30,21 @@
void
gen8_media_fillfunc(struct intel_batchbuffer *batch,
- struct igt_buf *dst,
+ const struct igt_buf *dst,
unsigned int x, unsigned int y,
unsigned int width, unsigned int height,
uint8_t color);
void
gen7_media_fillfunc(struct intel_batchbuffer *batch,
- struct igt_buf *dst,
+ const struct igt_buf *dst,
unsigned int x, unsigned int y,
unsigned int width, unsigned int height,
uint8_t color);
void
gen9_media_fillfunc(struct intel_batchbuffer *batch,
- struct igt_buf *dst,
+ const struct igt_buf *dst,
unsigned int x, unsigned int y,
unsigned int width, unsigned int height,
uint8_t color);
diff --git a/lib/media_spin.c b/lib/media_spin.c
index f3e68ef74c39..009c7806ee82 100644
--- a/lib/media_spin.c
+++ b/lib/media_spin.c
@@ -81,7 +81,7 @@ static const uint32_t spin_kernel[][4] = {
void
gen8_media_spinfunc(struct intel_batchbuffer *batch,
- struct igt_buf *dst, uint32_t spins)
+ const struct igt_buf *dst, uint32_t spins)
{
uint32_t curbe_buffer, interface_descriptor;
uint32_t batch_end;
@@ -121,7 +121,7 @@ gen8_media_spinfunc(struct intel_batchbuffer *batch,
void
gen9_media_spinfunc(struct intel_batchbuffer *batch,
- struct igt_buf *dst, uint32_t spins)
+ const struct igt_buf *dst, uint32_t spins)
{
uint32_t curbe_buffer, interface_descriptor;
uint32_t batch_end;
diff --git a/lib/media_spin.h b/lib/media_spin.h
index 57d8c2e231b0..768eccc06aae 100644
--- a/lib/media_spin.h
+++ b/lib/media_spin.h
@@ -28,9 +28,9 @@
#define MEDIA_SPIN_H
void gen8_media_spinfunc(struct intel_batchbuffer *batch,
- struct igt_buf *dst, uint32_t spins);
+ const struct igt_buf *dst, uint32_t spins);
void gen9_media_spinfunc(struct intel_batchbuffer *batch,
- struct igt_buf *dst, uint32_t spins);
+ const struct igt_buf *dst, uint32_t spins);
#endif /* MEDIA_SPIN_H */
diff --git a/lib/rendercopy.h b/lib/rendercopy.h
index fdc3cabb20d7..f1c501977304 100644
--- a/lib/rendercopy.h
+++ b/lib/rendercopy.h
@@ -25,31 +25,31 @@ static inline void emit_vertex_normalized(struct intel_batchbuffer *batch,
void gen9_render_copyfunc(struct intel_batchbuffer *batch,
drm_intel_context *context,
- struct igt_buf *src, unsigned src_x, unsigned src_y,
+ const struct igt_buf *src, unsigned src_x, unsigned src_y,
unsigned width, unsigned height,
- struct igt_buf *dst, unsigned dst_x, unsigned dst_y);
+ const struct igt_buf *dst, unsigned dst_x, unsigned dst_y);
void gen8_render_copyfunc(struct intel_batchbuffer *batch,
drm_intel_context *context,
- struct igt_buf *src, unsigned src_x, unsigned src_y,
+ const struct igt_buf *src, unsigned src_x, unsigned src_y,
unsigned width, unsigned height,
- struct igt_buf *dst, unsigned dst_x, unsigned dst_y);
+ const struct igt_buf *dst, unsigned dst_x, unsigned dst_y);
void gen7_render_copyfunc(struct intel_batchbuffer *batch,
drm_intel_context *context,
- struct igt_buf *src, unsigned src_x, unsigned src_y,
+ const struct igt_buf *src, unsigned src_x, unsigned src_y,
unsigned width, unsigned height,
- struct igt_buf *dst, unsigned dst_x, unsigned dst_y);
+ const struct igt_buf *dst, unsigned dst_x, unsigned dst_y);
void gen6_render_copyfunc(struct intel_batchbuffer *batch,
drm_intel_context *context,
- struct igt_buf *src, unsigned src_x, unsigned src_y,
+ const struct igt_buf *src, unsigned src_x, unsigned src_y,
unsigned width, unsigned height,
- struct igt_buf *dst, unsigned dst_x, unsigned dst_y);
+ const struct igt_buf *dst, unsigned dst_x, unsigned dst_y);
void gen3_render_copyfunc(struct intel_batchbuffer *batch,
drm_intel_context *context,
- struct igt_buf *src, unsigned src_x, unsigned src_y,
+ const struct igt_buf *src, unsigned src_x, unsigned src_y,
unsigned width, unsigned height,
- struct igt_buf *dst, unsigned dst_x, unsigned dst_y);
+ const struct igt_buf *dst, unsigned dst_x, unsigned dst_y);
void gen2_render_copyfunc(struct intel_batchbuffer *batch,
drm_intel_context *context,
- struct igt_buf *src, unsigned src_x, unsigned src_y,
+ const struct igt_buf *src, unsigned src_x, unsigned src_y,
unsigned width, unsigned height,
- struct igt_buf *dst, unsigned dst_x, unsigned dst_y);
+ const struct igt_buf *dst, unsigned dst_x, unsigned dst_y);
diff --git a/lib/rendercopy_gen6.c b/lib/rendercopy_gen6.c
index 3cbe3d0259f2..eebc9bf25877 100644
--- a/lib/rendercopy_gen6.c
+++ b/lib/rendercopy_gen6.c
@@ -72,7 +72,7 @@ gen6_render_flush(struct intel_batchbuffer *batch,
}
static uint32_t
-gen6_bind_buf(struct intel_batchbuffer *batch, struct igt_buf *buf,
+gen6_bind_buf(struct intel_batchbuffer *batch, const struct igt_buf *buf,
uint32_t format, int is_dst)
{
struct gen6_surface_state *ss;
@@ -111,8 +111,8 @@ gen6_bind_buf(struct intel_batchbuffer *batch, struct igt_buf *buf,
static uint32_t
gen6_bind_surfaces(struct intel_batchbuffer *batch,
- struct igt_buf *src,
- struct igt_buf *dst)
+ const struct igt_buf *src,
+ const struct igt_buf *dst)
{
uint32_t *binding_table;
@@ -341,7 +341,7 @@ gen6_emit_binding_table(struct intel_batchbuffer *batch, uint32_t wm_table)
}
static void
-gen6_emit_drawing_rectangle(struct intel_batchbuffer *batch, struct igt_buf *dst)
+gen6_emit_drawing_rectangle(struct intel_batchbuffer *batch, const struct igt_buf *dst)
{
OUT_BATCH(GEN6_3DSTATE_DRAWING_RECTANGLE | (4 - 2));
OUT_BATCH(0);
@@ -512,9 +512,9 @@ static uint32_t gen6_emit_primitive(struct intel_batchbuffer *batch)
void gen6_render_copyfunc(struct intel_batchbuffer *batch,
drm_intel_context *context,
- struct igt_buf *src, unsigned src_x, unsigned src_y,
+ const struct igt_buf *src, unsigned src_x, unsigned src_y,
unsigned width, unsigned height,
- struct igt_buf *dst, unsigned dst_x, unsigned dst_y)
+ const 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;
diff --git a/lib/rendercopy_gen7.c b/lib/rendercopy_gen7.c
index 706d62760859..caaa05ca8dc0 100644
--- a/lib/rendercopy_gen7.c
+++ b/lib/rendercopy_gen7.c
@@ -58,7 +58,7 @@ gen7_tiling_bits(uint32_t tiling)
static uint32_t
gen7_bind_buf(struct intel_batchbuffer *batch,
- struct igt_buf *buf,
+ const struct igt_buf *buf,
uint32_t format,
int is_dst)
{
@@ -179,8 +179,8 @@ static void gen7_emit_vertex_buffer(struct intel_batchbuffer *batch,
static uint32_t
gen7_bind_surfaces(struct intel_batchbuffer *batch,
- struct igt_buf *src,
- struct igt_buf *dst)
+ const struct igt_buf *src,
+ const struct igt_buf *dst)
{
uint32_t *binding_table;
@@ -196,8 +196,8 @@ gen7_bind_surfaces(struct intel_batchbuffer *batch,
static void
gen7_emit_binding_table(struct intel_batchbuffer *batch,
- struct igt_buf *src,
- struct igt_buf *dst,
+ const struct igt_buf *src,
+ const struct igt_buf *dst,
uint32_t bind_surf_off)
{
OUT_BATCH(GEN7_3DSTATE_BINDING_TABLE_POINTERS_PS | (2 - 2));
@@ -205,7 +205,7 @@ gen7_emit_binding_table(struct intel_batchbuffer *batch,
}
static void
-gen7_emit_drawing_rectangle(struct intel_batchbuffer *batch, struct igt_buf *dst)
+gen7_emit_drawing_rectangle(struct intel_batchbuffer *batch, const struct igt_buf *dst)
{
OUT_BATCH(GEN6_3DSTATE_DRAWING_RECTANGLE | (4 - 2));
OUT_BATCH(0);
@@ -492,9 +492,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 igt_buf *src, unsigned src_x, unsigned src_y,
+ const struct igt_buf *src, unsigned src_x, unsigned src_y,
unsigned width, unsigned height,
- struct igt_buf *dst, unsigned dst_x, unsigned dst_y)
+ const struct igt_buf *dst, unsigned dst_x, unsigned dst_y)
{
uint32_t ps_binding_table, ps_sampler_off, ps_kernel_off;
uint32_t blend_state, cc_viewport;
diff --git a/lib/rendercopy_gen8.c b/lib/rendercopy_gen8.c
index 90b2730b7d46..4406a0a0e6eb 100644
--- a/lib/rendercopy_gen8.c
+++ b/lib/rendercopy_gen8.c
@@ -144,7 +144,7 @@ gen6_render_flush(struct intel_batchbuffer *batch,
static uint32_t
gen8_bind_buf(struct intel_batchbuffer *batch,
struct annotations_context *aub,
- struct igt_buf *buf,
+ const struct igt_buf *buf,
uint32_t format, int is_dst)
{
struct gen8_surface_state *ss;
@@ -195,8 +195,8 @@ gen8_bind_buf(struct intel_batchbuffer *batch,
static uint32_t
gen8_bind_surfaces(struct intel_batchbuffer *batch,
struct annotations_context *aub,
- struct igt_buf *src,
- struct igt_buf *dst)
+ const struct igt_buf *src,
+ const struct igt_buf *dst)
{
uint32_t *binding_table, offset;
@@ -267,7 +267,7 @@ gen8_fill_ps(struct intel_batchbuffer *batch,
static uint32_t
gen7_fill_vertex_buffer_data(struct intel_batchbuffer *batch,
struct annotations_context *aub,
- struct igt_buf *src,
+ const 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)
@@ -823,7 +823,7 @@ gen7_emit_clear(struct intel_batchbuffer *batch) {
}
static void
-gen6_emit_drawing_rectangle(struct intel_batchbuffer *batch, struct igt_buf *dst)
+gen6_emit_drawing_rectangle(struct intel_batchbuffer *batch, const struct igt_buf *dst)
{
OUT_BATCH(GEN6_3DSTATE_DRAWING_RECTANGLE | (4 - 2));
OUT_BATCH(0);
@@ -887,9 +887,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 igt_buf *src, unsigned src_x, unsigned src_y,
+ const struct igt_buf *src, unsigned src_x, unsigned src_y,
unsigned width, unsigned height,
- struct igt_buf *dst, unsigned dst_x, unsigned dst_y)
+ const struct igt_buf *dst, unsigned dst_x, unsigned dst_y)
{
struct annotations_context aub_annotations;
uint32_t ps_sampler_state, ps_kernel_off, ps_binding_table;
diff --git a/lib/rendercopy_gen9.c b/lib/rendercopy_gen9.c
index 6707ef8e6aef..fc5c09374c77 100644
--- a/lib/rendercopy_gen9.c
+++ b/lib/rendercopy_gen9.c
@@ -143,7 +143,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 igt_buf *buf,
+gen8_bind_buf(struct intel_batchbuffer *batch, const struct igt_buf *buf,
uint32_t format, int is_dst) {
struct gen8_surface_state *ss;
uint32_t write_domain, read_domain, offset;
@@ -193,8 +193,8 @@ gen8_bind_buf(struct intel_batchbuffer *batch, struct igt_buf *buf,
static uint32_t
gen8_bind_surfaces(struct intel_batchbuffer *batch,
- struct igt_buf *src,
- struct igt_buf *dst)
+ const struct igt_buf *src,
+ const struct igt_buf *dst)
{
uint32_t *binding_table, offset;
@@ -261,7 +261,7 @@ gen8_fill_ps(struct intel_batchbuffer *batch,
*/
static uint32_t
gen7_fill_vertex_buffer_data(struct intel_batchbuffer *batch,
- struct igt_buf *src,
+ const 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)
@@ -827,7 +827,7 @@ gen7_emit_clear(struct intel_batchbuffer *batch) {
}
static void
-gen6_emit_drawing_rectangle(struct intel_batchbuffer *batch, struct igt_buf *dst)
+gen6_emit_drawing_rectangle(struct intel_batchbuffer *batch, const struct igt_buf *dst)
{
OUT_BATCH(GEN6_3DSTATE_DRAWING_RECTANGLE | (4 - 2));
OUT_BATCH(0);
@@ -894,9 +894,9 @@ static void gen8_emit_primitive(struct intel_batchbuffer *batch, uint32_t offset
void gen9_render_copyfunc(struct intel_batchbuffer *batch,
drm_intel_context *context,
- struct igt_buf *src, unsigned src_x, unsigned src_y,
+ const struct igt_buf *src, unsigned src_x, unsigned src_y,
unsigned width, unsigned height,
- struct igt_buf *dst, unsigned dst_x, unsigned dst_y)
+ const 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;
diff --git a/lib/rendercopy_i830.c b/lib/rendercopy_i830.c
index 04215b1b0bb2..2b07ad5d750a 100644
--- a/lib/rendercopy_i830.c
+++ b/lib/rendercopy_i830.c
@@ -133,7 +133,7 @@ static void gen2_emit_invariant(struct intel_batchbuffer *batch)
}
static void gen2_emit_target(struct intel_batchbuffer *batch,
- struct igt_buf *dst)
+ const struct igt_buf *dst)
{
uint32_t tiling;
@@ -161,7 +161,7 @@ static void gen2_emit_target(struct intel_batchbuffer *batch,
}
static void gen2_emit_texture(struct intel_batchbuffer *batch,
- struct igt_buf *src,
+ const struct igt_buf *src,
int unit)
{
uint32_t tiling;
@@ -209,9 +209,9 @@ static void gen2_emit_copy_pipeline(struct intel_batchbuffer *batch)
void gen2_render_copyfunc(struct intel_batchbuffer *batch,
drm_intel_context *context,
- struct igt_buf *src, unsigned src_x, unsigned src_y,
+ const struct igt_buf *src, unsigned src_x, unsigned src_y,
unsigned width, unsigned height,
- struct igt_buf *dst, unsigned dst_x, unsigned dst_y)
+ const struct igt_buf *dst, unsigned dst_x, unsigned dst_y)
{
gen2_emit_invariant(batch);
gen2_emit_copy_pipeline(batch);
diff --git a/lib/rendercopy_i915.c b/lib/rendercopy_i915.c
index fc9583cfdab1..f68e7c1f2806 100644
--- a/lib/rendercopy_i915.c
+++ b/lib/rendercopy_i915.c
@@ -21,9 +21,9 @@
void gen3_render_copyfunc(struct intel_batchbuffer *batch,
drm_intel_context *context,
- struct igt_buf *src, unsigned src_x, unsigned src_y,
+ const struct igt_buf *src, unsigned src_x, unsigned src_y,
unsigned width, unsigned height,
- struct igt_buf *dst, unsigned dst_x, unsigned dst_y)
+ const struct igt_buf *dst, unsigned dst_x, unsigned dst_y)
{
/* invariant state */
{
--
2.16.4
More information about the igt-dev
mailing list