2019-01-26 12:26:10

by Sam Ravnborg

[permalink] [raw]
Subject: [PATCH v6 0/5] drm: minimize drmP.h dependencies

Updated patchset, with merged patches removed, new patches added.

> From the original mail:

- drmP.h is now stripped down to include files
and forward declarations.
- All header files in include/drm/ no longer include drmP.h.

The series was made on top of drm-misc-next:
f1a2a540c86441016ce3dff6590b7a09080871de ("video/hdmi: Add an enum for HDMI packet types")

Build tested using arm and x86, ia64, alpha, sparc32, sparc64
Included staging/vboxvideo in the build test - which revealed
the build issues Daniel had identifed

This series include fixes to i915 as it looks in drm-misc.
This series also include fixes to stagin/vboxvideo, which I
expect to be committet to drm-misc due to the final patch
(drmP.h removal from drm_modeset_helper.h) depending on this patch.

Daniel - thanks for being paitent and applying this piecemal.

Sam
v6:
- include fixes to vboxvideo (Daniel)
- include i915 build fixes
- revised/new rcar-du patch (lots of new build failures popped up)
- split updates to drm/*.c file to dedicated patch,
to make the final removal patch slimmer

v5:
- Rebased on top of drm-misc-next and dropped patches already merged
- Sorted list of include files where they are touched (Laurent)
- Collected ack's, reviewed by's

v4:
- Rebased on top of drm-misc-next and dropped patches already merged
- Include build test of kirin (Daniel)
- Plug drm_util.h into drm-internals.rst (Daniel)
- Fix kernel-doc syntax in drm_util.h (Daniel)
- Split removal of drmP.h from drm_modeset_helper.h
in smaller patches, to ease the merge process

v3:
- Added Acks/Reviewed annotations (thanks!)
- Add forward of drm_gem_object to drm_framebuffer.h (Noralf)
- Drop "drm: move DRM_IF_VERSION to drm_internal.h" as it is applied to drm-misc
- Drop "drm: make drm_file.h self contained" as Jan made a similar patch that was appleid to drm-misc
- Rebased on top of drm-misc-next

v2:
- DRM_SWITCH_POWER as enum (Daniel Vetter)
- Prefer forward decalration over includes (Laurent Pinchart)
- Updated drm_device to use kerneldoc style (Daniel Vetter)
- Improved commit messages (David Lechner)
- Split up patch when removing drmP.h from drm_gem_cma_helper.h
- rebased on top of drm-misc-next
- dropped patch already applied
- added reviewed-by from Laurent Pinchart (Laurent Pinchart)
- add drm_framebuffer.h patch
- add kernel-doc comments to drm_util.h
- moved EXPORT_SYMBOL_FOR_TESTS_ONLY to drm_util.h
- added note to drmP.h not to add new stuff and not to use in new files

Sam Ravnborg (5):
staging/vboxvideo: prepare for drmP.h removal from drm_modeset_helper.h
drm/i915: prepare for drmP.h removal from drm_modeset_helper.h
drm/rcar-du: prepare for drmP.h removal from drm_modeset_helper.h
drm: prepare for drmP.h removal from drm_modeset_helper.h
drm: remove drmP.h from drm_modeset_helper.h

drivers/gpu/drm/drm_damage_helper.c | 1 +
drivers/gpu/drm/drm_modeset_helper.c | 2 ++
drivers/gpu/drm/i915/i915_drv.c | 4 +++-
drivers/gpu/drm/i915/intel_atomic.c | 2 ++
drivers/gpu/drm/i915/intel_atomic_plane.c | 2 ++
drivers/gpu/drm/i915/intel_display.c | 29 ++++++++++++++++-------------
drivers/gpu/drm/i915/intel_pm.c | 7 +++++--
drivers/gpu/drm/rcar-du/rcar_du_crtc.c | 3 +++
drivers/gpu/drm/rcar-du/rcar_du_drv.c | 1 +
drivers/gpu/drm/rcar-du/rcar_du_kms.c | 2 ++
drivers/gpu/drm/rcar-du/rcar_du_plane.c | 2 ++
drivers/gpu/drm/rcar-du/rcar_du_vsp.c | 1 +
drivers/staging/vboxvideo/vbox_drv.c | 6 +++++-
drivers/staging/vboxvideo/vbox_fb.c | 18 ++++++++++--------
drivers/staging/vboxvideo/vbox_mode.c | 5 ++++-
include/drm/drm_modeset_helper.h | 6 +++++-
16 files changed, 64 insertions(+), 27 deletions(-)


2019-01-26 12:26:32

by Sam Ravnborg

[permalink] [raw]
Subject: [PATCH v6 3/5] drm/rcar-du: prepare for drmP.h removal from drm_modeset_helper.h

The use of drmP.h is discouraged and removal of it from
drm_modeset_helper.h caused rcar-du to fail to build.

This patch introduce the necessary fixes to prepare for the
drmP.h removal from drm_modeset_helper.h.

Build tested on arm allmodconfig/allyesconfig.

v2:
- new patch. Changes like drm_probe_helper and other
required several updates

Signed-off-by: Sam Ravnborg <[email protected]>
Cc: Laurent Pinchart <[email protected]>
Cc: Kieran Bingham <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Daniel Vetter <[email protected]>
Cc: [email protected]
---
drivers/gpu/drm/rcar-du/rcar_du_crtc.c | 3 +++
drivers/gpu/drm/rcar-du/rcar_du_drv.c | 1 +
drivers/gpu/drm/rcar-du/rcar_du_kms.c | 2 ++
drivers/gpu/drm/rcar-du/rcar_du_plane.c | 2 ++
drivers/gpu/drm/rcar-du/rcar_du_vsp.c | 1 +
5 files changed, 9 insertions(+)

diff --git a/drivers/gpu/drm/rcar-du/rcar_du_crtc.c b/drivers/gpu/drm/rcar-du/rcar_du_crtc.c
index 93ee0020c9b1..4d1e5098b70e 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_crtc.c
+++ b/drivers/gpu/drm/rcar-du/rcar_du_crtc.c
@@ -9,14 +9,17 @@

#include <linux/clk.h>
#include <linux/mutex.h>
+#include <linux/platform_device.h>
#include <linux/sys_soc.h>

#include <drm/drm_atomic.h>
#include <drm/drm_atomic_helper.h>
#include <drm/drm_crtc.h>
+#include <drm/drm_device.h>
#include <drm/drm_fb_cma_helper.h>
#include <drm/drm_gem_cma_helper.h>
#include <drm/drm_plane_helper.h>
+#include <drm/drm_vblank.h>

#include "rcar_du_crtc.h"
#include "rcar_du_drv.h"
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_drv.c b/drivers/gpu/drm/rcar-du/rcar_du_drv.c
index abd70d2931b0..75ab17af13a9 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_drv.c
+++ b/drivers/gpu/drm/rcar-du/rcar_du_drv.c
@@ -20,6 +20,7 @@
#include <drm/drm_atomic_helper.h>
#include <drm/drm_fb_cma_helper.h>
#include <drm/drm_fb_helper.h>
+#include <drm/drm_drv.h>
#include <drm/drm_gem_cma_helper.h>
#include <drm/drm_probe_helper.h>

diff --git a/drivers/gpu/drm/rcar-du/rcar_du_kms.c b/drivers/gpu/drm/rcar-du/rcar_du_kms.c
index 663ab98d1f97..18d21bc1d265 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_kms.c
+++ b/drivers/gpu/drm/rcar-du/rcar_du_kms.c
@@ -10,10 +10,12 @@
#include <drm/drm_atomic.h>
#include <drm/drm_atomic_helper.h>
#include <drm/drm_crtc.h>
+#include <drm/drm_device.h>
#include <drm/drm_fb_cma_helper.h>
#include <drm/drm_gem_cma_helper.h>
#include <drm/drm_gem_framebuffer_helper.h>
#include <drm/drm_probe_helper.h>
+#include <drm/drm_vblank.h>

#include <linux/of_graph.h>
#include <linux/wait.h>
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_plane.c b/drivers/gpu/drm/rcar-du/rcar_du_plane.c
index 321ac80b48d3..c6430027169f 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_plane.c
+++ b/drivers/gpu/drm/rcar-du/rcar_du_plane.c
@@ -10,7 +10,9 @@
#include <drm/drm_atomic.h>
#include <drm/drm_atomic_helper.h>
#include <drm/drm_crtc.h>
+#include <drm/drm_device.h>
#include <drm/drm_fb_cma_helper.h>
+#include <drm/drm_fourcc.h>
#include <drm/drm_gem_cma_helper.h>
#include <drm/drm_plane_helper.h>

diff --git a/drivers/gpu/drm/rcar-du/rcar_du_vsp.c b/drivers/gpu/drm/rcar-du/rcar_du_vsp.c
index 76a39eee7c9c..0878accbd134 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_vsp.c
+++ b/drivers/gpu/drm/rcar-du/rcar_du_vsp.c
@@ -13,6 +13,7 @@
#include <drm/drm_gem_cma_helper.h>
#include <drm/drm_gem_framebuffer_helper.h>
#include <drm/drm_plane_helper.h>
+#include <drm/drm_vblank.h>

#include <linux/bitops.h>
#include <linux/dma-mapping.h>
--
2.12.0


2019-01-26 12:26:56

by Sam Ravnborg

[permalink] [raw]
Subject: [PATCH v6 2/5] drm/i915: prepare for drmP.h removal from drm_modeset_helper.h

The use of drmP.h is discouraged and removal of it from
drm_modeset_helper.h caused i915 to fail to build.

This patch introduce the necessary fixes to prepare for the
drmP.h removal from drm_modeset_helper.h.

In the files touched the lists of include files was grouped
and sorted.

Build tested on x86 and arm allmodconfig / allyesconfig.

Signed-off-by: Sam Ravnborg <[email protected]>
Cc: Jani Nikula <[email protected]>
Cc: Joonas Lahtinen <[email protected]>
Cc: Rodrigo Vivi <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Daniel Vetter <[email protected]>
Cc: [email protected]
---
drivers/gpu/drm/i915/i915_drv.c | 4 +++-
drivers/gpu/drm/i915/intel_atomic.c | 2 ++
drivers/gpu/drm/i915/intel_atomic_plane.c | 2 ++
drivers/gpu/drm/i915/intel_display.c | 29 ++++++++++++++++-------------
drivers/gpu/drm/i915/intel_pm.c | 7 +++++--
5 files changed, 28 insertions(+), 16 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 9883921013b1..8c8f36a91e7e 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -41,8 +41,10 @@
#include <linux/vt.h>
#include <acpi/video.h>

-#include <drm/drm_probe_helper.h>
#include <drm/drm_atomic_helper.h>
+#include <drm/drm_ioctl.h>
+#include <drm/drm_irq.h>
+#include <drm/drm_probe_helper.h>
#include <drm/i915_drm.h>

#include "i915_drv.h"
diff --git a/drivers/gpu/drm/i915/intel_atomic.c b/drivers/gpu/drm/i915/intel_atomic.c
index d8dbc9980281..f415ed239184 100644
--- a/drivers/gpu/drm/i915/intel_atomic.c
+++ b/drivers/gpu/drm/i915/intel_atomic.c
@@ -31,7 +31,9 @@

#include <drm/drm_atomic.h>
#include <drm/drm_atomic_helper.h>
+#include <drm/drm_fourcc.h>
#include <drm/drm_plane_helper.h>
+
#include "intel_drv.h"

/**
diff --git a/drivers/gpu/drm/i915/intel_atomic_plane.c b/drivers/gpu/drm/i915/intel_atomic_plane.c
index 683a75dad4fb..79139d496c78 100644
--- a/drivers/gpu/drm/i915/intel_atomic_plane.c
+++ b/drivers/gpu/drm/i915/intel_atomic_plane.c
@@ -32,7 +32,9 @@
*/

#include <drm/drm_atomic_helper.h>
+#include <drm/drm_fourcc.h>
#include <drm/drm_plane_helper.h>
+
#include "intel_drv.h"

struct intel_plane *intel_plane_alloc(void)
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 15d758cd0c1b..e0f40be07131 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -24,29 +24,32 @@
* Eric Anholt <[email protected]>
*/

-#include <linux/module.h>
-#include <linux/input.h>
#include <linux/i2c.h>
+#include <linux/input.h>
+#include <linux/intel-iommu.h>
#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/reservation.h>
#include <linux/slab.h>
#include <linux/vgaarb.h>
-#include <drm/drm_edid.h>
-#include "intel_drv.h"
-#include "intel_frontbuffer.h"
-#include <drm/i915_drm.h>
-#include "i915_drv.h"
-#include "i915_gem_clflush.h"
-#include "intel_dsi.h"
-#include "i915_trace.h"
+
#include <drm/drm_atomic.h>
#include <drm/drm_atomic_helper.h>
+#include <drm/drm_atomic_uapi.h>
#include <drm/drm_dp_helper.h>
+#include <drm/drm_edid.h>
+#include <drm/drm_fourcc.h>
#include <drm/drm_plane_helper.h>
#include <drm/drm_probe_helper.h>
#include <drm/drm_rect.h>
-#include <drm/drm_atomic_uapi.h>
-#include <linux/intel-iommu.h>
-#include <linux/reservation.h>
+#include <drm/i915_drm.h>
+
+#include "i915_drv.h"
+#include "i915_gem_clflush.h"
+#include "i915_trace.h"
+#include "intel_drv.h"
+#include "intel_dsi.h"
+#include "intel_frontbuffer.h"

/* Primary plane formats for gen <= 3 */
static const uint32_t i8xx_primary_formats[] = {
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index 83b01cde8113..48c755dc895b 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -26,13 +26,16 @@
*/

#include <linux/cpufreq.h>
+#include <linux/module.h>
#include <linux/pm_runtime.h>
+
+#include <drm/drm_atomic_helper.h>
+#include <drm/drm_fourcc.h>
#include <drm/drm_plane_helper.h>
+
#include "i915_drv.h"
#include "intel_drv.h"
#include "../../../platform/x86/intel_ips.h"
-#include <linux/module.h>
-#include <drm/drm_atomic_helper.h>

/**
* DOC: RC6
--
2.12.0


2019-01-26 12:27:19

by Sam Ravnborg

[permalink] [raw]
Subject: [PATCH v6 4/5] drm: prepare for drmP.h removal from drm_modeset_helper.h

The use of drmP.h is discouraged and removal of it from
drm_modeset_helper.h caused drm/ to fail to build.

This patch introduce the necessary fixes to prepare for the
drmP.h removal from drm_modeset_helper.h.

Build tested on x86, arm, alpha, ia64 allmodconfig/allyesconfig.

Signed-off-by: Sam Ravnborg <[email protected]>
Cc: Maarten Lankhorst <[email protected]>
Cc: Maxime Ripard <[email protected]>
Cc: Sean Paul <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Daniel Vetter <[email protected]>
---
drivers/gpu/drm/drm_damage_helper.c | 1 +
drivers/gpu/drm/drm_modeset_helper.c | 2 ++
2 files changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/drm_damage_helper.c b/drivers/gpu/drm/drm_damage_helper.c
index e16aa5ae00b4..ee67c96841fa 100644
--- a/drivers/gpu/drm/drm_damage_helper.c
+++ b/drivers/gpu/drm/drm_damage_helper.c
@@ -32,6 +32,7 @@

#include <drm/drm_atomic.h>
#include <drm/drm_damage_helper.h>
+#include <drm/drm_device.h>

/**
* DOC: overview
diff --git a/drivers/gpu/drm/drm_modeset_helper.c b/drivers/gpu/drm/drm_modeset_helper.c
index 890eee07892d..da483125e063 100644
--- a/drivers/gpu/drm/drm_modeset_helper.c
+++ b/drivers/gpu/drm/drm_modeset_helper.c
@@ -22,8 +22,10 @@

#include <drm/drm_atomic_helper.h>
#include <drm/drm_fb_helper.h>
+#include <drm/drm_fourcc.h>
#include <drm/drm_modeset_helper.h>
#include <drm/drm_plane_helper.h>
+#include <drm/drm_print.h>
#include <drm/drm_probe_helper.h>

/**
--
2.12.0


2019-01-26 12:27:29

by Sam Ravnborg

[permalink] [raw]
Subject: [PATCH v6 1/5] staging/vboxvideo: prepare for drmP.h removal from drm_modeset_helper.h

The use of drmP.h is discouraged and removal of it from
drm_modeset_helper.h caused vboxvideo to fail to build.

This patch introduce the necessary fixes to prepare for the
drmP.h removal from drm_modeset_helper.h.

In the files touched sort the include files

Build tested on x86 and arm allmodconfig / allyesconfig.

Signed-off-by: Sam Ravnborg <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Hans de Goede <[email protected]>
Cc: Daniel Vetter <[email protected]>
---
drivers/staging/vboxvideo/vbox_drv.c | 6 +++++-
drivers/staging/vboxvideo/vbox_fb.c | 18 ++++++++++--------
drivers/staging/vboxvideo/vbox_mode.c | 5 ++++-
3 files changed, 19 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/vboxvideo/vbox_drv.c b/drivers/staging/vboxvideo/vbox_drv.c
index cc6532d8c2fa..d1b0d7b4886a 100644
--- a/drivers/staging/vboxvideo/vbox_drv.c
+++ b/drivers/staging/vboxvideo/vbox_drv.c
@@ -7,11 +7,15 @@
* Michael Thayer <[email protected],
* Hans de Goede <[email protected]>
*/
-#include <linux/module.h>
#include <linux/console.h>
+#include <linux/module.h>
+#include <linux/pci.h>
#include <linux/vt_kern.h>

#include <drm/drm_crtc_helper.h>
+#include <drm/drm_drv.h>
+#include <drm/drm_file.h>
+#include <drm/drm_ioctl.h>

#include "vbox_drv.h"

diff --git a/drivers/staging/vboxvideo/vbox_fb.c b/drivers/staging/vboxvideo/vbox_fb.c
index 397496cf0bdf..83a04afd1766 100644
--- a/drivers/staging/vboxvideo/vbox_fb.c
+++ b/drivers/staging/vboxvideo/vbox_fb.c
@@ -6,20 +6,22 @@
* Authors: Dave Airlie <[email protected]>
* Michael Thayer <[email protected],
*/
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/errno.h>
-#include <linux/string.h>
-#include <linux/mm.h>
-#include <linux/tty.h>
-#include <linux/sysrq.h>
#include <linux/delay.h>
+#include <linux/errno.h>
#include <linux/fb.h>
#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/mm.h>
+#include <linux/module.h>
+#include <linux/pci.h>
+#include <linux/string.h>
+#include <linux/sysrq.h>
+#include <linux/tty.h>

#include <drm/drm_crtc.h>
-#include <drm/drm_fb_helper.h>
#include <drm/drm_crtc_helper.h>
+#include <drm/drm_fb_helper.h>
+#include <drm/drm_fourcc.h>

#include "vbox_drv.h"
#include "vboxvideo.h"
diff --git a/drivers/staging/vboxvideo/vbox_mode.c b/drivers/staging/vboxvideo/vbox_mode.c
index 1aaff02c07ff..213551394495 100644
--- a/drivers/staging/vboxvideo/vbox_mode.c
+++ b/drivers/staging/vboxvideo/vbox_mode.c
@@ -10,14 +10,17 @@
* Hans de Goede <[email protected]>
*/
#include <linux/export.h>
+
#include <drm/drm_atomic.h>
#include <drm/drm_atomic_helper.h>
+#include <drm/drm_fourcc.h>
#include <drm/drm_plane_helper.h>
#include <drm/drm_probe_helper.h>
+#include <drm/drm_vblank.h>

+#include "hgsmi_channels.h"
#include "vbox_drv.h"
#include "vboxvideo.h"
-#include "hgsmi_channels.h"

/*
* Set a graphics mode. Poke any required values into registers, do an HGSMI
--
2.12.0


2019-01-26 12:28:41

by Sam Ravnborg

[permalink] [raw]
Subject: [PATCH v6 5/5] drm: remove drmP.h from drm_modeset_helper.h

With the removal of drmP.h from drm_modeset_helper.h
the drmP.h are no longer included by any include files
in include/drm.
The drmP.h file is thus only included explicit
either in .c files or in local .h files.
This makes the process of deleting the drmP.h includes easier
as we have a more local dependency chain.

v2:
- moved updates of .c files in drm/ to a dedicated
patch. This allows the updates to the *.c files
to be committed without the removal part.
So this patch can wait if it causes build failures
due to pending changes

Signed-off-by: Sam Ravnborg <[email protected]>
Reviewed-by: Laurent Pinchart <[email protected]>
Cc: Maarten Lankhorst <[email protected]>
Cc: Maxime Ripard <[email protected]>
Cc: Sean Paul <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Daniel Vetter <[email protected]>
---
include/drm/drm_modeset_helper.h | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/include/drm/drm_modeset_helper.h b/include/drm/drm_modeset_helper.h
index efa337f03129..995fd981cab0 100644
--- a/include/drm/drm_modeset_helper.h
+++ b/include/drm/drm_modeset_helper.h
@@ -23,7 +23,11 @@
#ifndef __DRM_KMS_HELPER_H__
#define __DRM_KMS_HELPER_H__

-#include <drm/drmP.h>
+struct drm_crtc;
+struct drm_crtc_funcs;
+struct drm_device;
+struct drm_framebuffer;
+struct drm_mode_fb_cmd2;

void drm_helper_move_panel_connectors_to_head(struct drm_device *);

--
2.12.0


2019-01-28 11:40:27

by Jani Nikula

[permalink] [raw]
Subject: Re: [PATCH v6 2/5] drm/i915: prepare for drmP.h removal from drm_modeset_helper.h

On Sat, 26 Jan 2019, Sam Ravnborg <[email protected]> wrote:
> The use of drmP.h is discouraged and removal of it from
> drm_modeset_helper.h caused i915 to fail to build.
>
> This patch introduce the necessary fixes to prepare for the
> drmP.h removal from drm_modeset_helper.h.
>
> In the files touched the lists of include files was grouped
> and sorted.
>
> Build tested on x86 and arm allmodconfig / allyesconfig.
>
> Signed-off-by: Sam Ravnborg <[email protected]>
> Cc: Jani Nikula <[email protected]>
> Cc: Joonas Lahtinen <[email protected]>
> Cc: Rodrigo Vivi <[email protected]>
> Cc: David Airlie <[email protected]>
> Cc: Daniel Vetter <[email protected]>
> Cc: [email protected]

Not going to second-guess the compiler, looks good to me,

Acked-by: Jani Nikula <[email protected]>

and good to merge via whichever tree you see fit.


> ---
> drivers/gpu/drm/i915/i915_drv.c | 4 +++-
> drivers/gpu/drm/i915/intel_atomic.c | 2 ++
> drivers/gpu/drm/i915/intel_atomic_plane.c | 2 ++
> drivers/gpu/drm/i915/intel_display.c | 29 ++++++++++++++++-------------
> drivers/gpu/drm/i915/intel_pm.c | 7 +++++--
> 5 files changed, 28 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> index 9883921013b1..8c8f36a91e7e 100644
> --- a/drivers/gpu/drm/i915/i915_drv.c
> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@ -41,8 +41,10 @@
> #include <linux/vt.h>
> #include <acpi/video.h>
>
> -#include <drm/drm_probe_helper.h>
> #include <drm/drm_atomic_helper.h>
> +#include <drm/drm_ioctl.h>
> +#include <drm/drm_irq.h>
> +#include <drm/drm_probe_helper.h>
> #include <drm/i915_drm.h>
>
> #include "i915_drv.h"
> diff --git a/drivers/gpu/drm/i915/intel_atomic.c b/drivers/gpu/drm/i915/intel_atomic.c
> index d8dbc9980281..f415ed239184 100644
> --- a/drivers/gpu/drm/i915/intel_atomic.c
> +++ b/drivers/gpu/drm/i915/intel_atomic.c
> @@ -31,7 +31,9 @@
>
> #include <drm/drm_atomic.h>
> #include <drm/drm_atomic_helper.h>
> +#include <drm/drm_fourcc.h>
> #include <drm/drm_plane_helper.h>
> +
> #include "intel_drv.h"
>
> /**
> diff --git a/drivers/gpu/drm/i915/intel_atomic_plane.c b/drivers/gpu/drm/i915/intel_atomic_plane.c
> index 683a75dad4fb..79139d496c78 100644
> --- a/drivers/gpu/drm/i915/intel_atomic_plane.c
> +++ b/drivers/gpu/drm/i915/intel_atomic_plane.c
> @@ -32,7 +32,9 @@
> */
>
> #include <drm/drm_atomic_helper.h>
> +#include <drm/drm_fourcc.h>
> #include <drm/drm_plane_helper.h>
> +
> #include "intel_drv.h"
>
> struct intel_plane *intel_plane_alloc(void)
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 15d758cd0c1b..e0f40be07131 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -24,29 +24,32 @@
> * Eric Anholt <[email protected]>
> */
>
> -#include <linux/module.h>
> -#include <linux/input.h>
> #include <linux/i2c.h>
> +#include <linux/input.h>
> +#include <linux/intel-iommu.h>
> #include <linux/kernel.h>
> +#include <linux/module.h>
> +#include <linux/reservation.h>
> #include <linux/slab.h>
> #include <linux/vgaarb.h>
> -#include <drm/drm_edid.h>
> -#include "intel_drv.h"
> -#include "intel_frontbuffer.h"
> -#include <drm/i915_drm.h>
> -#include "i915_drv.h"
> -#include "i915_gem_clflush.h"
> -#include "intel_dsi.h"
> -#include "i915_trace.h"
> +
> #include <drm/drm_atomic.h>
> #include <drm/drm_atomic_helper.h>
> +#include <drm/drm_atomic_uapi.h>
> #include <drm/drm_dp_helper.h>
> +#include <drm/drm_edid.h>
> +#include <drm/drm_fourcc.h>
> #include <drm/drm_plane_helper.h>
> #include <drm/drm_probe_helper.h>
> #include <drm/drm_rect.h>
> -#include <drm/drm_atomic_uapi.h>
> -#include <linux/intel-iommu.h>
> -#include <linux/reservation.h>
> +#include <drm/i915_drm.h>
> +
> +#include "i915_drv.h"
> +#include "i915_gem_clflush.h"
> +#include "i915_trace.h"
> +#include "intel_drv.h"
> +#include "intel_dsi.h"
> +#include "intel_frontbuffer.h"
>
> /* Primary plane formats for gen <= 3 */
> static const uint32_t i8xx_primary_formats[] = {
> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> index 83b01cde8113..48c755dc895b 100644
> --- a/drivers/gpu/drm/i915/intel_pm.c
> +++ b/drivers/gpu/drm/i915/intel_pm.c
> @@ -26,13 +26,16 @@
> */
>
> #include <linux/cpufreq.h>
> +#include <linux/module.h>
> #include <linux/pm_runtime.h>
> +
> +#include <drm/drm_atomic_helper.h>
> +#include <drm/drm_fourcc.h>
> #include <drm/drm_plane_helper.h>
> +
> #include "i915_drv.h"
> #include "intel_drv.h"
> #include "../../../platform/x86/intel_ips.h"
> -#include <linux/module.h>
> -#include <drm/drm_atomic_helper.h>
>
> /**
> * DOC: RC6

--
Jani Nikula, Intel Open Source Graphics Center

2019-02-01 18:08:49

by Daniel Vetter

[permalink] [raw]
Subject: Re: [PATCH v6 1/5] staging/vboxvideo: prepare for drmP.h removal from drm_modeset_helper.h

On Sat, Jan 26, 2019 at 01:25:23PM +0100, Sam Ravnborg wrote:
> The use of drmP.h is discouraged and removal of it from
> drm_modeset_helper.h caused vboxvideo to fail to build.
>
> This patch introduce the necessary fixes to prepare for the
> drmP.h removal from drm_modeset_helper.h.
>
> In the files touched sort the include files
>
> Build tested on x86 and arm allmodconfig / allyesconfig.
>
> Signed-off-by: Sam Ravnborg <[email protected]>
> Cc: Greg Kroah-Hartman <[email protected]>
> Cc: Hans de Goede <[email protected]>
> Cc: Daniel Vetter <[email protected]>

Hi Greg,

Ack for merging this through drm-misc? I think we've defacto-maintained
vboxvideo in drm anyway this release ...
-Daniel

> ---
> drivers/staging/vboxvideo/vbox_drv.c | 6 +++++-
> drivers/staging/vboxvideo/vbox_fb.c | 18 ++++++++++--------
> drivers/staging/vboxvideo/vbox_mode.c | 5 ++++-
> 3 files changed, 19 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/staging/vboxvideo/vbox_drv.c b/drivers/staging/vboxvideo/vbox_drv.c
> index cc6532d8c2fa..d1b0d7b4886a 100644
> --- a/drivers/staging/vboxvideo/vbox_drv.c
> +++ b/drivers/staging/vboxvideo/vbox_drv.c
> @@ -7,11 +7,15 @@
> * Michael Thayer <[email protected],
> * Hans de Goede <[email protected]>
> */
> -#include <linux/module.h>
> #include <linux/console.h>
> +#include <linux/module.h>
> +#include <linux/pci.h>
> #include <linux/vt_kern.h>
>
> #include <drm/drm_crtc_helper.h>
> +#include <drm/drm_drv.h>
> +#include <drm/drm_file.h>
> +#include <drm/drm_ioctl.h>
>
> #include "vbox_drv.h"
>
> diff --git a/drivers/staging/vboxvideo/vbox_fb.c b/drivers/staging/vboxvideo/vbox_fb.c
> index 397496cf0bdf..83a04afd1766 100644
> --- a/drivers/staging/vboxvideo/vbox_fb.c
> +++ b/drivers/staging/vboxvideo/vbox_fb.c
> @@ -6,20 +6,22 @@
> * Authors: Dave Airlie <[email protected]>
> * Michael Thayer <[email protected],
> */
> -#include <linux/module.h>
> -#include <linux/kernel.h>
> -#include <linux/errno.h>
> -#include <linux/string.h>
> -#include <linux/mm.h>
> -#include <linux/tty.h>
> -#include <linux/sysrq.h>
> #include <linux/delay.h>
> +#include <linux/errno.h>
> #include <linux/fb.h>
> #include <linux/init.h>
> +#include <linux/kernel.h>
> +#include <linux/mm.h>
> +#include <linux/module.h>
> +#include <linux/pci.h>
> +#include <linux/string.h>
> +#include <linux/sysrq.h>
> +#include <linux/tty.h>
>
> #include <drm/drm_crtc.h>
> -#include <drm/drm_fb_helper.h>
> #include <drm/drm_crtc_helper.h>
> +#include <drm/drm_fb_helper.h>
> +#include <drm/drm_fourcc.h>
>
> #include "vbox_drv.h"
> #include "vboxvideo.h"
> diff --git a/drivers/staging/vboxvideo/vbox_mode.c b/drivers/staging/vboxvideo/vbox_mode.c
> index 1aaff02c07ff..213551394495 100644
> --- a/drivers/staging/vboxvideo/vbox_mode.c
> +++ b/drivers/staging/vboxvideo/vbox_mode.c
> @@ -10,14 +10,17 @@
> * Hans de Goede <[email protected]>
> */
> #include <linux/export.h>
> +
> #include <drm/drm_atomic.h>
> #include <drm/drm_atomic_helper.h>
> +#include <drm/drm_fourcc.h>
> #include <drm/drm_plane_helper.h>
> #include <drm/drm_probe_helper.h>
> +#include <drm/drm_vblank.h>
>
> +#include "hgsmi_channels.h"
> #include "vbox_drv.h"
> #include "vboxvideo.h"
> -#include "hgsmi_channels.h"
>
> /*
> * Set a graphics mode. Poke any required values into registers, do an HGSMI
> --
> 2.12.0
>

--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

2019-02-01 18:16:44

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH v6 1/5] staging/vboxvideo: prepare for drmP.h removal from drm_modeset_helper.h

On Fri, Feb 01, 2019 at 06:37:49PM +0100, Daniel Vetter wrote:
> On Sat, Jan 26, 2019 at 01:25:23PM +0100, Sam Ravnborg wrote:
> > The use of drmP.h is discouraged and removal of it from
> > drm_modeset_helper.h caused vboxvideo to fail to build.
> >
> > This patch introduce the necessary fixes to prepare for the
> > drmP.h removal from drm_modeset_helper.h.
> >
> > In the files touched sort the include files
> >
> > Build tested on x86 and arm allmodconfig / allyesconfig.
> >
> > Signed-off-by: Sam Ravnborg <[email protected]>
> > Cc: Greg Kroah-Hartman <[email protected]>
> > Cc: Hans de Goede <[email protected]>
> > Cc: Daniel Vetter <[email protected]>
>
> Hi Greg,
>
> Ack for merging this through drm-misc? I think we've defacto-maintained
> vboxvideo in drm anyway this release ...

Sorry, feel free to just always take this type of stuff without my ack,
I can merge around you if I ever have any problems.

Acked-by: Greg Kroah-Hartman <[email protected]>

2019-02-07 21:36:27

by Daniel Vetter

[permalink] [raw]
Subject: Re: [PATCH v6 0/5] drm: minimize drmP.h dependencies

On Sat, Jan 26, 2019 at 01:25:22PM +0100, Sam Ravnborg wrote:
> Updated patchset, with merged patches removed, new patches added.
>
> > From the original mail:
>
> - drmP.h is now stripped down to include files
> and forward declarations.
> - All header files in include/drm/ no longer include drmP.h.
>
> The series was made on top of drm-misc-next:
> f1a2a540c86441016ce3dff6590b7a09080871de ("video/hdmi: Add an enum for HDMI packet types")

Entire series applied to drm-misc-next, and this time around nothing new
popped up! Thanks for sticking through this.

Cheers, Daniel

>
> Build tested using arm and x86, ia64, alpha, sparc32, sparc64
> Included staging/vboxvideo in the build test - which revealed
> the build issues Daniel had identifed
>
> This series include fixes to i915 as it looks in drm-misc.
> This series also include fixes to stagin/vboxvideo, which I
> expect to be committet to drm-misc due to the final patch
> (drmP.h removal from drm_modeset_helper.h) depending on this patch.
>
> Daniel - thanks for being paitent and applying this piecemal.
>
> Sam
> v6:
> - include fixes to vboxvideo (Daniel)
> - include i915 build fixes
> - revised/new rcar-du patch (lots of new build failures popped up)
> - split updates to drm/*.c file to dedicated patch,
> to make the final removal patch slimmer
>
> v5:
> - Rebased on top of drm-misc-next and dropped patches already merged
> - Sorted list of include files where they are touched (Laurent)
> - Collected ack's, reviewed by's
>
> v4:
> - Rebased on top of drm-misc-next and dropped patches already merged
> - Include build test of kirin (Daniel)
> - Plug drm_util.h into drm-internals.rst (Daniel)
> - Fix kernel-doc syntax in drm_util.h (Daniel)
> - Split removal of drmP.h from drm_modeset_helper.h
> in smaller patches, to ease the merge process
>
> v3:
> - Added Acks/Reviewed annotations (thanks!)
> - Add forward of drm_gem_object to drm_framebuffer.h (Noralf)
> - Drop "drm: move DRM_IF_VERSION to drm_internal.h" as it is applied to drm-misc
> - Drop "drm: make drm_file.h self contained" as Jan made a similar patch that was appleid to drm-misc
> - Rebased on top of drm-misc-next
>
> v2:
> - DRM_SWITCH_POWER as enum (Daniel Vetter)
> - Prefer forward decalration over includes (Laurent Pinchart)
> - Updated drm_device to use kerneldoc style (Daniel Vetter)
> - Improved commit messages (David Lechner)
> - Split up patch when removing drmP.h from drm_gem_cma_helper.h
> - rebased on top of drm-misc-next
> - dropped patch already applied
> - added reviewed-by from Laurent Pinchart (Laurent Pinchart)
> - add drm_framebuffer.h patch
> - add kernel-doc comments to drm_util.h
> - moved EXPORT_SYMBOL_FOR_TESTS_ONLY to drm_util.h
> - added note to drmP.h not to add new stuff and not to use in new files
>
> Sam Ravnborg (5):
> staging/vboxvideo: prepare for drmP.h removal from drm_modeset_helper.h
> drm/i915: prepare for drmP.h removal from drm_modeset_helper.h
> drm/rcar-du: prepare for drmP.h removal from drm_modeset_helper.h
> drm: prepare for drmP.h removal from drm_modeset_helper.h
> drm: remove drmP.h from drm_modeset_helper.h
>
> drivers/gpu/drm/drm_damage_helper.c | 1 +
> drivers/gpu/drm/drm_modeset_helper.c | 2 ++
> drivers/gpu/drm/i915/i915_drv.c | 4 +++-
> drivers/gpu/drm/i915/intel_atomic.c | 2 ++
> drivers/gpu/drm/i915/intel_atomic_plane.c | 2 ++
> drivers/gpu/drm/i915/intel_display.c | 29 ++++++++++++++++-------------
> drivers/gpu/drm/i915/intel_pm.c | 7 +++++--
> drivers/gpu/drm/rcar-du/rcar_du_crtc.c | 3 +++
> drivers/gpu/drm/rcar-du/rcar_du_drv.c | 1 +
> drivers/gpu/drm/rcar-du/rcar_du_kms.c | 2 ++
> drivers/gpu/drm/rcar-du/rcar_du_plane.c | 2 ++
> drivers/gpu/drm/rcar-du/rcar_du_vsp.c | 1 +
> drivers/staging/vboxvideo/vbox_drv.c | 6 +++++-
> drivers/staging/vboxvideo/vbox_fb.c | 18 ++++++++++--------
> drivers/staging/vboxvideo/vbox_mode.c | 5 ++++-
> include/drm/drm_modeset_helper.h | 6 +++++-
> 16 files changed, 64 insertions(+), 27 deletions(-)

--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch