From: Jack Leigh <jack.leigh@collabora.com>
Date: Wed, 25 Jun 2014 11:55:30 +0100
Subject: Add backport checks

---
 drivers/gpu/drm/ati_pcigart.c                 |   2 +
 drivers/gpu/drm/drm_agpsupport.c              |   4 +
 drivers/gpu/drm/drm_auth.c                    |   2 +
 drivers/gpu/drm/drm_buffer.c                  |   2 +
 drivers/gpu/drm/drm_bufs.c                    |   2 +
 drivers/gpu/drm/drm_cache.c                   |   2 +
 drivers/gpu/drm/drm_context.c                 |   2 +
 drivers/gpu/drm/drm_crtc.c                    |   2 +
 drivers/gpu/drm/drm_crtc_helper.c             |   2 +
 drivers/gpu/drm/drm_debugfs.c                 |   2 +
 drivers/gpu/drm/drm_dma.c                     |   2 +
 drivers/gpu/drm/drm_dp_helper.c               |   2 +
 drivers/gpu/drm/drm_drv.c                     |   5 +
 drivers/gpu/drm/drm_edid.c                    |   2 +
 drivers/gpu/drm/drm_edid_load.c               |   2 +
 drivers/gpu/drm/drm_encoder_slave.c           |   2 +
 drivers/gpu/drm/drm_fb_cma_helper.c           |   2 +
 drivers/gpu/drm/drm_fb_helper.c               |   2 +
 drivers/gpu/drm/drm_flip_work.c               |   2 +
 drivers/gpu/drm/drm_fops.c                    |   2 +
 drivers/gpu/drm/drm_gem.c                     |   2 +
 drivers/gpu/drm/drm_gem_cma_helper.c          |   2 +
 drivers/gpu/drm/drm_global.c                  |   2 +
 drivers/gpu/drm/drm_hashtab.c                 |   2 +
 drivers/gpu/drm/drm_info.c                    |   2 +
 drivers/gpu/drm/drm_ioc32.c                   |   6 +
 drivers/gpu/drm/drm_ioctl.c                   |   6 +
 drivers/gpu/drm/drm_irq.c                     |   2 +
 drivers/gpu/drm/drm_lock.c                    |   2 +
 drivers/gpu/drm/drm_memory.c                  |   2 +
 drivers/gpu/drm/drm_mipi_dsi.c                |   2 +
 drivers/gpu/drm/drm_mm.c                      |   2 +
 drivers/gpu/drm/drm_modes.c                   |   2 +
 drivers/gpu/drm/drm_modeset_lock.c            |   2 +
 drivers/gpu/drm/drm_panel.c                   |   2 +
 drivers/gpu/drm/drm_pci.c                     |   2 +
 drivers/gpu/drm/drm_plane_helper.c            |   2 +
 drivers/gpu/drm/drm_platform.c                |   2 +
 drivers/gpu/drm/drm_prime.c                   |   2 +
 drivers/gpu/drm/drm_probe_helper.c            |   2 +
 drivers/gpu/drm/drm_rect.c                    |   2 +
 drivers/gpu/drm/drm_scatter.c                 |   2 +
 drivers/gpu/drm/drm_stub.c                    |   6 +
 drivers/gpu/drm/drm_sysfs.c                   |   6 +
 drivers/gpu/drm/drm_trace.h                   |   2 +
 drivers/gpu/drm/drm_trace_points.c            |   2 +
 drivers/gpu/drm/drm_usb.c                     |   2 +
 drivers/gpu/drm/drm_vm.c                      |   2 +
 drivers/gpu/drm/drm_vma_manager.c             |   2 +
 drivers/gpu/drm/i915/dvo.h                    |   2 +
 drivers/gpu/drm/i915/dvo_ch7017.c             |   2 +
 drivers/gpu/drm/i915/dvo_ch7xxx.c             |   2 +
 drivers/gpu/drm/i915/dvo_ivch.c               |   2 +
 drivers/gpu/drm/i915/dvo_ns2501.c             |   2 +
 drivers/gpu/drm/i915/dvo_sil164.c             |   2 +
 drivers/gpu/drm/i915/dvo_tfp410.c             |   2 +
 drivers/gpu/drm/i915/i915_cmd_parser.c        |   2 +
 drivers/gpu/drm/i915/i915_debugfs.c           |   2 +
 drivers/gpu/drm/i915/i915_dma.c               |   2 +
 drivers/gpu/drm/i915/i915_drv.c               |   2 +
 drivers/gpu/drm/i915/i915_gem.c               |   2 +
 drivers/gpu/drm/i915/i915_gem_context.c       |   2 +
 drivers/gpu/drm/i915/i915_gem_debug.c         |   2 +
 drivers/gpu/drm/i915/i915_gem_dmabuf.c        |   2 +
 drivers/gpu/drm/i915/i915_gem_evict.c         |   2 +
 drivers/gpu/drm/i915/i915_gem_execbuffer.c    |   2 +
 drivers/gpu/drm/i915/i915_gem_gtt.c           |   2 +
 drivers/gpu/drm/i915/i915_gem_render_state.c  |   2 +
 drivers/gpu/drm/i915/i915_gem_stolen.c        |   2 +
 drivers/gpu/drm/i915/i915_gem_tiling.c        |   2 +
 drivers/gpu/drm/i915/i915_gem_userptr.c       |   2 +
 drivers/gpu/drm/i915/i915_gpu_error.c         |   2 +
 drivers/gpu/drm/i915/i915_ioc32.c             |   2 +
 drivers/gpu/drm/i915/i915_irq.c               |   2 +
 drivers/gpu/drm/i915/i915_params.c            |   2 +
 drivers/gpu/drm/i915/i915_suspend.c           |   2 +
 drivers/gpu/drm/i915/i915_sysfs.c             |   2 +
 drivers/gpu/drm/i915/i915_trace_points.c      |   2 +
 drivers/gpu/drm/i915/i915_ums.c               |   2 +
 drivers/gpu/drm/i915/intel_acpi.c             |   2 +
 drivers/gpu/drm/i915/intel_bios.c             |   2 +
 drivers/gpu/drm/i915/intel_crt.c              |   2 +
 drivers/gpu/drm/i915/intel_ddi.c              |   2 +
 drivers/gpu/drm/i915/intel_display.c          |   2 +
 drivers/gpu/drm/i915/intel_dp.c               |   2 +
 drivers/gpu/drm/i915/intel_dsi.c              |   2 +
 drivers/gpu/drm/i915/intel_dsi_cmd.c          |   2 +
 drivers/gpu/drm/i915/intel_dsi_panel_vbt.c    |   2 +
 drivers/gpu/drm/i915/intel_dsi_pll.c          |   2 +
 drivers/gpu/drm/i915/intel_dvo.c              |   2 +
 drivers/gpu/drm/i915/intel_fbdev.c            |   2 +
 drivers/gpu/drm/i915/intel_hdmi.c             |   2 +
 drivers/gpu/drm/i915/intel_i2c.c              |   2 +
 drivers/gpu/drm/i915/intel_lvds.c             |   2 +
 drivers/gpu/drm/i915/intel_modes.c            |   2 +
 drivers/gpu/drm/i915/intel_opregion.c         |   2 +
 drivers/gpu/drm/i915/intel_overlay.c          |   2 +
 drivers/gpu/drm/i915/intel_panel.c            |   2 +
 drivers/gpu/drm/i915/intel_pm.c               |   2 +
 drivers/gpu/drm/i915/intel_renderstate_gen6.c |   2 +
 drivers/gpu/drm/i915/intel_renderstate_gen7.c |   2 +
 drivers/gpu/drm/i915/intel_renderstate_gen8.c |   2 +
 drivers/gpu/drm/i915/intel_ringbuffer.c       |   2 +
 drivers/gpu/drm/i915/intel_sdvo.c             |   2 +
 drivers/gpu/drm/i915/intel_sideband.c         |   2 +
 drivers/gpu/drm/i915/intel_sprite.c           |   2 +
 drivers/gpu/drm/i915/intel_tv.c               |   2 +
 drivers/gpu/drm/i915/intel_uncore.c           |   2 +
 drivers/platform/x86/intel_ips.c              |   2 +
 include/backport-check.h                      | 205 ++++++++++++++++++++++++++
 include/drm/drmP.h                            |   6 +
 include/drm/drm_agpsupport.h                  |   2 +
 include/drm/drm_buffer.h                      |   2 +
 include/drm/drm_core.h                        |   2 +
 include/drm/drm_crtc.h                        |   2 +
 include/drm/drm_crtc_helper.h                 |   2 +
 include/drm/drm_dp_helper.h                   |   2 +
 include/drm/drm_edid.h                        |   2 +
 include/drm/drm_encoder_slave.h               |   2 +
 include/drm/drm_fb_cma_helper.h               |   2 +
 include/drm/drm_fb_helper.h                   |   2 +
 include/drm/drm_flip_work.h                   |   2 +
 include/drm/drm_gem_cma_helper.h              |   2 +
 include/drm/drm_global.h                      |   3 +
 include/drm/drm_hashtab.h                     |   2 +
 include/drm/drm_mem_util.h                    |   2 +
 include/drm/drm_mipi_dsi.h                    |   2 +
 include/drm/drm_mm.h                          |   2 +
 include/drm/drm_modes.h                       |   2 +
 include/drm/drm_modeset_lock.h                |   2 +
 include/drm/drm_os_linux.h                    |   2 +
 include/drm/drm_panel.h                       |   2 +
 include/drm/drm_plane_helper.h                |   2 +
 include/drm/drm_rect.h                        |   2 +
 include/drm/drm_sysfs.h                       |   2 +
 include/drm/drm_usb.h                         |   2 +
 include/drm/drm_vma_manager.h                 |   2 +
 include/drm/i915_drm.h                        |   2 +
 include/drm/i915_pciids.h                     |   2 +
 include/drm/i915_powerwell.h                  |   2 +
 include/uapi/drm/drm.h                        |   2 +
 include/uapi/drm/drm_fourcc.h                 |   2 +
 include/uapi/drm/drm_mode.h                   |   2 +
 include/uapi/drm/drm_sarea.h                  |   2 +
 include/uapi/drm/i915_drm.h                   |   2 +
 145 files changed, 519 insertions(+)
 create mode 100644 include/backport-check.h

diff --git a/drivers/gpu/drm/ati_pcigart.c b/drivers/gpu/drm/ati_pcigart.c
index c399dea..10a62c4 100644
--- a/drivers/gpu/drm/ati_pcigart.c
+++ b/drivers/gpu/drm/ati_pcigart.c
@@ -34,6 +34,8 @@
 #include <linux/export.h>
 #include <drm/drmP.h>
 
+#include "backport-check.h"
+
 # define ATI_PCIGART_PAGE_SIZE		4096	/**< PCI GART page size */
 
 static int drm_ati_alloc_pcigart_table(struct drm_device *dev,
diff --git a/drivers/gpu/drm/drm_agpsupport.c b/drivers/gpu/drm/drm_agpsupport.c
index dde205c..9b9ba5d 100644
--- a/drivers/gpu/drm/drm_agpsupport.c
+++ b/drivers/gpu/drm/drm_agpsupport.c
@@ -35,10 +35,14 @@
 #include <linux/module.h>
 #include <linux/slab.h>
 
+#include "backport-check.h"
+
 #if __OS_HAS_AGP
 
 #include <asm/agp.h>
 
+#include "backport-check.h"
+
 /**
  * Get AGP information.
  *
diff --git a/drivers/gpu/drm/drm_auth.c b/drivers/gpu/drm/drm_auth.c
index 3cedae1..5888e74 100644
--- a/drivers/gpu/drm/drm_auth.c
+++ b/drivers/gpu/drm/drm_auth.c
@@ -35,6 +35,8 @@
 
 #include <drm/drmP.h>
 
+#include "backport-check.h"
+
 /**
  * Find the file with the given magic number.
  *
diff --git a/drivers/gpu/drm/drm_buffer.c b/drivers/gpu/drm/drm_buffer.c
index 0406110..a80370d 100644
--- a/drivers/gpu/drm/drm_buffer.c
+++ b/drivers/gpu/drm/drm_buffer.c
@@ -35,6 +35,8 @@
 #include <linux/export.h>
 #include <drm/drm_buffer.h>
 
+#include "backport-check.h"
+
 /**
  * Allocate the drm buffer object.
  *
diff --git a/drivers/gpu/drm/drm_bufs.c b/drivers/gpu/drm/drm_bufs.c
index 68175b5..8f652b1 100644
--- a/drivers/gpu/drm/drm_bufs.c
+++ b/drivers/gpu/drm/drm_bufs.c
@@ -40,6 +40,8 @@
 #include <asm/shmparam.h>
 #include <drm/drmP.h>
 
+#include "backport-check.h"
+
 static struct drm_map_list *drm_find_matching_map(struct drm_device *dev,
 						  struct drm_local_map *map)
 {
diff --git a/drivers/gpu/drm/drm_cache.c b/drivers/gpu/drm/drm_cache.c
index a6b6906..8f81f3c 100644
--- a/drivers/gpu/drm/drm_cache.c
+++ b/drivers/gpu/drm/drm_cache.c
@@ -31,6 +31,8 @@
 #include <linux/export.h>
 #include <drm/drmP.h>
 
+#include "backport-check.h"
+
 #if defined(CONFIG_X86)
 
 /*
diff --git a/drivers/gpu/drm/drm_context.c b/drivers/gpu/drm/drm_context.c
index a4b017b..947c444 100644
--- a/drivers/gpu/drm/drm_context.c
+++ b/drivers/gpu/drm/drm_context.c
@@ -42,6 +42,8 @@
 
 #include <drm/drmP.h>
 
+#include "backport-check.h"
+
 /******************************************************************/
 /** \name Context bitmap support */
 /*@{*/
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
index fe94cc1..5c42c41 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -41,6 +41,8 @@
 
 #include "drm_crtc_internal.h"
 
+#include "backport-check.h"
+
 /**
  * drm_modeset_lock_all - take all modeset locks
  * @dev: drm device
diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c
index 78b37f3..b1cb66c 100644
--- a/drivers/gpu/drm/drm_crtc_helper.c
+++ b/drivers/gpu/drm/drm_crtc_helper.c
@@ -40,6 +40,8 @@
 #include <drm/drm_fb_helper.h>
 #include <drm/drm_edid.h>
 
+#include "backport-check.h"
+
 MODULE_AUTHOR("David Airlie, Jesse Barnes");
 MODULE_DESCRIPTION("DRM KMS helper");
 MODULE_LICENSE("GPL and additional rights");
diff --git a/drivers/gpu/drm/drm_debugfs.c b/drivers/gpu/drm/drm_debugfs.c
index b4b51d4..f0f5b42 100644
--- a/drivers/gpu/drm/drm_debugfs.c
+++ b/drivers/gpu/drm/drm_debugfs.c
@@ -36,6 +36,8 @@
 #include <linux/export.h>
 #include <drm/drmP.h>
 
+#include "backport-check.h"
+
 #if defined(CONFIG_DEBUG_FS)
 
 /***************************************************
diff --git a/drivers/gpu/drm/drm_dma.c b/drivers/gpu/drm/drm_dma.c
index 8a140a9..dfbe93b 100644
--- a/drivers/gpu/drm/drm_dma.c
+++ b/drivers/gpu/drm/drm_dma.c
@@ -36,6 +36,8 @@
 #include <linux/export.h>
 #include <drm/drmP.h>
 
+#include "backport-check.h"
+
 /**
  * Initialize the DMA data.
  *
diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c
index 08e33b8..89c75e2 100644
--- a/drivers/gpu/drm/drm_dp_helper.c
+++ b/drivers/gpu/drm/drm_dp_helper.c
@@ -30,6 +30,8 @@
 #include <drm/drm_dp_helper.h>
 #include <drm/drmP.h>
 
+#include "backport-check.h"
+
 /**
  * DOC: dp helpers
  *
diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
index 8218078..a9d6457 100644
--- a/drivers/gpu/drm/drm_drv.c
+++ b/drivers/gpu/drm/drm_drv.c
@@ -52,6 +52,11 @@
 #include <drm/drmP.h>
 #include <drm/drm_core.h>
 
+#ifndef BACKPORT_DRM_CORE_H
+#error "drm/drm_core.h not from package"
+#endif
+
+#include "backport-check.h"
 
 static int drm_version(struct drm_device *dev, void *data,
 		       struct drm_file *file_priv);
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index dfa9769..2e5db36 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -35,6 +35,8 @@
 #include <drm/drmP.h>
 #include <drm/drm_edid.h>
 
+#include "backport-check.h"
+
 #define version_greater(edid, maj, min) \
 	(((edid)->version > (maj)) || \
 	 ((edid)->version == (maj) && (edid)->revision > (min)))
diff --git a/drivers/gpu/drm/drm_edid_load.c b/drivers/gpu/drm/drm_edid_load.c
index 0a235fe..f709d58 100644
--- a/drivers/gpu/drm/drm_edid_load.c
+++ b/drivers/gpu/drm/drm_edid_load.c
@@ -26,6 +26,8 @@
 #include <drm/drm_crtc_helper.h>
 #include <drm/drm_edid.h>
 
+#include "backport-check.h"
+
 static char edid_firmware[PATH_MAX];
 module_param_string(edid_firmware, edid_firmware, sizeof(edid_firmware), 0644);
 MODULE_PARM_DESC(edid_firmware, "Do not probe monitor, use specified EDID blob "
diff --git a/drivers/gpu/drm/drm_encoder_slave.c b/drivers/gpu/drm/drm_encoder_slave.c
index d18b88b..fa73f73 100644
--- a/drivers/gpu/drm/drm_encoder_slave.c
+++ b/drivers/gpu/drm/drm_encoder_slave.c
@@ -28,6 +28,8 @@
 
 #include <drm/drm_encoder_slave.h>
 
+#include "backport-check.h"
+
 /**
  * drm_i2c_encoder_init - Initialize an I2C slave encoder
  * @dev:	DRM device.
diff --git a/drivers/gpu/drm/drm_fb_cma_helper.c b/drivers/gpu/drm/drm_fb_cma_helper.c
index f27c883..3fa3a37 100644
--- a/drivers/gpu/drm/drm_fb_cma_helper.c
+++ b/drivers/gpu/drm/drm_fb_cma_helper.c
@@ -25,6 +25,8 @@
 #include <drm/drm_fb_cma_helper.h>
 #include <linux/module.h>
 
+#include "backport-check.h"
+
 struct drm_fb_cma {
 	struct drm_framebuffer		fb;
 	struct drm_gem_cma_object	*obj[4];
diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index d5d8cea..205ad49 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -39,6 +39,8 @@
 #include <drm/drm_fb_helper.h>
 #include <drm/drm_crtc_helper.h>
 
+#include "backport-check.h"
+
 static LIST_HEAD(kernel_fb_helper_list);
 
 /**
diff --git a/drivers/gpu/drm/drm_flip_work.c b/drivers/gpu/drm/drm_flip_work.c
index f9c7fa3..eb854ce 100644
--- a/drivers/gpu/drm/drm_flip_work.c
+++ b/drivers/gpu/drm/drm_flip_work.c
@@ -24,6 +24,8 @@
 #include "drmP.h"
 #include "drm_flip_work.h"
 
+#include "backport-check.h"
+
 /**
  * drm_flip_work_queue - queue work
  * @work: the flip-work
diff --git a/drivers/gpu/drm/drm_fops.c b/drivers/gpu/drm/drm_fops.c
index 021fe5d..65d4b68 100644
--- a/drivers/gpu/drm/drm_fops.c
+++ b/drivers/gpu/drm/drm_fops.c
@@ -39,6 +39,8 @@
 #include <linux/slab.h>
 #include <linux/module.h>
 
+#include "backport-check.h"
+
 /* from BKL pushdown */
 DEFINE_MUTEX(drm_global_mutex);
 EXPORT_SYMBOL(drm_global_mutex);
diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c
index f7d7119..4b6cb29 100644
--- a/drivers/gpu/drm/drm_gem.c
+++ b/drivers/gpu/drm/drm_gem.c
@@ -39,6 +39,8 @@
 #include <drm/drmP.h>
 #include <drm/drm_vma_manager.h>
 
+#include "backport-check.h"
+
 /** @file drm_gem.c
  *
  * This file provides some of the base ioctls and library routines for
diff --git a/drivers/gpu/drm/drm_gem_cma_helper.c b/drivers/gpu/drm/drm_gem_cma_helper.c
index 05c97c5..f4578c4 100644
--- a/drivers/gpu/drm/drm_gem_cma_helper.c
+++ b/drivers/gpu/drm/drm_gem_cma_helper.c
@@ -29,6 +29,8 @@
 #include <drm/drm_gem_cma_helper.h>
 #include <drm/drm_vma_manager.h>
 
+#include "backport-check.h"
+
 /*
  * __drm_gem_cma_create - Create a GEM CMA object without allocating memory
  * @drm: The drm device
diff --git a/drivers/gpu/drm/drm_global.c b/drivers/gpu/drm/drm_global.c
index 3d2e91c..41702ea 100644
--- a/drivers/gpu/drm/drm_global.c
+++ b/drivers/gpu/drm/drm_global.c
@@ -33,6 +33,8 @@
 #include <linux/module.h>
 #include <drm/drm_global.h>
 
+#include "backport-check.h"
+
 struct drm_global_item {
 	struct mutex mutex;
 	void *object;
diff --git a/drivers/gpu/drm/drm_hashtab.c b/drivers/gpu/drm/drm_hashtab.c
index 7e4bae7..8a5ed1b 100644
--- a/drivers/gpu/drm/drm_hashtab.c
+++ b/drivers/gpu/drm/drm_hashtab.c
@@ -38,6 +38,8 @@
 #include <linux/slab.h>
 #include <linux/export.h>
 
+#include "backport-check.h"
+
 int drm_ht_create(struct drm_open_hash *ht, unsigned int order)
 {
 	unsigned int size = 1 << order;
diff --git a/drivers/gpu/drm/drm_info.c b/drivers/gpu/drm/drm_info.c
index 86feedd..4401c21 100644
--- a/drivers/gpu/drm/drm_info.c
+++ b/drivers/gpu/drm/drm_info.c
@@ -36,6 +36,8 @@
 #include <linux/seq_file.h>
 #include <drm/drmP.h>
 
+#include "backport-check.h"
+
 /**
  * Called when "/proc/dri/.../name" is read.
  *
diff --git a/drivers/gpu/drm/drm_ioc32.c b/drivers/gpu/drm/drm_ioc32.c
index 2f4c434..8374b6e 100644
--- a/drivers/gpu/drm/drm_ioc32.c
+++ b/drivers/gpu/drm/drm_ioc32.c
@@ -34,6 +34,12 @@
 #include <drm/drmP.h>
 #include <drm/drm_core.h>
 
+#ifndef BACKPORT_DRM_CORE_H
+#error "drm/drm_core.h not from package"
+#endif
+
+#include "backport-check.h"
+
 #define DRM_IOCTL_VERSION32		DRM_IOWR(0x00, drm_version32_t)
 #define DRM_IOCTL_GET_UNIQUE32		DRM_IOWR(0x01, drm_unique32_t)
 #define DRM_IOCTL_GET_MAP32		DRM_IOWR(0x04, drm_map32_t)
diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c
index 69c61f3..b008302 100644
--- a/drivers/gpu/drm/drm_ioctl.c
+++ b/drivers/gpu/drm/drm_ioctl.c
@@ -36,12 +36,18 @@
 #include <drm/drmP.h>
 #include <drm/drm_core.h>
 
+#ifndef BACKPORT_DRM_CORE_H
+#error "drm/drm_core.h not from package"
+#endif
+
 #include <linux/pci.h>
 #include <linux/export.h>
 #ifdef CONFIG_X86
 #include <asm/mtrr.h>
 #endif
 
+#include "backport-check.h"
+
 /**
  * Get the bus id.
  *
diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
index 0de123a..cd4297c 100644
--- a/drivers/gpu/drm/drm_irq.c
+++ b/drivers/gpu/drm/drm_irq.c
@@ -41,6 +41,8 @@
 #include <linux/vgaarb.h>
 #include <linux/export.h>
 
+#include "backport-check.h"
+
 /* Access macro for slots in vblank timestamp ringbuffer. */
 #define vblanktimestamp(dev, crtc, count) \
 	((dev)->vblank[crtc].time[(count) % DRM_VBLANKTIME_RBSIZE])
diff --git a/drivers/gpu/drm/drm_lock.c b/drivers/gpu/drm/drm_lock.c
index f645268..816dfdc 100644
--- a/drivers/gpu/drm/drm_lock.c
+++ b/drivers/gpu/drm/drm_lock.c
@@ -36,6 +36,8 @@
 #include <linux/export.h>
 #include <drm/drmP.h>
 
+#include "backport-check.h"
+
 static int drm_notifier(void *priv);
 
 static int drm_lock_take(struct drm_lock_data *lock_data, unsigned int context);
diff --git a/drivers/gpu/drm/drm_memory.c b/drivers/gpu/drm/drm_memory.c
index 00c67c0..91e3d2a 100644
--- a/drivers/gpu/drm/drm_memory.c
+++ b/drivers/gpu/drm/drm_memory.c
@@ -37,6 +37,8 @@
 #include <linux/export.h>
 #include <drm/drmP.h>
 
+#include "backport-check.h"
+
 #if __OS_HAS_AGP
 static void *agp_remap(unsigned long offset, unsigned long size,
 		       struct drm_device * dev)
diff --git a/drivers/gpu/drm/drm_mipi_dsi.c b/drivers/gpu/drm/drm_mipi_dsi.c
index e633df2..362a969 100644
--- a/drivers/gpu/drm/drm_mipi_dsi.c
+++ b/drivers/gpu/drm/drm_mipi_dsi.c
@@ -35,6 +35,8 @@
 
 #include <video/mipi_display.h>
 
+#include "backport-check.h"
+
 static int mipi_dsi_device_match(struct device *dev, struct device_driver *drv)
 {
 	return of_driver_match_device(dev, drv);
diff --git a/drivers/gpu/drm/drm_mm.c b/drivers/gpu/drm/drm_mm.c
index 04a209e..ea02c35 100644
--- a/drivers/gpu/drm/drm_mm.c
+++ b/drivers/gpu/drm/drm_mm.c
@@ -47,6 +47,8 @@
 #include <linux/seq_file.h>
 #include <linux/export.h>
 
+#include "backport-check.h"
+
 /**
  * DOC: Overview
  *
diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
index bedf189..20883e6 100644
--- a/drivers/gpu/drm/drm_modes.c
+++ b/drivers/gpu/drm/drm_modes.c
@@ -41,6 +41,8 @@
 
 #include "drm_crtc_internal.h"
 
+#include "backport-check.h"
+
 /**
  * drm_mode_debug_printmodeline - print a mode to dmesg
  * @mode: mode to print
diff --git a/drivers/gpu/drm/drm_modeset_lock.c b/drivers/gpu/drm/drm_modeset_lock.c
index 0dc57d5..1449a7a 100644
--- a/drivers/gpu/drm/drm_modeset_lock.c
+++ b/drivers/gpu/drm/drm_modeset_lock.c
@@ -25,6 +25,8 @@
 #include <drm/drm_crtc.h>
 #include <drm/drm_modeset_lock.h>
 
+#include "backport-check.h"
+
 /**
  * DOC: kms locking
  *
diff --git a/drivers/gpu/drm/drm_panel.c b/drivers/gpu/drm/drm_panel.c
index 2ef988e..b6e6f5e 100644
--- a/drivers/gpu/drm/drm_panel.c
+++ b/drivers/gpu/drm/drm_panel.c
@@ -27,6 +27,8 @@
 #include <drm/drm_crtc.h>
 #include <drm/drm_panel.h>
 
+#include "backport-check.h"
+
 static DEFINE_MUTEX(panel_lock);
 static LIST_HEAD(panel_list);
 
diff --git a/drivers/gpu/drm/drm_pci.c b/drivers/gpu/drm/drm_pci.c
index 020cfd9..a5c0a91 100644
--- a/drivers/gpu/drm/drm_pci.c
+++ b/drivers/gpu/drm/drm_pci.c
@@ -28,6 +28,8 @@
 #include <linux/export.h>
 #include <drm/drmP.h>
 
+#include "backport-check.h"
+
 /**
  * drm_pci_alloc - Allocate a PCI consistent memory block, for DMA.
  * @dev: DRM device
diff --git a/drivers/gpu/drm/drm_plane_helper.c b/drivers/gpu/drm/drm_plane_helper.c
index 6d13314..ea66833 100644
--- a/drivers/gpu/drm/drm_plane_helper.c
+++ b/drivers/gpu/drm/drm_plane_helper.c
@@ -29,6 +29,8 @@
 #include <drm/drm_rect.h>
 #include <drm/drm_plane_helper.h>
 
+#include "backport-check.h"
+
 #define SUBPIXEL_MASK 0xffff
 
 /*
diff --git a/drivers/gpu/drm/drm_platform.c b/drivers/gpu/drm/drm_platform.c
index d5b76f1..0fc6935 100644
--- a/drivers/gpu/drm/drm_platform.c
+++ b/drivers/gpu/drm/drm_platform.c
@@ -28,6 +28,8 @@
 #include <linux/export.h>
 #include <drm/drmP.h>
 
+#include "backport-check.h"
+
 /*
  * Register.
  *
diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm/drm_prime.c
index 304ca8c..786fedb 100644
--- a/drivers/gpu/drm/drm_prime.c
+++ b/drivers/gpu/drm/drm_prime.c
@@ -30,6 +30,8 @@
 #include <linux/dma-buf.h>
 #include <drm/drmP.h>
 
+#include "backport-check.h"
+
 /*
  * DMA-BUF/GEM Object references and lifetime overview:
  *
diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c
index d22676b..5006cba 100644
--- a/drivers/gpu/drm/drm_probe_helper.c
+++ b/drivers/gpu/drm/drm_probe_helper.c
@@ -39,6 +39,8 @@
 #include <drm/drm_fb_helper.h>
 #include <drm/drm_edid.h>
 
+#include "backport-check.h"
+
 /**
  * DOC: output probing helper overview
  *
diff --git a/drivers/gpu/drm/drm_rect.c b/drivers/gpu/drm/drm_rect.c
index 7047ca0..4bab97d 100644
--- a/drivers/gpu/drm/drm_rect.c
+++ b/drivers/gpu/drm/drm_rect.c
@@ -27,6 +27,8 @@
 #include <drm/drmP.h>
 #include <drm/drm_rect.h>
 
+#include "backport-check.h"
+
 /**
  * drm_rect_intersect - intersect two rectangles
  * @r1: first rectangle
diff --git a/drivers/gpu/drm/drm_scatter.c b/drivers/gpu/drm/drm_scatter.c
index 1c78406..172c6fe 100644
--- a/drivers/gpu/drm/drm_scatter.c
+++ b/drivers/gpu/drm/drm_scatter.c
@@ -35,6 +35,8 @@
 #include <linux/slab.h>
 #include <drm/drmP.h>
 
+#include "backport-check.h"
+
 #define DEBUG_SCATTER 0
 
 static inline void *drm_vmalloc_dma(unsigned long size)
diff --git a/drivers/gpu/drm/drm_stub.c b/drivers/gpu/drm/drm_stub.c
index 14d1646..869295e 100644
--- a/drivers/gpu/drm/drm_stub.c
+++ b/drivers/gpu/drm/drm_stub.c
@@ -34,6 +34,12 @@
 #include <drm/drmP.h>
 #include <drm/drm_core.h>
 
+#ifndef BACKPORT_DRM_CORE_H
+#error "drm/drm_core.h not from package"
+#endif
+
+#include "backport-check.h"
+
 unsigned int drm_debug = 0;	/* 1 to enable debug output */
 EXPORT_SYMBOL(drm_debug);
 
diff --git a/drivers/gpu/drm/drm_sysfs.c b/drivers/gpu/drm/drm_sysfs.c
index 369b262..2f7b90a 100644
--- a/drivers/gpu/drm/drm_sysfs.c
+++ b/drivers/gpu/drm/drm_sysfs.c
@@ -22,6 +22,12 @@
 #include <drm/drm_core.h>
 #include <drm/drmP.h>
 
+#ifndef BACKPORT_DRM_CORE_H
+#error "drm/drm_core.h not from package"
+#endif
+
+#include "backport-check.h"
+
 #define to_drm_minor(d) dev_get_drvdata(d)
 #define to_drm_connector(d) dev_get_drvdata(d)
 
diff --git a/drivers/gpu/drm/drm_trace.h b/drivers/gpu/drm/drm_trace.h
index 27cc95f..cd0944e 100644
--- a/drivers/gpu/drm/drm_trace.h
+++ b/drivers/gpu/drm/drm_trace.h
@@ -1,6 +1,8 @@
 #if !defined(_DRM_TRACE_H_) || defined(TRACE_HEADER_MULTI_READ)
 #define _DRM_TRACE_H_
 
+#define BACKPORT__DRM_TRACE_H_
+
 #include <linux/stringify.h>
 #include <linux/types.h>
 #include <linux/tracepoint.h>
diff --git a/drivers/gpu/drm/drm_trace_points.c b/drivers/gpu/drm/drm_trace_points.c
index 3bbc4de..83a05d3 100644
--- a/drivers/gpu/drm/drm_trace_points.c
+++ b/drivers/gpu/drm/drm_trace_points.c
@@ -2,3 +2,5 @@
 
 #define CREATE_TRACE_POINTS
 #include "drm_trace.h"
+
+#include "backport-check.h"
diff --git a/drivers/gpu/drm/drm_usb.c b/drivers/gpu/drm/drm_usb.c
index f2fe94a..3d19a13 100644
--- a/drivers/gpu/drm/drm_usb.c
+++ b/drivers/gpu/drm/drm_usb.c
@@ -3,6 +3,8 @@
 #include <linux/usb.h>
 #include <linux/module.h>
 
+#include "backport-check.h"
+
 int drm_get_usb_dev(struct usb_interface *interface,
 		    const struct usb_device_id *id,
 		    struct drm_driver *driver)
diff --git a/drivers/gpu/drm/drm_vm.c b/drivers/gpu/drm/drm_vm.c
index 24e045c..168f11f 100644
--- a/drivers/gpu/drm/drm_vm.c
+++ b/drivers/gpu/drm/drm_vm.c
@@ -40,6 +40,8 @@
 #include <linux/slab.h>
 #endif
 
+#include "backport-check.h"
+
 static void drm_vm_open(struct vm_area_struct *vma);
 static void drm_vm_close(struct vm_area_struct *vma);
 
diff --git a/drivers/gpu/drm/drm_vma_manager.c b/drivers/gpu/drm/drm_vma_manager.c
index 63b4712..33b8afd 100644
--- a/drivers/gpu/drm/drm_vma_manager.c
+++ b/drivers/gpu/drm/drm_vma_manager.c
@@ -33,6 +33,8 @@
 #include <linux/spinlock.h>
 #include <linux/types.h>
 
+#include "backport-check.h"
+
 /**
  * DOC: vma offset manager
  *
diff --git a/drivers/gpu/drm/i915/dvo.h b/drivers/gpu/drm/i915/dvo.h
index 3121633..970f30f 100644
--- a/drivers/gpu/drm/i915/dvo.h
+++ b/drivers/gpu/drm/i915/dvo.h
@@ -23,6 +23,8 @@
 #ifndef _INTEL_DVO_H
 #define _INTEL_DVO_H
 
+#define BACKPORT__INTEL_DVO_H
+
 #include <linux/i2c.h>
 #include <drm/drmP.h>
 #include <drm/drm_crtc.h>
diff --git a/drivers/gpu/drm/i915/dvo_ch7017.c b/drivers/gpu/drm/i915/dvo_ch7017.c
index 86b27d1..47153d5 100644
--- a/drivers/gpu/drm/i915/dvo_ch7017.c
+++ b/drivers/gpu/drm/i915/dvo_ch7017.c
@@ -27,6 +27,8 @@
 
 #include "dvo.h"
 
+#include "backport-check.h"
+
 #define CH7017_TV_DISPLAY_MODE		0x00
 #define CH7017_FLICKER_FILTER		0x01
 #define CH7017_VIDEO_BANDWIDTH		0x02
diff --git a/drivers/gpu/drm/i915/dvo_ch7xxx.c b/drivers/gpu/drm/i915/dvo_ch7xxx.c
index 80449f4..cdc9f1e 100644
--- a/drivers/gpu/drm/i915/dvo_ch7xxx.c
+++ b/drivers/gpu/drm/i915/dvo_ch7xxx.c
@@ -28,6 +28,8 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 #include "dvo.h"
 
+#include "backport-check.h"
+
 #define CH7xxx_REG_VID		0x4a
 #define CH7xxx_REG_DID		0x4b
 
diff --git a/drivers/gpu/drm/i915/dvo_ivch.c b/drivers/gpu/drm/i915/dvo_ivch.c
index 0f2587f..bf202ae 100644
--- a/drivers/gpu/drm/i915/dvo_ivch.c
+++ b/drivers/gpu/drm/i915/dvo_ivch.c
@@ -27,6 +27,8 @@
 
 #include "dvo.h"
 
+#include "backport-check.h"
+
 /*
  * register definitions for the i82807aa.
  *
diff --git a/drivers/gpu/drm/i915/dvo_ns2501.c b/drivers/gpu/drm/i915/dvo_ns2501.c
index 74f2af7..dc833ca 100644
--- a/drivers/gpu/drm/i915/dvo_ns2501.c
+++ b/drivers/gpu/drm/i915/dvo_ns2501.c
@@ -30,6 +30,8 @@
 #include "i915_reg.h"
 #include "i915_drv.h"
 
+#include "backport-check.h"
+
 #define NS2501_VID 0x1305
 #define NS2501_DID 0x6726
 
diff --git a/drivers/gpu/drm/i915/dvo_sil164.c b/drivers/gpu/drm/i915/dvo_sil164.c
index fa01149..7812965 100644
--- a/drivers/gpu/drm/i915/dvo_sil164.c
+++ b/drivers/gpu/drm/i915/dvo_sil164.c
@@ -28,6 +28,8 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 #include "dvo.h"
 
+#include "backport-check.h"
+
 #define SIL164_VID 0x0001
 #define SIL164_DID 0x0006
 
diff --git a/drivers/gpu/drm/i915/dvo_tfp410.c b/drivers/gpu/drm/i915/dvo_tfp410.c
index 7853719..11c2085 100644
--- a/drivers/gpu/drm/i915/dvo_tfp410.c
+++ b/drivers/gpu/drm/i915/dvo_tfp410.c
@@ -27,6 +27,8 @@
 
 #include "dvo.h"
 
+#include "backport-check.h"
+
 /* register definitions according to the TFP410 data sheet */
 #define TFP410_VID		0x014C
 #define TFP410_DID		0x0410
diff --git a/drivers/gpu/drm/i915/i915_cmd_parser.c b/drivers/gpu/drm/i915/i915_cmd_parser.c
index 9d79543..04e578b 100644
--- a/drivers/gpu/drm/i915/i915_cmd_parser.c
+++ b/drivers/gpu/drm/i915/i915_cmd_parser.c
@@ -27,6 +27,8 @@
 
 #include "i915_drv.h"
 
+#include "backport-check.h"
+
 /**
  * DOC: batch buffer command parser
  *
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index b8c6892..9aaee68 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -40,6 +40,8 @@
 #include <drm/i915_drm.h>
 #include "i915_drv.h"
 
+#include "backport-check.h"
+
 enum {
 	ACTIVE_LIST,
 	INACTIVE_LIST,
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
index d443441..059d62a 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -48,6 +48,8 @@
 #include <linux/pm_runtime.h>
 #include <linux/oom.h>
 
+#include "backport-check.h"
+
 #define LP_RING(d) (&((struct drm_i915_private *)(d))->ring[RCS])
 
 #define BEGIN_LP_RING(n) \
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 651e65e..64fc7e7 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -39,6 +39,8 @@
 #include <linux/pm_runtime.h>
 #include <drm/drm_crtc_helper.h>
 
+#include "backport-check.h"
+
 static struct drm_driver driver;
 
 #define GEN_DEFAULT_PIPEOFFSETS \
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index d893e4d..cfabcff 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -38,6 +38,8 @@
 #include <linux/pci.h>
 #include <linux/dma-buf.h>
 
+#include "backport-check.h"
+
 static void i915_gem_object_flush_gtt_write_domain(struct drm_i915_gem_object *obj);
 static void i915_gem_object_flush_cpu_write_domain(struct drm_i915_gem_object *obj,
 						   bool force);
diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c
index a5ddf3b..f96e1cb 100644
--- a/drivers/gpu/drm/i915/i915_gem_context.c
+++ b/drivers/gpu/drm/i915/i915_gem_context.c
@@ -89,6 +89,8 @@
 #include <drm/i915_drm.h>
 #include "i915_drv.h"
 
+#include "backport-check.h"
+
 /* This is a HW constraint. The value below is the largest known requirement
  * I've seen in a spec to date, and that was a workaround for a non-shipping
  * part. It should be safe to decrease this, but it's more future proof as is.
diff --git a/drivers/gpu/drm/i915/i915_gem_debug.c b/drivers/gpu/drm/i915/i915_gem_debug.c
index f462d1b..196ce5c 100644
--- a/drivers/gpu/drm/i915/i915_gem_debug.c
+++ b/drivers/gpu/drm/i915/i915_gem_debug.c
@@ -29,6 +29,8 @@
 #include <drm/i915_drm.h>
 #include "i915_drv.h"
 
+#include "backport-check.h"
+
 #if WATCH_LISTS
 int
 i915_verify_lists(struct drm_device *dev)
diff --git a/drivers/gpu/drm/i915/i915_gem_dmabuf.c b/drivers/gpu/drm/i915/i915_gem_dmabuf.c
index 580aa42..83d3b5e 100644
--- a/drivers/gpu/drm/i915/i915_gem_dmabuf.c
+++ b/drivers/gpu/drm/i915/i915_gem_dmabuf.c
@@ -27,6 +27,8 @@
 #include "i915_drv.h"
 #include <linux/dma-buf.h>
 
+#include "backport-check.h"
+
 static struct drm_i915_gem_object *dma_buf_to_obj(struct dma_buf *buf)
 {
 	return to_intel_bo(buf->priv);
diff --git a/drivers/gpu/drm/i915/i915_gem_evict.c b/drivers/gpu/drm/i915/i915_gem_evict.c
index bbf4b12..d5b1c49 100644
--- a/drivers/gpu/drm/i915/i915_gem_evict.c
+++ b/drivers/gpu/drm/i915/i915_gem_evict.c
@@ -33,6 +33,8 @@
 #include "intel_drv.h"
 #include "i915_trace.h"
 
+#include "backport-check.h"
+
 static bool
 mark_free(struct i915_vma *vma, struct list_head *unwind)
 {
diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
index 3a30133..967dbfe 100644
--- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
@@ -33,6 +33,8 @@
 #include "intel_drv.h"
 #include <linux/dma_remapping.h>
 
+#include "backport-check.h"
+
 #define  __EXEC_OBJECT_HAS_PIN (1<<31)
 #define  __EXEC_OBJECT_HAS_FENCE (1<<30)
 #define  __EXEC_OBJECT_NEEDS_BIAS (1<<28)
diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
index 8b3cde7..dfb2fdb 100644
--- a/drivers/gpu/drm/i915/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
@@ -30,6 +30,8 @@
 #include "i915_trace.h"
 #include "intel_drv.h"
 
+#include "backport-check.h"
+
 static void bdw_setup_private_ppat(struct drm_i915_private *dev_priv);
 static void chv_setup_private_ppat(struct drm_i915_private *dev_priv);
 
diff --git a/drivers/gpu/drm/i915/i915_gem_render_state.c b/drivers/gpu/drm/i915/i915_gem_render_state.c
index 34894b5..af68d62 100644
--- a/drivers/gpu/drm/i915/i915_gem_render_state.c
+++ b/drivers/gpu/drm/i915/i915_gem_render_state.c
@@ -28,6 +28,8 @@
 #include "i915_drv.h"
 #include "intel_renderstate.h"
 
+#include "backport-check.h"
+
 struct i915_render_state {
 	struct drm_i915_gem_object *obj;
 	unsigned long ggtt_offset;
diff --git a/drivers/gpu/drm/i915/i915_gem_stolen.c b/drivers/gpu/drm/i915/i915_gem_stolen.c
index 7465ab0..a507e16 100644
--- a/drivers/gpu/drm/i915/i915_gem_stolen.c
+++ b/drivers/gpu/drm/i915/i915_gem_stolen.c
@@ -30,6 +30,8 @@
 #include <drm/i915_drm.h>
 #include "i915_drv.h"
 
+#include "backport-check.h"
+
 /*
  * The BIOS typically reserves some of the system's memory for the exclusive
  * use of the integrated graphics. This memory is no longer available for
diff --git a/drivers/gpu/drm/i915/i915_gem_tiling.c b/drivers/gpu/drm/i915/i915_gem_tiling.c
index cb150e8..872c341 100644
--- a/drivers/gpu/drm/i915/i915_gem_tiling.c
+++ b/drivers/gpu/drm/i915/i915_gem_tiling.c
@@ -31,6 +31,8 @@
 #include <drm/i915_drm.h>
 #include "i915_drv.h"
 
+#include "backport-check.h"
+
 /** @file i915_gem_tiling.c
  *
  * Support for managing tiling state of buffer objects.
diff --git a/drivers/gpu/drm/i915/i915_gem_userptr.c b/drivers/gpu/drm/i915/i915_gem_userptr.c
index 21ea928..5d9a801 100644
--- a/drivers/gpu/drm/i915/i915_gem_userptr.c
+++ b/drivers/gpu/drm/i915/i915_gem_userptr.c
@@ -32,6 +32,8 @@
 #include <linux/mempolicy.h>
 #include <linux/swap.h>
 
+#include "backport-check.h"
+
 #if defined(CONFIG_MMU_NOTIFIER)
 #include <linux/interval_tree.h>
 
diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c
index 66cf417..839ba42 100644
--- a/drivers/gpu/drm/i915/i915_gpu_error.c
+++ b/drivers/gpu/drm/i915/i915_gpu_error.c
@@ -30,6 +30,8 @@
 #include <generated/utsrelease.h>
 #include "i915_drv.h"
 
+#include "backport-check.h"
+
 static const char *yesno(int v)
 {
 	return v ? "yes" : "no";
diff --git a/drivers/gpu/drm/i915/i915_ioc32.c b/drivers/gpu/drm/i915/i915_ioc32.c
index 2e0613e..5ad8f55 100644
--- a/drivers/gpu/drm/i915/i915_ioc32.c
+++ b/drivers/gpu/drm/i915/i915_ioc32.c
@@ -35,6 +35,8 @@
 #include <drm/i915_drm.h>
 #include "i915_drv.h"
 
+#include "backport-check.h"
+
 typedef struct _drm_i915_batchbuffer32 {
 	int start;		/* agp offset */
 	int used;		/* nr bytes in use */
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index c05c84f..9abf75b 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -37,6 +37,8 @@
 #include "i915_trace.h"
 #include "intel_drv.h"
 
+#include "backport-check.h"
+
 static const u32 hpd_ibx[] = {
 	[HPD_CRT] = SDE_CRT_HOTPLUG,
 	[HPD_SDVO_B] = SDE_SDVOB_HOTPLUG,
diff --git a/drivers/gpu/drm/i915/i915_params.c b/drivers/gpu/drm/i915/i915_params.c
index d05a2af..553219d 100644
--- a/drivers/gpu/drm/i915/i915_params.c
+++ b/drivers/gpu/drm/i915/i915_params.c
@@ -24,6 +24,8 @@
 
 #include "i915_drv.h"
 
+#include "backport-check.h"
+
 struct i915_params i915 __read_mostly = {
 	.modeset = -1,
 	.panel_ignore_lid = 1,
diff --git a/drivers/gpu/drm/i915/i915_suspend.c b/drivers/gpu/drm/i915/i915_suspend.c
index 043123c..0765f3b 100644
--- a/drivers/gpu/drm/i915/i915_suspend.c
+++ b/drivers/gpu/drm/i915/i915_suspend.c
@@ -29,6 +29,8 @@
 #include "intel_drv.h"
 #include "i915_reg.h"
 
+#include "backport-check.h"
+
 static u8 i915_read_indexed(struct drm_device *dev, u16 index_port, u16 data_port, u8 reg)
 {
 	struct drm_i915_private *dev_priv = dev->dev_private;
diff --git a/drivers/gpu/drm/i915/i915_sysfs.c b/drivers/gpu/drm/i915/i915_sysfs.c
index 86ce39a..0997ef3 100644
--- a/drivers/gpu/drm/i915/i915_sysfs.c
+++ b/drivers/gpu/drm/i915/i915_sysfs.c
@@ -32,6 +32,8 @@
 #include "intel_drv.h"
 #include "i915_drv.h"
 
+#include "backport-check.h"
+
 #define dev_to_drm_minor(d) dev_get_drvdata((d))
 
 #ifdef CONFIG_PM
diff --git a/drivers/gpu/drm/i915/i915_trace_points.c b/drivers/gpu/drm/i915/i915_trace_points.c
index f1df2bd..e03a597 100644
--- a/drivers/gpu/drm/i915/i915_trace_points.c
+++ b/drivers/gpu/drm/i915/i915_trace_points.c
@@ -11,3 +11,5 @@
 #define CREATE_TRACE_POINTS
 #include "i915_trace.h"
 #endif
+
+#include "backport-check.h"
diff --git a/drivers/gpu/drm/i915/i915_ums.c b/drivers/gpu/drm/i915/i915_ums.c
index 480da59..2c7623d 100644
--- a/drivers/gpu/drm/i915/i915_ums.c
+++ b/drivers/gpu/drm/i915/i915_ums.c
@@ -31,6 +31,8 @@
 #include "intel_drv.h"
 #include "i915_reg.h"
 
+#include "backport-check.h"
+
 static bool i915_pipe_enabled(struct drm_device *dev, enum pipe pipe)
 {
 	struct drm_i915_private *dev_priv = dev->dev_private;
diff --git a/drivers/gpu/drm/i915/intel_acpi.c b/drivers/gpu/drm/i915/intel_acpi.c
index d96eee1..ff692db 100644
--- a/drivers/gpu/drm/i915/intel_acpi.c
+++ b/drivers/gpu/drm/i915/intel_acpi.c
@@ -9,6 +9,8 @@
 #include <drm/drmP.h>
 #include "i915_drv.h"
 
+#include "backport-check.h"
+
 #define INTEL_DSM_REVISION_ID 1 /* For Calpella anyway... */
 #define INTEL_DSM_FN_PLATFORM_MUX_INFO 1 /* No args */
 
diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c
index 827498e..a37d530 100644
--- a/drivers/gpu/drm/i915/intel_bios.c
+++ b/drivers/gpu/drm/i915/intel_bios.c
@@ -31,6 +31,8 @@
 #include "i915_drv.h"
 #include "intel_bios.h"
 
+#include "backport-check.h"
+
 #define	SLAVE_ADDR1	0x70
 #define	SLAVE_ADDR2	0x72
 
diff --git a/drivers/gpu/drm/i915/intel_crt.c b/drivers/gpu/drm/i915/intel_crt.c
index 5a045d3..e27206c 100644
--- a/drivers/gpu/drm/i915/intel_crt.c
+++ b/drivers/gpu/drm/i915/intel_crt.c
@@ -35,6 +35,8 @@
 #include <drm/i915_drm.h>
 #include "i915_drv.h"
 
+#include "backport-check.h"
+
 /* Here's the desired hotplug mode */
 #define ADPA_HOTPLUG_BITS (ADPA_CRT_HOTPLUG_PERIOD_128 |		\
 			   ADPA_CRT_HOTPLUG_WARMUP_10MS |		\
diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
index b17b9c7..7781262 100644
--- a/drivers/gpu/drm/i915/intel_ddi.c
+++ b/drivers/gpu/drm/i915/intel_ddi.c
@@ -28,6 +28,8 @@
 #include "i915_drv.h"
 #include "intel_drv.h"
 
+#include "backport-check.h"
+
 /* HDMI/DVI modes ignore everything but the last 2 items. So we share
  * them for both DP and FDI transports, allowing those ports to
  * automatically adapt to HDMI connections as well
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index f0be855..eaa244a 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -41,6 +41,8 @@
 #include <drm/drm_crtc_helper.h>
 #include <linux/dma_remapping.h>
 
+#include "backport-check.h"
+
 #define DIV_ROUND_CLOSEST_ULL(ll, d)	\
 	({ unsigned long long _tmp = (ll)+(d)/2; do_div(_tmp, d); _tmp; })
 
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 8a1a4fb..0d5ef74 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -38,6 +38,8 @@
 #include <drm/i915_drm.h>
 #include "i915_drv.h"
 
+#include "backport-check.h"
+
 #define DP_LINK_CHECK_TIMEOUT	(10 * 1000)
 
 struct dp_link_dpll {
diff --git a/drivers/gpu/drm/i915/intel_dsi.c b/drivers/gpu/drm/i915/intel_dsi.c
index 3fd0829..5d17d6a 100644
--- a/drivers/gpu/drm/i915/intel_dsi.c
+++ b/drivers/gpu/drm/i915/intel_dsi.c
@@ -33,6 +33,8 @@
 #include "intel_dsi.h"
 #include "intel_dsi_cmd.h"
 
+#include "backport-check.h"
+
 /* the sub-encoders aka panel drivers */
 static const struct intel_dsi_device intel_dsi_devices[] = {
 	{
diff --git a/drivers/gpu/drm/i915/intel_dsi_cmd.c b/drivers/gpu/drm/i915/intel_dsi_cmd.c
index 933c863..7007240 100644
--- a/drivers/gpu/drm/i915/intel_dsi_cmd.c
+++ b/drivers/gpu/drm/i915/intel_dsi_cmd.c
@@ -32,6 +32,8 @@
 #include "intel_dsi.h"
 #include "intel_dsi_cmd.h"
 
+#include "backport-check.h"
+
 /*
  * XXX: MIPI_DATA_ADDRESS, MIPI_DATA_LENGTH, MIPI_COMMAND_LENGTH, and
  * MIPI_COMMAND_ADDRESS registers.
diff --git a/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c b/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c
index 21a0d34..cc10b11 100644
--- a/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c
+++ b/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c
@@ -37,6 +37,8 @@
 #include "intel_dsi.h"
 #include "intel_dsi_cmd.h"
 
+#include "backport-check.h"
+
 #define MIPI_TRANSFER_MODE_SHIFT	0
 #define MIPI_VIRTUAL_CHANNEL_SHIFT	1
 #define MIPI_PORT_SHIFT			3
diff --git a/drivers/gpu/drm/i915/intel_dsi_pll.c b/drivers/gpu/drm/i915/intel_dsi_pll.c
index ba79ec1..8edff2a 100644
--- a/drivers/gpu/drm/i915/intel_dsi_pll.c
+++ b/drivers/gpu/drm/i915/intel_dsi_pll.c
@@ -30,6 +30,8 @@
 #include "i915_drv.h"
 #include "intel_dsi.h"
 
+#include "backport-check.h"
+
 #define DSI_HSS_PACKET_SIZE		4
 #define DSI_HSE_PACKET_SIZE		4
 #define DSI_HSA_PACKET_EXTRA_SIZE	6
diff --git a/drivers/gpu/drm/i915/intel_dvo.c b/drivers/gpu/drm/i915/intel_dvo.c
index a3631c0..f5f63dc 100644
--- a/drivers/gpu/drm/i915/intel_dvo.c
+++ b/drivers/gpu/drm/i915/intel_dvo.c
@@ -33,6 +33,8 @@
 #include "i915_drv.h"
 #include "dvo.h"
 
+#include "backport-check.h"
+
 #define SIL164_ADDR	0x38
 #define CH7xxx_ADDR	0x76
 #define TFP410_ADDR	0x38
diff --git a/drivers/gpu/drm/i915/intel_fbdev.c b/drivers/gpu/drm/i915/intel_fbdev.c
index 088fe93..bd1d1e9 100644
--- a/drivers/gpu/drm/i915/intel_fbdev.c
+++ b/drivers/gpu/drm/i915/intel_fbdev.c
@@ -43,6 +43,8 @@
 #include <drm/i915_drm.h>
 #include "i915_drv.h"
 
+#include "backport-check.h"
+
 static struct fb_ops intelfb_ops = {
 	.owner = THIS_MODULE,
 	.fb_check_var = drm_fb_helper_check_var,
diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
index eee2bbe..e956caf 100644
--- a/drivers/gpu/drm/i915/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/intel_hdmi.c
@@ -37,6 +37,8 @@
 #include <drm/i915_drm.h>
 #include "i915_drv.h"
 
+#include "backport-check.h"
+
 static struct drm_device *intel_hdmi_to_dev(struct intel_hdmi *intel_hdmi)
 {
 	return hdmi_to_dig_port(intel_hdmi)->base.base.dev;
diff --git a/drivers/gpu/drm/i915/intel_i2c.c b/drivers/gpu/drm/i915/intel_i2c.c
index d33b61d..ba42fa4 100644
--- a/drivers/gpu/drm/i915/intel_i2c.c
+++ b/drivers/gpu/drm/i915/intel_i2c.c
@@ -34,6 +34,8 @@
 #include <drm/i915_drm.h>
 #include "i915_drv.h"
 
+#include "backport-check.h"
+
 enum disp_clk {
 	CDCLK,
 	CZCLK
diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c
index 5e5a72f..1bbd83e 100644
--- a/drivers/gpu/drm/i915/intel_lvds.c
+++ b/drivers/gpu/drm/i915/intel_lvds.c
@@ -39,6 +39,8 @@
 #include "i915_drv.h"
 #include <linux/acpi.h>
 
+#include "backport-check.h"
+
 /* Private structure for the integrated LVDS support */
 struct intel_lvds_connector {
 	struct intel_connector base;
diff --git a/drivers/gpu/drm/i915/intel_modes.c b/drivers/gpu/drm/i915/intel_modes.c
index 0e860f3..544a385 100644
--- a/drivers/gpu/drm/i915/intel_modes.c
+++ b/drivers/gpu/drm/i915/intel_modes.c
@@ -31,6 +31,8 @@
 #include "intel_drv.h"
 #include "i915_drv.h"
 
+#include "backport-check.h"
+
 /**
  * intel_connector_update_modes - update connector from edid
  * @connector: DRM connector device to use
diff --git a/drivers/gpu/drm/i915/intel_opregion.c b/drivers/gpu/drm/i915/intel_opregion.c
index 4f6b539..775f741 100644
--- a/drivers/gpu/drm/i915/intel_opregion.c
+++ b/drivers/gpu/drm/i915/intel_opregion.c
@@ -35,6 +35,8 @@
 #include "i915_drv.h"
 #include "intel_drv.h"
 
+#include "backport-check.h"
+
 #define PCI_ASLE		0xe4
 #define PCI_ASLS		0xfc
 #define PCI_SWSCI		0xe8
diff --git a/drivers/gpu/drm/i915/intel_overlay.c b/drivers/gpu/drm/i915/intel_overlay.c
index daa1189..66f8fb1 100644
--- a/drivers/gpu/drm/i915/intel_overlay.c
+++ b/drivers/gpu/drm/i915/intel_overlay.c
@@ -31,6 +31,8 @@
 #include "i915_reg.h"
 #include "intel_drv.h"
 
+#include "backport-check.h"
+
 /* Limits for overlay size. According to intel doc, the real limits are:
  * Y width: 4095, UV width (planar): 2047, Y height: 2047,
  * UV width (planar): * 1023. But the xorg thinks 2048 for height and width. Use
diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c
index 12b02fe..1ab7916 100644
--- a/drivers/gpu/drm/i915/intel_panel.c
+++ b/drivers/gpu/drm/i915/intel_panel.c
@@ -33,6 +33,8 @@
 #include <linux/moduleparam.h>
 #include "intel_drv.h"
 
+#include "backport-check.h"
+
 void
 intel_fixed_panel_mode(const struct drm_display_mode *fixed_mode,
 		       struct drm_display_mode *adjusted_mode)
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index ee72807..43a18e3 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -34,6 +34,8 @@
 #include <drm/i915_powerwell.h>
 #include <linux/pm_runtime.h>
 
+#include "backport-check.h"
+
 /**
  * RC6 is a special power stage which allows the GPU to enter an very
  * low-voltage mode when idle, using down to 0V while at this stage.  This
diff --git a/drivers/gpu/drm/i915/intel_renderstate_gen6.c b/drivers/gpu/drm/i915/intel_renderstate_gen6.c
index 740538a..ca50efb 100644
--- a/drivers/gpu/drm/i915/intel_renderstate_gen6.c
+++ b/drivers/gpu/drm/i915/intel_renderstate_gen6.c
@@ -1,5 +1,7 @@
 #include "intel_renderstate.h"
 
+#include "backport-check.h"
+
 static const u32 gen6_null_state_relocs[] = {
 	0x00000020,
 	0x00000024,
diff --git a/drivers/gpu/drm/i915/intel_renderstate_gen7.c b/drivers/gpu/drm/i915/intel_renderstate_gen7.c
index 6fa7ff2..d1e95c7 100644
--- a/drivers/gpu/drm/i915/intel_renderstate_gen7.c
+++ b/drivers/gpu/drm/i915/intel_renderstate_gen7.c
@@ -1,5 +1,7 @@
 #include "intel_renderstate.h"
 
+#include "backport-check.h"
+
 static const u32 gen7_null_state_relocs[] = {
 	0x0000000c,
 	0x00000010,
diff --git a/drivers/gpu/drm/i915/intel_renderstate_gen8.c b/drivers/gpu/drm/i915/intel_renderstate_gen8.c
index 5c87561..175a18f 100644
--- a/drivers/gpu/drm/i915/intel_renderstate_gen8.c
+++ b/drivers/gpu/drm/i915/intel_renderstate_gen8.c
@@ -1,5 +1,7 @@
 #include "intel_renderstate.h"
 
+#include "backport-check.h"
+
 static const u32 gen8_null_state_relocs[] = {
 	0x00000048,
 	0x00000050,
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
index 279488a..1421923 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.c
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
@@ -33,6 +33,8 @@
 #include "i915_trace.h"
 #include "intel_drv.h"
 
+#include "backport-check.h"
+
 /* Early gen2 devices have a cacheline of just 32 bytes, using 64 is overkill,
  * but keeps the logic simple. Indeed, the whole purpose of this macro is just
  * to give some inclination as to some of the magic values used in the various
diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c
index 20375cc..66e85a8 100644
--- a/drivers/gpu/drm/i915/intel_sdvo.c
+++ b/drivers/gpu/drm/i915/intel_sdvo.c
@@ -37,6 +37,8 @@
 #include "i915_drv.h"
 #include "intel_sdvo_regs.h"
 
+#include "backport-check.h"
+
 #define SDVO_TMDS_MASK (SDVO_OUTPUT_TMDS0 | SDVO_OUTPUT_TMDS1)
 #define SDVO_RGB_MASK  (SDVO_OUTPUT_RGB0 | SDVO_OUTPUT_RGB1)
 #define SDVO_LVDS_MASK (SDVO_OUTPUT_LVDS0 | SDVO_OUTPUT_LVDS1)
diff --git a/drivers/gpu/drm/i915/intel_sideband.c b/drivers/gpu/drm/i915/intel_sideband.c
index 01d841e..7751dc3 100644
--- a/drivers/gpu/drm/i915/intel_sideband.c
+++ b/drivers/gpu/drm/i915/intel_sideband.c
@@ -25,6 +25,8 @@
 #include "i915_drv.h"
 #include "intel_drv.h"
 
+#include "backport-check.h"
+
 /*
  * IOSF sideband, see VLV2_SidebandMsg_HAS.docx and
  * VLV_VLV2_PUNIT_HAS_0.8.docx
diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c
index 9a17b4e..6b9d445 100644
--- a/drivers/gpu/drm/i915/intel_sprite.c
+++ b/drivers/gpu/drm/i915/intel_sprite.c
@@ -37,6 +37,8 @@
 #include <drm/i915_drm.h>
 #include "i915_drv.h"
 
+#include "backport-check.h"
+
 static int usecs_to_scanlines(const struct drm_display_mode *mode, int usecs)
 {
 	/* paranoia */
diff --git a/drivers/gpu/drm/i915/intel_tv.c b/drivers/gpu/drm/i915/intel_tv.c
index 67c6c9a..e3c87ef 100644
--- a/drivers/gpu/drm/i915/intel_tv.c
+++ b/drivers/gpu/drm/i915/intel_tv.c
@@ -37,6 +37,8 @@
 #include <drm/i915_drm.h>
 #include "i915_drv.h"
 
+#include "backport-check.h"
+
 enum tv_margin {
 	TV_MARGIN_LEFT, TV_MARGIN_TOP,
 	TV_MARGIN_RIGHT, TV_MARGIN_BOTTOM
diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c
index 4f6fef7..8811120 100644
--- a/drivers/gpu/drm/i915/intel_uncore.c
+++ b/drivers/gpu/drm/i915/intel_uncore.c
@@ -24,6 +24,8 @@
 #include "i915_drv.h"
 #include "intel_drv.h"
 
+#include "backport-check.h"
+
 #define FORCEWAKE_ACK_TIMEOUT_MS 2
 
 #define __raw_i915_read8(dev_priv__, reg__) readb((dev_priv__)->regs + (reg__))
diff --git a/drivers/platform/x86/intel_ips.c b/drivers/platform/x86/intel_ips.c
index 18dcb58..189b644 100644
--- a/drivers/platform/x86/intel_ips.c
+++ b/drivers/platform/x86/intel_ips.c
@@ -80,6 +80,8 @@
 
 #include <asm-generic/io-64-nonatomic-lo-hi.h>
 
+#include "backport-check.h"
+
 #define PCI_DEVICE_ID_INTEL_THERMAL_SENSOR 0x3b32
 
 /*
diff --git a/include/backport-check.h b/include/backport-check.h
new file mode 100644
index 0000000..b35eef2
--- /dev/null
+++ b/include/backport-check.h
@@ -0,0 +1,205 @@
+#pragma once
+
+#ifdef _DRM_P_H_
+#ifndef BACKPORT__DRM_P_H_
+#error "drm/drmP.h not from package"
+#endif
+#endif
+
+#ifdef _DRM_AGPSUPPORT_H_
+#ifndef BACKPORT__DRM_AGPSUPPORT_H_
+#error "drm/drm_agpsupport.h not from package"
+#endif
+#endif
+
+#ifdef _DRM_BUFFER_H_
+#ifndef BACKPORT__DRM_BUFFER_H_
+#error "drm/drm_buffer.h not from package"
+#endif
+#endif
+
+#ifdef __DRM_CRTC_H__
+#ifndef BACKPORT___DRM_CRTC_H__
+#error "drm/drm_crtc.h not from package"
+#endif
+#endif
+
+#ifdef __DRM_CRTC_HELPER_H__
+#ifndef BACKPORT___DRM_CRTC_HELPER_H__
+#error "drm/drm_crtc_helper.h not from package"
+#endif
+#endif
+
+#ifdef _DRM_DP_HELPER_H
+#ifndef BACKPORT__DRM_DP_HELPER_H_
+#error "drm/drm_dp_helper.h not from package"
+#endif
+#endif
+
+#ifdef __DRM_EDID_H__
+#ifndef BACKPORT___DRM_EDID_H__
+#error "drm/drm_edid.h not from package"
+#endif
+#endif
+
+#ifdef __DRM_ENCODER_SLAVE_H__
+#ifndef BACKPORT___DRM_ENCODER_SLAVE_H__
+#error "drm/drm_encoder_slave.h not from package"
+#endif
+#endif
+
+#ifdef __DRM_FB_CMA_HELPER_H__
+#ifndef BACKPORT___DRM_FB_CMA_HELPER_H__
+#error "drm/drm_fb_cma_helper.h not from package"
+#endif
+#endif
+
+#ifdef DRM_FB_HELPER_H
+#ifndef BACKPORT_DRM_FB_HELPER_H
+#error "drm/drm_fb_helper.h not from package"
+#endif
+#endif
+
+#ifdef DRM_FLIP_WORK_H
+#ifndef BACKPORT_DRM_FLIP_WORK_H
+#error "drm/drm_flip_work.h not from package"
+#endif
+#endif
+
+#ifdef __DRM_GEM_CMA_HELPER_H__
+#ifndef BACKPORT___DRM_GEM_CMA_HELPER_H__
+#error "drm/drm_gem_cma_helper.h not from package"
+#endif
+#endif
+
+#ifdef _DRM_GLOBAL_H_
+#ifndef BACKPORT__DRM_GLOBAL_H_
+#error "drm/drm_global.h not from package"
+#endif
+#endif
+
+#ifdef DRM_HASHTAB_H
+#ifndef BACKPORT_DRM_HASHTAB_H
+#error "drm/drm_hashtab.h not from package"
+#endif
+#endif
+
+#ifdef _DRM_MEM_UTIL_H_
+#ifndef BACKPORT__DRM_MEM_UTIL_H_
+#error "drm/drm_mem_util.h not from package"
+#endif
+#endif
+
+#ifdef __DRM_MIPI_DSI_H__
+#ifndef BACKPORT___DRM_MIPI_DSI_H__
+#error "drm/drm_mipi_dsi.h not from package"
+#endif
+#endif
+
+#ifdef _DRM_MM_H_
+#ifndef BACKPORT__DRM_MM_H_
+#error "drm/drm_mm.h not from package"
+#endif
+#endif
+
+#ifdef DRM_MODESET_LOCK_H_
+#ifndef BACKPORT_DRM_MODESET_LOCK_H_
+#error "drm/drm_modeset_lock.h not from package"
+#endif
+#endif
+
+#ifdef __DRM_MODES_H__
+#ifndef BACKPORT___DRM_MODES_H__
+#error "drm/drm_modes.h not from package"
+#endif
+#endif
+
+#ifdef __DRM_PANEL_H__
+#ifndef BACKPORT___DRM_PANEL_H__
+#error "drm/drm_panel.h not from package"
+#endif
+#endif
+
+#ifdef DRM_PLANE_HELPER_H
+#ifndef BACKPORT_DRM_PLANE_HELPER_H
+#error "drm/drm_plane_helper.h not from package"
+#endif
+#endif
+
+#ifdef DRM_RECT_H
+#ifndef BACKPORT_DRM_RECT_H
+#error "drm/drm_rect.h not from package"
+#endif
+#endif
+
+#ifdef _DRM_SYSFS_H_
+#ifndef BACKPORT__DRM_SYSFS_H_
+#error "drm/drm_sysfs.h not from package"
+#endif
+#endif
+
+#ifdef _DRM_TRACE_H_
+#ifndef BACKPORT__DRM_TRACE_H_
+#error "drm/drm_trace.h not from package"
+#endif
+#endif
+
+#ifdef DRM_USB_H
+#ifndef BACKPORT_DRM_USB_H
+#error "drm/drm_usb.h not from package"
+#endif
+#endif
+
+#ifdef __DRM_VMA_MANAGER_H__
+#ifndef BACKPORT___DRM_VMA_MANAGER_H__
+#error "drm/drm_vm_manager.h not from package"
+#endif
+#endif
+
+#ifdef _I915_DRM_H_
+#ifndef BACKPORT__I915_DRM_H_
+#error "drm/i915_drm.h not from package"
+#endif
+#endif
+
+#ifdef _I915_PCIIDS_H
+#ifndef BACKPORT__I915_PCIIDS_H
+#error "drm/i915_pciids.h not from package"
+#endif
+#endif
+
+#ifdef _I915_POWERWELL_H_
+#ifndef BACKPORT__I915_POWERWELL_H_
+#error "drm/i915_powerwell.h not from package"
+#endif
+#endif
+
+#ifdef _DRM_H_
+#ifndef BACKPORT__DRM_H_
+#error "uapi/drm/drm.h not from package"
+#endif
+#endif
+
+#ifdef DRM_FOURCC_H
+#ifndef BACKPORT_DRM_FOURCC_H
+#error "uapi/drm/drm_fourcc.h not from package"
+#endif
+#endif
+
+#ifdef _DRM_MODE_H
+#ifndef BACKPORT__DRM_MODE_H
+#error "uapi/drm/drm_mode.h not from package"
+#endif
+#endif
+
+#ifdef _DRM_SAREA_H_
+#ifndef BACKPORT__DRM_SAREA_H_
+#error "uapi/drm/drm_sarea.h not from package"
+#endif
+#endif
+
+#ifdef _UAPI_I915_DRM_H_
+#ifndef BACKPORT__UAPI_I915_DRM_H_
+#error "uapi/drm/i915_drm.h not from package"
+#endif
+#endif
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index 8af71a8..04c643b 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -35,6 +35,8 @@
 #ifndef _DRM_P_H_
 #define _DRM_P_H_
 
+#define BACKPORT__DRM_P_H_
+
 #ifdef __KERNEL__
 #ifdef __alpha__
 /* add include of current.h so that "current" is defined
@@ -88,6 +90,10 @@ struct videomode;
 #include <drm/drm_hashtab.h>
 #include <drm/drm_mm.h>
 
+#ifndef BACKPORT_DRM_OS_LINUX_H
+#error "drm/drm_os_linux.h not from package"
+#endif
+
 /*
  * 4 debug categories are defined:
  *
diff --git a/include/drm/drm_agpsupport.h b/include/drm/drm_agpsupport.h
index 86a0218..242d6b3 100644
--- a/include/drm/drm_agpsupport.h
+++ b/include/drm/drm_agpsupport.h
@@ -1,6 +1,8 @@
 #ifndef _DRM_AGPSUPPORT_H_
 #define _DRM_AGPSUPPORT_H_
 
+#define BACKPORT__DRM_AGPSUPPORT_H_
+
 #include <linux/kernel.h>
 #include <linux/mm.h>
 #include <linux/mutex.h>
diff --git a/include/drm/drm_buffer.h b/include/drm/drm_buffer.h
index c80d3a3..0a48641 100644
--- a/include/drm/drm_buffer.h
+++ b/include/drm/drm_buffer.h
@@ -35,6 +35,8 @@
 #ifndef _DRM_BUFFER_H_
 #define _DRM_BUFFER_H_
 
+#define BACKPORT__DRM_BUFFER_H_
+
 #include <drm/drmP.h>
 
 struct drm_buffer {
diff --git a/include/drm/drm_core.h b/include/drm/drm_core.h
index 4e75238..0889f2a 100644
--- a/include/drm/drm_core.h
+++ b/include/drm/drm_core.h
@@ -32,3 +32,5 @@
 #define CORE_MAJOR	1
 #define CORE_MINOR	1
 #define CORE_PATCHLEVEL 0
+
+#define BACKPORT_DRM_CORE_H
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index 251b75e..5b80f5a 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -25,6 +25,8 @@
 #ifndef __DRM_CRTC_H__
 #define __DRM_CRTC_H__
 
+#define BACKPORT___DRM_CRTC_H__
+
 #include <linux/i2c.h>
 #include <linux/spinlock.h>
 #include <linux/types.h>
diff --git a/include/drm/drm_crtc_helper.h b/include/drm/drm_crtc_helper.h
index a3d75fe..52fc79e 100644
--- a/include/drm/drm_crtc_helper.h
+++ b/include/drm/drm_crtc_helper.h
@@ -33,6 +33,8 @@
 #ifndef __DRM_CRTC_HELPER_H__
 #define __DRM_CRTC_HELPER_H__
 
+#define BACKPORT___DRM_CRTC_HELPER_H__
+
 #include <linux/spinlock.h>
 #include <linux/types.h>
 #include <linux/idr.h>
diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h
index a21568b..7fb1cd4 100644
--- a/include/drm/drm_dp_helper.h
+++ b/include/drm/drm_dp_helper.h
@@ -23,6 +23,8 @@
 #ifndef _DRM_DP_HELPER_H_
 #define _DRM_DP_HELPER_H_
 
+#define BACKPORT_DRM_DP_HELPER_H_
+
 #include <linux/types.h>
 #include <linux/i2c.h>
 #include <linux/delay.h>
diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h
index b96031d..3a283e6 100644
--- a/include/drm/drm_edid.h
+++ b/include/drm/drm_edid.h
@@ -23,6 +23,8 @@
 #ifndef __DRM_EDID_H__
 #define __DRM_EDID_H__
 
+#define BACKPORT___DRM_EDID_H__
+
 #include <linux/types.h>
 
 #define EDID_LENGTH 128
diff --git a/include/drm/drm_encoder_slave.h b/include/drm/drm_encoder_slave.h
index 8b9cc36..e0c908f 100644
--- a/include/drm/drm_encoder_slave.h
+++ b/include/drm/drm_encoder_slave.h
@@ -27,6 +27,8 @@
 #ifndef __DRM_ENCODER_SLAVE_H__
 #define __DRM_ENCODER_SLAVE_H__
 
+#define BACKPORT___DRM_ENCODER_SLAVE_H__
+
 #include <drm/drmP.h>
 #include <drm/drm_crtc.h>
 
diff --git a/include/drm/drm_fb_cma_helper.h b/include/drm/drm_fb_cma_helper.h
index c54cf3d..dcc2919 100644
--- a/include/drm/drm_fb_cma_helper.h
+++ b/include/drm/drm_fb_cma_helper.h
@@ -1,6 +1,8 @@
 #ifndef __DRM_FB_CMA_HELPER_H__
 #define __DRM_FB_CMA_HELPER_H__
 
+#define BACKPORT___DRM_FB_CMA_HELPER_H__
+
 struct drm_fbdev_cma;
 struct drm_gem_cma_object;
 
diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
index 7997246..d964e5c 100644
--- a/include/drm/drm_fb_helper.h
+++ b/include/drm/drm_fb_helper.h
@@ -30,6 +30,8 @@
 #ifndef DRM_FB_HELPER_H
 #define DRM_FB_HELPER_H
 
+#define BACKPORT_DRM_FB_HELPER_H
+
 struct drm_fb_helper;
 
 #include <linux/kgdb.h>
diff --git a/include/drm/drm_flip_work.h b/include/drm/drm_flip_work.h
index 9eed34d..c85109c 100644
--- a/include/drm/drm_flip_work.h
+++ b/include/drm/drm_flip_work.h
@@ -24,6 +24,8 @@
 #ifndef DRM_FLIP_WORK_H
 #define DRM_FLIP_WORK_H
 
+#define BACKPORT_DRM_FLIP_WORK_H
+
 #include <linux/kfifo.h>
 #include <linux/workqueue.h>
 
diff --git a/include/drm/drm_gem_cma_helper.h b/include/drm/drm_gem_cma_helper.h
index 2a3cea9..0b0d413 100644
--- a/include/drm/drm_gem_cma_helper.h
+++ b/include/drm/drm_gem_cma_helper.h
@@ -1,6 +1,8 @@
 #ifndef __DRM_GEM_CMA_HELPER_H__
 #define __DRM_GEM_CMA_HELPER_H__
 
+#define BACKPORT___DRM_GEM_CMA_HELPER_H__
+
 #include <drm/drmP.h>
 
 struct drm_gem_cma_object {
diff --git a/include/drm/drm_global.h b/include/drm/drm_global.h
index a06805e..e670f5c 100644
--- a/include/drm/drm_global.h
+++ b/include/drm/drm_global.h
@@ -30,6 +30,9 @@
 
 #ifndef _DRM_GLOBAL_H_
 #define _DRM_GLOBAL_H_
+
+#define BACKPORT__DRM_GLOBAL_H_
+
 enum drm_global_types {
 	DRM_GLOBAL_TTM_MEM = 0,
 	DRM_GLOBAL_TTM_BO,
diff --git a/include/drm/drm_hashtab.h b/include/drm/drm_hashtab.h
index fce2ef3..3756d93 100644
--- a/include/drm/drm_hashtab.h
+++ b/include/drm/drm_hashtab.h
@@ -35,6 +35,8 @@
 #ifndef DRM_HASHTAB_H
 #define DRM_HASHTAB_H
 
+#define BACKPORT_DRM_HASHTAB_H
+
 #include <linux/list.h>
 
 #define drm_hash_entry(_ptr, _type, _member) container_of(_ptr, _type, _member)
diff --git a/include/drm/drm_mem_util.h b/include/drm/drm_mem_util.h
index 19a2404..075df3b 100644
--- a/include/drm/drm_mem_util.h
+++ b/include/drm/drm_mem_util.h
@@ -27,6 +27,8 @@
 #ifndef _DRM_MEM_UTIL_H_
 #define _DRM_MEM_UTIL_H_
 
+#define BACKPORT__DRM_MEM_UTIL_H_
+
 #include <linux/vmalloc.h>
 
 static __inline__ void *drm_calloc_large(size_t nmemb, size_t size)
diff --git a/include/drm/drm_mipi_dsi.h b/include/drm/drm_mipi_dsi.h
index 944f33f..5195c11 100644
--- a/include/drm/drm_mipi_dsi.h
+++ b/include/drm/drm_mipi_dsi.h
@@ -12,6 +12,8 @@
 #ifndef __DRM_MIPI_DSI_H__
 #define __DRM_MIPI_DSI_H__
 
+#define BACKPORT___DRM_MIPI_DSI_H__
+
 #include <linux/device.h>
 
 struct mipi_dsi_host;
diff --git a/include/drm/drm_mm.h b/include/drm/drm_mm.h
index a24addf..62c43ac 100644
--- a/include/drm/drm_mm.h
+++ b/include/drm/drm_mm.h
@@ -33,6 +33,8 @@
 #ifndef _DRM_MM_H_
 #define _DRM_MM_H_
 
+#define BACKPORT__DRM_MM_H_
+
 /*
  * Generic range manager structs
  */
diff --git a/include/drm/drm_modes.h b/include/drm/drm_modes.h
index 91d0582..6c62d21 100644
--- a/include/drm/drm_modes.h
+++ b/include/drm/drm_modes.h
@@ -27,6 +27,8 @@
 #ifndef __DRM_MODES_H__
 #define __DRM_MODES_H__
 
+#define BACKPORT___DRM_MODES_H__
+
 /*
  * Note on terminology:  here, for brevity and convenience, we refer to connector
  * control chips as 'CRTCs'.  They can control any type of connector, VGA, LVDS,
diff --git a/include/drm/drm_modeset_lock.h b/include/drm/drm_modeset_lock.h
index 402aa7a..57eb2fc 100644
--- a/include/drm/drm_modeset_lock.h
+++ b/include/drm/drm_modeset_lock.h
@@ -24,6 +24,8 @@
 #ifndef DRM_MODESET_LOCK_H_
 #define DRM_MODESET_LOCK_H_
 
+#define BACKPORT_DRM_MODESET_LOCK_H_
+
 #include <linux/ww_mutex.h>
 
 struct drm_modeset_lock;
diff --git a/include/drm/drm_os_linux.h b/include/drm/drm_os_linux.h
index 86ab99b..12377cd 100644
--- a/include/drm/drm_os_linux.h
+++ b/include/drm/drm_os_linux.h
@@ -3,6 +3,8 @@
  * OS abstraction macros.
  */
 
+#define BACKPORT_DRM_OS_LINUX_H
+
 #include <linux/interrupt.h>	/* For task queue support */
 #include <linux/delay.h>
 
diff --git a/include/drm/drm_panel.h b/include/drm/drm_panel.h
index c2ab77a..b38f86b 100644
--- a/include/drm/drm_panel.h
+++ b/include/drm/drm_panel.h
@@ -24,6 +24,8 @@
 #ifndef __DRM_PANEL_H__
 #define __DRM_PANEL_H__
 
+#define BACKPORT___DRM_PANEL_H__
+
 #include <linux/list.h>
 
 struct drm_connector;
diff --git a/include/drm/drm_plane_helper.h b/include/drm/drm_plane_helper.h
index 52e6870..c796954 100644
--- a/include/drm/drm_plane_helper.h
+++ b/include/drm/drm_plane_helper.h
@@ -24,6 +24,8 @@
 #ifndef DRM_PLANE_HELPER_H
 #define DRM_PLANE_HELPER_H
 
+#define BACKPORT_DRM_PLANE_HELPER_H
+
 #include <drm/drm_rect.h>
 
 /*
diff --git a/include/drm/drm_rect.h b/include/drm/drm_rect.h
index d128629..88577b8 100644
--- a/include/drm/drm_rect.h
+++ b/include/drm/drm_rect.h
@@ -24,6 +24,8 @@
 #ifndef DRM_RECT_H
 #define DRM_RECT_H
 
+#define BACKPORT_DRM_RECT_H
+
 /**
  * DOC: rect utils
  *
diff --git a/include/drm/drm_sysfs.h b/include/drm/drm_sysfs.h
index 1d8e033..7352fa3 100644
--- a/include/drm/drm_sysfs.h
+++ b/include/drm/drm_sysfs.h
@@ -1,6 +1,8 @@
 #ifndef _DRM_SYSFS_H_
 #define _DRM_SYSFS_H_
 
+#define BACKPORT__DRM_SYSFS_H_
+
 /**
  * This minimalistic include file is intended for users (read TTM) that
  * don't want to include the full drmP.h file.
diff --git a/include/drm/drm_usb.h b/include/drm/drm_usb.h
index 33506c1..76d2f8e 100644
--- a/include/drm/drm_usb.h
+++ b/include/drm/drm_usb.h
@@ -1,6 +1,8 @@
 #ifndef DRM_USB_H
 #define DRM_USB_H
 
+#define BACKPORT_DRM_USB_H
+
 #include <drmP.h>
 
 #include <linux/usb.h>
diff --git a/include/drm/drm_vma_manager.h b/include/drm/drm_vma_manager.h
index 8cd402c..6e1343d 100644
--- a/include/drm/drm_vma_manager.h
+++ b/include/drm/drm_vma_manager.h
@@ -1,6 +1,8 @@
 #ifndef __DRM_VMA_MANAGER_H__
 #define __DRM_VMA_MANAGER_H__
 
+#define BACKPORT___DRM_VMA_MANAGER_H__
+
 /*
  * Copyright (c) 2013 David Herrmann <dh.herrmann@gmail.com>
  *
diff --git a/include/drm/i915_drm.h b/include/drm/i915_drm.h
index 595f85c..2e01da7 100644
--- a/include/drm/i915_drm.h
+++ b/include/drm/i915_drm.h
@@ -26,6 +26,8 @@
 #ifndef _I915_DRM_H_
 #define _I915_DRM_H_
 
+#define BACKPORT__I915_DRM_H_
+
 #include <drm/i915_pciids.h>
 #include <uapi/drm/i915_drm.h>
 
diff --git a/include/drm/i915_pciids.h b/include/drm/i915_pciids.h
index a70d456..23ddfba 100644
--- a/include/drm/i915_pciids.h
+++ b/include/drm/i915_pciids.h
@@ -25,6 +25,8 @@
 #ifndef _I915_PCIIDS_H
 #define _I915_PCIIDS_H
 
+#define BACKPORT__I915_PCIIDS_H
+
 /*
  * A pci_device_id struct {
  *	__u32 vendor, device;
diff --git a/include/drm/i915_powerwell.h b/include/drm/i915_powerwell.h
index baa6f11..e743e80 100644
--- a/include/drm/i915_powerwell.h
+++ b/include/drm/i915_powerwell.h
@@ -29,6 +29,8 @@
 #ifndef _I915_POWERWELL_H_
 #define _I915_POWERWELL_H_
 
+#define BACKPORT__I915_POWERWELL_H_
+
 /* For use by hda_i915 driver */
 extern int i915_request_power_well(void);
 extern int i915_release_power_well(void);
diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h
index 9abbeb9..1af1a17 100644
--- a/include/uapi/drm/drm.h
+++ b/include/uapi/drm/drm.h
@@ -36,6 +36,8 @@
 #ifndef _DRM_H_
 #define _DRM_H_
 
+#define BACKPORT__DRM_H_
+
 #if defined(__KERNEL__) || defined(__linux__)
 
 #include <linux/types.h>
diff --git a/include/uapi/drm/drm_fourcc.h b/include/uapi/drm/drm_fourcc.h
index 646ae5f..6a09c2d 100644
--- a/include/uapi/drm/drm_fourcc.h
+++ b/include/uapi/drm/drm_fourcc.h
@@ -24,6 +24,8 @@
 #ifndef DRM_FOURCC_H
 #define DRM_FOURCC_H
 
+#define BACKPORT_DRM_FOURCC_H
+
 #include <linux/types.h>
 
 #define fourcc_code(a, b, c, d) ((__u32)(a) | ((__u32)(b) << 8) | \
diff --git a/include/uapi/drm/drm_mode.h b/include/uapi/drm/drm_mode.h
index def54f9..b2afd2e 100644
--- a/include/uapi/drm/drm_mode.h
+++ b/include/uapi/drm/drm_mode.h
@@ -27,6 +27,8 @@
 #ifndef _DRM_MODE_H
 #define _DRM_MODE_H
 
+#define BACKPORT__DRM_MODE_H
+
 #include <linux/types.h>
 
 #define DRM_DISPLAY_INFO_LEN	32
diff --git a/include/uapi/drm/drm_sarea.h b/include/uapi/drm/drm_sarea.h
index 413a564..6c1078f 100644
--- a/include/uapi/drm/drm_sarea.h
+++ b/include/uapi/drm/drm_sarea.h
@@ -32,6 +32,8 @@
 #ifndef _DRM_SAREA_H_
 #define _DRM_SAREA_H_
 
+#define BACKPORT__DRM_SAREA_H_
+
 #include <drm/drm.h>
 
 /* SAREA area needs to be at least a page */
diff --git a/include/uapi/drm/i915_drm.h b/include/uapi/drm/i915_drm.h
index ff57f07..4020010 100644
--- a/include/uapi/drm/i915_drm.h
+++ b/include/uapi/drm/i915_drm.h
@@ -27,6 +27,8 @@
 #ifndef _UAPI_I915_DRM_H_
 #define _UAPI_I915_DRM_H_
 
+#define BACKPORT__UAPI_I915_DRM_H_
+
 #include <drm/drm.h>
 
 /* Please note that modifications to all structs defined here are
