All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: jani.nikula@intel.com
Subject: [PATCH v2 15/25] drm/i915: extract intel_fbdev.h from intel_drv.h
Date: Fri,  5 Apr 2019 14:00:16 +0300	[thread overview]
Message-ID: <82d11bf634094f44a7469a096de3d3768314d6bc.1554461791.git.jani.nikula@intel.com> (raw)
In-Reply-To: <cover.1554461791.git.jani.nikula@intel.com>

It used to be handy that we only had a couple of headers, but over time
intel_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>
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/Makefile.header-test |  1 +
 drivers/gpu/drm/i915/i915_drv.c           |  1 +
 drivers/gpu/drm/i915/i915_pci.c           |  1 +
 drivers/gpu/drm/i915/intel_display.c      |  1 +
 drivers/gpu/drm/i915/intel_drv.h          | 40 -----------------
 drivers/gpu/drm/i915/intel_fbdev.c        | 17 ++++----
 drivers/gpu/drm/i915/intel_fbdev.h        | 53 +++++++++++++++++++++++
 7 files changed, 66 insertions(+), 48 deletions(-)
 create mode 100644 drivers/gpu/drm/i915/intel_fbdev.h

diff --git a/drivers/gpu/drm/i915/Makefile.header-test b/drivers/gpu/drm/i915/Makefile.header-test
index ab7ac0..9fd6f3 100644
--- a/drivers/gpu/drm/i915/Makefile.header-test
+++ b/drivers/gpu/drm/i915/Makefile.header-test
@@ -17,6 +17,7 @@ header_test := \
 	intel_ddi.h \
 	intel_engine_types.h \
 	intel_fbc.h \
+	intel_fbdev.h \
 	intel_frontbuffer.h \
 	intel_hdcp.h \
 	intel_lspcon.h \
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 85dac2..fc11c21 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -56,6 +56,7 @@
 #include "intel_audio.h"
 #include "intel_csr.h"
 #include "intel_drv.h"
+#include "intel_fbdev.h"
 #include "intel_pm.h"
 #include "intel_uc.h"
 #include "intel_workarounds.h"
diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c
index 6ffb85..f893c2 100644
--- a/drivers/gpu/drm/i915/i915_pci.c
+++ b/drivers/gpu/drm/i915/i915_pci.c
@@ -31,6 +31,7 @@
 #include "i915_drv.h"
 #include "i915_globals.h"
 #include "i915_selftest.h"
+#include "intel_fbdev.h"
 
 #define PLATFORM(x) .platform = (x)
 #define GEN(x) .gen = (x), .gen_mask = BIT((x) - 1)
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index f81a5c..a1a29a 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -54,6 +54,7 @@
 #include "intel_drv.h"
 #include "intel_dsi.h"
 #include "intel_fbc.h"
+#include "intel_fbdev.h"
 #include "intel_frontbuffer.h"
 #include "intel_hdcp.h"
 #include "intel_pm.h"
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 5d4031..54170ce 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -1973,46 +1973,6 @@ void intel_hpd_poll_init(struct drm_i915_private *dev_priv);
 bool intel_encoder_hotplug(struct intel_encoder *encoder,
 			   struct intel_connector *connector);
 
-/* legacy fbdev emulation in intel_fbdev.c */
-#ifdef CONFIG_DRM_FBDEV_EMULATION
-extern int intel_fbdev_init(struct drm_device *dev);
-extern void intel_fbdev_initial_config_async(struct drm_device *dev);
-extern void intel_fbdev_unregister(struct drm_i915_private *dev_priv);
-extern void intel_fbdev_fini(struct drm_i915_private *dev_priv);
-extern void intel_fbdev_set_suspend(struct drm_device *dev, int state, bool synchronous);
-extern void intel_fbdev_output_poll_changed(struct drm_device *dev);
-extern void intel_fbdev_restore_mode(struct drm_device *dev);
-#else
-static inline int intel_fbdev_init(struct drm_device *dev)
-{
-	return 0;
-}
-
-static inline void intel_fbdev_initial_config_async(struct drm_device *dev)
-{
-}
-
-static inline void intel_fbdev_unregister(struct drm_i915_private *dev_priv)
-{
-}
-
-static inline void intel_fbdev_fini(struct drm_i915_private *dev_priv)
-{
-}
-
-static inline void intel_fbdev_set_suspend(struct drm_device *dev, int state, bool synchronous)
-{
-}
-
-static inline void intel_fbdev_output_poll_changed(struct drm_device *dev)
-{
-}
-
-static inline void intel_fbdev_restore_mode(struct drm_device *dev)
-{
-}
-#endif
-
 /* intel_hdmi.c */
 void intel_hdmi_init(struct drm_i915_private *dev_priv, i915_reg_t hdmi_reg,
 		     enum port port);
diff --git a/drivers/gpu/drm/i915/intel_fbdev.c b/drivers/gpu/drm/i915/intel_fbdev.c
index ef93c2..bc532e 100644
--- a/drivers/gpu/drm/i915/intel_fbdev.c
+++ b/drivers/gpu/drm/i915/intel_fbdev.c
@@ -25,26 +25,27 @@
  */
 
 #include <linux/async.h>
-#include <linux/module.h>
-#include <linux/kernel.h>
 #include <linux/console.h>
+#include <linux/delay.h>
 #include <linux/errno.h>
-#include <linux/string.h>
+#include <linux/init.h>
+#include <linux/kernel.h>
 #include <linux/mm.h>
-#include <linux/tty.h>
+#include <linux/module.h>
+#include <linux/string.h>
 #include <linux/sysrq.h>
-#include <linux/delay.h>
-#include <linux/init.h>
+#include <linux/tty.h>
 #include <linux/vga_switcheroo.h>
 
 #include <drm/drm_crtc.h>
 #include <drm/drm_fb_helper.h>
 #include <drm/drm_fourcc.h>
+#include <drm/i915_drm.h>
 
+#include "i915_drv.h"
 #include "intel_drv.h"
+#include "intel_fbdev.h"
 #include "intel_frontbuffer.h"
-#include <drm/i915_drm.h>
-#include "i915_drv.h"
 
 static void intel_fbdev_invalidate(struct intel_fbdev *ifbdev)
 {
diff --git a/drivers/gpu/drm/i915/intel_fbdev.h b/drivers/gpu/drm/i915/intel_fbdev.h
new file mode 100644
index 000000..de7c84
--- /dev/null
+++ b/drivers/gpu/drm/i915/intel_fbdev.h
@@ -0,0 +1,53 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * Copyright © 2019 Intel Corporation
+ */
+
+#ifndef __INTEL_FBDEV_H__
+#define __INTEL_FBDEV_H__
+
+#include <linux/types.h>
+
+struct drm_device;
+struct drm_i915_private;
+
+#ifdef CONFIG_DRM_FBDEV_EMULATION
+int intel_fbdev_init(struct drm_device *dev);
+void intel_fbdev_initial_config_async(struct drm_device *dev);
+void intel_fbdev_unregister(struct drm_i915_private *dev_priv);
+void intel_fbdev_fini(struct drm_i915_private *dev_priv);
+void intel_fbdev_set_suspend(struct drm_device *dev, int state, bool synchronous);
+void intel_fbdev_output_poll_changed(struct drm_device *dev);
+void intel_fbdev_restore_mode(struct drm_device *dev);
+#else
+static inline int intel_fbdev_init(struct drm_device *dev)
+{
+	return 0;
+}
+
+static inline void intel_fbdev_initial_config_async(struct drm_device *dev)
+{
+}
+
+static inline void intel_fbdev_unregister(struct drm_i915_private *dev_priv)
+{
+}
+
+static inline void intel_fbdev_fini(struct drm_i915_private *dev_priv)
+{
+}
+
+static inline void intel_fbdev_set_suspend(struct drm_device *dev, int state, bool synchronous)
+{
+}
+
+static inline void intel_fbdev_output_poll_changed(struct drm_device *dev)
+{
+}
+
+static inline void intel_fbdev_restore_mode(struct drm_device *dev)
+{
+}
+#endif
+
+#endif /* __INTEL_FBDEV_H__ */
-- 
2.20.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2019-04-05 10:58 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-05 11:00 [PATCH v2 00/25] drm/i915: the great header refactoring, part one Jani Nikula
2019-04-05 11:00 ` [PATCH v2 01/25] drm/i915: make intel_frontbuffer.h self-contained Jani Nikula
2019-04-05 11:00 ` [PATCH v2 02/25] drm/i915: extract intel_audio.h from intel_drv.h Jani Nikula
2019-04-05 11:00 ` [PATCH v2 03/25] drm/i915: extract intel_crt.h " Jani Nikula
2019-04-05 11:00 ` [PATCH v2 04/25] drm/i915: extract intel_ddi.h " Jani Nikula
2019-04-05 11:00 ` [PATCH v2 05/25] drm/i915: extract intel_connector.h " Jani Nikula
2019-04-05 11:00 ` [PATCH v2 06/25] drm/i915: extract intel_csr.h " Jani Nikula
2019-04-05 11:00 ` [PATCH v2 07/25] drm/i915: extract intel_fbc.h " Jani Nikula
2019-04-05 11:00 ` [PATCH v2 08/25] drm/i915: extract intel_psr.h " Jani Nikula
2019-04-05 11:00 ` [PATCH v2 09/25] drm/i915: extract intel_color.h " Jani Nikula
2019-04-05 11:00 ` [PATCH v2 10/25] drm/i915: extract intel_lspcon.h " Jani Nikula
2019-04-05 11:00 ` [PATCH v2 11/25] drm/i915: extract intel_sdvo.h " Jani Nikula
2019-04-05 11:00 ` [PATCH v2 12/25] drm/i915: extract intel_hdcp.h " Jani Nikula
2019-04-05 11:00 ` [PATCH v2 13/25] drm/i915: extract intel_panel.h " Jani Nikula
2019-04-05 11:00 ` [PATCH v2 14/25] drm/i915: extract intel_pm.h " Jani Nikula
2019-04-05 11:00 ` Jani Nikula [this message]
2019-04-05 11:00 ` [PATCH v2 16/25] drm/i915: extract intel_dp.h " Jani Nikula
2019-04-05 11:00 ` [PATCH v2 17/25] drm/i915: extract intel_hdmi.h " Jani Nikula
2019-04-05 11:00 ` [PATCH v2 18/25] drm/i915: extract intel_atomic_plane.h " Jani Nikula
2019-04-05 11:00 ` [PATCH v2 19/25] drm/i915: extract intel_pipe_crc.h " Jani Nikula
2019-04-05 11:00 ` [PATCH v2 20/25] drm/i915: extract intel_tv.h " Jani Nikula
2019-04-05 11:00 ` [PATCH v2 21/25] drm/i915: extract intel_lvds.h " Jani Nikula
2019-04-05 11:00 ` [PATCH v2 22/25] drm/i915: extract intel_dvo.h " Jani Nikula
2019-04-05 11:00 ` [PATCH v2 23/25] drm/i915: extract intel_sprite.h " Jani Nikula
2019-04-05 11:00 ` [PATCH v2 24/25] drm/i915: extract intel_cdclk.h " Jani Nikula
2019-04-05 11:00 ` [PATCH v2 25/25] drm/i915/cdclk: have only one init/uninit function Jani Nikula
2019-04-05 11:45 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915: the great header refactoring, part one (rev2) Patchwork
2019-04-05 11:58 ` ✗ Fi.CI.SPARSE: " Patchwork
2019-04-05 12:18 ` ✓ Fi.CI.BAT: success " Patchwork
2019-04-06  8:08 ` ✓ Fi.CI.IGT: " Patchwork
2019-04-08  7:59 ` [PATCH v2 00/25] drm/i915: the great header refactoring, part one Jani Nikula

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=82d11bf634094f44a7469a096de3d3768314d6bc.1554461791.git.jani.nikula@intel.com \
    --to=jani.nikula@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.