xf86-video-intel: 22 commits - src/intel_device.c src/intel_module.c src/legacy/i810 src/meson.build src/sna/blt.c src/sna/fb src/sna/gen2_render.c src/sna/gen3_render.c src/sna/gen4_render.c src/sna/gen5_render.c src/sna/gen6_render.c src/sna/gen7_render.c src/sna/gen8_render.c src/sna/gen9_render.c src/sna/kgem.c src/sna/meson.build src/sna/sna_accel.c src/sna/sna_blt.c src/sna/sna_composite.c src/sna/sna_damage.h src/sna/sna_display.c src/sna/sna_display_fake.c src/sna/sna_dri2.c src/sna/sna_driver.c src/sna/sna_glyphs.c src/sna/sna.h src/sna/sna_io.c src/sna/sna_render.c src/sna/sna_render.h src/sna/sna_trapezoids_mono.c src/sna/sna_video_overlay.c src/sna/sna_video_sprite.c src/sna/sna_video_textured.c src/uxa/i965_render.c src/uxa/i965_video.c src/uxa/intel_display.c src/uxa/intel_dri.c src/uxa/meson.build tools/backlight_helper.c tools/meson.build tools/virtual.c

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Sep 27 19:41:45 UTC 2019


 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           |   19 ++++++-------
 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, 222 insertions(+), 174 deletions(-)

New commits:
commit c6cb1b199598c572484fb4e30e1026be9d4ccc31
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Sep 27 20:36:43 2019 +0100

    sna: Squelch compiler warning for unused var
    
    sna_display.c: In function ‘crtc_init_gamma’:
    sna_display.c:7462:28: warning: unused variable ‘lut’ [-Wunused-variable]
    sna_display.c:7444:14: warning: unused variable ‘sna’ [-Wunused-variable]
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index 5c377cf2..874292bc 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -7441,7 +7441,6 @@ static bool crtc_get_gamma_legacy(xf86CrtcPtr crtc,
 
 static void crtc_init_gamma(xf86CrtcPtr crtc)
 {
-	struct sna *sna = to_sna(crtc->scrn);
 	struct sna_crtc *sna_crtc = to_sna_crtc(crtc);
 	uint16_t *gamma;
 	int size;
@@ -7459,11 +7458,10 @@ static void crtc_init_gamma(xf86CrtcPtr crtc)
 	if (gamma == NULL)
 		gamma = malloc(3 * size * sizeof(uint16_t));
 	if (gamma) {
-		struct drm_mode_crtc_lut lut;
-		bool gamma_set;
 		uint16_t *red = gamma;
 		uint16_t *green = gamma + size;
 		uint16_t *blue = gamma + 2 * size;
+		bool gamma_set;
 
 		if (sna_crtc->gamma_lut_size)
 			gamma_set = crtc_get_gamma_lut(crtc, red,
commit 581ddc5d2f55efa2cf5ec76a802fb781ee142b01
Author: Ville Syrjälä <ville.syrjala at linux.intel.com>
Date:   Sun Mar 3 17:21:55 2019 +0200

    sna: Fix compiler warnings due to DrawablePtr vs. PixmapPtr
    
    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 at linux.intel.com>

diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 8266e86d..fa386ff6 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
 }
commit bfeeae4de951712e9e00f681d582c6bd7f40dcd6
Author: Ville Syrjälä <ville.syrjala at linux.intel.com>
Date:   Mon Sep 16 16:20:44 2019 +0300

    tools: Get rid of -Wno-sign-compare
    
    Fix the sign comparison warnings by changing some types, and
    using a few casts.
    
    Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>

diff --git a/tools/backlight_helper.c b/tools/backlight_helper.c
index aadb8fac..65151a53 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 b4621abb..3df33385 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 fc8db2b9..010a3aab 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;
 	}
commit 97058e38d897ef351b9d8a49eaefc515244c438f
Author: Ville Syrjälä <ville.syrjala at linux.intel.com>
Date:   Sun Sep 15 12:51:35 2019 +0300

    uxa: Get rid of -Wno-shift-negative-value
    
    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 at linux.intel.com>

diff --git a/src/uxa/i965_render.c b/src/uxa/i965_render.c
index c1943fb6..32dbf2f9 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 9b9203b6..fcd5657d 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 5f0929ae..f4a3302d 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',
 		     ],
commit e95e9d41ca87185d4065be35e862348d24f455f3
Author: Ville Syrjälä <ville.syrjala at linux.intel.com>
Date:   Sun Sep 15 12:51:35 2019 +0300

    sna: Get rid of -Wno-shift-negative-value
    
    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 at linux.intel.com>

diff --git a/src/sna/meson.build b/src/sna/meson.build
index 7408f63c..e1eb25f2 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 07a7867d..1582c96c 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;
commit fbe15cf431deadd984023e9bdfa4dd2ac2f9cf1b
Author: Ville Syrjälä <ville.syrjala at linux.intel.com>
Date:   Tue Mar 19 17:09:43 2019 +0200

    sna: Use -Wno-maybe-uninitialized
    
    The compiler seems incapable of deducing whether something
    is used uninitialized or not.
    
    Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>

diff --git a/src/sna/meson.build b/src/sna/meson.build
index 9e4b69f4..7408f63c 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',
commit 070fb84ecf7e40fb3003a58471fac0934758d41e
Author: Ville Syrjälä <ville.syrjala at linux.intel.com>
Date:   Tue Mar 19 17:38:36 2019 +0200

    sna/fb: Initialize xoff/yoff
    
    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 at linux.intel.com>

diff --git a/src/sna/fb/fbpict.c b/src/sna/fb/fbpict.c
index abe223f3..8e65deb2 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)
commit be30b162e451e91b6618bafb584288ce42f186f6
Author: Ville Syrjälä <ville.syrjala at linux.intel.com>
Date:   Tue Mar 19 16:56:25 2019 +0200

    xvmc: Eliminate strict aliasing violations
    
    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 at linux.intel.com>

diff --git a/src/legacy/i810/xvmc/I810XvMC.c b/src/legacy/i810/xvmc/I810XvMC.c
index a538e999..6780bba0 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);
 
commit e4a8d533daa74649fd43ad505ea7ec2ec7c680fa
Author: Ville Syrjälä <ville.syrjala at linux.intel.com>
Date:   Tue Mar 19 16:56:34 2019 +0200

    sna/fb: Use memcpy() to avoid strict aliasing violations
    
    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 at linux.intel.com>

diff --git a/src/sna/fb/fbspan.c b/src/sna/fb/fbspan.c
index 45cb7cc7..18136c20 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;
 
commit d8a3db257418d5ebb99509e0bdcfa24d618e6b3d
Author: Ville Syrjälä <ville.syrjala at linux.intel.com>
Date:   Tue Mar 19 17:06:41 2019 +0200

    sna: Avoid strict aliasing violations with glyphinfo
    
    Just access the xGlyphInfo members directly to avoid the
    compiler getting upset about strict aliasing violations.
    
    Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>

diff --git a/src/sna/sna_glyphs.c b/src/sna/sna_glyphs.c
index 6ee40336..ebc061b5 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;
commit 97ce02157035e4d8d1861f18f76c82f6d034df1b
Author: Ville Syrjälä <ville.syrjala at linux.intel.com>
Date:   Tue Mar 19 16:53:35 2019 +0200

    sna: Use memcmp() to avoid strict aliasing warns
    
    ../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 at linux.intel.com>

diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index 5c522011..5c377cf2 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;
commit 17ecd906f3b07c232d3a18fa3cc858b168123215
Author: Ville Syrjälä <ville.syrjala at linux.intel.com>
Date:   Tue Mar 19 16:48:00 2019 +0200

    sna: Increase the size of the path name buffer a bit
    
    ../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 at linux.intel.com>

diff --git a/src/intel_device.c b/src/intel_device.c
index 21955073..f28d3be1 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/");
commit 24a06fef712a98cfe2b409638307d5b349828f72
Author: Ville Syrjälä <ville.syrjala at linux.intel.com>
Date:   Sun Mar 3 19:50:14 2019 +0200

    sna: Use named initializers
    
    Avoid -Wno-missing-field-initializers by using named
    initializers.
    
    Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>

diff --git a/src/sna/meson.build b/src/sna/meson.build
index b1276ab3..9e4b69f4 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 1da8c291..3a8e8684 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 1e62cc40..5c522011 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 fa26bda1..401e9a06 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 9bc5ce40..7c7bb483 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 da676ad6..711a2fb2 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 06da36d0..6e30461d 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[] = {
commit 696f7eda807932f72ba0eb49c8ec7f2e210dd579
Author: Ville Syrjälä <ville.syrjala at linux.intel.com>
Date:   Sun Mar 3 19:49:33 2019 +0200

    Avoid missing initializer warning
    
    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 at linux.intel.com>

diff --git a/src/intel_module.c b/src/intel_module.c
index 171b20d8..a71c2e40 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 0a46e233..1125c65b 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'),
commit 4b26ec2ef680f595dded9b1fd5c5ef43edba17a5
Author: Ville Syrjälä <ville.syrjala at linux.intel.com>
Date:   Sun Mar 3 17:53:18 2019 +0200

    uxa: Use named initializers
    
    Silence the compiler warning about missing initializers
    by using named initializers.
    
    Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>

diff --git a/src/uxa/intel_display.c b/src/uxa/intel_display.c
index 809cda1d..ba4b8d87 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,
 };
 
 /*
commit b88d9287df800a9753ec1b158be563bd15153516
Author: Ville Syrjälä <ville.syrjala at linux.intel.com>
Date:   Thu Sep 19 18:49:29 2019 +0300

    sna/fb: Eliminate implicit fallthrough
    
    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 at linux.intel.com>

diff --git a/src/sna/fb/fb.h b/src/sna/fb/fb.h
index 90431747..ee5da97b 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; \
commit 1804eacc85da089644cbfd061ba6319a4dd4ee87
Author: Ville Syrjälä <ville.syrjala at linux.intel.com>
Date:   Sun Mar 3 17:49:31 2019 +0200

    sna: Add sna_br13_color_depth()
    
    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 at linux.intel.com>

diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index d396f1b4..9c0708a6 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 cf2a7a51..f2bc1896 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 61e2b0fe..00522436 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 d32bd583..d03280ed 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) ||
commit 8cad99802b11bb60480d813b5974183e923bd492
Author: Ville Syrjälä <ville.syrjala at linux.intel.com>
Date:   Sun Mar 3 17:28:38 2019 +0200

    sna: Annotate more fall throughs
    
    Sprinkle fall through comments where needed.
    
    Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>

diff --git a/src/intel_module.c b/src/intel_module.c
index a8c9768e..171b20d8 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 cb90437a..afc719f6 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 e03c4401..80f68454 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 166635eb..e0a7d158 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 934c8f66..8266e86d 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 d5c727ee..abdc7868 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 d6210cc7..1e62cc40 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 daa71dc6..5fd4d54b 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 754b2d4f..4f8895f1 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 1787ffae..904d4400 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 524826d2..e707b74f 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:
commit f9f318e45540e2b99fe400114b2cde7ef2675a5d
Author: Ville Syrjälä <ville.syrjala at linux.intel.com>
Date:   Sun Mar 3 19:39:49 2019 +0200

    sna: Replace fall through comments with standard form
    
    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 at linux.intel.com>

diff --git a/src/sna/gen4_render.c b/src/sna/gen4_render.c
index ae26debf..5a4f968d 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 3d9d35f1..3b1f25aa 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 9eefcbda..1a64d5b9 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 a33ba902..f58f39d4 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 5d09c2cc..0955f90e 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 46908499..06c1f9a3 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 6426a386..daa71dc6 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 891fc905..75998032 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) |
commit 04d8411d6cd7bac36fd44f925cb420ace17675f3
Author: Ville Syrjälä <ville.syrjala at linux.intel.com>
Date:   Sun Mar 3 17:21:45 2019 +0200

    sna: undef FontSetPrivate() before redefining it
    
    Avoid the compiler gettings upset about us redefining
    FontSetPrivate().
    
    Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>

diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 7fd00b9a..934c8f66 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
 
commit 2fae3b89f2d9e5aeb64205ea3fa1ea1a8a010911
Author: Ville Syrjälä <ville.syrjala at linux.intel.com>
Date:   Sun Mar 3 16:58:48 2019 +0200

    sna: Shut up more compiler warns
    
    Suppress more compiler warnings.
    
    Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>

diff --git a/src/sna/meson.build b/src/sna/meson.build
index 4af181f3..b1276ab3 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',
commit e95490a7888ee1a5f08544778c6c11ad52182ad0
Author: Ville Syrjälä <ville.syrjala at linux.intel.com>
Date:   Tue Mar 19 17:18:10 2019 +0200

    sna: Use -Wno-clobbered
    
    ../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 at linux.intel.com>

diff --git a/src/sna/meson.build b/src/sna/meson.build
index 5631d4d8..4af181f3 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)


More information about the xorg-commit mailing list