[Intel-gfx] [PATCH xf86-video-intel 10/21] sna: Use named initializers

Ville Syrjala ville.syrjala at linux.intel.com
Thu Sep 19 16:31:02 UTC 2019


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

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

Signed-off-by: Ville Syrjälä <ville.syrjala at 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



More information about the Intel-gfx mailing list