All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH xf86-video-intel 00/21] Compiler warn elimination
@ 2019-09-19 16:30 Ville Syrjala
  2019-09-19 16:30 ` [PATCH xf86-video-intel 01/21] sna: Use -Wno-clobbered Ville Syrjala
                   ` (21 more replies)
  0 siblings, 22 replies; 23+ messages in thread
From: Ville Syrjala @ 2019-09-19 16:30 UTC (permalink / raw)
  To: intel-gfx

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Random smattering of patches to eliminate compiler warnings.
Some I just suppressed out of lazyness, others I tried to
silence by adjusting the code a bit.

Afterwards the build is clean on my gcc 8.3, though with
a bunch of stuff still suppressed I'm not 100% sure that's
a good thing.

git://github.com/vsyrjala/xf86-video-intel.git compiler_warns_3

Ville Syrjälä (21):
  sna: Use -Wno-clobbered
  sna: Shut up more compiler warns
  sna: undef FontSetPrivate() before redefining it
  sna: Replace fall through comments with standard form
  sna: Annotate more fall throughs
  sna: Add sna_br13_color_depth()
  sna/fb: Eliminate implicit fallthrough
  uxa: Use named initializers
  Avoid missing initializer warning
  sna: Use named initializers
  sna: Increase the size of the path name buffer a bit
  sna: Use memcmp() to avoid strict aliasing warns
  sna: Avoid strict aliasing violations with glyphinfo
  sna/fb: Use memcpy() to avoid strict aliasing violations
  xvmc: Eliminate strict aliasing violations
  sna/fb: Initialize xoff/yoff
  sna: Use -Wno-maybe-uninitialized
  sna: Get rid of -Wno-shift-negative-value
  uxa: Get rid of -Wno-shift-negative-value
  tools: Get rid of -Wno-sign-compare
  sna: Fix compiler warnings due to DrawablePtr vs. PixmapPtr

 src/intel_device.c              |  2 +-
 src/intel_module.c              |  3 +-
 src/legacy/i810/xvmc/I810XvMC.c | 48 ++++++++++++++--------------
 src/meson.build                 |  1 -
 src/sna/blt.c                   |  2 ++
 src/sna/fb/fb.h                 |  6 ++--
 src/sna/fb/fbpict.c             |  6 +++-
 src/sna/fb/fbspan.c             |  6 ++--
 src/sna/gen2_render.c           | 21 ++++++++++---
 src/sna/gen3_render.c           | 24 ++++++++++----
 src/sna/gen4_render.c           |  6 ++--
 src/sna/gen5_render.c           |  6 ++--
 src/sna/gen6_render.c           |  6 ++--
 src/sna/gen7_render.c           |  6 ++--
 src/sna/gen8_render.c           |  6 ++--
 src/sna/gen9_render.c           |  6 ++--
 src/sna/kgem.c                  | 10 ++----
 src/sna/meson.build             |  7 +++--
 src/sna/sna.h                   | 19 +++++++++++
 src/sna/sna_accel.c             | 24 +++++++++++++-
 src/sna/sna_blt.c               | 56 +++++++--------------------------
 src/sna/sna_composite.c         |  2 +-
 src/sna/sna_damage.h            |  1 +
 src/sna/sna_display.c           | 15 ++++-----
 src/sna/sna_display_fake.c      |  2 +-
 src/sna/sna_dri2.c              |  6 ++--
 src/sna/sna_driver.c            |  1 +
 src/sna/sna_glyphs.c            |  7 +++--
 src/sna/sna_io.c                | 30 ++++++------------
 src/sna/sna_render.c            |  4 +--
 src/sna/sna_render.h            |  2 +-
 src/sna/sna_trapezoids_mono.c   |  2 +-
 src/sna/sna_video_overlay.c     |  6 +++-
 src/sna/sna_video_sprite.c      |  8 ++++-
 src/sna/sna_video_textured.c    |  5 ++-
 src/uxa/i965_render.c           |  2 +-
 src/uxa/i965_video.c            |  2 +-
 src/uxa/intel_display.c         |  2 +-
 src/uxa/intel_dri.c             |  1 +
 src/uxa/meson.build             |  1 -
 tools/backlight_helper.c        |  2 +-
 tools/meson.build               |  2 --
 tools/virtual.c                 | 18 +++++------
 43 files changed, 221 insertions(+), 171 deletions(-)

-- 
2.21.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH xf86-video-intel 01/21] sna: Use -Wno-clobbered
  2019-09-19 16:30 [PATCH xf86-video-intel 00/21] Compiler warn elimination Ville Syrjala
@ 2019-09-19 16:30 ` Ville Syrjala
  2019-09-19 16:30 ` [PATCH xf86-video-intel 02/21] sna: Shut up more compiler warns Ville Syrjala
                   ` (20 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: Ville Syrjala @ 2019-09-19 16:30 UTC (permalink / raw)
  To: intel-gfx

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

../src/sna/sna_composite.c:567:11: warning: variable ‘sx’ might be clobbered by ‘longjmp’ or ‘vfork’ [-Wclobbered]
   int16_t sx = src_x + tx - (dst->pDrawable->x + dst_x);
           ^~
etc.

I had a quick look at a few of the cases and they seemed fine to me,
so feels like gcc just being dense.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 src/sna/meson.build | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/sna/meson.build b/src/sna/meson.build
index 5631d4d8047f..4af181f37b29 100644
--- a/src/sna/meson.build
+++ b/src/sna/meson.build
@@ -135,5 +135,6 @@ sna = static_library('sna',
 		       '-Wno-unused-parameter',
 		       '-Wno-sign-compare',
 		       '-Wno-type-limits',
+		       '-Wno-clobbered',
 		     ],
 		     install : false)
-- 
2.21.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH xf86-video-intel 02/21] sna: Shut up more compiler warns
  2019-09-19 16:30 [PATCH xf86-video-intel 00/21] Compiler warn elimination Ville Syrjala
  2019-09-19 16:30 ` [PATCH xf86-video-intel 01/21] sna: Use -Wno-clobbered Ville Syrjala
@ 2019-09-19 16:30 ` Ville Syrjala
  2019-09-19 16:30 ` [PATCH xf86-video-intel 03/21] sna: undef FontSetPrivate() before redefining it Ville Syrjala
                   ` (19 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: Ville Syrjala @ 2019-09-19 16:30 UTC (permalink / raw)
  To: intel-gfx

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Suppress more compiler warnings.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 src/sna/meson.build | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/sna/meson.build b/src/sna/meson.build
index 4af181f37b29..b1276ab3aa6e 100644
--- a/src/sna/meson.build
+++ b/src/sna/meson.build
@@ -131,8 +131,11 @@ sna = static_library('sna',
 		     c_args : [
 		       '-Wno-missing-field-initializers',
 		       '-Wno-unused-but-set-variable',
+		       '-Wno-expansion-to-defined',
 		       '-Wno-shift-negative-value',
 		       '-Wno-unused-parameter',
+		       '-Wno-unused-function',
+		       '-Wno-unused-variable',
 		       '-Wno-sign-compare',
 		       '-Wno-type-limits',
 		       '-Wno-clobbered',
-- 
2.21.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH xf86-video-intel 03/21] sna: undef FontSetPrivate() before redefining it
  2019-09-19 16:30 [PATCH xf86-video-intel 00/21] Compiler warn elimination Ville Syrjala
  2019-09-19 16:30 ` [PATCH xf86-video-intel 01/21] sna: Use -Wno-clobbered Ville Syrjala
  2019-09-19 16:30 ` [PATCH xf86-video-intel 02/21] sna: Shut up more compiler warns Ville Syrjala
@ 2019-09-19 16:30 ` Ville Syrjala
  2019-09-19 16:30 ` [PATCH xf86-video-intel 04/21] sna: Replace fall through comments with standard form Ville Syrjala
                   ` (18 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: Ville Syrjala @ 2019-09-19 16:30 UTC (permalink / raw)
  To: intel-gfx

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Avoid the compiler gettings upset about us redefining
FontSetPrivate().

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 src/sna/sna_accel.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 7fd00b9af679..934c8f662bea 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -121,6 +121,7 @@
 
 #if XFONT2_CLIENT_FUNCS_VERSION >= 1
 #define AllocateFontPrivateIndex() xfont2_allocate_font_private_index()
+#undef FontSetPrivate
 #define FontSetPrivate(font, idx, data) xfont2_font_set_private(font, idx, data)
 #endif
 
-- 
2.21.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH xf86-video-intel 04/21] sna: Replace fall through comments with standard form
  2019-09-19 16:30 [PATCH xf86-video-intel 00/21] Compiler warn elimination Ville Syrjala
                   ` (2 preceding siblings ...)
  2019-09-19 16:30 ` [PATCH xf86-video-intel 03/21] sna: undef FontSetPrivate() before redefining it Ville Syrjala
@ 2019-09-19 16:30 ` Ville Syrjala
  2019-09-19 16:30 ` [PATCH xf86-video-intel 05/21] sna: Annotate more fall throughs Ville Syrjala
                   ` (17 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: Ville Syrjala @ 2019-09-19 16:30 UTC (permalink / raw)
  To: intel-gfx

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

gcc doesn't like extra stuff in the fall through comments.
Replace them with the standard form.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 src/sna/gen4_render.c | 6 +++---
 src/sna/gen5_render.c | 6 +++---
 src/sna/gen6_render.c | 6 +++---
 src/sna/gen7_render.c | 6 +++---
 src/sna/gen8_render.c | 6 +++---
 src/sna/gen9_render.c | 6 +++---
 src/sna/sna_dri2.c    | 4 ++--
 src/sna/sna_render.h  | 2 +-
 8 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/src/sna/gen4_render.c b/src/sna/gen4_render.c
index ae26debf049a..5a4f968d0268 100644
--- a/src/sna/gen4_render.c
+++ b/src/sna/gen4_render.c
@@ -2019,7 +2019,7 @@ gen4_render_composite(struct sna *sna,
 	case 0:
 		if (!gen4_channel_init_solid(sna, &tmp->src, 0))
 			goto cleanup_dst;
-		/* fall through to fixup */
+		/* fall through */
 	case 1:
 		if (mask == NULL &&
 		    sna_blt_composite__convert(sna,
@@ -2071,7 +2071,7 @@ gen4_render_composite(struct sna *sna,
 			case 0:
 				if (!gen4_channel_init_solid(sna, &tmp->mask, 0))
 					goto cleanup_src;
-				/* fall through to fixup */
+				/* fall through */
 			case 1:
 				gen4_composite_channel_convert(&tmp->mask);
 				break;
@@ -2328,7 +2328,7 @@ gen4_render_composite_spans(struct sna *sna,
 	case 0:
 		if (!gen4_channel_init_solid(sna, &tmp->base.src, 0))
 			goto cleanup_dst;
-		/* fall through to fixup */
+		/* fall through */
 	case 1:
 		gen4_composite_channel_convert(&tmp->base.src);
 		break;
diff --git a/src/sna/gen5_render.c b/src/sna/gen5_render.c
index 3d9d35f113aa..3b1f25aacb39 100644
--- a/src/sna/gen5_render.c
+++ b/src/sna/gen5_render.c
@@ -1972,7 +1972,7 @@ gen5_render_composite(struct sna *sna,
 	case 0:
 		if (!gen4_channel_init_solid(sna, &tmp->src, 0))
 			goto cleanup_dst;
-		/* fall through to fixup */
+		/* fall through */
 	case 1:
 		if (mask == NULL &&
 		    sna_blt_composite__convert(sna,
@@ -2023,7 +2023,7 @@ gen5_render_composite(struct sna *sna,
 			case 0:
 				if (!gen4_channel_init_solid(sna, &tmp->mask, 0))
 					goto cleanup_src;
-				/* fall through to fixup */
+				/* fall through */
 			case 1:
 				gen5_composite_channel_convert(&tmp->mask);
 				break;
@@ -2268,7 +2268,7 @@ gen5_render_composite_spans(struct sna *sna,
 	case 0:
 		if (!gen4_channel_init_solid(sna, &tmp->base.src, 0))
 			goto cleanup_dst;
-		/* fall through to fixup */
+		/* fall through */
 	case 1:
 		gen5_composite_channel_convert(&tmp->base.src);
 		break;
diff --git a/src/sna/gen6_render.c b/src/sna/gen6_render.c
index 9eefcbda3e26..1a64d5b915e3 100644
--- a/src/sna/gen6_render.c
+++ b/src/sna/gen6_render.c
@@ -2346,7 +2346,7 @@ gen6_render_composite(struct sna *sna,
 	case 0:
 		if (!gen4_channel_init_solid(sna, &tmp->src, 0))
 			goto cleanup_dst;
-		/* fall through to fixup */
+		/* fall through */
 	case 1:
 		/* Did we just switch rings to prepare the source? */
 		if (mask == NULL &&
@@ -2399,7 +2399,7 @@ gen6_render_composite(struct sna *sna,
 			case 0:
 				if (!gen4_channel_init_solid(sna, &tmp->mask, 0))
 					goto cleanup_src;
-				/* fall through to fixup */
+				/* fall through */
 			case 1:
 				gen6_composite_channel_convert(&tmp->mask);
 				break;
@@ -2653,7 +2653,7 @@ gen6_render_composite_spans(struct sna *sna,
 	case 0:
 		if (!gen4_channel_init_solid(sna, &tmp->base.src, 0))
 			goto cleanup_dst;
-		/* fall through to fixup */
+		/* fall through */
 	case 1:
 		gen6_composite_channel_convert(&tmp->base.src);
 		break;
diff --git a/src/sna/gen7_render.c b/src/sna/gen7_render.c
index a33ba902d665..f58f39d457dc 100644
--- a/src/sna/gen7_render.c
+++ b/src/sna/gen7_render.c
@@ -2576,7 +2576,7 @@ gen7_render_composite(struct sna *sna,
 	case 0:
 		if (!gen4_channel_init_solid(sna, &tmp->src, 0))
 			goto cleanup_dst;
-		/* fall through to fixup */
+		/* fall through */
 	case 1:
 		/* Did we just switch rings to prepare the source? */
 		if (mask == NULL &&
@@ -2629,7 +2629,7 @@ gen7_render_composite(struct sna *sna,
 			case 0:
 				if (!gen4_channel_init_solid(sna, &tmp->mask, 0))
 					goto cleanup_src;
-				/* fall through to fixup */
+				/* fall through */
 			case 1:
 				gen7_composite_channel_convert(&tmp->mask);
 				break;
@@ -2863,7 +2863,7 @@ gen7_render_composite_spans(struct sna *sna,
 	case 0:
 		if (!gen4_channel_init_solid(sna, &tmp->base.src, 0))
 			goto cleanup_dst;
-		/* fall through to fixup */
+		/* fall through */
 	case 1:
 		gen7_composite_channel_convert(&tmp->base.src);
 		break;
diff --git a/src/sna/gen8_render.c b/src/sna/gen8_render.c
index 5d09c2cca94f..0955f90e0c37 100644
--- a/src/sna/gen8_render.c
+++ b/src/sna/gen8_render.c
@@ -2405,7 +2405,7 @@ gen8_render_composite(struct sna *sna,
 	case 0:
 		if (!gen4_channel_init_solid(sna, &tmp->src, 0))
 			goto cleanup_dst;
-		/* fall through to fixup */
+		/* fall through */
 	case 1:
 		/* Did we just switch rings to prepare the source? */
 		if (mask == NULL &&
@@ -2461,7 +2461,7 @@ gen8_render_composite(struct sna *sna,
 			case 0:
 				if (!gen4_channel_init_solid(sna, &tmp->mask, 0))
 					goto cleanup_src;
-				/* fall through to fixup */
+				/* fall through */
 			case 1:
 				if (!gen8_composite_channel_convert(&tmp->mask))
 					goto cleanup_mask;
@@ -2696,7 +2696,7 @@ gen8_render_composite_spans(struct sna *sna,
 	case 0:
 		if (!gen4_channel_init_solid(sna, &tmp->base.src, 0))
 			goto cleanup_dst;
-		/* fall through to fixup */
+		/* fall through */
 	case 1:
 		if (!gen8_composite_channel_convert(&tmp->base.src))
 			goto cleanup_src;
diff --git a/src/sna/gen9_render.c b/src/sna/gen9_render.c
index 469084990264..06c1f9a32145 100644
--- a/src/sna/gen9_render.c
+++ b/src/sna/gen9_render.c
@@ -2483,7 +2483,7 @@ gen9_render_composite(struct sna *sna,
 	case 0:
 		if (!gen4_channel_init_solid(sna, &tmp->src, 0))
 			goto cleanup_dst;
-		/* fall through to fixup */
+		/* fall through */
 	case 1:
 		/* Did we just switch rings to prepare the source? */
 		if (mask == NULL &&
@@ -2539,7 +2539,7 @@ gen9_render_composite(struct sna *sna,
 			case 0:
 				if (!gen4_channel_init_solid(sna, &tmp->mask, 0))
 					goto cleanup_src;
-				/* fall through to fixup */
+				/* fall through */
 			case 1:
 				if (!gen9_composite_channel_convert(&tmp->mask))
 					goto cleanup_mask;
@@ -2774,7 +2774,7 @@ gen9_render_composite_spans(struct sna *sna,
 	case 0:
 		if (!gen4_channel_init_solid(sna, &tmp->base.src, 0))
 			goto cleanup_dst;
-		/* fall through to fixup */
+		/* fall through */
 	case 1:
 		if (!gen9_composite_channel_convert(&tmp->base.src))
 			goto cleanup_src;
diff --git a/src/sna/sna_dri2.c b/src/sna/sna_dri2.c
index 6426a38626af..daa71dc6db30 100644
--- a/src/sna/sna_dri2.c
+++ b/src/sna/sna_dri2.c
@@ -2601,7 +2601,7 @@ void sna_dri2_vblank_handler(struct drm_event_vblank *event)
 		    sna_dri2_flip(info))
 			return;
 
-		/* else fall through to blit */
+		/* fall through */
 	case SWAP:
 		assert(info->signal);
 		if (can_xchg(info->sna, draw, info->front, info->back)) {
@@ -2623,7 +2623,7 @@ void sna_dri2_vblank_handler(struct drm_event_vblank *event)
 		DBG(("%s -- requeue failed, errno=%d\n", __FUNCTION__, errno));
 		assert(info->pending.bo == NULL);
 		assert(info->keepalive == 1);
-		/* fall through to SwapComplete */
+		/* fall through */
 	case SWAP_COMPLETE:
 		DBG(("%s: %d complete, frame=%d tv=%d.%06d\n",
 		     __FUNCTION__, info->type,
diff --git a/src/sna/sna_render.h b/src/sna/sna_render.h
index 891fc905fad2..7599803211fc 100644
--- a/src/sna/sna_render.h
+++ b/src/sna/sna_render.h
@@ -823,7 +823,7 @@ sna_get_pixel_from_rgba(uint32_t * pixel,
 	switch (format) {
 	case PICT_x8r8g8b8:
 		alpha = 0xffff;
-		/* fall through to re-use a8r8g8b8 expansion */
+		/* fall through */
 	case PICT_a8r8g8b8:
 		*pixel = ((alpha >> 8 << 24) |
 			  (red >> 8 << 16) |
-- 
2.21.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH xf86-video-intel 05/21] sna: Annotate more fall throughs
  2019-09-19 16:30 [PATCH xf86-video-intel 00/21] Compiler warn elimination Ville Syrjala
                   ` (3 preceding siblings ...)
  2019-09-19 16:30 ` [PATCH xf86-video-intel 04/21] sna: Replace fall through comments with standard form Ville Syrjala
@ 2019-09-19 16:30 ` Ville Syrjala
  2019-09-19 16:30 ` [PATCH xf86-video-intel 06/21] sna: Add sna_br13_color_depth() Ville Syrjala
                   ` (16 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: Ville Syrjala @ 2019-09-19 16:30 UTC (permalink / raw)
  To: intel-gfx

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Sprinkle fall through comments where needed.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 src/intel_module.c    |  1 +
 src/sna/blt.c         |  2 ++
 src/sna/gen2_render.c | 21 +++++++++++++++++----
 src/sna/gen3_render.c | 24 ++++++++++++++++++------
 src/sna/sna_accel.c   |  3 +++
 src/sna/sna_damage.h  |  1 +
 src/sna/sna_display.c |  7 ++++---
 src/sna/sna_dri2.c    |  2 ++
 src/sna/sna_driver.c  |  1 +
 src/sna/sna_render.c  |  4 ++--
 src/uxa/intel_dri.c   |  1 +
 11 files changed, 52 insertions(+), 15 deletions(-)

diff --git a/src/intel_module.c b/src/intel_module.c
index a8c9768ee9f8..171b20d83d33 100644
--- a/src/intel_module.c
+++ b/src/intel_module.c
@@ -692,6 +692,7 @@ static Bool intel_pci_probe(DriverPtr		driver,
 		case PCI_CHIP_I815:
 			if (!hosted())
 				break;
+			/* fall through */
 		default:
 			return FALSE;
 		}
diff --git a/src/sna/blt.c b/src/sna/blt.c
index cb90437ad5ad..afc719f6dc8c 100644
--- a/src/sna/blt.c
+++ b/src/sna/blt.c
@@ -1404,6 +1404,7 @@ memcpy_xor(const void *src, void *dst, int bpp,
 				width /= 2;
 				or |= or << 8;
 			}
+			/* fall through */
 		case 2:
 			if (width & 1) {
 				do {
@@ -1421,6 +1422,7 @@ memcpy_xor(const void *src, void *dst, int bpp,
 				width /= 2;
 				or |= or << 16;
 			}
+			/* fall through */
 		case 4:
 			w = width;
 			if (w * 4 == dst_stride && dst_stride == src_stride) {
diff --git a/src/sna/gen2_render.c b/src/sna/gen2_render.c
index e03c44015701..80f684543149 100644
--- a/src/sna/gen2_render.c
+++ b/src/sna/gen2_render.c
@@ -116,10 +116,17 @@ gen2_buf_tiling(uint32_t tiling)
 {
 	uint32_t v = 0;
 	switch (tiling) {
-	default: assert(0);
-	case I915_TILING_Y: v |= BUF_3D_TILE_WALK_Y;
-	case I915_TILING_X: v |= BUF_3D_TILED_SURFACE;
-	case I915_TILING_NONE: break;
+	default:
+		assert(0);
+		/* fall through */
+	case I915_TILING_Y:
+		v |= BUF_3D_TILE_WALK_Y;
+		/* fall through */
+	case I915_TILING_X:
+		v |= BUF_3D_TILED_SURFACE;
+		/* fall through */
+	case I915_TILING_NONE:
+		break;
 	}
 	return v;
 }
@@ -131,6 +138,7 @@ gen2_get_dst_format(uint32_t format)
 	switch (format) {
 	default:
 		assert(0);
+		/* fall through */
 	case PICT_a8r8g8b8:
 	case PICT_x8r8g8b8:
 		return COLR_BUF_ARGB8888 | BIAS;
@@ -219,10 +227,13 @@ gen2_sampler_tiling_bits(uint32_t tiling)
 	switch (tiling) {
 	default:
 		assert(0);
+		/* fall through */
 	case I915_TILING_Y:
 		bits |= TM0S1_TILE_WALK;
+		/* fall through */
 	case I915_TILING_X:
 		bits |= TM0S1_TILED_SURFACE;
+		/* fall through */
 	case I915_TILING_NONE:
 		break;
 	}
@@ -277,6 +288,7 @@ gen2_emit_texture(struct sna *sna,
 	switch (channel->repeat) {
 	default:
 		assert(0);
+		/* fall through */
 	case RepeatNone:
 		wrap_mode_u = TEXCOORDMODE_CLAMP_BORDER;
 		break;
@@ -298,6 +310,7 @@ gen2_emit_texture(struct sna *sna,
 	switch (channel->filter) {
 	default:
 		assert(0);
+		/* fall through */
 	case PictFilterNearest:
 		filter = (FILTER_NEAREST << TM0S3_MAG_FILTER_SHIFT |
 			  FILTER_NEAREST << TM0S3_MIN_FILTER_SHIFT |
diff --git a/src/sna/gen3_render.c b/src/sna/gen3_render.c
index 166635eba055..e0a7d158015a 100644
--- a/src/sna/gen3_render.c
+++ b/src/sna/gen3_render.c
@@ -131,9 +131,14 @@ static inline uint32_t gen3_buf_tiling(uint32_t tiling)
 {
 	uint32_t v = 0;
 	switch (tiling) {
-	case I915_TILING_Y: v |= BUF_3D_TILE_WALK_Y;
-	case I915_TILING_X: v |= BUF_3D_TILED_SURFACE;
-	case I915_TILING_NONE: break;
+	case I915_TILING_Y:
+		v |= BUF_3D_TILE_WALK_Y;
+		/* fall through */
+	case I915_TILING_X:
+		v |= BUF_3D_TILED_SURFACE;
+		/* fall through */
+	case I915_TILING_NONE:
+		break;
 	}
 	return v;
 }
@@ -400,6 +405,7 @@ static uint32_t gen3_filter(uint32_t filter)
 	switch (filter) {
 	default:
 		assert(0);
+		/* fall through */
 	case PictFilterNearest:
 		return (FILTER_NEAREST << SS2_MAG_FILTER_SHIFT |
 			FILTER_NEAREST << SS2_MIN_FILTER_SHIFT |
@@ -1884,9 +1890,14 @@ static uint32_t gen3_ms_tiling(uint32_t tiling)
 {
 	uint32_t v = 0;
 	switch (tiling) {
-	case I915_TILING_Y: v |= MS3_TILE_WALK;
-	case I915_TILING_X: v |= MS3_TILED_SURFACE;
-	case I915_TILING_NONE: break;
+	case I915_TILING_Y:
+		v |= MS3_TILE_WALK;
+		/* fall through */
+	case I915_TILING_X:
+		v |= MS3_TILED_SURFACE;
+		/* fall through */
+	case I915_TILING_NONE:
+		break;
 	}
 	return v;
 }
@@ -4981,6 +4992,7 @@ gen3_render_composite_spans(struct sna *sna,
 	switch (tmp->base.src.u.gen3.type) {
 	case SHADER_NONE:
 		assert(0);
+		/* fall through */
 	case SHADER_ZERO:
 		if (no_offset) {
 			tmp->prim_emit = gen3_emit_composite_spans_primitive_zero_no_offset;
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 934c8f662bea..8266e86d8fea 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -4955,6 +4955,7 @@ try_upload__inplace(PixmapPtr pixmap, RegionRec *region,
 	case I915_TILING_X:
 		if (!sna->kgem.memcpy_to_tiled_x)
 			break;
+		/* fall through */
 	default:
 		if (try_upload__tiled_x(pixmap, region, x, y, w, h, bits, stride))
 			goto done;
@@ -8719,6 +8720,7 @@ sna_copy_plane_blt(DrawablePtr source, DrawablePtr drawable, GCPtr gc,
 				}
 			default:
 				assert(0);
+				/* fall through */
 			case 8:
 				{
 					uint8_t *src = src_pixmap->devPrivate.ptr;
@@ -10123,6 +10125,7 @@ spans_fallback:
 			switch (gc->lineStyle) {
 			default:
 				assert(0);
+				/* fall through */
 			case LineSolid:
 				if (gc->lineWidth == 0) {
 					DBG(("%s: miZeroLine\n", __FUNCTION__));
diff --git a/src/sna/sna_damage.h b/src/sna/sna_damage.h
index d5c727eeee34..abdc786863a9 100644
--- a/src/sna/sna_damage.h
+++ b/src/sna/sna_damage.h
@@ -152,6 +152,7 @@ static inline bool sna_damage_is_all(struct sna_damage **_damage,
 		return false;
 	default:
 		assert(0);
+		/* fall through */
 	case DAMAGE_ADD:
 		if (damage->extents.x2 < width  || damage->extents.x1 > 0)
 			return false;
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index d6210cc7bbc8..1e62cc40473f 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -8309,7 +8309,7 @@ static bool sna_emit_wait_for_scanline_hsw(struct sna *sna,
 	sna->kgem.nbatch += 17;
 
 	switch (pipe) {
-	default: assert(0);
+	default: assert(0); /* fall through */
 	case 0: event = 1 << 0; break;
 	case 1: event = 1 << 8; break;
 	case 2: event = 1 << 14; break;
@@ -8325,7 +8325,7 @@ static bool sna_emit_wait_for_scanline_hsw(struct sna *sna,
 	/* The documentation says that the LOAD_SCAN_LINES command
 	 * always comes in pairs. Don't ask me why. */
 	switch (pipe) {
-	default: assert(0);
+	default: assert(0); /* fall through */
 	case 0: event = 0 << 19; break;
 	case 1: event = 1 << 19; break;
 	case 2: event = 4 << 19; break;
@@ -8334,7 +8334,7 @@ static bool sna_emit_wait_for_scanline_hsw(struct sna *sna,
 	b[9] = b[7] = (y1 << 16) | (y2-1);
 
 	switch (pipe) {
-	default: assert(0);
+	default: assert(0); /* fall through */
 	case 0: event = 1 << 0; break;
 	case 1: event = 1 << 8; break;
 	case 2: event = 1 << 14; break;
@@ -8374,6 +8374,7 @@ static bool sna_emit_wait_for_scanline_ivb(struct sna *sna,
 	switch (pipe) {
 	default:
 		assert(0);
+		/* fall through */
 	case 0:
 		event = 1 << (full_height ? 3 : 0);
 		break;
diff --git a/src/sna/sna_dri2.c b/src/sna/sna_dri2.c
index daa71dc6db30..5fd4d54b6d70 100644
--- a/src/sna/sna_dri2.c
+++ b/src/sna/sna_dri2.c
@@ -680,6 +680,7 @@ sna_dri2_create_buffer(DrawablePtr draw,
 			    (sna->flags & (SNA_LINEAR_FB | SNA_NO_WAIT | SNA_NO_FLIP)) == 0)
 				flags |= CREATE_SCANOUT;
 		}
+		/* fall through */
 	case DRI2BufferBackRight:
 	case DRI2BufferFrontRight:
 	case DRI2BufferFakeFrontLeft:
@@ -2944,6 +2945,7 @@ static void sna_dri2_flip_event(struct sna_dri2_event *flip)
 			DBG(("%s: triple buffer swap complete, unblocking client\n", __FUNCTION__));
 			frame_swap_complete(flip, DRI2_FLIP_COMPLETE);
 		}
+		/* fall through */
 	case FLIP_COMPLETE:
 		assert(!flip->signal);
 		if (sna->dri2.flip_pending) {
diff --git a/src/sna/sna_driver.c b/src/sna/sna_driver.c
index 754b2d4f130d..4f8895f1eda2 100644
--- a/src/sna/sna_driver.c
+++ b/src/sna/sna_driver.c
@@ -603,6 +603,7 @@ static Bool sna_pre_init(ScrnInfoPtr scrn, int probe)
 		if ((sna->flags & SNA_IS_HOSTED) ||
 		    fb_supports_depth(fd, scrn->depth))
 			break;
+		/* fall through */
 	default:
 		xf86DrvMsg(scrn->scrnIndex, X_ERROR,
 			   "Given depth (%d) is not supported by the Intel driver and this chipset.\n",
diff --git a/src/sna/sna_render.c b/src/sna/sna_render.c
index 1787ffae4874..904d44004d44 100644
--- a/src/sna/sna_render.c
+++ b/src/sna/sna_render.c
@@ -58,7 +58,7 @@ sna_format_for_depth(int depth)
 	case 8: return PICT_a8;
 	case 15: return PICT_x1r5g5b5;
 	case 16: return PICT_r5g6b5;
-	default: assert(0);
+	default: assert(0); /* fall through */
 	case 24: return PICT_x8r8g8b8;
 #if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,6,99,900,0)
 	case 30: return PICT_x2r10g10b10;
@@ -77,7 +77,7 @@ sna_render_format_for_depth(int depth)
 	case 15: return PIXMAN_a1r5g5b5;
 	case 16: return PIXMAN_r5g6b5;
 	case 30: return PIXMAN_a2r10g10b10;
-	default: assert(0);
+	default: assert(0); /* fall through */
 	case 24:
 	case 32: return PIXMAN_a8r8g8b8;
 	}
diff --git a/src/uxa/intel_dri.c b/src/uxa/intel_dri.c
index 524826d24082..e707b74f091f 100644
--- a/src/uxa/intel_dri.c
+++ b/src/uxa/intel_dri.c
@@ -302,6 +302,7 @@ I830DRI2CreateBuffer(DrawablePtr drawable, unsigned int attachment,
 					hint |= INTEL_CREATE_PIXMAP_TILING_Y;
 					break;
 				}
+				/* fall through */
 			case DRI2BufferAccum:
 			case DRI2BufferBackLeft:
 			case DRI2BufferBackRight:
-- 
2.21.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH xf86-video-intel 06/21] sna: Add sna_br13_color_depth()
  2019-09-19 16:30 [PATCH xf86-video-intel 00/21] Compiler warn elimination Ville Syrjala
                   ` (4 preceding siblings ...)
  2019-09-19 16:30 ` [PATCH xf86-video-intel 05/21] sna: Annotate more fall throughs Ville Syrjala
@ 2019-09-19 16:30 ` Ville Syrjala
  2019-09-19 16:30 ` [PATCH xf86-video-intel 07/21] sna/fb: Eliminate implicit fallthrough Ville Syrjala
                   ` (15 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: Ville Syrjala @ 2019-09-19 16:30 UTC (permalink / raw)
  To: intel-gfx

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Refactor the BR13 color depth setup to common helper. This
eliminates a bunch of implicit fall through warns.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 src/sna/kgem.c    | 10 +++------
 src/sna/sna.h     | 19 ++++++++++++++++
 src/sna/sna_blt.c | 56 ++++++++++-------------------------------------
 src/sna/sna_io.c  | 30 ++++++++-----------------
 4 files changed, 43 insertions(+), 72 deletions(-)

diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index d396f1b40dbc..9c0708a635fb 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -8148,13 +8148,9 @@ kgem_replace_bo(struct kgem *kgem,
 	}
 
 	br13 |= 0xcc << 16;
-	switch (bpp) {
-	default:
-	case 32: br00 |= BLT_WRITE_ALPHA | BLT_WRITE_RGB;
-		 br13 |= 1 << 25; /* RGB8888 */
-	case 16: br13 |= 1 << 24; /* RGB565 */
-	case 8: break;
-	}
+	br13 |= sna_br13_color_depth(bpp);
+	if (bpp == 32)
+		br00 |= BLT_WRITE_ALPHA | BLT_WRITE_RGB;
 
 	b = kgem->batch + kgem->nbatch;
 	if (kgem->gen >= 0100) {
diff --git a/src/sna/sna.h b/src/sna/sna.h
index cf2a7a519f29..f2bc189624a5 100644
--- a/src/sna/sna.h
+++ b/src/sna/sna.h
@@ -1397,4 +1397,23 @@ static inline void add_shm_flush(struct sna *sna, struct sna_pixmap *priv)
 	sna->needs_shm_flush = true;
 }
 
+static inline uint32_t sna_br13_color_depth(int bpp)
+{
+	uint32_t br13 = 0;
+
+	switch (bpp) {
+	default:
+		assert(0);
+		/* fall through */
+	case 32:
+		br13 |= 1 << 25; /* RGB8888 */
+		/* fall through */
+	case 16:
+		br13 |= 1 << 24; /* RGB565 */
+		/* fall through */
+	case 8:
+		return br13;
+	}
+}
+
 #endif /* _SNA_H */
diff --git a/src/sna/sna_blt.c b/src/sna/sna_blt.c
index 61e2b0feaf35..005224363b9c 100644
--- a/src/sna/sna_blt.c
+++ b/src/sna/sna_blt.c
@@ -154,12 +154,7 @@ static bool sna_blt_fill_init(struct sna *sna,
 	}
 
 	blt->br13 |= 1<<31 | (fill_ROP[alu] << 16);
-	switch (bpp) {
-	default: assert(0);
-	case 32: blt->br13 |= 1 << 25; /* RGB8888 */
-	case 16: blt->br13 |= 1 << 24; /* RGB565 */
-	case 8: break;
-	}
+	blt->br13 |= sna_br13_color_depth(bpp);
 
 	blt->pixel = pixel;
 	blt->bpp = bpp;
@@ -372,12 +367,7 @@ static bool sna_blt_copy_init(struct sna *sna,
 
 	blt->overwrites = alu == GXcopy || alu == GXclear || alu == GXset;
 	blt->br13 = (copy_ROP[alu] << 16) | blt->pitch[1];
-	switch (bpp) {
-	default: assert(0);
-	case 32: blt->br13 |= 1 << 25; /* RGB8888 */
-	case 16: blt->br13 |= 1 << 24; /* RGB565 */
-	case 8: break;
-	}
+	blt->br13 |= sna_br13_color_depth(bpp);
 
 	kgem_set_mode(kgem, KGEM_BLT, dst);
 	if (!kgem_check_many_bo_fenced(kgem, src, dst, NULL)) {
@@ -425,13 +415,10 @@ static bool sna_blt_alpha_fixup_init(struct sna *sna,
 
 	blt->overwrites = 1;
 	blt->br13 = (0xfc << 16) | blt->pitch[1];
-	switch (bpp) {
-	default: assert(0);
-	case 32: blt->cmd |= BLT_WRITE_ALPHA | BLT_WRITE_RGB;
-		 blt->br13 |= 1 << 25; /* RGB8888 */
-	case 16: blt->br13 |= 1 << 24; /* RGB565 */
-	case 8: break;
-	}
+	blt->br13 |= sna_br13_color_depth(bpp);
+	if (bpp == 32)
+		blt->cmd |= BLT_WRITE_ALPHA | BLT_WRITE_RGB;
+
 	blt->pixel = alpha;
 
 	kgem_set_mode(kgem, KGEM_BLT, dst);
@@ -3356,13 +3343,9 @@ static bool sna_blt_fill_box(struct sna *sna, uint8_t alu,
 	assert(br13 <= MAXSHORT);
 
 	br13 |= fill_ROP[alu] << 16;
-	switch (bpp) {
-	default: assert(0);
-	case 32: cmd |= BLT_WRITE_ALPHA | BLT_WRITE_RGB;
-		 br13 |= 1 << 25; /* RGB8888 */
-	case 16: br13 |= 1 << 24; /* RGB565 */
-	case 8: break;
-	}
+	br13 |= sna_br13_color_depth(bpp);
+	if (bpp == 32)
+		cmd |= BLT_WRITE_ALPHA | BLT_WRITE_RGB;
 
 	/* All too frequently one blt completely overwrites the previous */
 	overwrites = alu == GXcopy || alu == GXclear || alu == GXset;
@@ -3517,12 +3500,7 @@ bool sna_blt_fill_boxes(struct sna *sna, uint8_t alu,
 	assert(br13 <= MAXSHORT);
 
 	br13 |= 1<<31 | fill_ROP[alu] << 16;
-	switch (bpp) {
-	default: assert(0);
-	case 32: br13 |= 1 << 25; /* RGB8888 */
-	case 16: br13 |= 1 << 24; /* RGB565 */
-	case 8: break;
-	}
+	br13 |= sna_br13_color_depth(bpp);
 
 	kgem_set_mode(kgem, KGEM_BLT, bo);
 	if (!kgem_check_batch(kgem, 14) ||
@@ -3739,12 +3717,7 @@ bool sna_blt_copy_boxes(struct sna *sna, uint8_t alu,
 	assert(br13 <= MAXSHORT);
 
 	br13 |= copy_ROP[alu] << 16;
-	switch (bpp) {
-	default: assert(0);
-	case 32: br13 |= 1 << 25; /* RGB8888 */
-	case 16: br13 |= 1 << 24; /* RGB565 */
-	case 8: break;
-	}
+	br13 |= sna_br13_color_depth(bpp);
 
 	/* Compare first box against a previous fill */
 	if ((alu == GXcopy || alu == GXclear || alu == GXset) &&
@@ -4086,12 +4059,7 @@ bool sna_blt_copy_boxes__with_alpha(struct sna *sna, uint8_t alu,
 	assert(br13 <= MAXSHORT);
 
 	br13 |= copy_ROP[alu] << 16;
-	switch (bpp) {
-	default: assert(0);
-	case 32: br13 |= 1 << 25; /* RGB8888 */
-	case 16: br13 |= 1 << 24; /* RGB565 */
-	case 8: break;
-	}
+	br13 |= sna_br13_color_depth(bpp);
 
 	kgem_set_mode(kgem, KGEM_BLT, dst_bo);
 	if (!kgem_check_many_bo_fenced(kgem, dst_bo, src_bo, NULL)) {
diff --git a/src/sna/sna_io.c b/src/sna/sna_io.c
index d32bd583fc42..d03280edb7a7 100644
--- a/src/sna/sna_io.c
+++ b/src/sna/sna_io.c
@@ -465,13 +465,9 @@ fallback:
 	}
 
 	br13 = 0xcc << 16;
-	switch (cpp) {
-	default:
-	case 4: cmd |= BLT_WRITE_ALPHA | BLT_WRITE_RGB;
-		br13 |= 1 << 25; /* RGB8888 */
-	case 2: br13 |= 1 << 24; /* RGB565 */
-	case 1: break;
-	}
+	br13 |= sna_br13_color_depth(cpp * 4);
+	if (cpp == 4)
+		cmd |= BLT_WRITE_ALPHA | BLT_WRITE_RGB;
 
 	kgem_set_mode(kgem, KGEM_BLT, dst_bo);
 	if (!kgem_check_batch(kgem, 10) ||
@@ -1042,13 +1038,9 @@ tile:
 		br13 >>= 2;
 	}
 	br13 |= 0xcc << 16;
-	switch (dst->drawable.bitsPerPixel) {
-	default:
-	case 32: cmd |= BLT_WRITE_ALPHA | BLT_WRITE_RGB;
-		 br13 |= 1 << 25; /* RGB8888 */
-	case 16: br13 |= 1 << 24; /* RGB565 */
-	case 8: break;
-	}
+	br13 |= sna_br13_color_depth(dst->drawable.bitsPerPixel);
+	if (dst->drawable.bitsPerPixel == 32)
+		cmd |= BLT_WRITE_ALPHA | BLT_WRITE_RGB;
 
 	kgem_set_mode(kgem, KGEM_BLT, dst_bo);
 	if (!kgem_check_batch(kgem, 10) ||
@@ -1548,13 +1540,9 @@ tile:
 		br13 >>= 2;
 	}
 	br13 |= 0xcc << 16;
-	switch (dst->drawable.bitsPerPixel) {
-	default:
-	case 32: cmd |= BLT_WRITE_ALPHA | BLT_WRITE_RGB;
-		 br13 |= 1 << 25; /* RGB8888 */
-	case 16: br13 |= 1 << 24; /* RGB565 */
-	case 8: break;
-	}
+	br13 |= sna_br13_color_depth(dst->drawable.bitsPerPixel);
+	if (dst->drawable.bitsPerPixel == 32)
+		cmd |= BLT_WRITE_ALPHA | BLT_WRITE_RGB;
 
 	kgem_set_mode(kgem, KGEM_BLT, dst_bo);
 	if (!kgem_check_batch(kgem, 10) ||
-- 
2.21.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH xf86-video-intel 07/21] sna/fb: Eliminate implicit fallthrough
  2019-09-19 16:30 [PATCH xf86-video-intel 00/21] Compiler warn elimination Ville Syrjala
                   ` (5 preceding siblings ...)
  2019-09-19 16:30 ` [PATCH xf86-video-intel 06/21] sna: Add sna_br13_color_depth() Ville Syrjala
@ 2019-09-19 16:30 ` Ville Syrjala
  2019-09-19 16:31 ` [PATCH xf86-video-intel 08/21] uxa: Use named initializers Ville Syrjala
                   ` (14 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: Ville Syrjala @ 2019-09-19 16:30 UTC (permalink / raw)
  To: intel-gfx

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Duplicate a bit of code in FbDoLeftMaskByteRRop() switch statement
to avoid the fall through.

And while at it sort the cases based on the left byte and length.
Makes the pattern matcher in my brain much happier.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 src/sna/fb/fb.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/sna/fb/fb.h b/src/sna/fb/fb.h
index 904317478e8a..ee5da97b458c 100644
--- a/src/sna/fb/fb.h
+++ b/src/sna/fb/fb.h
@@ -185,11 +185,13 @@ typedef int FbStride;
 	FbStorePart(dst,sizeof (FbBits) - 3,CARD8,xor); \
 	FbStorePart(dst,sizeof (FbBits) - 2,CARD8,xor); \
 	break; \
+    case sizeof (FbBits) - 3: \
+	FbStorePart(dst,sizeof (FbBits) - 3,CARD8,xor); \
+	FbStorePart(dst,sizeof (FbBits) - 2,CARD16,xor); \
+	break; \
     case (sizeof (FbBits) - 2) | (1 << (FB_SHIFT - 3)): \
 	FbStorePart(dst,sizeof (FbBits) - 2,CARD8,xor); \
 	break; \
-    case sizeof (FbBits) - 3: \
-	FbStorePart(dst,sizeof (FbBits) - 3,CARD8,xor); \
     case sizeof (FbBits) - 2: \
 	FbStorePart(dst,sizeof (FbBits) - 2,CARD16,xor); \
 	break; \
-- 
2.21.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH xf86-video-intel 08/21] uxa: Use named initializers
  2019-09-19 16:30 [PATCH xf86-video-intel 00/21] Compiler warn elimination Ville Syrjala
                   ` (6 preceding siblings ...)
  2019-09-19 16:30 ` [PATCH xf86-video-intel 07/21] sna/fb: Eliminate implicit fallthrough Ville Syrjala
@ 2019-09-19 16:31 ` Ville Syrjala
  2019-09-19 16:31 ` [PATCH xf86-video-intel 09/21] Avoid missing initializer warning Ville Syrjala
                   ` (13 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: Ville Syrjala @ 2019-09-19 16:31 UTC (permalink / raw)
  To: intel-gfx

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Silence the compiler warning about missing initializers
by using named initializers.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 src/uxa/intel_display.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/uxa/intel_display.c b/src/uxa/intel_display.c
index 809cda1dd56b..ba4b8d87412c 100644
--- a/src/uxa/intel_display.c
+++ b/src/uxa/intel_display.c
@@ -1818,7 +1818,7 @@ error_out:
 }
 
 static const xf86CrtcConfigFuncsRec intel_xf86crtc_config_funcs = {
-	intel_xf86crtc_resize
+	.resize = intel_xf86crtc_resize,
 };
 
 /*
-- 
2.21.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH xf86-video-intel 09/21] Avoid missing initializer warning
  2019-09-19 16:30 [PATCH xf86-video-intel 00/21] Compiler warn elimination Ville Syrjala
                   ` (7 preceding siblings ...)
  2019-09-19 16:31 ` [PATCH xf86-video-intel 08/21] uxa: Use named initializers Ville Syrjala
@ 2019-09-19 16:31 ` Ville Syrjala
  2019-09-19 16:31 ` [PATCH xf86-video-intel 10/21] sna: Use named initializers Ville Syrjala
                   ` (12 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: Ville Syrjala @ 2019-09-19 16:31 UTC (permalink / raw)
  To: intel-gfx

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Use an empty {} as the terminator in intel_device_match[] to avoid
the warning about missing initlizers.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 src/intel_module.c | 2 +-
 src/meson.build    | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/intel_module.c b/src/intel_module.c
index 171b20d83d33..a71c2e40b774 100644
--- a/src/intel_module.c
+++ b/src/intel_module.c
@@ -388,7 +388,7 @@ static const struct pci_id_match intel_device_match[] = {
 	INTEL_VGA_DEVICE(PCI_MATCH_ANY, &intel_generic_info),
 #endif
 
-	{ 0, 0, 0 },
+	{},
 };
 
 void
diff --git a/src/meson.build b/src/meson.build
index 0a46e233a94c..1125c65b73be 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -150,7 +150,6 @@ shared_module('intel_drv',
 		'-DMAJOR_IN_SYSMACROS',
 		'-Wno-unused-parameter',
 		'-Wno-sign-compare',
-		'-Wno-missing-field-initializers',
 	      ],
 	      name_prefix : '',
 	      install_dir : join_paths(moduledir, 'drivers'),
-- 
2.21.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH xf86-video-intel 10/21] sna: Use named initializers
  2019-09-19 16:30 [PATCH xf86-video-intel 00/21] Compiler warn elimination Ville Syrjala
                   ` (8 preceding siblings ...)
  2019-09-19 16:31 ` [PATCH xf86-video-intel 09/21] Avoid missing initializer warning Ville Syrjala
@ 2019-09-19 16:31 ` Ville Syrjala
  2019-09-19 16:31 ` [PATCH xf86-video-intel 11/21] sna: Increase the size of the path name buffer a bit Ville Syrjala
                   ` (11 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: Ville Syrjala @ 2019-09-19 16:31 UTC (permalink / raw)
  To: intel-gfx

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Avoid -Wno-missing-field-initializers by using named
initializers.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 src/sna/meson.build          | 1 -
 src/sna/sna_composite.c      | 2 +-
 src/sna/sna_display.c        | 6 +++---
 src/sna/sna_display_fake.c   | 2 +-
 src/sna/sna_video_overlay.c  | 6 +++++-
 src/sna/sna_video_sprite.c   | 8 +++++++-
 src/sna/sna_video_textured.c | 5 ++++-
 7 files changed, 21 insertions(+), 9 deletions(-)

diff --git a/src/sna/meson.build b/src/sna/meson.build
index b1276ab3aa6e..9e4b69f45e55 100644
--- a/src/sna/meson.build
+++ b/src/sna/meson.build
@@ -129,7 +129,6 @@ sna = static_library('sna',
 		     link_with : [ brw, fb, ],
 		     include_directories : inc,
 		     c_args : [
-		       '-Wno-missing-field-initializers',
 		       '-Wno-unused-but-set-variable',
 		       '-Wno-expansion-to-defined',
 		       '-Wno-shift-negative-value',
diff --git a/src/sna/sna_composite.c b/src/sna/sna_composite.c
index 1da8c29155b4..3a8e86845069 100644
--- a/src/sna/sna_composite.c
+++ b/src/sna/sna_composite.c
@@ -1074,7 +1074,7 @@ sna_composite_rectangles(CARD8		 op,
 		}
 	} else {
 		for (i = 0; i < num_boxes; i++) {
-			RegionRec tmp = { boxes[i] };
+			RegionRec tmp = { .extents = boxes[i], };
 			if (pixman_region_intersect(&tmp, &tmp, dst->pCompositeClip)) {
 				int n = 0;
 
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index 1e62cc40473f..5c522011e056 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -7316,7 +7316,7 @@ next_crtc:
 }
 
 static const xf86CrtcConfigFuncsRec sna_mode_funcs = {
-	sna_mode_resize
+	.resize = sna_mode_resize,
 };
 
 static void set_size_range(struct sna *sna)
@@ -7784,7 +7784,7 @@ static bool has_flip__async(struct sna *sna)
 	struct local_get_cap {
 		uint64_t name;
 		uint64_t value;
-	} cap = { DRM_CAP_ASYNC_PAGE_FLIP };
+	} cap = { .name = DRM_CAP_ASYNC_PAGE_FLIP, };
 
 	if (sna->flags & SNA_NO_FLIP)
 		return false;
@@ -9682,7 +9682,7 @@ fixup_flip:
 			     __FUNCTION__, __sna_crtc_id(crtc), crtc->flip_bo->handle, crtc->flip_bo->active_scanout, crtc->flip_serial));
 
 			{
-				struct drm_i915_gem_busy busy = { flip_bo->handle };
+				struct drm_i915_gem_busy busy = { .handle = flip_bo->handle, };
 				if (drmIoctl(sna->kgem.fd, DRM_IOCTL_I915_GEM_BUSY, &busy) == 0) {
 					if (busy.busy) {
 						int mode = KGEM_RENDER;
diff --git a/src/sna/sna_display_fake.c b/src/sna/sna_display_fake.c
index fa26bda138d7..401e9a066534 100644
--- a/src/sna/sna_display_fake.c
+++ b/src/sna/sna_display_fake.c
@@ -221,7 +221,7 @@ sna_mode_resize(ScrnInfoPtr scrn, int width, int height)
 }
 
 static const xf86CrtcConfigFuncsRec sna_mode_funcs = {
-	sna_mode_resize
+	.resize = sna_mode_resize,
 };
 
 static bool add_fake_output(struct sna *sna, bool late)
diff --git a/src/sna/sna_video_overlay.c b/src/sna/sna_video_overlay.c
index 9bc5ce40dc94..7c7bb4833662 100644
--- a/src/sna/sna_video_overlay.c
+++ b/src/sna/sna_video_overlay.c
@@ -56,7 +56,11 @@ static Atom xvGamma0, xvGamma1, xvGamma2, xvGamma3, xvGamma4, xvGamma5;
 #define IMAGE_MAX_WIDTH_LEGACY	1024
 #define IMAGE_MAX_HEIGHT_LEGACY	1088
 
-static XvFormatRec Formats[] = { {15}, {16}, {24} };
+static XvFormatRec Formats[] = {
+	{ .depth = 15, },
+	{ .depth = 16, },
+	{ .depth = 24, },
+};
 
 static const XvAttributeRec Attributes[] = {
 	{XvSettable | XvGettable, 0, (1 << 24) - 1, (char *)"XV_COLORKEY"},
diff --git a/src/sna/sna_video_sprite.c b/src/sna/sna_video_sprite.c
index da676ad658fc..711a2fb261c0 100644
--- a/src/sna/sna_video_sprite.c
+++ b/src/sna/sna_video_sprite.c
@@ -72,7 +72,13 @@ struct local_mode_set_plane {
 
 static Atom xvColorKey, xvAlwaysOnTop, xvSyncToVblank, xvColorspace;
 
-static XvFormatRec formats[] = { {8}, {15}, {16}, {24}, {30} };
+static XvFormatRec formats[] = {
+	{ .depth = 8, },
+	{ .depth = 15, },
+	{ .depth = 16, },
+	{ .depth = 24, },
+	{ .depth = 30, },
+};
 static const XvImageRec images[] = { XVIMAGE_YUY2, XVIMAGE_UYVY,
 				     XVMC_RGB888 };
 static const XvImageRec images_rgb565[] = { XVIMAGE_YUY2, XVIMAGE_UYVY,
diff --git a/src/sna/sna_video_textured.c b/src/sna/sna_video_textured.c
index 06da36d03c03..6e30461d43be 100644
--- a/src/sna/sna_video_textured.c
+++ b/src/sna/sna_video_textured.c
@@ -39,7 +39,10 @@
 static Atom xvBrightness, xvContrast, xvSyncToVblank, xvColorspace;
 
 static XvFormatRec Formats[] = {
-	{15}, {16}, {24}, {30}
+	{ .depth = 15, },
+	{ .depth = 16, },
+	{ .depth = 24, },
+	{ .depth = 30, },
 };
 
 static const XvAttributeRec Attributes[] = {
-- 
2.21.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH xf86-video-intel 11/21] sna: Increase the size of the path name buffer a bit
  2019-09-19 16:30 [PATCH xf86-video-intel 00/21] Compiler warn elimination Ville Syrjala
                   ` (9 preceding siblings ...)
  2019-09-19 16:31 ` [PATCH xf86-video-intel 10/21] sna: Use named initializers Ville Syrjala
@ 2019-09-19 16:31 ` Ville Syrjala
  2019-09-19 16:31 ` [PATCH xf86-video-intel 12/21] sna: Use memcmp() to avoid strict aliasing warns Ville Syrjala
                   ` (10 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: Ville Syrjala @ 2019-09-19 16:31 UTC (permalink / raw)
  To: intel-gfx

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

../src/intel_device.c: In function ‘__intel_open_device__pci.isra.6’:
../src/intel_device.c:321:25: warning: ‘%s’ directive writing up to 255 bytes into a region of size 247 [-Wformat-overflow=]
   sprintf(path + base, "%s", de->d_name);

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 src/intel_device.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/intel_device.c b/src/intel_device.c
index 219550731500..f28d3be11796 100644
--- a/src/intel_device.c
+++ b/src/intel_device.c
@@ -301,9 +301,9 @@ static int open_cloexec(const char *path)
 #ifdef __linux__
 static int __intel_open_device__major_minor(int _major, int _minor)
 {
-	char path[256];
 	DIR *dir;
 	struct dirent *de;
+	char path[9+sizeof(de->d_name)];
 	int base, fd = -1;
 
 	base = sprintf(path, "/dev/dri/");
-- 
2.21.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH xf86-video-intel 12/21] sna: Use memcmp() to avoid strict aliasing warns
  2019-09-19 16:30 [PATCH xf86-video-intel 00/21] Compiler warn elimination Ville Syrjala
                   ` (10 preceding siblings ...)
  2019-09-19 16:31 ` [PATCH xf86-video-intel 11/21] sna: Increase the size of the path name buffer a bit Ville Syrjala
@ 2019-09-19 16:31 ` Ville Syrjala
  2019-09-19 16:31 ` [PATCH xf86-video-intel 13/21] sna: Avoid strict aliasing violations with glyphinfo Ville Syrjala
                   ` (9 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: Ville Syrjala @ 2019-09-19 16:31 UTC (permalink / raw)
  To: intel-gfx

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

../src/sna/sna_display.c: In function ‘sna_covering_crtc’:
../src/sna/sna_display.c:8235:34: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   if (*(const uint64_t *)box == *(uint64_t *)&crtc->bounds) {

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 src/sna/sna_display.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index 5c522011e056..5c377cf2d86d 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -8232,7 +8232,7 @@ sna_covering_crtc(struct sna *sna, const BoxRec *box, xf86CrtcPtr desired)
 		     __FUNCTION__, c,
 		     crtc->bounds.x1, crtc->bounds.y1,
 		     crtc->bounds.x2, crtc->bounds.y2));
-		if (*(const uint64_t *)box == *(uint64_t *)&crtc->bounds) {
+		if (!memcmp(box, &crtc->bounds, sizeof(*box))) {
 			DBG(("%s: box exactly matches crtc [%d]\n",
 			     __FUNCTION__, c));
 			return crtc;
-- 
2.21.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH xf86-video-intel 13/21] sna: Avoid strict aliasing violations with glyphinfo
  2019-09-19 16:30 [PATCH xf86-video-intel 00/21] Compiler warn elimination Ville Syrjala
                   ` (11 preceding siblings ...)
  2019-09-19 16:31 ` [PATCH xf86-video-intel 12/21] sna: Use memcmp() to avoid strict aliasing warns Ville Syrjala
@ 2019-09-19 16:31 ` Ville Syrjala
  2019-09-19 16:31 ` [PATCH xf86-video-intel 14/21] sna/fb: Use memcpy() to avoid strict aliasing violations Ville Syrjala
                   ` (8 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: Ville Syrjala @ 2019-09-19 16:31 UTC (permalink / raw)
  To: intel-gfx

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Just access the xGlyphInfo members directly to avoid the
compiler getting upset about strict aliasing violations.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 src/sna/sna_glyphs.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/sna/sna_glyphs.c b/src/sna/sna_glyphs.c
index 6ee403360226..ebc061b5a8a8 100644
--- a/src/sna/sna_glyphs.c
+++ b/src/sna/sna_glyphs.c
@@ -85,8 +85,11 @@
 #define NO_ATLAS ((PicturePtr)-1)
 #define GLYPH_TOLERANCE 3
 
-#define glyph_valid(g) *((uint32_t *)&(g)->info.width)
-#define glyph_copy_size(r, g) *(uint32_t *)&(r)->width = *(uint32_t *)&g->info.width
+#define glyph_valid(g) ((g)->info.width || (g)->info.height)
+#define glyph_copy_size(r, g) do { \
+	(r)->width = (g)->info.width; \
+	(r)->height = (g)->info.height; \
+} while (0)
 
 #if HAS_PIXMAN_GLYPHS
 static  pixman_glyph_cache_t *__global_glyph_cache;
-- 
2.21.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH xf86-video-intel 14/21] sna/fb: Use memcpy() to avoid strict aliasing violations
  2019-09-19 16:30 [PATCH xf86-video-intel 00/21] Compiler warn elimination Ville Syrjala
                   ` (12 preceding siblings ...)
  2019-09-19 16:31 ` [PATCH xf86-video-intel 13/21] sna: Avoid strict aliasing violations with glyphinfo Ville Syrjala
@ 2019-09-19 16:31 ` Ville Syrjala
  2019-09-19 16:31 ` [PATCH xf86-video-intel 15/21] xvmc: Eliminate " Ville Syrjala
                   ` (7 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: Ville Syrjala @ 2019-09-19 16:31 UTC (permalink / raw)
  To: intel-gfx

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Replace the cast+deref with memcpy() so that we don't upset
the compiler's strict aliasing rules.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 src/sna/fb/fbspan.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/sna/fb/fbspan.c b/src/sna/fb/fbspan.c
index 45cb7cc7bd6c..18136c200458 100644
--- a/src/sna/fb/fbspan.c
+++ b/src/sna/fb/fbspan.c
@@ -39,12 +39,13 @@ fbFillSpans(DrawablePtr drawable, GCPtr gc,
 	while (n--) {
 		BoxRec box;
 
-		*(DDXPointPtr)&box = *pt++;
+		memcpy(&box, pt, sizeof(box));
 		box.x2 = box.x1 + *width++;
 		box.y2 = box.y1 + 1;
 
 		/* XXX fSorted */
 		fbDrawableRun(drawable, gc, &box, fbFillSpan, NULL);
+		pt++;
 	}
 }
 
@@ -91,7 +92,8 @@ fbSetSpans(DrawablePtr drawable, GCPtr gc,
 	while (n--) {
 		BoxRec box;
 
-		*(DDXPointPtr)&box = data.pt = *pt;
+		memcpy(&box, pt, sizeof(box));
+		data.pt = *pt;
 		box.x2 = box.x1 + *width;
 		box.y2 = box.y1 + 1;
 
-- 
2.21.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH xf86-video-intel 15/21] xvmc: Eliminate strict aliasing violations
  2019-09-19 16:30 [PATCH xf86-video-intel 00/21] Compiler warn elimination Ville Syrjala
                   ` (13 preceding siblings ...)
  2019-09-19 16:31 ` [PATCH xf86-video-intel 14/21] sna/fb: Use memcpy() to avoid strict aliasing violations Ville Syrjala
@ 2019-09-19 16:31 ` Ville Syrjala
  2019-09-19 16:31 ` [PATCH xf86-video-intel 16/21] sna/fb: Initialize xoff/yoff Ville Syrjala
                   ` (6 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: Ville Syrjala @ 2019-09-19 16:31 UTC (permalink / raw)
  To: intel-gfx

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Just access both halves of the motion vector thing
directly instead of doung the cast to uint and deref.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 src/legacy/i810/xvmc/I810XvMC.c | 48 ++++++++++++++++-----------------
 1 file changed, 24 insertions(+), 24 deletions(-)

diff --git a/src/legacy/i810/xvmc/I810XvMC.c b/src/legacy/i810/xvmc/I810XvMC.c
index a538e9991602..6780bba06b2c 100644
--- a/src/legacy/i810/xvmc/I810XvMC.c
+++ b/src/legacy/i810/xvmc/I810XvMC.c
@@ -1246,8 +1246,8 @@ static __inline__ void renderFieldinField(uint **datay,uint **datau,
   *dy++ = (1<<30) | (3<<28) | dw1;
   *dy++ = xy;
   *dy++ = (16<<16) | 16;
-  *dy++ = *(uint *)fmv;
-  *dy++ = *(uint *)bmv;
+  *dy++ = fmv[1] << 16 | fmv[0];
+  *dy++ = bmv[1] << 16 | bmv[0];
   PACK_CORR_DATA(dy,block_ptr,ysize);
   block_ptr = (short *)((unsigned long)block_ptr + ysize);
   /* End Y Blocks */
@@ -1263,8 +1263,8 @@ static __inline__ void renderFieldinField(uint **datay,uint **datau,
   *du++ = (2<<30) | (1<<28) | dw1;
   *du++ = xy;
   *du++ = (8<<16) | 8;
-  *du++ = *(uint *)fmv;
-  *du++ = *(uint *)bmv;
+  *du++ = fmv[1] << 16 | fmv[0];
+  *du++ = bmv[1] << 16 | bmv[0];
   PACK_CORR_DATA(du,block_ptr,usize);
   block_ptr = (short *)((unsigned long)block_ptr + usize);
 
@@ -1273,8 +1273,8 @@ static __inline__ void renderFieldinField(uint **datay,uint **datau,
   *dv++ = (3<<30) | (1<<28) | dw1;
   *dv++ = xy;
   *dv++ = (8<<16) | 8;
-  *dv++ = *(uint *)fmv;
-  *dv++ = *(uint *)bmv;
+  *dv++ = fmv[1] << 16 | fmv[0];
+  *dv++ = bmv[1] << 16 | bmv[0];
   PACK_CORR_DATA(dv,block_ptr,vsize);
   block_ptr = (short *)((unsigned long)block_ptr + vsize);
 
@@ -1394,8 +1394,8 @@ static __inline__ void render16x8inField(uint **datay,uint **datau,
   *dy++ = (1<<30) | (2<<28) | dw1[0];
   *dy++ = xy;
   *dy++ = (8<<16) | 16;
-  *dy++ = *(uint *)fmv;
-  *dy++ = *(uint *)bmv;
+  *dy++ = fmv[1] << 16 | fmv[0];
+  *dy++ = bmv[1] << 16 | bmv[0];
   PACK_CORR_DATA(dy,block_ptr,y1size);
   block_ptr = (short *)((unsigned long)block_ptr + y1size);
 
@@ -1404,8 +1404,8 @@ static __inline__ void render16x8inField(uint **datay,uint **datau,
   *dy++ = (1<<30) | (2<<28) | dw1[1];
   *dy++ = (xy + 8);
   *dy++ = (8<<16) | 16;
-  *dy++ = *(uint *)&fmv[2];
-  *dy++ = *(uint *)&bmv[2];
+  *dy++ = fmv[3] << 16 | fmv[2];
+  *dy++ = bmv[3] << 16 | bmv[2];
   PACK_CORR_DATA(dy,block_ptr,y2size);
   block_ptr = (short *)((unsigned long)block_ptr + y2size);
   /* End Y Blocks */
@@ -1427,8 +1427,8 @@ static __inline__ void render16x8inField(uint **datay,uint **datau,
   *du++ = (2<<30) | (1<<28) | dw1[0];
   *du++ = xy;
   *du++ = (4<<16) | 8;
-  *du++ = *(uint *)fmv;
-  *du++ = *(uint *)bmv;
+  *du++ = fmv[1] << 16 | fmv[0];
+  *du++ = bmv[1] << 16 | bmv[0];
   PACK_CORR_DATA(du,block_ptr,usize);
   block_ptr = (short *)((unsigned long)block_ptr + usize);
 
@@ -1437,8 +1437,8 @@ static __inline__ void render16x8inField(uint **datay,uint **datau,
   *du++ = (2<<30) | (1<<28) | dw1[1];
   *du++ = (xy + 4);
   *du++ = (4<<16) | 8;
-  *du++ = *(uint *)&fmv[2];
-  *du++ = *(uint *)&bmv[2];
+  *du++ = fmv[3] << 16 | fmv[2];
+  *du++ = bmv[3] << 16 | bmv[2];
   PACK_CORR_DATA(du,block_ptr,usize);
   block_ptr = (short *)((unsigned long)block_ptr + usize);
   /* End U Blocks */
@@ -1448,8 +1448,8 @@ static __inline__ void render16x8inField(uint **datay,uint **datau,
   *dv++ = (3<<30) | (1<<28) | dw1[0];
   *dv++ = xy;
   *dv++ = (4<<16) | 8;
-  *dv++ = *(uint *)fmv;
-  *dv++ = *(uint *)bmv;
+  *dv++ = fmv[1] << 16 | fmv[0];
+  *dv++ = bmv[1] << 16 | bmv[0];
   PACK_CORR_DATA(dv,block_ptr,vsize);
   block_ptr = (short *)((unsigned long)block_ptr + vsize);
 
@@ -1458,8 +1458,8 @@ static __inline__ void render16x8inField(uint **datay,uint **datau,
   *dv++ = (3<<30) | (1<<28) | dw1[1];
   *dv++ = (xy + 4);
   *dv++ = (4<<16) | 8;
-  *dv++ = *(uint *)&fmv[2];
-  *dv++ = *(uint *)&bmv[2];
+  *dv++ = fmv[3] << 16 | fmv[2];
+  *dv++ = bmv[3] << 16 | bmv[2];
   PACK_CORR_DATA(dv,block_ptr,vsize);
   block_ptr = (short *)((unsigned long)block_ptr + vsize);
   /* End V Blocks */
@@ -1513,8 +1513,8 @@ static __inline__ void renderDualPrimeinField(uint **datay,uint **datau,
   *dy++ = (1<<30) | (3<<28) | dw1;
   *dy++ = xy;
   *dy++ = (16<<16) | 16;
-  *dy++ = *(uint *)fmv;
-  *dy++ = *(uint *)bmv;
+  *dy++ = fmv[1] << 16 | fmv[0];
+  *dy++ = bmv[1] << 16 | bmv[0];
   PACK_CORR_DATA(dy,block_ptr,ysize);
   block_ptr = (short *)((unsigned long)block_ptr + ysize);
   /* End Y Blocks */
@@ -1530,8 +1530,8 @@ static __inline__ void renderDualPrimeinField(uint **datay,uint **datau,
   *du++ = (2<<30) | (1<<28) | dw1;
   *du++ = xy;
   *du++ = (8<<16) | 8;
-  *du++ = *(uint *)fmv;
-  *du++ = *(uint *)bmv;
+  *du++ = fmv[1] << 16 | fmv[0];
+  *du++ = bmv[1] << 16 | bmv[0];
   PACK_CORR_DATA(du,block_ptr,usize);
   block_ptr = (short *)((unsigned long)block_ptr + usize);
 
@@ -1540,8 +1540,8 @@ static __inline__ void renderDualPrimeinField(uint **datay,uint **datau,
   *dv++ = (3<<30) | (1<<28) | dw1;
   *dv++ = xy;
   *dv++ = (8<<16) | 8;
-  *dv++ = *(uint *)fmv;
-  *dv++ = *(uint *)bmv;
+  *dv++ = fmv[1] << 16 | fmv[0];
+  *dv++ = bmv[1] << 16 | bmv[0];
   PACK_CORR_DATA(dv,block_ptr,vsize);
   block_ptr = (short *)((unsigned long)block_ptr + vsize);
 
-- 
2.21.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH xf86-video-intel 16/21] sna/fb: Initialize xoff/yoff
  2019-09-19 16:30 [PATCH xf86-video-intel 00/21] Compiler warn elimination Ville Syrjala
                   ` (14 preceding siblings ...)
  2019-09-19 16:31 ` [PATCH xf86-video-intel 15/21] xvmc: Eliminate " Ville Syrjala
@ 2019-09-19 16:31 ` Ville Syrjala
  2019-09-19 16:31 ` [PATCH xf86-video-intel 17/21] sna: Use -Wno-maybe-uninitialized Ville Syrjala
                   ` (5 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: Ville Syrjala @ 2019-09-19 16:31 UTC (permalink / raw)
  To: intel-gfx

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

The compiler seems to think src/mask xoff/yoff can be used
uninitialized. Zero them to make sure.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 src/sna/fb/fbpict.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/sna/fb/fbpict.c b/src/sna/fb/fbpict.c
index abe223f31c88..8e65deb26fe9 100644
--- a/src/sna/fb/fbpict.c
+++ b/src/sna/fb/fbpict.c
@@ -313,8 +313,10 @@ image_from_pict_internal(PicturePtr pict, Bool has_clip, int *xoff, int *yoff,
 {
 	pixman_image_t *image = NULL;
 
-	if (!pict)
+	if (!pict) {
+		*xoff = *yoff = 0;
 		return NULL;
+	}
 
 	if (pict->pDrawable) {
 		image = create_bits_picture(pict, has_clip, xoff, yoff);
@@ -336,6 +338,8 @@ image_from_pict_internal(PicturePtr pict, Bool has_clip, int *xoff, int *yoff,
 				image = create_conical_gradient_image(gradient);
 		}
 		*xoff = *yoff = 0;
+	} else {
+		*xoff = *yoff = 0;
 	}
 
 	if (image)
-- 
2.21.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH xf86-video-intel 17/21] sna: Use -Wno-maybe-uninitialized
  2019-09-19 16:30 [PATCH xf86-video-intel 00/21] Compiler warn elimination Ville Syrjala
                   ` (15 preceding siblings ...)
  2019-09-19 16:31 ` [PATCH xf86-video-intel 16/21] sna/fb: Initialize xoff/yoff Ville Syrjala
@ 2019-09-19 16:31 ` Ville Syrjala
  2019-09-19 16:31 ` [PATCH xf86-video-intel 18/21] sna: Get rid of -Wno-shift-negative-value Ville Syrjala
                   ` (4 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: Ville Syrjala @ 2019-09-19 16:31 UTC (permalink / raw)
  To: intel-gfx

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

The compiler seems incapable of deducing whether something
is used uninitialized or not.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 src/sna/meson.build | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/sna/meson.build b/src/sna/meson.build
index 9e4b69f45e55..7408f63c82db 100644
--- a/src/sna/meson.build
+++ b/src/sna/meson.build
@@ -132,6 +132,7 @@ sna = static_library('sna',
 		       '-Wno-unused-but-set-variable',
 		       '-Wno-expansion-to-defined',
 		       '-Wno-shift-negative-value',
+		       '-Wno-maybe-uninitialized',
 		       '-Wno-unused-parameter',
 		       '-Wno-unused-function',
 		       '-Wno-unused-variable',
-- 
2.21.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH xf86-video-intel 18/21] sna: Get rid of -Wno-shift-negative-value
  2019-09-19 16:30 [PATCH xf86-video-intel 00/21] Compiler warn elimination Ville Syrjala
                   ` (16 preceding siblings ...)
  2019-09-19 16:31 ` [PATCH xf86-video-intel 17/21] sna: Use -Wno-maybe-uninitialized Ville Syrjala
@ 2019-09-19 16:31 ` Ville Syrjala
  2019-09-19 16:31 ` [PATCH xf86-video-intel 19/21] uxa: " Ville Syrjala
                   ` (3 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: Ville Syrjala @ 2019-09-19 16:31 UTC (permalink / raw)
  To: intel-gfx

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Use a cast to avoid the "left shift of negative value
[-Wshift-negative-value]" warning, and get rid of the
suppression.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 src/sna/meson.build           | 1 -
 src/sna/sna_trapezoids_mono.c | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/sna/meson.build b/src/sna/meson.build
index 7408f63c82db..e1eb25f2be36 100644
--- a/src/sna/meson.build
+++ b/src/sna/meson.build
@@ -131,7 +131,6 @@ sna = static_library('sna',
 		     c_args : [
 		       '-Wno-unused-but-set-variable',
 		       '-Wno-expansion-to-defined',
-		       '-Wno-shift-negative-value',
 		       '-Wno-maybe-uninitialized',
 		       '-Wno-unused-parameter',
 		       '-Wno-unused-function',
diff --git a/src/sna/sna_trapezoids_mono.c b/src/sna/sna_trapezoids_mono.c
index 07a7867d7f09..1582c96c57e8 100644
--- a/src/sna/sna_trapezoids_mono.c
+++ b/src/sna/sna_trapezoids_mono.c
@@ -657,7 +657,7 @@ mono_init(struct mono *c, int num_edges)
 
 	c->head.dy = 0;
 	c->head.height_left = INT_MAX;
-	c->head.x.quo = INT16_MIN << 16;
+	c->head.x.quo = (uint32_t)INT16_MIN << 16;
 	c->head.prev = NULL;
 	c->head.next = &c->tail;
 	c->tail.prev = &c->head;
-- 
2.21.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH xf86-video-intel 19/21] uxa: Get rid of -Wno-shift-negative-value
  2019-09-19 16:30 [PATCH xf86-video-intel 00/21] Compiler warn elimination Ville Syrjala
                   ` (17 preceding siblings ...)
  2019-09-19 16:31 ` [PATCH xf86-video-intel 18/21] sna: Get rid of -Wno-shift-negative-value Ville Syrjala
@ 2019-09-19 16:31 ` Ville Syrjala
  2019-09-19 16:31 ` [PATCH xf86-video-intel 20/21] tools: Get rid of -Wno-sign-compare Ville Syrjala
                   ` (2 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: Ville Syrjala @ 2019-09-19 16:31 UTC (permalink / raw)
  To: intel-gfx

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

The minimum CS URB entry size is 1. Let's use that
instead of 0 so that we don't end up left shifting
a -1.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 src/uxa/i965_render.c | 2 +-
 src/uxa/i965_video.c  | 2 +-
 src/uxa/meson.build   | 1 -
 3 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/uxa/i965_render.c b/src/uxa/i965_render.c
index c1943fb6b5a8..32dbf2f95173 100644
--- a/src/uxa/i965_render.c
+++ b/src/uxa/i965_render.c
@@ -277,7 +277,7 @@ i965_check_composite_texture(ScreenPtr screen, PicturePtr picture)
 /* Set up a default static partitioning of the URB, which is supposed to
  * allow anything we would want to do, at potentially lower performance.
  */
-#define URB_CS_ENTRY_SIZE     0
+#define URB_CS_ENTRY_SIZE     1
 #define URB_CS_ENTRIES	      0
 
 #define URB_VS_ENTRY_SIZE     1	// each 512-bit row
diff --git a/src/uxa/i965_video.c b/src/uxa/i965_video.c
index 9b9203b66f25..fcd5657d9426 100644
--- a/src/uxa/i965_video.c
+++ b/src/uxa/i965_video.c
@@ -378,7 +378,7 @@ static void i965_post_draw_debug(ScrnInfoPtr scrn)
 #define URB_SF_ENTRY_SIZE     2
 
 #define URB_CS_ENTRIES	      0
-#define URB_CS_ENTRY_SIZE     0
+#define URB_CS_ENTRY_SIZE     1
 
 static void i965_create_dst_surface_state(ScrnInfoPtr scrn,
 					PixmapPtr pixmap,
diff --git a/src/uxa/meson.build b/src/uxa/meson.build
index 5f0929ae32a9..f4a3302d3655 100644
--- a/src/uxa/meson.build
+++ b/src/uxa/meson.build
@@ -58,7 +58,6 @@ uxa = static_library('uxa',
 		     include_directories : inc,
 		     c_args : [
 		       '-Wno-deprecated-declarations',
-		       '-Wno-shift-negative-value',
 		       '-Wno-unused-parameter',
 		       '-Wno-sign-compare',
 		     ],
-- 
2.21.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH xf86-video-intel 20/21] tools: Get rid of -Wno-sign-compare
  2019-09-19 16:30 [PATCH xf86-video-intel 00/21] Compiler warn elimination Ville Syrjala
                   ` (18 preceding siblings ...)
  2019-09-19 16:31 ` [PATCH xf86-video-intel 19/21] uxa: " Ville Syrjala
@ 2019-09-19 16:31 ` Ville Syrjala
  2019-09-19 16:31 ` [PATCH xf86-video-intel 21/21] sna: Fix compiler warnings due to DrawablePtr vs. PixmapPtr Ville Syrjala
  2019-09-27 19:41 ` [PATCH xf86-video-intel 00/21] Compiler warn elimination Chris Wilson
  21 siblings, 0 replies; 23+ messages in thread
From: Ville Syrjala @ 2019-09-19 16:31 UTC (permalink / raw)
  To: intel-gfx

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Fix the sign comparison warnings by changing some types, and
using a few casts.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 tools/backlight_helper.c |  2 +-
 tools/meson.build        |  2 --
 tools/virtual.c          | 18 +++++++++---------
 3 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/tools/backlight_helper.c b/tools/backlight_helper.c
index aadb8fac92ba..65151a534009 100644
--- a/tools/backlight_helper.c
+++ b/tools/backlight_helper.c
@@ -51,7 +51,7 @@ int main(int argc, char *argv[])
 
 	if (snprintf(buf, sizeof(buf),
 		     "/sys/class/backlight/%s/brightness",
-		     argv[1]) >= sizeof(buf))
+		     argv[1]) >= (int)sizeof(buf))
 		die("Invalid interface '%s': name too long\n", argv[1]);
 
 	fd = open(buf, O_RDWR);
diff --git a/tools/meson.build b/tools/meson.build
index b4621abb3c7c..3df33385be3b 100644
--- a/tools/meson.build
+++ b/tools/meson.build
@@ -17,7 +17,6 @@ if with_tools
 	     ],
 	     c_args : [
 	       '-Wno-unused-parameter',
-	       '-Wno-sign-compare',
 	     ],
 	     install : true)
 
@@ -81,7 +80,6 @@ if with_backlight_helper
 	     install_mode : [ 'rws--x--x', 'root', 'root' ],
 	     c_args : [
 	       '-DMAJOR_IN_SYSMACROS',
-	       '-Wno-sign-compare',
 	     ],
 	     install : true)
 
diff --git a/tools/virtual.c b/tools/virtual.c
index fc8db2b9f2e2..010a3aab7cf3 100644
--- a/tools/virtual.c
+++ b/tools/virtual.c
@@ -121,7 +121,7 @@ struct display {
 	int cursor_y;
 	int cursor_moved;
 	int cursor_visible;
-	int cursor;
+	Cursor cursor;
 
 	int flush;
 	int send;
@@ -148,7 +148,7 @@ struct output {
 	Pixmap pixmap;
 	GC gc;
 
-	long serial;
+	unsigned long serial;
 	int use_shm;
 	int use_shm_pixmap;
 	XShmSegmentInfo shm;
@@ -166,7 +166,7 @@ struct clone {
 	struct clone *active;
 
 	struct output src, dst;
-	long timestamp;
+	Time timestamp;
 
 	XShmSegmentInfo shm;
 	XImage image;
@@ -194,8 +194,8 @@ struct context {
 
 	int timer_active;
 
-	long timestamp;
-	long configTimestamp;
+	Time timestamp;
+	Time configTimestamp;
 
 	Atom singleton;
 	char command[1024];
@@ -597,7 +597,7 @@ static int mode_equal(const XRRModeInfo *a, const XRRModeInfo *b)
 		a->modeFlags == b->modeFlags);
 }
 
-static XRRModeInfo *lookup_mode(XRRScreenResources *res, int id)
+static XRRModeInfo *lookup_mode(XRRScreenResources *res, RRMode id)
 {
 	int i;
 
@@ -3055,7 +3055,7 @@ static int first_display_send_command(struct context *ctx, int timeout,
 	va_start(va, format);
 	len = vsnprintf(buf+4, sizeof(buf)-4, format, va)+5;
 	va_end(va);
-	assert(len < sizeof(buf));
+	assert(len < (int)sizeof(buf));
 
 	DBG(X11, ("%s: send command '%s'\n", DisplayString(display->dpy), buf));
 
@@ -3063,7 +3063,7 @@ static int first_display_send_command(struct context *ctx, int timeout,
 	while (len) {
 		XClientMessageEvent msg;
 		int n = len;
-		if (n > sizeof(msg.data.b))
+		if (n > (int)sizeof(msg.data.b))
 			n = sizeof(msg.data.b);
 		len -= n;
 
@@ -3113,7 +3113,7 @@ static void first_display_handle_command(struct context *ctx,
 	for (len = 0; len < 20 && msg[len]; len++)
 		;
 
-	if (ctx->command_continuation + len > sizeof(ctx->command)) {
+	if (ctx->command_continuation + len > (int)sizeof(ctx->command)) {
 		ctx->command_continuation = 0;
 		return;
 	}
-- 
2.21.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH xf86-video-intel 21/21] sna: Fix compiler warnings due to DrawablePtr vs. PixmapPtr
  2019-09-19 16:30 [PATCH xf86-video-intel 00/21] Compiler warn elimination Ville Syrjala
                   ` (19 preceding siblings ...)
  2019-09-19 16:31 ` [PATCH xf86-video-intel 20/21] tools: Get rid of -Wno-sign-compare Ville Syrjala
@ 2019-09-19 16:31 ` Ville Syrjala
  2019-09-27 19:41 ` [PATCH xf86-video-intel 00/21] Compiler warn elimination Chris Wilson
  21 siblings, 0 replies; 23+ messages in thread
From: Ville Syrjala @ 2019-09-19 16:31 UTC (permalink / raw)
  To: intel-gfx

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Deal with xserver commit 8e3b26ceaa86 ("Make PixmapDirtyUpdateRec::src
a DrawablePtr")

Not sure this is still correct though. Is this stuff limited to
pixmaps anymore?

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 src/sna/sna_accel.c | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 8266e86d8fea..fa386ff6b9a6 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -17518,7 +17518,11 @@ static bool has_offload_slaves(struct sna *sna)
 	PixmapDirtyUpdatePtr dirty;
 
 	xorg_list_for_each_entry(dirty, &screen->pixmap_dirty_list, ent) {
+#ifdef HAS_DIRTYTRACKING_DRAWABLE_SRC
+		assert(dirty->src == &sna->front->drawable);
+#else
 		assert(dirty->src == sna->front);
+#endif
 		if (RegionNotEmpty(DamageRegion(dirty->damage)))
 			return true;
 	}
@@ -17679,7 +17683,11 @@ static void sna_accel_post_damage(struct sna *sna)
 		if (RegionNil(damage))
 			continue;
 
-		src = dirty->src;
+#ifdef HAS_DIRTYTRACKING_DRAWABLE_SRC
+		assert(dirty->src->type == DRAWABLE_PIXMAP);
+#endif
+
+		src = (PixmapPtr)dirty->src;
 		dst = dirty->slave_dst->master_pixmap;
 
 		region.extents.x1 = dirty->x;
@@ -17930,9 +17938,15 @@ migrate_dirty_tracking(PixmapPtr old_front, PixmapPtr new_front)
 	PixmapDirtyUpdatePtr dirty, safe;
 
 	xorg_list_for_each_entry_safe(dirty, safe, &screen->pixmap_dirty_list, ent) {
+#ifdef HAS_DIRTYTRACKING_DRAWABLE_SRC
+		assert(dirty->src == &old_front->drawable);
+		if (dirty->src != &old_front->drawable)
+			continue;
+#else
 		assert(dirty->src == old_front);
 		if (dirty->src != old_front)
 			continue;
+#endif
 
 		DamageUnregister(&dirty->src->drawable, dirty->damage);
 		DamageDestroy(dirty->damage);
@@ -17947,7 +17961,11 @@ migrate_dirty_tracking(PixmapPtr old_front, PixmapPtr new_front)
 		}
 
 		DamageRegister(&new_front->drawable, dirty->damage);
+#ifdef HAS_DIRTYTRACKING_DRAWABLE_SRC
+		dirty->src = &new_front->drawable;
+#else
 		dirty->src = new_front;
+#endif
 	}
 #endif
 }
-- 
2.21.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* Re: [PATCH xf86-video-intel 00/21] Compiler warn elimination
  2019-09-19 16:30 [PATCH xf86-video-intel 00/21] Compiler warn elimination Ville Syrjala
                   ` (20 preceding siblings ...)
  2019-09-19 16:31 ` [PATCH xf86-video-intel 21/21] sna: Fix compiler warnings due to DrawablePtr vs. PixmapPtr Ville Syrjala
@ 2019-09-27 19:41 ` Chris Wilson
  21 siblings, 0 replies; 23+ messages in thread
From: Chris Wilson @ 2019-09-27 19:41 UTC (permalink / raw)
  To: Ville Syrjala, intel-gfx

Quoting Ville Syrjala (2019-09-19 17:30:52)
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Random smattering of patches to eliminate compiler warnings.
> Some I just suppressed out of lazyness, others I tried to
> silence by adjusting the code a bit.

Some of the aliasing pointer avoidance looked silly, but silly compiler
is silly.
 
> Afterwards the build is clean on my gcc 8.3, though with
> a bunch of stuff still suppressed I'm not 100% sure that's
> a good thing.

Definitely quieter which is much less offputting.
Thanks,
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2019-09-27 19:41 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-19 16:30 [PATCH xf86-video-intel 00/21] Compiler warn elimination Ville Syrjala
2019-09-19 16:30 ` [PATCH xf86-video-intel 01/21] sna: Use -Wno-clobbered Ville Syrjala
2019-09-19 16:30 ` [PATCH xf86-video-intel 02/21] sna: Shut up more compiler warns Ville Syrjala
2019-09-19 16:30 ` [PATCH xf86-video-intel 03/21] sna: undef FontSetPrivate() before redefining it Ville Syrjala
2019-09-19 16:30 ` [PATCH xf86-video-intel 04/21] sna: Replace fall through comments with standard form Ville Syrjala
2019-09-19 16:30 ` [PATCH xf86-video-intel 05/21] sna: Annotate more fall throughs Ville Syrjala
2019-09-19 16:30 ` [PATCH xf86-video-intel 06/21] sna: Add sna_br13_color_depth() Ville Syrjala
2019-09-19 16:30 ` [PATCH xf86-video-intel 07/21] sna/fb: Eliminate implicit fallthrough Ville Syrjala
2019-09-19 16:31 ` [PATCH xf86-video-intel 08/21] uxa: Use named initializers Ville Syrjala
2019-09-19 16:31 ` [PATCH xf86-video-intel 09/21] Avoid missing initializer warning Ville Syrjala
2019-09-19 16:31 ` [PATCH xf86-video-intel 10/21] sna: Use named initializers Ville Syrjala
2019-09-19 16:31 ` [PATCH xf86-video-intel 11/21] sna: Increase the size of the path name buffer a bit Ville Syrjala
2019-09-19 16:31 ` [PATCH xf86-video-intel 12/21] sna: Use memcmp() to avoid strict aliasing warns Ville Syrjala
2019-09-19 16:31 ` [PATCH xf86-video-intel 13/21] sna: Avoid strict aliasing violations with glyphinfo Ville Syrjala
2019-09-19 16:31 ` [PATCH xf86-video-intel 14/21] sna/fb: Use memcpy() to avoid strict aliasing violations Ville Syrjala
2019-09-19 16:31 ` [PATCH xf86-video-intel 15/21] xvmc: Eliminate " Ville Syrjala
2019-09-19 16:31 ` [PATCH xf86-video-intel 16/21] sna/fb: Initialize xoff/yoff Ville Syrjala
2019-09-19 16:31 ` [PATCH xf86-video-intel 17/21] sna: Use -Wno-maybe-uninitialized Ville Syrjala
2019-09-19 16:31 ` [PATCH xf86-video-intel 18/21] sna: Get rid of -Wno-shift-negative-value Ville Syrjala
2019-09-19 16:31 ` [PATCH xf86-video-intel 19/21] uxa: " Ville Syrjala
2019-09-19 16:31 ` [PATCH xf86-video-intel 20/21] tools: Get rid of -Wno-sign-compare Ville Syrjala
2019-09-19 16:31 ` [PATCH xf86-video-intel 21/21] sna: Fix compiler warnings due to DrawablePtr vs. PixmapPtr Ville Syrjala
2019-09-27 19:41 ` [PATCH xf86-video-intel 00/21] Compiler warn elimination Chris Wilson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.