]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/i915: extract intel_acpi.h from i915_drv.h
authorJani Nikula <jani.nikula@intel.com>
Thu, 2 May 2019 15:02:42 +0000 (18:02 +0300)
committerJani Nikula <jani.nikula@intel.com>
Fri, 3 May 2019 07:06:37 +0000 (10:06 +0300)
It used to be handy that we only had a couple of headers, but over time
i915_drv.h has become unwieldy. Extract declarations to a separate
header file corresponding to the implementation module, clarifying the
modularity of the driver.

Ensure the new header is self-contained, and do so with minimal further
includes, using forward declarations as needed. Include the new header
only where needed, and sort the modified include directives while at it
and as needed.

No functional changes.

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/9bc1317a67df0b9d019eca5b36f474b76a1cad26.1556809195.git.jani.nikula@intel.com
drivers/gpu/drm/i915/Makefile.header-test
drivers/gpu/drm/i915/i915_drv.c
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/intel_acpi.c
drivers/gpu/drm/i915/intel_acpi.h [new file with mode: 0644]
drivers/gpu/drm/i915/intel_display.c

index 4375ff4abd8ece868432a27715399e80976661d9..c1fa85790dfd5b836a5906373e98c7684bf70464 100644 (file)
@@ -13,6 +13,7 @@ header_test := \
        i915_reg.h \
        i915_scheduler_types.h \
        i915_timeline_types.h \
+       intel_acpi.h \
        intel_atomic.h \
        intel_atomic_plane.h \
        intel_audio.h \
index 21dac5a09fbe6d7ef244c8b62b7126953ab3c01f..c011a1b5720a4953a3dceb94bab4abda96bccd42 100644 (file)
@@ -57,6 +57,7 @@
 #include "i915_query.h"
 #include "i915_trace.h"
 #include "i915_vgpu.h"
+#include "intel_acpi.h"
 #include "intel_audio.h"
 #include "intel_cdclk.h"
 #include "intel_csr.h"
index 91efe2864bb135aca3d12b484a813a9c27b049d1..6ddc3d91f441f56143c4d28626083126ed1626b8 100644 (file)
@@ -3264,15 +3264,6 @@ static inline bool intel_gmbus_is_forced_bit(struct i2c_adapter *adapter)
 }
 extern void intel_i2c_reset(struct drm_i915_private *dev_priv);
 
-/* intel_acpi.c */
-#ifdef CONFIG_ACPI
-extern void intel_register_dsm_handler(void);
-extern void intel_unregister_dsm_handler(void);
-#else
-static inline void intel_register_dsm_handler(void) { return; }
-static inline void intel_unregister_dsm_handler(void) { return; }
-#endif /* CONFIG_ACPI */
-
 /* intel_device_info.c */
 static inline struct intel_device_info *
 mkwrite_device_info(struct drm_i915_private *dev_priv)
index 9d142d038a7d3631ac927280e549528e86756db5..3456d33feb46aa52dd5e3095034886766ea5192c 100644 (file)
@@ -4,9 +4,12 @@
  *
  * _DSM related code stolen from nouveau_acpi.c.
  */
+
 #include <linux/pci.h>
 #include <linux/acpi.h>
+
 #include "i915_drv.h"
+#include "intel_acpi.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_acpi.h b/drivers/gpu/drm/i915/intel_acpi.h
new file mode 100644 (file)
index 0000000..1c576b3
--- /dev/null
@@ -0,0 +1,17 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * Copyright © 2019 Intel Corporation
+ */
+
+#ifndef __INTEL_ACPI_H__
+#define __INTEL_ACPI_H__
+
+#ifdef CONFIG_ACPI
+void intel_register_dsm_handler(void);
+void intel_unregister_dsm_handler(void);
+#else
+static inline void intel_register_dsm_handler(void) { return; }
+static inline void intel_unregister_dsm_handler(void) { return; }
+#endif /* CONFIG_ACPI */
+
+#endif /* __INTEL_ACPI_H__ */
index 8c2f36eca6b9715649b07a03cde22343e204fc86..bb0815c55bd0c52e6dae66386b4c63304e7b2fb4 100644 (file)
@@ -47,6 +47,7 @@
 #include "i915_drv.h"
 #include "i915_gem_clflush.h"
 #include "i915_trace.h"
+#include "intel_acpi.h"
 #include "intel_atomic.h"
 #include "intel_atomic_plane.h"
 #include "intel_color.h"