All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ville Syrjala <ville.syrjala@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH xf86-video-intel 10/21] sna: Use named initializers
Date: Thu, 19 Sep 2019 19:31:02 +0300	[thread overview]
Message-ID: <20190919163113.17402-11-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <20190919163113.17402-1-ville.syrjala@linux.intel.com>

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

  parent reply	other threads:[~2019-09-19 16:31 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` Ville Syrjala [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190919163113.17402-11-ville.syrjala@linux.intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.