diff mbox series

drm/i915: add Makefile magic for testing headers are self-contained

Message ID 20190403100636.28966-1-jani.nikula@intel.com (mailing list archive)
State New, archived
Headers show
Series drm/i915: add Makefile magic for testing headers are self-contained | expand

Commit Message

Jani Nikula April 3, 2019, 10:06 a.m. UTC
The below commits added dummy files to test that certain headers are
self-contained, i.e. compilable as standalone units:

39e2f501c1b4 ("drm/i915: Split struct intel_context definition to its own header")
3a891a626794 ("drm/i915: Move intel_engine_mask_t around for use by i915_request_types.h")
8b74594aa455 ("drm/i915: Split out i915_priolist_types into its own header")

The idea is fine, but the implementation is a bit tedious and
inflexible, and does not really scale well.

Implement the same in make using autogenerated dummy sources to include
the headers.

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/Makefile                 | 16 +++++---------
 drivers/gpu/drm/i915/Makefile.header-test     | 21 +++++++++++++++++++
 .../i915/test_i915_active_types_standalone.c  |  7 -------
 .../test_i915_gem_context_types_standalone.c  |  7 -------
 .../test_i915_priolist_types_standalone.c     |  7 -------
 .../test_i915_scheduler_types_standalone.c    |  7 -------
 .../test_i915_timeline_types_standalone.c     |  7 -------
 .../test_intel_context_types_standalone.c     |  7 -------
 .../i915/test_intel_engine_types_standalone.c |  7 -------
 .../test_intel_workarounds_types_standalone.c |  7 -------
 10 files changed, 26 insertions(+), 67 deletions(-)
 create mode 100644 drivers/gpu/drm/i915/Makefile.header-test
 delete mode 100644 drivers/gpu/drm/i915/test_i915_active_types_standalone.c
 delete mode 100644 drivers/gpu/drm/i915/test_i915_gem_context_types_standalone.c
 delete mode 100644 drivers/gpu/drm/i915/test_i915_priolist_types_standalone.c
 delete mode 100644 drivers/gpu/drm/i915/test_i915_scheduler_types_standalone.c
 delete mode 100644 drivers/gpu/drm/i915/test_i915_timeline_types_standalone.c
 delete mode 100644 drivers/gpu/drm/i915/test_intel_context_types_standalone.c
 delete mode 100644 drivers/gpu/drm/i915/test_intel_engine_types_standalone.c
 delete mode 100644 drivers/gpu/drm/i915/test_intel_workarounds_types_standalone.c

Comments

Chris Wilson April 3, 2019, 10:10 a.m. UTC | #1
Quoting Jani Nikula (2019-04-03 11:06:36)
> The below commits added dummy files to test that certain headers are
> self-contained, i.e. compilable as standalone units:
> 
> 39e2f501c1b4 ("drm/i915: Split struct intel_context definition to its own header")
> 3a891a626794 ("drm/i915: Move intel_engine_mask_t around for use by i915_request_types.h")
> 8b74594aa455 ("drm/i915: Split out i915_priolist_types into its own header")
> 
> The idea is fine, but the implementation is a bit tedious and
> inflexible, and does not really scale well.
> 
> Implement the same in make using autogenerated dummy sources to include
> the headers.

I knew it would work :-p

> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
>  drivers/gpu/drm/i915/Makefile                 | 16 +++++---------
>  drivers/gpu/drm/i915/Makefile.header-test     | 21 +++++++++++++++++++
>  .../i915/test_i915_active_types_standalone.c  |  7 -------
>  .../test_i915_gem_context_types_standalone.c  |  7 -------
>  .../test_i915_priolist_types_standalone.c     |  7 -------
>  .../test_i915_scheduler_types_standalone.c    |  7 -------
>  .../test_i915_timeline_types_standalone.c     |  7 -------
>  .../test_intel_context_types_standalone.c     |  7 -------
>  .../i915/test_intel_engine_types_standalone.c |  7 -------
>  .../test_intel_workarounds_types_standalone.c |  7 -------
>  10 files changed, 26 insertions(+), 67 deletions(-)
>  create mode 100644 drivers/gpu/drm/i915/Makefile.header-test
>  delete mode 100644 drivers/gpu/drm/i915/test_i915_active_types_standalone.c
>  delete mode 100644 drivers/gpu/drm/i915/test_i915_gem_context_types_standalone.c
>  delete mode 100644 drivers/gpu/drm/i915/test_i915_priolist_types_standalone.c
>  delete mode 100644 drivers/gpu/drm/i915/test_i915_scheduler_types_standalone.c
>  delete mode 100644 drivers/gpu/drm/i915/test_i915_timeline_types_standalone.c
>  delete mode 100644 drivers/gpu/drm/i915/test_intel_context_types_standalone.c
>  delete mode 100644 drivers/gpu/drm/i915/test_intel_engine_types_standalone.c
>  delete mode 100644 drivers/gpu/drm/i915/test_intel_workarounds_types_standalone.c
> 
> diff --git a/drivers/gpu/drm/i915/Makefile b/drivers/gpu/drm/i915/Makefile
> index 30bf33..dba77b 100644
> --- a/drivers/gpu/drm/i915/Makefile
> +++ b/drivers/gpu/drm/i915/Makefile
> @@ -57,17 +57,6 @@ i915-$(CONFIG_COMPAT)   += i915_ioc32.o
>  i915-$(CONFIG_DEBUG_FS) += i915_debugfs.o intel_pipe_crc.o
>  i915-$(CONFIG_PERF_EVENTS) += i915_pmu.o
>  
> -# Test the headers are compilable as standalone units
> -i915-$(CONFIG_DRM_I915_WERROR) += \
> -       test_i915_active_types_standalone.o \
> -       test_i915_gem_context_types_standalone.o \
> -       test_i915_priolist_types_standalone.o \
> -       test_i915_scheduler_types_standalone.o \
> -       test_i915_timeline_types_standalone.o \
> -       test_intel_context_types_standalone.o \
> -       test_intel_engine_types_standalone.o \
> -       test_intel_workarounds_types_standalone.o
> -
>  # GEM code
>  i915-y += \
>           i915_active.o \
> @@ -218,3 +207,8 @@ i915-y += intel_lpe_audio.o
>  
>  obj-$(CONFIG_DRM_I915) += i915.o
>  obj-$(CONFIG_DRM_I915_GVT_KVMGT) += gvt/kvmgt.o
> +
> +# Extra header tests
> +ifeq ($(CONFIG_DRM_I915_WERROR),y)
> +include $(src)/Makefile.header-test
> +endif

Can we get the headers tested first?

Fixing the standalone tests is a lot easier than traversing the
dependency chain of includes in a regular compile file.

> diff --git a/drivers/gpu/drm/i915/Makefile.header-test b/drivers/gpu/drm/i915/Makefile.header-test
> new file mode 100644
> index 000000..0cae6e3
> --- /dev/null
> +++ b/drivers/gpu/drm/i915/Makefile.header-test
> @@ -0,0 +1,21 @@
> +# SPDX-License-Identifier: MIT
> +# Copyright © 2019 Intel Corporation
> +
> +# Test the headers are compilable as standalone units
> +
> +quiet_cmd_header_test = HDRTEST        $@
> +      cmd_header_test = echo "\#include \"$(<F)\"" > $@
> +
> +header_test_%.c: %.h
> +       $(call cmd,header_test)
> +
> +# To test <base>.h add header_test_<base>.o here
> +extra-y += \
> +       header_test_i915_active_types.o \
> +       header_test_i915_gem_context_types.o \
> +       header_test_i915_priolist_types.o \
> +       header_test_i915_scheduler_types.o \
> +       header_test_i915_timeline_types.o \
> +       header_test_intel_context_types.o \
> +       header_test_intel_engine_types.o \
> +       header_test_intel_workarounds_types.o

Should there be a way to add the autogenerated files to make clean?
-Chris
Chris Wilson April 3, 2019, 10:12 a.m. UTC | #2
Quoting Chris Wilson (2019-04-03 11:10:31)
> Quoting Jani Nikula (2019-04-03 11:06:36)
> > The below commits added dummy files to test that certain headers are
> > self-contained, i.e. compilable as standalone units:
> > 
> > 39e2f501c1b4 ("drm/i915: Split struct intel_context definition to its own header")
> > 3a891a626794 ("drm/i915: Move intel_engine_mask_t around for use by i915_request_types.h")
> > 8b74594aa455 ("drm/i915: Split out i915_priolist_types into its own header")
> > 
> > The idea is fine, but the implementation is a bit tedious and
> > inflexible, and does not really scale well.
> > 
> > Implement the same in make using autogenerated dummy sources to include
> > the headers.
> 
> I knew it would work :-p
> 
> > Cc: Chris Wilson <chris@chris-wilson.co.uk>
> > Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> > Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> > ---
> >  drivers/gpu/drm/i915/Makefile                 | 16 +++++---------
> >  drivers/gpu/drm/i915/Makefile.header-test     | 21 +++++++++++++++++++
> >  .../i915/test_i915_active_types_standalone.c  |  7 -------
> >  .../test_i915_gem_context_types_standalone.c  |  7 -------
> >  .../test_i915_priolist_types_standalone.c     |  7 -------
> >  .../test_i915_scheduler_types_standalone.c    |  7 -------
> >  .../test_i915_timeline_types_standalone.c     |  7 -------
> >  .../test_intel_context_types_standalone.c     |  7 -------
> >  .../i915/test_intel_engine_types_standalone.c |  7 -------
> >  .../test_intel_workarounds_types_standalone.c |  7 -------
> >  10 files changed, 26 insertions(+), 67 deletions(-)
> >  create mode 100644 drivers/gpu/drm/i915/Makefile.header-test
> >  delete mode 100644 drivers/gpu/drm/i915/test_i915_active_types_standalone.c
> >  delete mode 100644 drivers/gpu/drm/i915/test_i915_gem_context_types_standalone.c
> >  delete mode 100644 drivers/gpu/drm/i915/test_i915_priolist_types_standalone.c
> >  delete mode 100644 drivers/gpu/drm/i915/test_i915_scheduler_types_standalone.c
> >  delete mode 100644 drivers/gpu/drm/i915/test_i915_timeline_types_standalone.c
> >  delete mode 100644 drivers/gpu/drm/i915/test_intel_context_types_standalone.c
> >  delete mode 100644 drivers/gpu/drm/i915/test_intel_engine_types_standalone.c
> >  delete mode 100644 drivers/gpu/drm/i915/test_intel_workarounds_types_standalone.c
> > 
> > diff --git a/drivers/gpu/drm/i915/Makefile b/drivers/gpu/drm/i915/Makefile
> > index 30bf33..dba77b 100644
> > --- a/drivers/gpu/drm/i915/Makefile
> > +++ b/drivers/gpu/drm/i915/Makefile
> > @@ -57,17 +57,6 @@ i915-$(CONFIG_COMPAT)   += i915_ioc32.o
> >  i915-$(CONFIG_DEBUG_FS) += i915_debugfs.o intel_pipe_crc.o
> >  i915-$(CONFIG_PERF_EVENTS) += i915_pmu.o
> >  
> > -# Test the headers are compilable as standalone units
> > -i915-$(CONFIG_DRM_I915_WERROR) += \
> > -       test_i915_active_types_standalone.o \
> > -       test_i915_gem_context_types_standalone.o \
> > -       test_i915_priolist_types_standalone.o \
> > -       test_i915_scheduler_types_standalone.o \
> > -       test_i915_timeline_types_standalone.o \
> > -       test_intel_context_types_standalone.o \
> > -       test_intel_engine_types_standalone.o \
> > -       test_intel_workarounds_types_standalone.o
> > -
> >  # GEM code
> >  i915-y += \
> >           i915_active.o \
> > @@ -218,3 +207,8 @@ i915-y += intel_lpe_audio.o
> >  
> >  obj-$(CONFIG_DRM_I915) += i915.o
> >  obj-$(CONFIG_DRM_I915_GVT_KVMGT) += gvt/kvmgt.o
> > +
> > +# Extra header tests
> > +ifeq ($(CONFIG_DRM_I915_WERROR),y)
> > +include $(src)/Makefile.header-test
> > +endif
> 
> Can we get the headers tested first?
> 
> Fixing the standalone tests is a lot easier than traversing the
> dependency chain of includes in a regular compile file.
> 
> > diff --git a/drivers/gpu/drm/i915/Makefile.header-test b/drivers/gpu/drm/i915/Makefile.header-test
> > new file mode 100644
> > index 000000..0cae6e3
> > --- /dev/null
> > +++ b/drivers/gpu/drm/i915/Makefile.header-test
> > @@ -0,0 +1,21 @@
> > +# SPDX-License-Identifier: MIT
> > +# Copyright © 2019 Intel Corporation
> > +
> > +# Test the headers are compilable as standalone units
> > +
> > +quiet_cmd_header_test = HDRTEST        $@
> > +      cmd_header_test = echo "\#include \"$(<F)\"" > $@
> > +
> > +header_test_%.c: %.h
> > +       $(call cmd,header_test)
> > +
> > +# To test <base>.h add header_test_<base>.o here
> > +extra-y += \
> > +       header_test_i915_active_types.o \
> > +       header_test_i915_gem_context_types.o \
> > +       header_test_i915_priolist_types.o \
> > +       header_test_i915_scheduler_types.o \
> > +       header_test_i915_timeline_types.o \
> > +       header_test_intel_context_types.o \
> > +       header_test_intel_engine_types.o \
> > +       header_test_intel_workarounds_types.o
> 
> Should there be a way to add the autogenerated files to make clean?

clean-files += header_test_*.c

No idea if that works.
-Chris
Chris Wilson April 3, 2019, 10:19 a.m. UTC | #3
Quoting Jani Nikula (2019-04-03 11:06:36)
> The below commits added dummy files to test that certain headers are
> self-contained, i.e. compilable as standalone units:
> 
> 39e2f501c1b4 ("drm/i915: Split struct intel_context definition to its own header")
> 3a891a626794 ("drm/i915: Move intel_engine_mask_t around for use by i915_request_types.h")
> 8b74594aa455 ("drm/i915: Split out i915_priolist_types into its own header")
> 
> The idea is fine, but the implementation is a bit tedious and
> inflexible, and does not really scale well.
> 
> Implement the same in make using autogenerated dummy sources to include
> the headers.

Also wants
i915/.gitignore: header_test_*.c
-Chris
Chris Wilson April 3, 2019, 10:57 a.m. UTC | #4
Quoting Jani Nikula (2019-04-03 11:06:36)
> The below commits added dummy files to test that certain headers are
> self-contained, i.e. compilable as standalone units:
> 
> 39e2f501c1b4 ("drm/i915: Split struct intel_context definition to its own header")
> 3a891a626794 ("drm/i915: Move intel_engine_mask_t around for use by i915_request_types.h")
> 8b74594aa455 ("drm/i915: Split out i915_priolist_types into its own header")
> 
> The idea is fine, but the implementation is a bit tedious and
> inflexible, and does not really scale well.
> 
> Implement the same in make using autogenerated dummy sources to include
> the headers.

The next question is to how to handle subdirs?
-Chris
Jani Nikula April 4, 2019, 5:24 p.m. UTC | #5
On Thu, 04 Apr 2019, Patchwork <patchwork@emeril.freedesktop.org> wrote:
> == Series Details ==
>
> Series: drm/i915: add Makefile magic for testing headers are self-contained (rev4)
> URL   : https://patchwork.freedesktop.org/series/58938/
> State : failure
>
> == Summary ==
>
> CI Bug Log - changes from CI_DRM_5863_full -> Patchwork_12674_full
> ====================================================
>
> Summary
> -------
>
>   **FAILURE**
>
>   Serious unknown changes coming with Patchwork_12674_full absolutely need to be
>   verified manually.
>   
>   If you think the reported changes have nothing to do with the changes
>   introduced in Patchwork_12674_full, please notify your bug team to allow them
>   to document this new failure mode, which will reduce false positives in CI.
>
>   
>
> Possible new issues
> -------------------
>
>   Here are the unknown changes that may have been introduced in Patchwork_12674_full:
>
> ### IGT changes ###
>
> #### Possible regressions ####
>
>   * igt@gem_eio@reset-stress:
>     - shard-skl:          PASS -> DMESG-WARN

Pushed, I'm pretty sure testing headers has no impact here.

BR,
Jani.

>
>   
> Known issues
> ------------
>
>   Here are the changes found in Patchwork_12674_full that come from known issues:
>
> ### IGT changes ###
>
> #### Issues hit ####
>
>   * igt@gem_ppgtt@blt-vs-render-ctxn:
>     - shard-iclb:         PASS -> INCOMPLETE [fdo#109801]
>
>   * igt@gem_userptr_blits@process-exit-gtt:
>     - shard-glk:          NOTRUN -> SKIP [fdo#109271] +44
>
>   * igt@kms_busy@extended-modeset-hang-newfb-with-reset-render-c:
>     - shard-skl:          NOTRUN -> DMESG-WARN [fdo#110222] +1
>
>   * igt@kms_busy@extended-pageflip-hang-oldfb-render-f:
>     - shard-glk:          NOTRUN -> SKIP [fdo#109271] / [fdo#109278] +3
>
>   * igt@kms_busy@extended-pageflip-modeset-hang-oldfb-render-a:
>     - shard-apl:          PASS -> DMESG-WARN [fdo#110222]
>
>   * igt@kms_chamelium@hdmi-crc-fast:
>     - shard-skl:          NOTRUN -> SKIP [fdo#109271] +83
>
>   * igt@kms_cursor_crc@cursor-256x256-random:
>     - shard-glk:          NOTRUN -> FAIL [fdo#103232]
>
>   * igt@kms_cursor_legacy@cursor-vs-flip-atomic:
>     - shard-iclb:         PASS -> FAIL [fdo#103355] +1
>
>   * igt@kms_flip@2x-modeset-vs-vblank-race:
>     - shard-glk:          PASS -> FAIL [fdo#103060]
>
>   * igt@kms_flip@flip-vs-expired-vblank-interruptible:
>     - shard-iclb:         PASS -> FAIL [fdo#105363]
>     - shard-skl:          PASS -> FAIL [fdo#105363]
>
>   * igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-pri-indfb-draw-blt:
>     - shard-iclb:         PASS -> FAIL [fdo#103167] +4
>
>   * igt@kms_frontbuffer_tracking@psr-1p-primscrn-indfb-plflip-blt:
>     - shard-skl:          PASS -> FAIL [fdo#103167]
>
>   * igt@kms_frontbuffer_tracking@psr-1p-primscrn-pri-indfb-draw-mmap-cpu:
>     - shard-iclb:         PASS -> FAIL [fdo#109247] +18
>
>   * igt@kms_frontbuffer_tracking@psr-2p-primscrn-pri-shrfb-draw-mmap-gtt:
>     - shard-apl:          NOTRUN -> SKIP [fdo#109271] +1
>
>   * igt@kms_pipe_crc_basic@suspend-read-crc-pipe-f:
>     - shard-skl:          NOTRUN -> SKIP [fdo#109271] / [fdo#109278] +10
>
>   * igt@kms_plane@plane-panning-bottom-right-suspend-pipe-a-planes:
>     - shard-skl:          NOTRUN -> INCOMPLETE [fdo#104108]
>
>   * igt@kms_plane_alpha_blend@pipe-a-constant-alpha-min:
>     - shard-skl:          PASS -> FAIL [fdo#108145]
>
>   * igt@kms_plane_alpha_blend@pipe-c-coverage-7efc:
>     - shard-skl:          PASS -> FAIL [fdo#107815]
>
>   * igt@kms_psr@primary_mmap_gtt:
>     - shard-iclb:         PASS -> FAIL [fdo#107383] / [fdo#110215]
>
>   
> #### Possible fixes ####
>
>   * igt@gem_tiled_pread_pwrite:
>     - shard-iclb:         TIMEOUT [fdo#109673] -> PASS
>
>   * igt@i915_pm_rpm@system-suspend-devices:
>     - shard-skl:          INCOMPLETE [fdo#107807] -> PASS
>
>   * igt@kms_cursor_crc@cursor-128x42-offscreen:
>     - shard-skl:          FAIL [fdo#103232] -> PASS
>
>   * igt@kms_cursor_edge_walk@pipe-a-128x128-left-edge:
>     - shard-snb:          SKIP [fdo#109271] / [fdo#109278] -> PASS
>
>   * igt@kms_cursor_legacy@2x-long-flip-vs-cursor-atomic:
>     - shard-glk:          FAIL [fdo#104873] -> PASS
>
>   * igt@kms_flip@flip-vs-expired-vblank-interruptible:
>     - shard-glk:          FAIL [fdo#102887] / [fdo#105363] -> PASS
>
>   * igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-move:
>     - shard-iclb:         FAIL [fdo#103167] -> PASS +14
>
>   * igt@kms_frontbuffer_tracking@fbcpsr-1p-offscren-pri-shrfb-draw-mmap-wc:
>     - shard-iclb:         FAIL [fdo#109247] -> PASS +21
>
>   * igt@kms_frontbuffer_tracking@fbcpsr-rgb101010-draw-pwrite:
>     - shard-iclb:         FAIL [fdo#105682] / [fdo#109247] -> PASS +3
>
>   * igt@kms_plane_alpha_blend@pipe-c-constant-alpha-min:
>     - shard-skl:          FAIL [fdo#108145] -> PASS
>
>   * igt@kms_psr2_su@page_flip:
>     - shard-iclb:         SKIP [fdo#109642] -> PASS
>
>   * igt@kms_psr@cursor_mmap_gtt:
>     - shard-iclb:         FAIL [fdo#107383] / [fdo#110215] -> PASS +4
>
>   * igt@kms_psr@psr2_cursor_render:
>     - shard-iclb:         SKIP [fdo#109441] -> PASS +1
>
>   * igt@kms_setmode@basic:
>     - shard-kbl:          FAIL [fdo#99912] -> PASS
>
>   
> #### Warnings ####
>
>   * igt@kms_cursor_crc@cursor-256x256-suspend:
>     - shard-skl:          FAIL [fdo#103191] / [fdo#103232] -> INCOMPLETE [fdo#104108] / [fdo#107773]
>
>   
>   [fdo#102887]: https://bugs.freedesktop.org/show_bug.cgi?id=102887
>   [fdo#103060]: https://bugs.freedesktop.org/show_bug.cgi?id=103060
>   [fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
>   [fdo#103191]: https://bugs.freedesktop.org/show_bug.cgi?id=103191
>   [fdo#103232]: https://bugs.freedesktop.org/show_bug.cgi?id=103232
>   [fdo#103355]: https://bugs.freedesktop.org/show_bug.cgi?id=103355
>   [fdo#104108]: https://bugs.freedesktop.org/show_bug.cgi?id=104108
>   [fdo#104873]: https://bugs.freedesktop.org/show_bug.cgi?id=104873
>   [fdo#105363]: https://bugs.freedesktop.org/show_bug.cgi?id=105363
>   [fdo#105682]: https://bugs.freedesktop.org/show_bug.cgi?id=105682
>   [fdo#107383]: https://bugs.freedesktop.org/show_bug.cgi?id=107383
>   [fdo#107773]: https://bugs.freedesktop.org/show_bug.cgi?id=107773
>   [fdo#107807]: https://bugs.freedesktop.org/show_bug.cgi?id=107807
>   [fdo#107815]: https://bugs.freedesktop.org/show_bug.cgi?id=107815
>   [fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
>   [fdo#109247]: https://bugs.freedesktop.org/show_bug.cgi?id=109247
>   [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
>   [fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278
>   [fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
>   [fdo#109642]: https://bugs.freedesktop.org/show_bug.cgi?id=109642
>   [fdo#109673]: https://bugs.freedesktop.org/show_bug.cgi?id=109673
>   [fdo#109801]: https://bugs.freedesktop.org/show_bug.cgi?id=109801
>   [fdo#110215]: https://bugs.freedesktop.org/show_bug.cgi?id=110215
>   [fdo#110222]: https://bugs.freedesktop.org/show_bug.cgi?id=110222
>   [fdo#99912]: https://bugs.freedesktop.org/show_bug.cgi?id=99912
>
>
> Participating hosts (10 -> 9)
> ------------------------------
>
>   Missing    (1): shard-hsw 
>
>
> Build changes
> -------------
>
>     * Linux: CI_DRM_5863 -> Patchwork_12674
>
>   CI_DRM_5863: d2c849411d8ae6de9c718b9c0cd1e00da7f0f121 @ git://anongit.freedesktop.org/gfx-ci/linux
>   IGT_4924: bcf2f21996b2ee5c6177f5412046690ff8017772 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
>   Patchwork_12674: 5f226a4e31cdc3bbb9c26c1d6d58e6a8d582b7e9 @ git://anongit.freedesktop.org/gfx-ci/linux
>   piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit
>
> == Logs ==
>
> For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12674/
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/Makefile b/drivers/gpu/drm/i915/Makefile
index 30bf33..dba77b 100644
--- a/drivers/gpu/drm/i915/Makefile
+++ b/drivers/gpu/drm/i915/Makefile
@@ -57,17 +57,6 @@  i915-$(CONFIG_COMPAT)   += i915_ioc32.o
 i915-$(CONFIG_DEBUG_FS) += i915_debugfs.o intel_pipe_crc.o
 i915-$(CONFIG_PERF_EVENTS) += i915_pmu.o
 
-# Test the headers are compilable as standalone units
-i915-$(CONFIG_DRM_I915_WERROR) += \
-	test_i915_active_types_standalone.o \
-	test_i915_gem_context_types_standalone.o \
-	test_i915_priolist_types_standalone.o \
-	test_i915_scheduler_types_standalone.o \
-	test_i915_timeline_types_standalone.o \
-	test_intel_context_types_standalone.o \
-	test_intel_engine_types_standalone.o \
-	test_intel_workarounds_types_standalone.o
-
 # GEM code
 i915-y += \
 	  i915_active.o \
@@ -218,3 +207,8 @@  i915-y += intel_lpe_audio.o
 
 obj-$(CONFIG_DRM_I915) += i915.o
 obj-$(CONFIG_DRM_I915_GVT_KVMGT) += gvt/kvmgt.o
+
+# Extra header tests
+ifeq ($(CONFIG_DRM_I915_WERROR),y)
+include $(src)/Makefile.header-test
+endif
diff --git a/drivers/gpu/drm/i915/Makefile.header-test b/drivers/gpu/drm/i915/Makefile.header-test
new file mode 100644
index 000000..0cae6e3
--- /dev/null
+++ b/drivers/gpu/drm/i915/Makefile.header-test
@@ -0,0 +1,21 @@ 
+# SPDX-License-Identifier: MIT
+# Copyright © 2019 Intel Corporation
+
+# Test the headers are compilable as standalone units
+
+quiet_cmd_header_test = HDRTEST	$@
+      cmd_header_test = echo "\#include \"$(<F)\"" > $@
+
+header_test_%.c: %.h
+	$(call cmd,header_test)
+
+# To test <base>.h add header_test_<base>.o here
+extra-y += \
+	header_test_i915_active_types.o \
+	header_test_i915_gem_context_types.o \
+	header_test_i915_priolist_types.o \
+	header_test_i915_scheduler_types.o \
+	header_test_i915_timeline_types.o \
+	header_test_intel_context_types.o \
+	header_test_intel_engine_types.o \
+	header_test_intel_workarounds_types.o
diff --git a/drivers/gpu/drm/i915/test_i915_active_types_standalone.c b/drivers/gpu/drm/i915/test_i915_active_types_standalone.c
deleted file mode 100644
index 144ebd..000000
--- a/drivers/gpu/drm/i915/test_i915_active_types_standalone.c
+++ /dev/null
@@ -1,7 +0,0 @@ 
-/*
- * SPDX-License-Identifier: MIT
- *
- * Copyright © 2019 Intel Corporation
- */
-
-#include "i915_active_types.h"
diff --git a/drivers/gpu/drm/i915/test_i915_gem_context_types_standalone.c b/drivers/gpu/drm/i915/test_i915_gem_context_types_standalone.c
deleted file mode 100644
index 4e4da486..000000
--- a/drivers/gpu/drm/i915/test_i915_gem_context_types_standalone.c
+++ /dev/null
@@ -1,7 +0,0 @@ 
-/*
- * SPDX-License-Identifier: MIT
- *
- * Copyright © 2019 Intel Corporation
- */
-
-#include "i915_gem_context_types.h"
diff --git a/drivers/gpu/drm/i915/test_i915_priolist_types_standalone.c b/drivers/gpu/drm/i915/test_i915_priolist_types_standalone.c
deleted file mode 100644
index f465eb..000000
--- a/drivers/gpu/drm/i915/test_i915_priolist_types_standalone.c
+++ /dev/null
@@ -1,7 +0,0 @@ 
-/*
- * SPDX-License-Identifier: MIT
- *
- * Copyright © 2019 Intel Corporation
- */
-
-#include "i915_priolist_types.h"
diff --git a/drivers/gpu/drm/i915/test_i915_scheduler_types_standalone.c b/drivers/gpu/drm/i915/test_i915_scheduler_types_standalone.c
deleted file mode 100644
index 8afa2c..000000
--- a/drivers/gpu/drm/i915/test_i915_scheduler_types_standalone.c
+++ /dev/null
@@ -1,7 +0,0 @@ 
-/*
- * SPDX-License-Identifier: MIT
- *
- * Copyright © 2019 Intel Corporation
- */
-
-#include "i915_scheduler_types.h"
diff --git a/drivers/gpu/drm/i915/test_i915_timeline_types_standalone.c b/drivers/gpu/drm/i915/test_i915_timeline_types_standalone.c
deleted file mode 100644
index f58e14..000000
--- a/drivers/gpu/drm/i915/test_i915_timeline_types_standalone.c
+++ /dev/null
@@ -1,7 +0,0 @@ 
-/*
- * SPDX-License-Identifier: MIT
- *
- * Copyright © 2019 Intel Corporation
- */
-
-#include "i915_timeline_types.h"
diff --git a/drivers/gpu/drm/i915/test_intel_context_types_standalone.c b/drivers/gpu/drm/i915/test_intel_context_types_standalone.c
deleted file mode 100644
index b39e3c4..000000
--- a/drivers/gpu/drm/i915/test_intel_context_types_standalone.c
+++ /dev/null
@@ -1,7 +0,0 @@ 
-/*
- * SPDX-License-Identifier: MIT
- *
- * Copyright © 2019 Intel Corporation
- */
-
-#include "intel_context_types.h"
diff --git a/drivers/gpu/drm/i915/test_intel_engine_types_standalone.c b/drivers/gpu/drm/i915/test_intel_engine_types_standalone.c
deleted file mode 100644
index d05e4cd..000000
--- a/drivers/gpu/drm/i915/test_intel_engine_types_standalone.c
+++ /dev/null
@@ -1,7 +0,0 @@ 
-/*
- * SPDX-License-Identifier: MIT
- *
- * Copyright © 2019 Intel Corporation
- */
-
-#include "intel_engine_types.h"
diff --git a/drivers/gpu/drm/i915/test_intel_workarounds_types_standalone.c b/drivers/gpu/drm/i915/test_intel_workarounds_types_standalone.c
deleted file mode 100644
index 4f658b..000000
--- a/drivers/gpu/drm/i915/test_intel_workarounds_types_standalone.c
+++ /dev/null
@@ -1,7 +0,0 @@ 
-/*
- * SPDX-License-Identifier: MIT
- *
- * Copyright © 2019 Intel Corporation
- */
-
-#include "intel_workarounds_types.h"