From 0db789e180b6b01fb8aff547879387058f52a0b9 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Wed, 13 Jun 2012 14:26:37 +0200 Subject: sna: Constification Adding preserving const modifiers to decrease amount of const warnings Signed-off-by: Zdenek Kabelac Signed-off-by: Chris Wilson --- src/sna/blt.c | 16 +++++----- src/sna/kgem_debug.c | 2 +- src/sna/kgem_debug_gen2.c | 4 +-- src/sna/kgem_debug_gen3.c | 76 +++++++++++++++++++++++------------------------ src/sna/kgem_debug_gen4.c | 6 ++-- src/sna/kgem_debug_gen5.c | 6 ++-- src/sna/kgem_debug_gen6.c | 6 ++-- src/sna/kgem_debug_gen7.c | 7 ++--- src/sna/sna_accel.c | 2 +- src/sna/sna_blt.c | 38 ++++++++++++------------ 10 files changed, 81 insertions(+), 82 deletions(-) diff --git a/src/sna/blt.c b/src/sna/blt.c index e9d06ebe..494b413f 100644 --- a/src/sna/blt.c +++ b/src/sna/blt.c @@ -164,7 +164,7 @@ memcpy_blt(const void *src, void *dst, int bpp, bpp /= 8; - src_bytes = (uint8_t *)src + src_stride * src_y + src_x * bpp; + src_bytes = (const uint8_t *)src + src_stride * src_y + src_x * bpp; dst_bytes = (uint8_t *)dst + dst_stride * dst_y + dst_x * bpp; byte_width = width * bpp; @@ -184,7 +184,7 @@ memcpy_blt(const void *src, void *dst, int bpp, case 2: do { - *(uint16_t *)dst_bytes = *(uint16_t *)src_bytes; + *(uint16_t *)dst_bytes = *(const uint16_t *)src_bytes; src_bytes += src_stride; dst_bytes += dst_stride; } while (--height); @@ -192,7 +192,7 @@ memcpy_blt(const void *src, void *dst, int bpp, case 4: do { - *(uint32_t *)dst_bytes = *(uint32_t *)src_bytes; + *(uint32_t *)dst_bytes = *(const uint32_t *)src_bytes; src_bytes += src_stride; dst_bytes += dst_stride; } while (--height); @@ -200,7 +200,7 @@ memcpy_blt(const void *src, void *dst, int bpp, case 8: do { - *(uint64_t *)dst_bytes = *(uint64_t *)src_bytes; + *(uint64_t *)dst_bytes = *(const uint64_t *)src_bytes; src_bytes += src_stride; dst_bytes += dst_stride; } while (--height); @@ -224,7 +224,7 @@ memcpy_xor(const void *src, void *dst, int bpp, uint16_t width, uint16_t height, uint32_t and, uint32_t or) { - uint8_t *src_bytes; + const uint8_t *src_bytes; uint8_t *dst_bytes; int i; @@ -239,7 +239,7 @@ memcpy_xor(const void *src, void *dst, int bpp, bpp, and, or)); bpp /= 8; - src_bytes = (uint8_t *)src + src_stride * src_y + src_x * bpp; + src_bytes = (const uint8_t *)src + src_stride * src_y + src_x * bpp; dst_bytes = (uint8_t *)dst + dst_stride * dst_y + dst_x * bpp; if (and == 0xffffffff) { @@ -262,7 +262,7 @@ memcpy_xor(const void *src, void *dst, int bpp, if (width & 1) { do { uint16_t *d = (uint16_t *)dst_bytes; - uint16_t *s = (uint16_t *)src_bytes; + const uint16_t *s = (const uint16_t *)src_bytes; for (i = 0; i < width; i++) d[i] = s[i] | or; @@ -285,7 +285,7 @@ memcpy_xor(const void *src, void *dst, int bpp, if (have_sse2()) { do { uint32_t *d = (uint32_t *)dst_bytes; - uint32_t *s = (uint32_t *)src_bytes; + const uint32_t *s = (const uint32_t *)src_bytes; __m128i mask = xmm_create_mask_32(or); i = width; diff --git a/src/sna/kgem_debug.c b/src/sna/kgem_debug.c index e46ffcac..2dc1b456 100644 --- a/src/sna/kgem_debug.c +++ b/src/sna/kgem_debug.c @@ -225,7 +225,7 @@ decode_2d(struct kgem *kgem, uint32_t offset) }; unsigned int op, len; - char *format = NULL; + const char *format = NULL; uint32_t *data = kgem->batch + offset; struct drm_i915_gem_relocation_entry *reloc; diff --git a/src/sna/kgem_debug_gen2.c b/src/sna/kgem_debug_gen2.c index e00cd814..09f3873b 100644 --- a/src/sna/kgem_debug_gen2.c +++ b/src/sna/kgem_debug_gen2.c @@ -245,14 +245,14 @@ decode_3d_1d(struct kgem *kgem, uint32_t offset) { uint32_t *data = kgem->batch + offset; unsigned int len, i, idx, word, map; - char *format, *zformat, *type; + const char *format, *zformat, *type; uint32_t opcode; static const struct { uint32_t opcode; int min_len; int max_len; - char *name; + const char *name; } opcodes_3d_1d[] = { { 0x86, 4, 4, "3DSTATE_CHROMA_KEY" }, { 0x88, 2, 2, "3DSTATE_CONSTANT_BLEND_COLOR" }, diff --git a/src/sna/kgem_debug_gen3.c b/src/sna/kgem_debug_gen3.c index de9d217f..5d6d1756 100644 --- a/src/sna/kgem_debug_gen3.c +++ b/src/sna/kgem_debug_gen3.c @@ -344,7 +344,7 @@ gen3_get_instruction_dst(uint32_t *data, int i, char *dstname, int do_mask) uint32_t a0 = data[i]; int dst_nr = (a0 >> 14) & 0xf; char dstmask[8]; - char *sat; + const char *sat; if (do_mask) { if (((a0 >> 10) & 0xf) == 0xf) { @@ -396,7 +396,7 @@ gen3_get_instruction_dst(uint32_t *data, int i, char *dstname, int do_mask) } } -static char * +static const char * gen3_get_channel_swizzle(uint32_t select) { switch (select & 0x7) { @@ -468,10 +468,10 @@ gen3_get_instruction_src0(uint32_t *data, int i, char *srcname) uint32_t a0 = data[i]; uint32_t a1 = data[i + 1]; int src_nr = (a0 >> 2) & 0x1f; - char *swizzle_x = gen3_get_channel_swizzle((a1 >> 28) & 0xf); - char *swizzle_y = gen3_get_channel_swizzle((a1 >> 24) & 0xf); - char *swizzle_z = gen3_get_channel_swizzle((a1 >> 20) & 0xf); - char *swizzle_w = gen3_get_channel_swizzle((a1 >> 16) & 0xf); + const char *swizzle_x = gen3_get_channel_swizzle((a1 >> 28) & 0xf); + const char *swizzle_y = gen3_get_channel_swizzle((a1 >> 24) & 0xf); + const char *swizzle_z = gen3_get_channel_swizzle((a1 >> 20) & 0xf); + const char *swizzle_w = gen3_get_channel_swizzle((a1 >> 16) & 0xf); char swizzle[100]; gen3_get_instruction_src_name((a0 >> 7) & 0x7, src_nr, srcname); @@ -486,10 +486,10 @@ gen3_get_instruction_src1(uint32_t *data, int i, char *srcname) uint32_t a1 = data[i + 1]; uint32_t a2 = data[i + 2]; int src_nr = (a1 >> 8) & 0x1f; - char *swizzle_x = gen3_get_channel_swizzle((a1 >> 4) & 0xf); - char *swizzle_y = gen3_get_channel_swizzle((a1 >> 0) & 0xf); - char *swizzle_z = gen3_get_channel_swizzle((a2 >> 28) & 0xf); - char *swizzle_w = gen3_get_channel_swizzle((a2 >> 24) & 0xf); + const char *swizzle_x = gen3_get_channel_swizzle((a1 >> 4) & 0xf); + const char *swizzle_y = gen3_get_channel_swizzle((a1 >> 0) & 0xf); + const char *swizzle_z = gen3_get_channel_swizzle((a2 >> 28) & 0xf); + const char *swizzle_w = gen3_get_channel_swizzle((a2 >> 24) & 0xf); char swizzle[100]; gen3_get_instruction_src_name((a1 >> 13) & 0x7, src_nr, srcname); @@ -503,10 +503,10 @@ gen3_get_instruction_src2(uint32_t *data, int i, char *srcname) { uint32_t a2 = data[i + 2]; int src_nr = (a2 >> 16) & 0x1f; - char *swizzle_x = gen3_get_channel_swizzle((a2 >> 12) & 0xf); - char *swizzle_y = gen3_get_channel_swizzle((a2 >> 8) & 0xf); - char *swizzle_z = gen3_get_channel_swizzle((a2 >> 4) & 0xf); - char *swizzle_w = gen3_get_channel_swizzle((a2 >> 0) & 0xf); + const char *swizzle_x = gen3_get_channel_swizzle((a2 >> 12) & 0xf); + const char *swizzle_y = gen3_get_channel_swizzle((a2 >> 8) & 0xf); + const char *swizzle_z = gen3_get_channel_swizzle((a2 >> 4) & 0xf); + const char *swizzle_w = gen3_get_channel_swizzle((a2 >> 0) & 0xf); char swizzle[100]; gen3_get_instruction_src_name((a2 >> 21) & 0x7, src_nr, srcname); @@ -554,7 +554,7 @@ gen3_get_instruction_addr(uint32_t src_type, uint32_t src_nr, char *name) static void gen3_decode_alu1(uint32_t *data, uint32_t offset, - int i, char *instr_prefix, char *op_name) + int i, char *instr_prefix, const char *op_name) { char dst[100], src0[100]; @@ -569,7 +569,7 @@ gen3_decode_alu1(uint32_t *data, uint32_t offset, static void gen3_decode_alu2(uint32_t *data, uint32_t offset, - int i, char *instr_prefix, char *op_name) + int i, char *instr_prefix, const char *op_name) { char dst[100], src0[100], src1[100]; @@ -585,7 +585,7 @@ gen3_decode_alu2(uint32_t *data, uint32_t offset, static void gen3_decode_alu3(uint32_t *data, uint32_t offset, - int i, char *instr_prefix, char *op_name) + int i, char *instr_prefix, const char *op_name) { char dst[100], src0[100], src1[100], src2[100]; @@ -602,7 +602,7 @@ gen3_decode_alu3(uint32_t *data, uint32_t offset, static void gen3_decode_tex(uint32_t *data, uint32_t offset, int i, char *instr_prefix, - char *tex_name) + const char *tex_name) { uint32_t t0 = data[i]; uint32_t t1 = data[i + 1]; @@ -626,12 +626,12 @@ static void gen3_decode_dcl(uint32_t *data, uint32_t offset, int i, char *instr_prefix) { uint32_t d0 = data[i]; - char *sampletype; + const char *sampletype; int dcl_nr = (d0 >> 14) & 0xf; - char *dcl_x = d0 & (1 << 10) ? "x" : ""; - char *dcl_y = d0 & (1 << 11) ? "y" : ""; - char *dcl_z = d0 & (1 << 12) ? "z" : ""; - char *dcl_w = d0 & (1 << 13) ? "w" : ""; + const char *dcl_x = d0 & (1 << 10) ? "x" : ""; + const char *dcl_y = d0 & (1 << 11) ? "y" : ""; + const char *dcl_z = d0 & (1 << 12) ? "z" : ""; + const char *dcl_w = d0 & (1 << 13) ? "w" : ""; char dcl_mask[10]; switch ((d0 >> 19) & 0x3) { @@ -790,7 +790,7 @@ gen3_decode_instruction(uint32_t *data, uint32_t offset, } } -static char * +static const char * gen3_decode_compare_func(uint32_t op) { switch (op&0x7) { @@ -806,7 +806,7 @@ gen3_decode_compare_func(uint32_t op) return ""; } -static char * +static const char * gen3_decode_stencil_op(uint32_t op) { switch (op&0x7) { @@ -824,7 +824,7 @@ gen3_decode_stencil_op(uint32_t op) #if 0 /* part of MODES_4 */ -static char * +static const char * gen3_decode_logic_op(uint32_t op) { switch (op&0xf) { @@ -849,7 +849,7 @@ gen3_decode_logic_op(uint32_t op) } #endif -static char * +static const char * gen3_decode_blend_fact(uint32_t op) { switch (op&0xf) { @@ -872,7 +872,7 @@ gen3_decode_blend_fact(uint32_t op) return ""; } -static char * +static const char * decode_tex_coord_mode(uint32_t mode) { switch (mode&0x7) { @@ -886,7 +886,7 @@ decode_tex_coord_mode(uint32_t mode) return ""; } -static char * +static const char * gen3_decode_sample_filter(uint32_t mode) { switch (mode&0x7) { @@ -949,8 +949,8 @@ gen3_decode_load_state_immediate_1(struct kgem *kgem, uint32_t offset) break; case 4: { - char *cullmode = ""; - char *vfmt_xyzw = ""; + const char *cullmode = ""; + const char *vfmt_xyzw = ""; switch((data[i]>>13)&0x3) { case 0: cullmode = "both"; break; case 1: cullmode = "none"; break; @@ -1050,13 +1050,13 @@ gen3_decode_3d_1d(struct kgem *kgem, uint32_t offset) { uint32_t *data = kgem->batch + offset; unsigned int len, i, c, idx, word, map, sampler, instr; - char *format, *zformat, *type; + const char *format, *zformat, *type; uint32_t opcode; - const struct { + static const struct { uint32_t opcode; int min_len; int max_len; - char *name; + const char *name; } opcodes_3d_1d[] = { { 0x86, 4, 4, "3DSTATE_CHROMA_KEY" }, { 0x88, 2, 2, "3DSTATE_CONSTANT_BLEND_COLOR" }, @@ -1310,7 +1310,7 @@ gen3_decode_3d_1d(struct kgem *kgem, uint32_t offset) for (sampler = 0; sampler <= 15; sampler++) { if (data[1] & (1 << sampler)) { uint32_t dword; - char *mip_filter = ""; + const char *mip_filter = ""; dword = data[i]; switch ((dword>>20)&0x3) { case 0: mip_filter = "none"; break; @@ -1483,7 +1483,7 @@ gen3_decode_3d_primitive(struct kgem *kgem, uint32_t offset) uint32_t *data = kgem->batch + offset; char immediate = (data[0] & (1 << 23)) == 0; unsigned int len, i, ret; - char *primtype; + const char *primtype; unsigned int vertex = 0; switch ((data[0] >> 18) & 0xf) { @@ -1553,11 +1553,11 @@ out: int kgem_gen3_decode_3d(struct kgem *kgem, uint32_t offset) { - struct { + static const struct { uint32_t opcode; int min_len; int max_len; - char *name; + const char *name; } opcodes[] = { { 0x06, 1, 1, "3DSTATE_ANTI_ALIASING" }, { 0x08, 1, 1, "3DSTATE_BACKFACE_STENCIL_OPS" }, diff --git a/src/sna/kgem_debug_gen4.c b/src/sna/kgem_debug_gen4.c index 53c350b8..9b80dc88 100644 --- a/src/sna/kgem_debug_gen4.c +++ b/src/sna/kgem_debug_gen4.c @@ -256,7 +256,7 @@ static void primitive_out(struct kgem *kgem, uint32_t *data) static void state_base_out(uint32_t *data, uint32_t offset, unsigned int index, - char *name) + const char *name) { if (data[index] & 1) kgem_debug_print(data, offset, index, @@ -270,7 +270,7 @@ state_base_out(uint32_t *data, uint32_t offset, unsigned int index, static void state_max_out(uint32_t *data, uint32_t offset, unsigned int index, - char *name) + const char *name) { if (data[index] == 1) kgem_debug_print(data, offset, index, @@ -460,7 +460,7 @@ int kgem_gen4_decode_3d(struct kgem *kgem, uint32_t offset) uint32_t op; unsigned int len; int i; - char *desc1 = NULL; + const char *desc1 = NULL; len = (data[0] & 0xff) + 2; op = (data[0] & 0xffff0000) >> 16; diff --git a/src/sna/kgem_debug_gen5.c b/src/sna/kgem_debug_gen5.c index 9e7360af..e23ceb1f 100644 --- a/src/sna/kgem_debug_gen5.c +++ b/src/sna/kgem_debug_gen5.c @@ -230,7 +230,7 @@ static void primitive_out(struct kgem *kgem, uint32_t *data) static void state_base_out(uint32_t *data, uint32_t offset, unsigned int index, - char *name) + const char *name) { if (data[index] & 1) kgem_debug_print(data, offset, index, @@ -244,7 +244,7 @@ state_base_out(uint32_t *data, uint32_t offset, unsigned int index, static void state_max_out(uint32_t *data, uint32_t offset, unsigned int index, - char *name) + const char *name) { if (data[index] == 1) kgem_debug_print(data, offset, index, @@ -434,7 +434,7 @@ int kgem_gen5_decode_3d(struct kgem *kgem, uint32_t offset) uint32_t op; unsigned int len; int i; - char *desc1 = NULL; + const char *desc1 = NULL; len = (data[0] & 0xff) + 2; op = (data[0] & 0xffff0000) >> 16; diff --git a/src/sna/kgem_debug_gen6.c b/src/sna/kgem_debug_gen6.c index 961aa009..e0b09d55 100644 --- a/src/sna/kgem_debug_gen6.c +++ b/src/sna/kgem_debug_gen6.c @@ -298,7 +298,7 @@ static void finish_state(struct kgem *kgem) static void state_base_out(uint32_t *data, uint32_t offset, unsigned int index, - char *name) + const char *name) { if (data[index] & 1) kgem_debug_print(data, offset, index, @@ -312,7 +312,7 @@ state_base_out(uint32_t *data, uint32_t offset, unsigned int index, static void state_max_out(uint32_t *data, uint32_t offset, unsigned int index, - char *name) + const char *name) { if (data[index] == 1) kgem_debug_print(data, offset, index, @@ -635,7 +635,7 @@ int kgem_gen6_decode_3d(struct kgem *kgem, uint32_t offset) uint32_t op; unsigned int len; int i, j; - char *desc1 = NULL; + const char *desc1 = NULL; len = (data[0] & 0xff) + 2; op = (data[0] & 0xffff0000) >> 16; diff --git a/src/sna/kgem_debug_gen7.c b/src/sna/kgem_debug_gen7.c index 78eae016..1bc014bf 100644 --- a/src/sna/kgem_debug_gen7.c +++ b/src/sna/kgem_debug_gen7.c @@ -302,7 +302,7 @@ static void finish_state(struct kgem *kgem) static void state_base_out(uint32_t *data, uint32_t offset, unsigned int index, - char *name) + const char *name) { if (data[index] & 1) kgem_debug_print(data, offset, index, @@ -316,7 +316,7 @@ state_base_out(uint32_t *data, uint32_t offset, unsigned int index, static void state_max_out(uint32_t *data, uint32_t offset, unsigned int index, - char *name) + const char *name) { if (data[index] == 1) kgem_debug_print(data, offset, index, @@ -595,8 +595,7 @@ int kgem_gen7_decode_3d(struct kgem *kgem, uint32_t offset) uint32_t *data = kgem->batch + offset; uint32_t op; unsigned int len; - int i, j; - char *desc1 = NULL; + int i; const char *name; len = (data[0] & 0xff) + 2; diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index 07806b2f..6c48db86 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -4221,7 +4221,7 @@ sna_fill_spans__cpu(DrawablePtr drawable, GCPtr gc, int n, DDXPointPtr pt, int *width, int sorted) { - const RegionRec *clip = sna_gc(gc)->priv; + RegionRec *clip = sna_gc(gc)->priv; DBG(("%s x %d\n", __FUNCTION__, n)); diff --git a/src/sna/sna_blt.c b/src/sna/sna_blt.c index 0cfa8b16..83bcd695 100644 --- a/src/sna/sna_blt.c +++ b/src/sna/sna_blt.c @@ -790,7 +790,7 @@ inline static void _sna_blt_fill_box(struct sna *sna, kgem->nbatch += 3; b[0] = blt->cmd; - *(uint64_t *)(b+1) = *(uint64_t *)box; + *(uint64_t *)(b+1) = *(const uint64_t *)box; } inline static void _sna_blt_fill_boxes(struct sna *sna, @@ -818,31 +818,31 @@ inline static void _sna_blt_fill_boxes(struct sna *sna, kgem->nbatch += 3 * nbox_this_time; while (nbox_this_time >= 8) { - b[0] = cmd; *(uint64_t *)(b+1) = *(uint64_t *)box++; - b[3] = cmd; *(uint64_t *)(b+4) = *(uint64_t *)box++; - b[6] = cmd; *(uint64_t *)(b+7) = *(uint64_t *)box++; - b[9] = cmd; *(uint64_t *)(b+10) = *(uint64_t *)box++; - b[12] = cmd; *(uint64_t *)(b+13) = *(uint64_t *)box++; - b[15] = cmd; *(uint64_t *)(b+16) = *(uint64_t *)box++; - b[18] = cmd; *(uint64_t *)(b+19) = *(uint64_t *)box++; - b[21] = cmd; *(uint64_t *)(b+22) = *(uint64_t *)box++; + b[0] = cmd; *(uint64_t *)(b+1) = *(const uint64_t *)box++; + b[3] = cmd; *(uint64_t *)(b+4) = *(const uint64_t *)box++; + b[6] = cmd; *(uint64_t *)(b+7) = *(const uint64_t *)box++; + b[9] = cmd; *(uint64_t *)(b+10) = *(const uint64_t *)box++; + b[12] = cmd; *(uint64_t *)(b+13) = *(const uint64_t *)box++; + b[15] = cmd; *(uint64_t *)(b+16) = *(const uint64_t *)box++; + b[18] = cmd; *(uint64_t *)(b+19) = *(const uint64_t *)box++; + b[21] = cmd; *(uint64_t *)(b+22) = *(const uint64_t *)box++; b += 24; nbox_this_time -= 8; } if (nbox_this_time & 4) { - b[0] = cmd; *(uint64_t *)(b+1) = *(uint64_t *)box++; - b[3] = cmd; *(uint64_t *)(b+4) = *(uint64_t *)box++; - b[6] = cmd; *(uint64_t *)(b+7) = *(uint64_t *)box++; - b[9] = cmd; *(uint64_t *)(b+10) = *(uint64_t *)box++; + b[0] = cmd; *(uint64_t *)(b+1) = *(const uint64_t *)box++; + b[3] = cmd; *(uint64_t *)(b+4) = *(const uint64_t *)box++; + b[6] = cmd; *(uint64_t *)(b+7) = *(const uint64_t *)box++; + b[9] = cmd; *(uint64_t *)(b+10) = *(const uint64_t *)box++; b += 12; } if (nbox_this_time & 2) { - b[0] = cmd; *(uint64_t *)(b+1) = *(uint64_t *)box++; - b[3] = cmd; *(uint64_t *)(b+4) = *(uint64_t *)box++; + b[0] = cmd; *(uint64_t *)(b+1) = *(const uint64_t *)box++; + b[3] = cmd; *(uint64_t *)(b+4) = *(const uint64_t *)box++; b += 6; } if (nbox_this_time & 1) { - b[0] = cmd; *(uint64_t *)(b+1) = *(uint64_t *)box++; + b[0] = cmd; *(uint64_t *)(b+1) = *(const uint64_t *)box++; } if (!nbox) @@ -1848,7 +1848,7 @@ static bool sna_blt_fill_box(struct sna *sna, uint8_t alu, overwrites = alu == GXcopy || alu == GXclear || alu == GXset; if (overwrites && kgem->nbatch >= 6 && kgem->batch[kgem->nbatch-6] == cmd && - *(uint64_t *)&kgem->batch[kgem->nbatch-4] == *(uint64_t *)box && + *(uint64_t *)&kgem->batch[kgem->nbatch-4] == *(const uint64_t *)box && kgem->reloc[kgem->nreloc-1].target_handle == bo->handle) { DBG(("%s: replacing last fill\n", __FUNCTION__)); kgem->batch[kgem->nbatch-5] = br13; @@ -1857,7 +1857,7 @@ static bool sna_blt_fill_box(struct sna *sna, uint8_t alu, } if (overwrites && kgem->nbatch >= 8 && (kgem->batch[kgem->nbatch-8] & 0xffc0000f) == XY_SRC_COPY_BLT_CMD && - *(uint64_t *)&kgem->batch[kgem->nbatch-6] == *(uint64_t *)box && + *(uint64_t *)&kgem->batch[kgem->nbatch-6] == *(const uint64_t *)box && kgem->reloc[kgem->nreloc-2].target_handle == bo->handle) { DBG(("%s: replacing last copy\n", __FUNCTION__)); kgem->batch[kgem->nbatch-8] = cmd; @@ -1893,7 +1893,7 @@ static bool sna_blt_fill_box(struct sna *sna, uint8_t alu, b = kgem->batch + kgem->nbatch; b[0] = cmd; b[1] = br13; - *(uint64_t *)(b+2) = *(uint64_t *)box; + *(uint64_t *)(b+2) = *(const uint64_t *)box; b[4] = kgem_add_reloc(kgem, kgem->nbatch + 4, bo, I915_GEM_DOMAIN_RENDER << 16 | I915_GEM_DOMAIN_RENDER | -- cgit v1.2.3