Skip to contentSkip to conversation

drm/i915: Add -Wall -Wextra to our build, set warnings to full

PATCH In review Chris Wilson 3 participants 6 messages Oct 24, 2017 – Oct 27, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/i915: Add -Wall -Wextra to our build, set warnings to full

Recently W=1 on gcc-7.2 (-Wunused-const-variable) caught a regression that had been lurking for 6 months, so lets try enabling the full set of warnings for CI builds. This means more patches will be rejected early that contain trivial and sometimes not so trivial bugs. However, our code does not yet compile cleanly with W=1, so we have to apply a filter to the set of warnings until we can eliminate the mistakes. It also means that developers will have to be running the full gamut of gcc to ensure that as warnings come and go with gcc updates, we have the CI build prepared.

v2: Use fine-grained -Wno overrides. Inside the makefile, we can specify CFLAGS on a per-object level, which allows us to limit the scope of any particular warning override.
v3: Place per-file overrides after the main enabling block.

Cc Joonas Lahtinen <[email protected]>
Cc Jani Nikula <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Tomi Sarvela <[email protected]>
Cc Michal Wajdeczko <[email protected]>
Cc Ville Syrjälä <[email protected]>

---
Seeking more acks for making our lives harder by giving gcc free reign in its warnings.
-Chris

---
 drivers/gpu/drm/i915/Makefile | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/Makefile +20 -1
index 6c3b0481ef82..7750be8e27a6 100644
@@ -2,7 +2,26 @@
 # Makefile for the drm device driver.  This driver provides support for the
 # Direct Rendering Infrastructure (DRI) in XFree86 4.1.0 and higher.
 
-subdir-ccflags-$(CONFIG_DRM_I915_WERROR) := -Werror
+# Add a set of useful warning flags and enable -Werror for CI to prevent
+# trivial mistakes from creeping in. We have to do this piecemeal as we reject
+# any patch that isn't warning clean, so turning on -Wall -Wextra (or W=1) we
+# need to filter out dubious warnings.  Still it is our interest
+# to keep running locally with W=1 C=1 until we are completely clean.
+#
+# Note the danger in using -Wall -Wextra is that when CI updates gcc we
+# will most likely get a sudden build breakage... Hopefully we will fix
+# new warnings before CI updates!
+subdir-ccflags-y := -Wall -Wextra
+subdir-ccflags-y += $(call cc-option,-Wno-unused-parameter,)
+subdir-ccflags-y += $(call cc-option,-Wno-type-limits,)
+subdir-ccflags-y += $(call cc-option,-Wno-missing-field-initializers,)
+subdir-ccflags-y += $(call cc-option,-Wno-implicit-fallthrough,)
+subdir-ccflags-$(CONFIG_DRM_I915_WERROR) += -Werror
+
+# Fine grained warnings disable
+CFLAGS_i915_pci.o = $(call cc-option,-Wno-override-init,)
+CFLAGS_intel_fbdev.o = $(call cc-option,-Wno-override-init,)
+
 subdir-ccflags-y += \
 	$(call as-instr,movntdqa (%eax)$(comma)%xmm0,-DCONFIG_AS_MOVNTDQA)
 
Signature · 6 lines
2.15.0.rc2

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

✓ Fi.CI.BAT: success for drm/i915: Add -Wall -Wextra to our build, set warnings to full (rev3)

== Series Details ==

== Series Details ==

Series: drm/i915: Add -Wall -Wextra to our build, set warnings to full (rev3)
URL : https://patchwork.freedesktop.org/series/32033/
State : success

== Summary ==

Series 32033v3 drm/i915: Add -Wall -Wextra to our build, set warnings to full
https://patchwork.freedesktop.org/api/1.0/series/32033/revisions/3/mbox/

Test chamelium:

        Subgroup dp-crc-fast:
                pass       -> FAIL       (fi-kbl-7500u) fdo#102514
Test gem_exec_reloc:
        Subgroup basic-gtt-active:
                dmesg-warn -> PASS       (fi-gdg-551) fdo#102582 +5
        Subgroup basic-write-cpu-active:
                skip       -> PASS       (fi-gdg-551)
        Subgroup basic-write-gtt-active:
                skip       -> PASS       (fi-gdg-551) fdo#102582
        Subgroup basic-softpin:
                skip       -> PASS       (fi-gdg-551)
Test gem_linear_blits:
        Subgroup basic:
                skip       -> PASS       (fi-gdg-551)
Test gem_render_linear_blits:
        Subgroup basic:
                skip       -> PASS       (fi-gdg-551)
Test gem_render_tiled_blits:
        Subgroup basic:
                skip       -> PASS       (fi-gdg-551)
Test gem_sync:
        Subgroup basic-all:
                skip       -> PASS       (fi-gdg-551)
        Subgroup basic-each:
                skip       -> PASS       (fi-gdg-551)
        Subgroup basic-many-each:
                skip       -> PASS       (fi-gdg-551)
        Subgroup basic-store-each:
                skip       -> PASS       (fi-gdg-551)
Test gem_tiled_blits:
        Subgroup basic:
                skip       -> PASS       (fi-gdg-551)
Test gem_tiled_fence_blits:
        Subgroup basic:
                skip       -> PASS       (fi-gdg-551)
Test gem_wait:
        Subgroup basic-busy-all:
                skip       -> PASS       (fi-gdg-551)
        Subgroup basic-wait-all:
                skip       -> PASS       (fi-gdg-551)
        Subgroup basic-await-all:
                skip       -> PASS       (fi-gdg-551)
Test kms_busy:
        Subgroup basic-flip-a:
                skip       -> PASS       (fi-gdg-551) fdo#102654 +1
Test kms_cursor_legacy:
        Subgroup basic-busy-flip-before-cursor-legacy:
                skip       -> PASS       (fi-gdg-551) fdo#102618

fdo#102514 https://bugs.freedesktop.org/show_bug.cgi?id=102514
fdo#102582 https://bugs.freedesktop.org/show_bug.cgi?id=102582
fdo#102582 https://bugs.freedesktop.org/show_bug.cgi?id=102582
fdo#102654 https://bugs.freedesktop.org/show_bug.cgi?id=102654
fdo#102618 https://bugs.freedesktop.org/show_bug.cgi?id=102618

fi-bdw-5557u     total:289  pass:268  dwarn:0   dfail:0   fail:0   skip:21  time:441s
fi-bdw-gvtdvm    total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:456s
fi-blb-e6850     total:289  pass:223  dwarn:1   dfail:0   fail:0   skip:65  time:368s
fi-bsw-n3050     total:289  pass:243  dwarn:0   dfail:0   fail:0   skip:46  time:521s
fi-bwr-2160      total:289  pass:183  dwarn:0   dfail:0   fail:0   skip:106 time:263s
fi-bxt-dsi       total:289  pass:259  dwarn:0   dfail:0   fail:0   skip:30  time:499s
fi-bxt-j4205     total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:492s
fi-byt-j1900     total:289  pass:253  dwarn:1   dfail:0   fail:0   skip:35  time:493s
fi-byt-n2820     total:289  pass:249  dwarn:1   dfail:0   fail:0   skip:39  time:474s
fi-cfl-s         total:289  pass:253  dwarn:4   dfail:0   fail:0   skip:32  time:549s
fi-cnl-y         total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:601s
fi-elk-e7500     total:289  pass:229  dwarn:0   dfail:0   fail:0   skip:60  time:417s
fi-gdg-551       total:289  pass:178  dwarn:1   dfail:0   fail:1   skip:109 time:250s
fi-glk-1         total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  time:580s
fi-glk-dsi       total:289  pass:258  dwarn:0   dfail:0   fail:1   skip:30  time:482s
fi-hsw-4770      total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:424s
fi-hsw-4770r     total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:423s
fi-ilk-650       total:289  pass:228  dwarn:0   dfail:0   fail:0   skip:61  time:430s
fi-ivb-3520m     total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:494s
fi-ivb-3770      total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:460s
fi-kbl-7500u     total:289  pass:263  dwarn:1   dfail:0   fail:1   skip:24  time:483s
fi-kbl-7560u     total:289  pass:270  dwarn:0   dfail:0   fail:0   skip:19  time:571s
fi-kbl-7567u     total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:473s
fi-kbl-r         total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:586s
fi-pnv-d510      total:289  pass:222  dwarn:1   dfail:0   fail:0   skip:66  time:554s
fi-skl-6260u     total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:449s
fi-skl-6700hq    total:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  time:647s
fi-skl-6700k     total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:521s
fi-skl-6770hq    total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:498s
fi-skl-gvtdvm    total:289  pass:266  dwarn:0   dfail:0   fail:0   skip:23  time:454s
fi-snb-2520m     total:289  pass:250  dwarn:0   dfail:0   fail:0   skip:39  time:569s
fi-snb-2600      total:289  pass:249  dwarn:0   dfail:0   fail:0   skip:40  time:415s

bcee836068d98bd2aaa5d64124c5994acce6a6c4 drm-tip: 2017y-10m-24d-15h-00m-14s UTC integration manifest d4435c242374 drm/i915: Add -Wall -Wextra to our build, set warnings to full

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_6170/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#2 lore raw

✗ Fi.CI.IGT: warning for drm/i915: Add -Wall -Wextra to our build, set warnings to full (rev3)

In reply to Chris Wilson
== Series Details ==

== Series Details ==

Series: drm/i915: Add -Wall -Wextra to our build, set warnings to full (rev3)
URL : https://patchwork.freedesktop.org/series/32033/
State : warning

== Summary ==

Test kms_draw_crc:

        Subgroup draw-method-xrgb8888-mmap-cpu-untiled:
                pass       -> SKIP       (shard-hsw)
Test kms_cursor_crc:
        Subgroup cursor-256x85-onscreen:
                pass       -> SKIP       (shard-hsw)
Test kms_chv_cursor_fail:
        Subgroup pipe-B-64x64-bottom-edge:
                pass       -> SKIP       (shard-hsw)
        Subgroup pipe-C-64x64-left-edge:
                pass       -> SKIP       (shard-hsw)
Test pm_rpm:
        Subgroup modeset-non-lpsp:
                pass       -> SKIP       (shard-hsw)
Test kms_busy:
        Subgroup extended-modeset-hang-newfb-with-reset-render-B:
                pass       -> DMESG-WARN (shard-hsw) fdo#103038
Test kms_flip:
        Subgroup modeset-vs-vblank-race-interruptible:
                fail       -> PASS       (shard-hsw) fdo#103060
Test kms_cursor_legacy:
        Subgroup flip-vs-cursor-legacy:
                fail       -> PASS       (shard-hsw) fdo#102670

fdo#103038 https://bugs.freedesktop.org/show_bug.cgi?id=103038
fdo#103060 https://bugs.freedesktop.org/show_bug.cgi?id=103060
fdo#102670 https://bugs.freedesktop.org/show_bug.cgi?id=102670

shard-hsw total:2540 pass:1425 dwarn:3 dfail:0 fail:10 skip:1102 time:9224s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_6170/shards.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Acked-by on v1 1/1
#3 lore raw
In reply to Chris Wilson
Quoted 24 lines · Chris Wilson

Recently W=1 on gcc-7.2 (-Wunused-const-variable) caught a regression that had been lurking for 6 months, so lets try enabling the full set of warnings for CI builds. This means more patches will be rejected early that contain trivial and sometimes not so trivial bugs. However, our code does not yet compile cleanly with W=1, so we have to apply a filter to the set of warnings until we can eliminate the mistakes. It also means that developers will have to be running the full gamut of gcc to ensure that as warnings come and go with gcc updates, we have the CI build prepared.

v2: Use fine-grained -Wno overrides. Inside the makefile, we can specify CFLAGS on a per-object level, which allows us to limit the scope of any particular warning override.
v3: Place per-file overrides after the main enabling block.

Cc Joonas Lahtinen <[email protected]>
Cc Jani Nikula <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Tomi Sarvela <[email protected]>
Cc Michal Wajdeczko <[email protected]>
Cc Ville Syrjälä <[email protected]>
Quoted 3 lines

---
Seeking more acks for making our lives harder by giving gcc free reign in its warnings.

Quoted 36 lines
(quoted diff) +0 -2
-Chris
---
 drivers/gpu/drm/i915/Makefile | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/Makefile +20 -1
index 6c3b0481ef82..7750be8e27a6 100644
@@ -2,7 +2,26 @@
 # Makefile for the drm device driver.  This driver provides support for the
 # Direct Rendering Infrastructure (DRI) in XFree86 4.1.0 and higher.
 
-subdir-ccflags-$(CONFIG_DRM_I915_WERROR) := -Werror
+# Add a set of useful warning flags and enable -Werror for CI to prevent
+# trivial mistakes from creeping in. We have to do this piecemeal as we reject
+# any patch that isn't warning clean, so turning on -Wall -Wextra (or W=1) we
+# need to filter out dubious warnings.  Still it is our interest
+# to keep running locally with W=1 C=1 until we are completely clean.
+#
+# Note the danger in using -Wall -Wextra is that when CI updates gcc we
+# will most likely get a sudden build breakage... Hopefully we will fix
+# new warnings before CI updates!
+subdir-ccflags-y := -Wall -Wextra
+subdir-ccflags-y += $(call cc-option,-Wno-unused-parameter,)
+subdir-ccflags-y += $(call cc-option,-Wno-type-limits,)
+subdir-ccflags-y += $(call cc-option,-Wno-missing-field-initializers,)
+subdir-ccflags-y += $(call cc-option,-Wno-implicit-fallthrough,)
+subdir-ccflags-$(CONFIG_DRM_I915_WERROR) += -Werror
+
+# Fine grained warnings disable
+CFLAGS_i915_pci.o = $(call cc-option,-Wno-override-init,)
+CFLAGS_intel_fbdev.o = $(call cc-option,-Wno-override-init,)
+
 subdir-ccflags-y += \
 	$(call as-instr,movntdqa (%eax)$(comma)%xmm0,-DCONFIG_AS_MOVNTDQA)
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#4 lore raw

Quoting Jani Nikula (2017-10-26 15:36:34)

Quoted 29 lines · Chris Wilson
Quoted 24 lines

Recently W=1 on gcc-7.2 (-Wunused-const-variable) caught a regression that had been lurking for 6 months, so lets try enabling the full set of warnings for CI builds. This means more patches will be rejected early that contain trivial and sometimes not so trivial bugs. However, our code does not yet compile cleanly with W=1, so we have to apply a filter to the set of warnings until we can eliminate the mistakes. It also means that developers will have to be running the full gamut of gcc to ensure that as warnings come and go with gcc updates, we have the CI build prepared.

v2: Use fine-grained -Wno overrides. Inside the makefile, we can specify CFLAGS on a per-object level, which allows us to limit the scope of any particular warning override.
v3: Place per-file overrides after the main enabling block.

Cc Joonas Lahtinen <[email protected]>
Cc Jani Nikula <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Tomi Sarvela <[email protected]>
Cc Michal Wajdeczko <[email protected]>
Cc Ville Syrjälä <[email protected]>
Quoted 3 lines

---
Seeking more acks for making our lives harder by giving gcc free reign in its warnings.

Quoted 1 line

So be it. I hope I don't regret letting gcc rule over us! -Chris
_______________________________________________
Intel-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#5 lore raw
Quoted 30 lines · Chris Wilson

Quoting Jani Nikula (2017-10-26 15:36:34)

Quoted 29 lines · Chris Wilson
Quoted 27 lines

Recently W=1 on gcc-7.2 (-Wunused-const-variable) caught a regression that had been lurking for 6 months, so lets try enabling the full set of warnings for CI builds. This means more patches will be rejected early that contain trivial and sometimes not so trivial bugs. However, our code does not yet compile cleanly with W=1, so we have to apply a filter to the set of warnings until we can eliminate the mistakes. It also means that developers will have to be running the full gamut of gcc to ensure that as warnings come and go with gcc updates, we have the CI build prepared.

v2: Use fine-grained -Wno overrides. Inside the makefile, we can specify CFLAGS on a per-object level, which allows us to limit the scope of any particular warning override.
v3: Place per-file overrides after the main enabling block.

Cc Joonas Lahtinen <[email protected]>
Cc Jani Nikula <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Tomi Sarvela <[email protected]>
Cc Michal Wajdeczko <[email protected]>
Cc Ville Syrjälä <[email protected]>

---
Seeking more acks for making our lives harder by giving gcc free reign in its warnings.

Quoted 3 lines
Quoted 1 line

So be it. I hope I don't regret letting gcc rule over us!

I figured we have git revert for regrets. ;)

BR,
Jani.

Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx