@@ -176,33 +176,35 @@ i915-$(CONFIG_ACPI) += intel_acpi.o intel_opregion.o
i915-$(CONFIG_DRM_FBDEV_EMULATION) += intel_fbdev.o
# modesetting output/encoder code
-i915-y += dvo_ch7017.o \
- dvo_ch7xxx.o \
- dvo_ivch.o \
- dvo_ns2501.o \
- dvo_sil164.o \
- dvo_tfp410.o \
- icl_dsi.o \
- intel_crt.o \
- intel_ddi.o \
- intel_dp_aux_backlight.o \
- intel_dp_link_training.o \
- intel_dp_mst.o \
- intel_dp.o \
- intel_dsi.o \
- intel_dsi_dcs_backlight.o \
- intel_dsi_vbt.o \
- intel_dvo.o \
- intel_gmbus.o \
- intel_hdmi.o \
- intel_lspcon.o \
- intel_lvds.o \
- intel_panel.o \
- intel_sdvo.o \
- intel_tv.o \
- vlv_dsi.o \
- vlv_dsi_pll.o \
- intel_vdsc.o
+obj-y += display/
+i915-y += \
+ display/dvo_ch7017.o \
+ display/dvo_ch7xxx.o \
+ display/dvo_ivch.o \
+ display/dvo_ns2501.o \
+ display/dvo_sil164.o \
+ display/dvo_tfp410.o \
+ display/icl_dsi.o \
+ display/intel_crt.o \
+ display/intel_ddi.o \
+ display/intel_dp.o \
+ display/intel_dp_aux_backlight.o \
+ display/intel_dp_link_training.o \
+ display/intel_dp_mst.o \
+ display/intel_dsi.o \
+ display/intel_dsi_dcs_backlight.o \
+ display/intel_dsi_vbt.o \
+ display/intel_dvo.o \
+ display/intel_gmbus.o \
+ display/intel_hdmi.o \
+ display/intel_lspcon.o \
+ display/intel_lvds.o \
+ display/intel_panel.o \
+ display/intel_sdvo.o \
+ display/intel_tv.o \
+ display/intel_vdsc.o \
+ display/vlv_dsi.o \
+ display/vlv_dsi_pll.o
# Post-mortem debug and GPU hang state capture
i915-$(CONFIG_DRM_I915_CAPTURE_ERROR) += i915_gpu_error.o
@@ -22,46 +22,27 @@ header_test := \
intel_color.h \
intel_combo_phy.h \
intel_connector.h \
- intel_crt.h \
intel_csr.h \
- intel_ddi.h \
intel_display_power.h \
- intel_dp.h \
- intel_dp_aux_backlight.h \
- intel_dp_link_training.h \
- intel_dp_mst.h \
intel_dpio_phy.h \
intel_dpll_mgr.h \
intel_drv.h \
- intel_dsi.h \
- intel_dsi_dcs_backlight.h \
- intel_dvo.h \
- intel_dvo_dev.h \
intel_fbc.h \
intel_fbdev.h \
intel_fifo_underrun.h \
intel_frontbuffer.h \
- intel_gmbus.h \
intel_hdcp.h \
- intel_hdmi.h \
intel_hotplug.h \
intel_lpe_audio.h \
- intel_lspcon.h \
- intel_lvds.h \
intel_overlay.h \
- intel_panel.h \
intel_pipe_crc.h \
intel_pm.h \
intel_psr.h \
intel_quirks.h \
intel_runtime_pm.h \
- intel_sdvo.h \
- intel_sdvo_regs.h \
intel_sideband.h \
intel_sprite.h \
- intel_tv.h \
intel_uncore.h \
- intel_vdsc.h \
intel_wakeref.h
quiet_cmd_header_test = HDRTEST $@
new file mode 100644
@@ -0,0 +1,2 @@
+# Extra header tests
+include $(src)/Makefile.header-test
new file mode 100644
@@ -0,0 +1,16 @@
+# SPDX-License-Identifier: MIT
+# Copyright © 2019 Intel Corporation
+
+# Test the headers are compilable as standalone units
+header_test := $(notdir $(wildcard $(src)/*.h))
+
+quiet_cmd_header_test = HDRTEST $@
+ cmd_header_test = echo "\#include \"$(<F)\"" > $@
+
+header_test_%.c: %.h
+ $(call cmd,header_test)
+
+extra-$(CONFIG_DRM_I915_WERROR) += \
+ $(foreach h,$(header_test),$(patsubst %.h,header_test_%.o,$(h)))
+
+clean-files += $(foreach h,$(header_test),$(patsubst %.h,header_test_%.c,$(h)))
similarity index 100%
rename from drivers/gpu/drm/i915/dvo_ch7017.c
rename to drivers/gpu/drm/i915/display/dvo_ch7017.c
similarity index 100%
rename from drivers/gpu/drm/i915/dvo_ch7xxx.c
rename to drivers/gpu/drm/i915/display/dvo_ch7xxx.c
similarity index 100%
rename from drivers/gpu/drm/i915/dvo_ivch.c
rename to drivers/gpu/drm/i915/display/dvo_ivch.c
similarity index 100%
rename from drivers/gpu/drm/i915/dvo_ns2501.c
rename to drivers/gpu/drm/i915/display/dvo_ns2501.c
similarity index 100%
rename from drivers/gpu/drm/i915/dvo_sil164.c
rename to drivers/gpu/drm/i915/display/dvo_sil164.c
similarity index 100%
rename from drivers/gpu/drm/i915/dvo_tfp410.c
rename to drivers/gpu/drm/i915/display/dvo_tfp410.c
similarity index 100%
rename from drivers/gpu/drm/i915/icl_dsi.c
rename to drivers/gpu/drm/i915/display/icl_dsi.c
similarity index 100%
rename from drivers/gpu/drm/i915/intel_crt.c
rename to drivers/gpu/drm/i915/display/intel_crt.c
similarity index 100%
rename from drivers/gpu/drm/i915/intel_crt.h
rename to drivers/gpu/drm/i915/display/intel_crt.h
similarity index 100%
rename from drivers/gpu/drm/i915/intel_ddi.c
rename to drivers/gpu/drm/i915/display/intel_ddi.c
similarity index 100%
rename from drivers/gpu/drm/i915/intel_ddi.h
rename to drivers/gpu/drm/i915/display/intel_ddi.h
similarity index 100%
rename from drivers/gpu/drm/i915/intel_dp.c
rename to drivers/gpu/drm/i915/display/intel_dp.c
similarity index 100%
rename from drivers/gpu/drm/i915/intel_dp.h
rename to drivers/gpu/drm/i915/display/intel_dp.h
similarity index 100%
rename from drivers/gpu/drm/i915/intel_dp_aux_backlight.c
rename to drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c
similarity index 100%
rename from drivers/gpu/drm/i915/intel_dp_aux_backlight.h
rename to drivers/gpu/drm/i915/display/intel_dp_aux_backlight.h
similarity index 100%
rename from drivers/gpu/drm/i915/intel_dp_link_training.c
rename to drivers/gpu/drm/i915/display/intel_dp_link_training.c
similarity index 100%
rename from drivers/gpu/drm/i915/intel_dp_link_training.h
rename to drivers/gpu/drm/i915/display/intel_dp_link_training.h
similarity index 100%
rename from drivers/gpu/drm/i915/intel_dp_mst.c
rename to drivers/gpu/drm/i915/display/intel_dp_mst.c
similarity index 100%
rename from drivers/gpu/drm/i915/intel_dp_mst.h
rename to drivers/gpu/drm/i915/display/intel_dp_mst.h
similarity index 100%
rename from drivers/gpu/drm/i915/intel_dsi.c
rename to drivers/gpu/drm/i915/display/intel_dsi.c
similarity index 100%
rename from drivers/gpu/drm/i915/intel_dsi.h
rename to drivers/gpu/drm/i915/display/intel_dsi.h
similarity index 100%
rename from drivers/gpu/drm/i915/intel_dsi_dcs_backlight.c
rename to drivers/gpu/drm/i915/display/intel_dsi_dcs_backlight.c
similarity index 100%
rename from drivers/gpu/drm/i915/intel_dsi_dcs_backlight.h
rename to drivers/gpu/drm/i915/display/intel_dsi_dcs_backlight.h
similarity index 100%
rename from drivers/gpu/drm/i915/intel_dsi_vbt.c
rename to drivers/gpu/drm/i915/display/intel_dsi_vbt.c
similarity index 100%
rename from drivers/gpu/drm/i915/intel_dvo.c
rename to drivers/gpu/drm/i915/display/intel_dvo.c
similarity index 100%
rename from drivers/gpu/drm/i915/intel_dvo.h
rename to drivers/gpu/drm/i915/display/intel_dvo.h
similarity index 100%
rename from drivers/gpu/drm/i915/intel_dvo_dev.h
rename to drivers/gpu/drm/i915/display/intel_dvo_dev.h
similarity index 100%
rename from drivers/gpu/drm/i915/intel_gmbus.c
rename to drivers/gpu/drm/i915/display/intel_gmbus.c
similarity index 100%
rename from drivers/gpu/drm/i915/intel_gmbus.h
rename to drivers/gpu/drm/i915/display/intel_gmbus.h
similarity index 100%
rename from drivers/gpu/drm/i915/intel_hdmi.c
rename to drivers/gpu/drm/i915/display/intel_hdmi.c
similarity index 100%
rename from drivers/gpu/drm/i915/intel_hdmi.h
rename to drivers/gpu/drm/i915/display/intel_hdmi.h
similarity index 100%
rename from drivers/gpu/drm/i915/intel_lspcon.c
rename to drivers/gpu/drm/i915/display/intel_lspcon.c
similarity index 100%
rename from drivers/gpu/drm/i915/intel_lspcon.h
rename to drivers/gpu/drm/i915/display/intel_lspcon.h
similarity index 100%
rename from drivers/gpu/drm/i915/intel_lvds.c
rename to drivers/gpu/drm/i915/display/intel_lvds.c
similarity index 100%
rename from drivers/gpu/drm/i915/intel_lvds.h
rename to drivers/gpu/drm/i915/display/intel_lvds.h
similarity index 100%
rename from drivers/gpu/drm/i915/intel_panel.c
rename to drivers/gpu/drm/i915/display/intel_panel.c
similarity index 100%
rename from drivers/gpu/drm/i915/intel_panel.h
rename to drivers/gpu/drm/i915/display/intel_panel.h
similarity index 100%
rename from drivers/gpu/drm/i915/intel_sdvo.c
rename to drivers/gpu/drm/i915/display/intel_sdvo.c
similarity index 100%
rename from drivers/gpu/drm/i915/intel_sdvo.h
rename to drivers/gpu/drm/i915/display/intel_sdvo.h
similarity index 100%
rename from drivers/gpu/drm/i915/intel_sdvo_regs.h
rename to drivers/gpu/drm/i915/display/intel_sdvo_regs.h
similarity index 100%
rename from drivers/gpu/drm/i915/intel_tv.c
rename to drivers/gpu/drm/i915/display/intel_tv.c
similarity index 100%
rename from drivers/gpu/drm/i915/intel_tv.h
rename to drivers/gpu/drm/i915/display/intel_tv.h
similarity index 100%
rename from drivers/gpu/drm/i915/intel_vdsc.c
rename to drivers/gpu/drm/i915/display/intel_vdsc.c
similarity index 100%
rename from drivers/gpu/drm/i915/intel_vdsc.h
rename to drivers/gpu/drm/i915/display/intel_vdsc.h
similarity index 100%
rename from drivers/gpu/drm/i915/vlv_dsi.c
rename to drivers/gpu/drm/i915/display/vlv_dsi.c
similarity index 100%
rename from drivers/gpu/drm/i915/vlv_dsi_pll.c
rename to drivers/gpu/drm/i915/display/vlv_dsi_pll.c
@@ -32,18 +32,19 @@
#include <drm/drm_debugfs.h>
#include <drm/drm_fourcc.h>
+#include "display/intel_dp.h"
+#include "display/intel_hdmi.h"
+
#include "gem/i915_gem_context.h"
#include "gt/intel_reset.h"
#include "i915_debugfs.h"
#include "i915_irq.h"
#include "intel_csr.h"
-#include "intel_dp.h"
#include "intel_drv.h"
#include "intel_fbc.h"
#include "intel_guc_submission.h"
#include "intel_hdcp.h"
-#include "intel_hdmi.h"
#include "intel_pm.h"
#include "intel_psr.h"
#include "intel_sideband.h"
@@ -47,6 +47,9 @@
#include <drm/drm_probe_helper.h>
#include <drm/i915_drm.h>
+#include "display/intel_dp.h"
+#include "display/intel_gmbus.h"
+
#include "gem/i915_gem_context.h"
#include "gem/i915_gem_ioctls.h"
#include "gt/intel_gt_pm.h"
@@ -65,10 +68,8 @@
#include "intel_bw.h"
#include "intel_cdclk.h"
#include "intel_csr.h"
-#include "intel_dp.h"
#include "intel_drv.h"
#include "intel_fbdev.h"
-#include "intel_gmbus.h"
#include "intel_hotplug.h"
#include "intel_overlay.h"
#include "intel_pipe_crc.h"
@@ -26,10 +26,11 @@
#include <drm/i915_drm.h>
+#include "display/intel_gmbus.h"
+
#include "i915_reg.h"
#include "intel_drv.h"
#include "intel_fbc.h"
-#include "intel_gmbus.h"
static void i915_save_display(struct drm_i915_private *dev_priv)
{
@@ -28,8 +28,9 @@
#include <drm/drm_dp_helper.h>
#include <drm/i915_drm.h>
+#include "display/intel_gmbus.h"
+
#include "i915_drv.h"
-#include "intel_gmbus.h"
#define _INTEL_BIOS_PRIVATE
#include "intel_vbt_defs.h"
@@ -29,11 +29,12 @@
#include <drm/drm_atomic_helper.h>
#include <drm/drm_edid.h>
+#include "display/intel_panel.h"
+
#include "i915_drv.h"
#include "intel_connector.h"
#include "intel_drv.h"
#include "intel_hdcp.h"
-#include "intel_panel.h"
int intel_connector_init(struct intel_connector *connector)
{
@@ -44,6 +44,18 @@
#include <drm/drm_rect.h>
#include <drm/i915_drm.h>
+#include "display/intel_crt.h"
+#include "display/intel_ddi.h"
+#include "display/intel_dp.h"
+#include "display/intel_dsi.h"
+#include "display/intel_dvo.h"
+#include "display/intel_gmbus.h"
+#include "display/intel_hdmi.h"
+#include "display/intel_lvds.h"
+#include "display/intel_sdvo.h"
+#include "display/intel_tv.h"
+#include "display/intel_vdsc.h"
+
#include "i915_drv.h"
#include "i915_trace.h"
#include "intel_acpi.h"
@@ -52,31 +64,20 @@
#include "intel_bw.h"
#include "intel_color.h"
#include "intel_cdclk.h"
-#include "intel_crt.h"
-#include "intel_ddi.h"
-#include "intel_dp.h"
#include "intel_drv.h"
-#include "intel_dsi.h"
-#include "intel_dvo.h"
#include "intel_fbc.h"
#include "intel_fbdev.h"
#include "intel_fifo_underrun.h"
#include "intel_frontbuffer.h"
-#include "intel_gmbus.h"
#include "intel_hdcp.h"
-#include "intel_hdmi.h"
#include "intel_hotplug.h"
-#include "intel_lvds.h"
#include "intel_overlay.h"
#include "intel_pipe_crc.h"
#include "intel_pm.h"
#include "intel_psr.h"
#include "intel_quirks.h"
-#include "intel_sdvo.h"
#include "intel_sideband.h"
#include "intel_sprite.h"
-#include "intel_tv.h"
-#include "intel_vdsc.h"
/* Primary plane formats for gen <= 3 */
static const u32 i8xx_primary_formats[] = {
@@ -5,13 +5,14 @@
#include <linux/vgaarb.h>
+#include "display/intel_crt.h"
+#include "display/intel_dp.h"
+
#include "i915_drv.h"
#include "i915_irq.h"
#include "intel_cdclk.h"
#include "intel_combo_phy.h"
-#include "intel_crt.h"
#include "intel_csr.h"
-#include "intel_dp.h"
#include "intel_dpio_phy.h"
#include "intel_drv.h"
#include "intel_hotplug.h"
@@ -21,7 +21,8 @@
* DEALINGS IN THE SOFTWARE.
*/
-#include "intel_dp.h"
+#include "display/intel_dp.h"
+
#include "intel_dpio_phy.h"
#include "intel_drv.h"
#include "intel_sideband.h"
@@ -55,8 +55,9 @@
* cancelled as soon as busyness is detected.
*/
+#include "display/intel_dp.h"
+
#include "i915_drv.h"
-#include "intel_dp.h"
#include "intel_drv.h"
#include "intel_fbc.h"
#include "intel_frontbuffer.h"
@@ -32,10 +32,11 @@
#include <drm/i915_drm.h>
+#include "display/intel_panel.h"
+
#include "i915_drv.h"
#include "intel_drv.h"
#include "intel_opregion.h"
-#include "intel_panel.h"
#define OPREGION_HEADER_OFFSET 0
#define OPREGION_ACPI_OFFSET 0x100
@@ -23,8 +23,9 @@
#include <drm/drm_atomic_helper.h>
+#include "display/intel_dp.h"
+
#include "i915_drv.h"
-#include "intel_dp.h"
#include "intel_drv.h"
#include "intel_psr.h"
#include "intel_sprite.h"