Skip to contentSkip to conversation

drm/shmobile: drop use of drmP.h

PATCH In review Sam Ravnborg 2 participants 4 messages Jun 30, 2019 – Jul 15, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/shmobile: drop use of drmP.h

Drop use of the deprecated drmP.h header file.
Fix fallout.

Cc Laurent Pinchart <[email protected]>
Cc Kieran Bingham <[email protected]>
Cc David Airlie <[email protected]>
Cc Daniel Vetter <[email protected]>

---
The patch is build tested using several configs and several architectures (including arm, arm64, x86).

The patch is based on drm-misc.

If patch is OK, please apply to your tree
as this driver is maintained outside drm-misc.

I am happy to rebase on another tree, just let me know.

Sam

 drivers/gpu/drm/shmobile/shmob_drm_crtc.c  | 3 ++-
 drivers/gpu/drm/shmobile/shmob_drm_crtc.h  | 1 -
 drivers/gpu/drm/shmobile/shmob_drm_drv.c   | 4 +++-
 drivers/gpu/drm/shmobile/shmob_drm_kms.c   | 1 -
 drivers/gpu/drm/shmobile/shmob_drm_plane.c | 2 +-
 5 files changed, 6 insertions(+), 5 deletions(-)
drivers/gpu/drm/shmobile/shmob_drm_crtc.c +2 -1
index b6988a6d698e..75a752d59ef1 100644
@@ -10,13 +10,14 @@
 #include <linux/backlight.h>
 #include <linux/clk.h>
 
-#include <drm/drmP.h>
 #include <drm/drm_crtc.h>
 #include <drm/drm_crtc_helper.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>
 #include <drm/drm_probe_helper.h>
+#include <drm/drm_vblank.h>
 
 #include "shmob_drm_backlight.h"
 #include "shmob_drm_crtc.h"
drivers/gpu/drm/shmobile/shmob_drm_crtc.h +0 -1
index 9ca6920641d8..bd35fe8f9028 100644
@@ -10,7 +10,6 @@
 #ifndef __SHMOB_DRM_CRTC_H__
 #define __SHMOB_DRM_CRTC_H__
 
-#include <drm/drmP.h>
 #include <drm/drm_crtc.h>
 #include <drm/drm_encoder.h>
 
drivers/gpu/drm/shmobile/shmob_drm_drv.c +3 -1
index 6c106b7a3bfe..b8c0930959c7 100644
@@ -15,10 +15,12 @@
 #include <linux/pm.h>
 #include <linux/slab.h>
 
-#include <drm/drmP.h>
 #include <drm/drm_crtc_helper.h>
+#include <drm/drm_drv.h>
 #include <drm/drm_gem_cma_helper.h>
+#include <drm/drm_irq.h>
 #include <drm/drm_probe_helper.h>
+#include <drm/drm_vblank.h>
 
 #include "shmob_drm_drv.h"
 #include "shmob_drm_kms.h"
drivers/gpu/drm/shmobile/shmob_drm_kms.c +0 -1
index 2e08bc203bf9..c51197b6fd85 100644
@@ -7,7 +7,6 @@
  * Laurent Pinchart ([email protected])
  */
 
-#include <drm/drmP.h>
 #include <drm/drm_crtc.h>
 #include <drm/drm_crtc_helper.h>
 #include <drm/drm_fb_cma_helper.h>
drivers/gpu/drm/shmobile/shmob_drm_plane.c +1 -1
index 1d1ee5e51351..cbc464f006b4 100644
@@ -7,10 +7,10 @@
  * Laurent Pinchart ([email protected])
  */
 
-#include <drm/drmP.h>
 #include <drm/drm_crtc.h>
 #include <drm/drm_crtc_helper.h>
 #include <drm/drm_fb_cma_helper.h>
+#include <drm/drm_fourcc.h>
 #include <drm/drm_gem_cma_helper.h>
 
 #include "shmob_drm_drv.h"
Signature · 6 lines
2.20.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 1/1
#1 lore raw

Hi Sam,

Thank you for the patch.

Quoted 13 lines · Sam Ravnborg

Drop use of the deprecated drmP.h header file.
Fix fallout.

Cc Laurent Pinchart <[email protected]>
Cc Kieran Bingham <[email protected]>
Cc David Airlie <[email protected]>
Cc Daniel Vetter <[email protected]>

---
The patch is build tested using several configs and several architectures (including arm, arm64, x86).

Quoted 6 lines

The patch is based on drm-misc.

If patch is OK, please apply to your tree
as this driver is maintained outside drm-misc.

I am happy to rebase on another tree, just let me know.

The shmobile driver hasn't seen changes for a long time and I don't have patches queued in my tree for it. If you don't mind taking this patch through drm-misc with the rest of the drmP.h removal series it would be easier for me. Otherwise please let me know and I'll handle it.

Quoted 32 lines
 drivers/gpu/drm/shmobile/shmob_drm_crtc.c  | 3 ++-
 drivers/gpu/drm/shmobile/shmob_drm_crtc.h  | 1 -
 drivers/gpu/drm/shmobile/shmob_drm_drv.c   | 4 +++-
 drivers/gpu/drm/shmobile/shmob_drm_kms.c   | 1 -
 drivers/gpu/drm/shmobile/shmob_drm_plane.c | 2 +-
 5 files changed, 6 insertions(+), 5 deletions(-)
drivers/gpu/drm/shmobile/shmob_drm_crtc.c +2 -1
index b6988a6d698e..75a752d59ef1 100644
@@ -10,13 +10,14 @@
 #include <linux/backlight.h>
 #include <linux/clk.h>
 
-#include <drm/drmP.h>
 #include <drm/drm_crtc.h>
 #include <drm/drm_crtc_helper.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>
 #include <drm/drm_probe_helper.h>
+#include <drm/drm_vblank.h>
 
 #include "shmob_drm_backlight.h"
 #include "shmob_drm_crtc.h"
drivers/gpu/drm/shmobile/shmob_drm_crtc.h +0 -0
index 9ca6920641d8..bd35fe8f9028 100644

drivers/gpu/drm/shmobile/shmob_drm_crtc.h line 13

Quoted 4 lines
drivers/gpu/drm/shmobile/shmob_drm_crtc.h +0 -1
@@ -10,7 +10,6 @@
 #ifndef __SHMOB_DRM_CRTC_H__
 #define __SHMOB_DRM_CRTC_H__
 
-#include <drm/drmP.h>

I think you should include drm/drm_connector.h here. It gets pulled indirectly, but it's one of the top-level headers and I think it should be explicitly included to avoid future breakages.

While at it a forward declaration of struct drm_pending_vblank_event and struct shmob_drm_format_info could also be useful to make the header self-contained.

Apart from that,

Quoted 49 lines
drivers/gpu/drm/shmobile/shmob_drm_crtc.h +0 -0
 #include <drm/drm_crtc.h>
 #include <drm/drm_encoder.h>
 
drivers/gpu/drm/shmobile/shmob_drm_drv.c +3 -1
index 6c106b7a3bfe..b8c0930959c7 100644
@@ -15,10 +15,12 @@
 #include <linux/pm.h>
 #include <linux/slab.h>
 
-#include <drm/drmP.h>
 #include <drm/drm_crtc_helper.h>
+#include <drm/drm_drv.h>
 #include <drm/drm_gem_cma_helper.h>
+#include <drm/drm_irq.h>
 #include <drm/drm_probe_helper.h>
+#include <drm/drm_vblank.h>
 
 #include "shmob_drm_drv.h"
 #include "shmob_drm_kms.h"
drivers/gpu/drm/shmobile/shmob_drm_kms.c +0 -1
index 2e08bc203bf9..c51197b6fd85 100644
@@ -7,7 +7,6 @@
  * Laurent Pinchart ([email protected])
  */
 
-#include <drm/drmP.h>
 #include <drm/drm_crtc.h>
 #include <drm/drm_crtc_helper.h>
 #include <drm/drm_fb_cma_helper.h>
drivers/gpu/drm/shmobile/shmob_drm_plane.c +1 -1
index 1d1ee5e51351..cbc464f006b4 100644
@@ -7,10 +7,10 @@
  * Laurent Pinchart ([email protected])
  */
 
-#include <drm/drmP.h>
 #include <drm/drm_crtc.h>
 #include <drm/drm_crtc_helper.h>
 #include <drm/drm_fb_cma_helper.h>
+#include <drm/drm_fourcc.h>
 #include <drm/drm_gem_cma_helper.h>
 
 #include "shmob_drm_drv.h"
Signature · 7 lines
Regards,

Laurent Pinchart
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#2 lore raw

Hi Laurent.

Thanks for the detailed feedback.

Quoted 9 lines
Quoted 4 lines

If patch is OK, please apply to your tree
as this driver is maintained outside drm-misc.

I am happy to rebase on another tree, just let me know.

The shmobile driver hasn't seen changes for a long time and I don't have patches queued in my tree for it. If you don't mind taking this patch through drm-misc with the rest of the drmP.h removal series it would be easier for me. Otherwise please let me know and I'll handle it.

No problem, I will add to drm-misc when ready.
The motivation was alone to avoid later merge conflicts - which in this case is a non-issue.

Quoted 14 lines

drivers/gpu/drm/shmobile/shmob_drm_crtc.h line 13

Quoted 9 lines
drivers/gpu/drm/shmobile/shmob_drm_crtc.h +0 -1
index 9ca6920641d8..bd35fe8f9028 100644
@@ -10,7 +10,6 @@
 #ifndef __SHMOB_DRM_CRTC_H__
 #define __SHMOB_DRM_CRTC_H__
 
-#include <drm/drmP.h>

I think you should include drm/drm_connector.h here. It gets pulled indirectly, but it's one of the top-level headers and I think it should be explicitly included to avoid future breakages.

Quoted 3 lines

While at it a forward declaration of struct drm_pending_vblank_event and struct shmob_drm_format_info could also be useful to make the header self-contained.

Good input.
I went through all shmobile header files - now gcc is happy with them all when used individually (self-contained).

I will post a v2 a bit later today with the below fixup included.

Sam

drivers/gpu/drm/shmobile/shmob_drm_crtc.h +3 -0
index bd35fe8f9028..21718843f46d 100644
@@ -11,10 +11,13 @@
 #define __SHMOB_DRM_CRTC_H__
 
 #include <drm/drm_crtc.h>
+#include <drm/drm_connector.h>
 #include <drm/drm_encoder.h>
 
 struct backlight_device;
+struct drm_pending_vblank_event;
 struct shmob_drm_device;
+struct shmob_drm_format_info;
 
 struct shmob_drm_crtc {
 	struct drm_crtc crtc;
drivers/gpu/drm/shmobile/shmob_drm_plane.h +1 -0
index bae67cc8c628..e72b21a4288f 100644
@@ -10,6 +10,7 @@
 #ifndef __SHMOB_DRM_PLANE_H__
 #define __SHMOB_DRM_PLANE_H__
 
+struct drm_plane;
 struct shmob_drm_device;
 
 int shmob_drm_plane_create(struct shmob_drm_device *sdev, unsigned int index);
drivers/gpu/drm/shmobile/shmob_drm_regs.h +3 -0
index 9eb0b3d01df8..058533685c4c 100644
@@ -11,6 +11,9 @@
 #define __SHMOB_DRM_REGS_H__
 
 #include <linux/io.h>
+#include <linux/jiffies.h>
+
+#include "shmob_drm_drv.h"
 
 /* Register definitions */
 #define LDDCKPAT1R		0x400

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

author Reviewed-by Laurent Pinchart
#3 lore raw

Hi Laurent

Quoted 23 lines
Quoted 5 lines

The shmobile driver hasn't seen changes for a long time and I don't have patches queued in my tree for it. If you don't mind taking this patch through drm-misc with the rest of the drmP.h removal series it would be easier for me. Otherwise please let me know and I'll handle it.

No problem, I will add to drm-misc when ready.
The motivation was alone to avoid later merge conflicts - which in this case is a non-issue.

Quoted 14 lines

drivers/gpu/drm/shmobile/shmob_drm_crtc.h line 13

Quoted 9 lines
drivers/gpu/drm/shmobile/shmob_drm_crtc.h +0 -1
index 9ca6920641d8..bd35fe8f9028 100644
@@ -10,7 +10,6 @@
 #ifndef __SHMOB_DRM_CRTC_H__
 #define __SHMOB_DRM_CRTC_H__
 
-#include <drm/drmP.h>

I think you should include drm/drm_connector.h here. It gets pulled indirectly, but it's one of the top-level headers and I think it should be explicitly included to avoid future breakages.

Quoted 8 lines
Quoted 3 lines

While at it a forward declaration of struct drm_pending_vblank_event and struct shmob_drm_format_info could also be useful to make the header self-contained.

Good input.
I went through all shmobile header files - now gcc is happy with them all when used individually (self-contained).

I will post a v2 a bit later today with the below fixup included.

Here is the v2 that I have applied locally and will push out soonish.

Sam

From 7a9ff461c095034f9339df1045a7e8a4177bfbfe Mon Sep 17 00:00:00 2001
From: Sam Ravnborg <[email protected]>
Date: Sat, 29 Jun 2019 11:27:23 +0200
Subject: [PATCH v2 1/1] drm/shmobile: drop use of drmP.h

Drop use of the deprecated drmP.h header file.
Fix fallout.

v2:
- Add additional include/forward to shmob_drm_crtc.h to avoid relying on indirect includes (Laurent)
- Add additional includes to shmob_drm_regs.h to make it self-contained
- Add additonal includes to shmob_drm_plane.h to make it self-contained

---
 drivers/gpu/drm/shmobile/shmob_drm_crtc.c  | 3 ++-
 drivers/gpu/drm/shmobile/shmob_drm_crtc.h  | 4 +++-
 drivers/gpu/drm/shmobile/shmob_drm_drv.c   | 4 +++-
 drivers/gpu/drm/shmobile/shmob_drm_kms.c   | 1 -
 drivers/gpu/drm/shmobile/shmob_drm_plane.c | 2 +-
 drivers/gpu/drm/shmobile/shmob_drm_plane.h | 1 +
 drivers/gpu/drm/shmobile/shmob_drm_regs.h  | 3 +++
 7 files changed, 13 insertions(+), 5 deletions(-)
drivers/gpu/drm/shmobile/shmob_drm_crtc.c +2 -1
index b6988a6d698e..75a752d59ef1 100644
@@ -10,13 +10,14 @@
 #include <linux/backlight.h>
 #include <linux/clk.h>
 
-#include <drm/drmP.h>
 #include <drm/drm_crtc.h>
 #include <drm/drm_crtc_helper.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>
 #include <drm/drm_probe_helper.h>
+#include <drm/drm_vblank.h>
 
 #include "shmob_drm_backlight.h"
 #include "shmob_drm_crtc.h"
drivers/gpu/drm/shmobile/shmob_drm_crtc.h +3 -1
index 9ca6920641d8..21718843f46d 100644
@@ -10,12 +10,14 @@
 #ifndef __SHMOB_DRM_CRTC_H__
 #define __SHMOB_DRM_CRTC_H__
 
-#include <drm/drmP.h>
 #include <drm/drm_crtc.h>
+#include <drm/drm_connector.h>
 #include <drm/drm_encoder.h>
 
 struct backlight_device;
+struct drm_pending_vblank_event;
 struct shmob_drm_device;
+struct shmob_drm_format_info;
 
 struct shmob_drm_crtc {
 	struct drm_crtc crtc;
drivers/gpu/drm/shmobile/shmob_drm_drv.c +3 -1
index 6c106b7a3bfe..b8c0930959c7 100644
@@ -15,10 +15,12 @@
 #include <linux/pm.h>
 #include <linux/slab.h>
 
-#include <drm/drmP.h>
 #include <drm/drm_crtc_helper.h>
+#include <drm/drm_drv.h>
 #include <drm/drm_gem_cma_helper.h>
+#include <drm/drm_irq.h>
 #include <drm/drm_probe_helper.h>
+#include <drm/drm_vblank.h>
 
 #include "shmob_drm_drv.h"
 #include "shmob_drm_kms.h"
drivers/gpu/drm/shmobile/shmob_drm_kms.c +0 -1
index 2e08bc203bf9..c51197b6fd85 100644
@@ -7,7 +7,6 @@
  * Laurent Pinchart ([email protected])
  */
 
-#include <drm/drmP.h>
 #include <drm/drm_crtc.h>
 #include <drm/drm_crtc_helper.h>
 #include <drm/drm_fb_cma_helper.h>
drivers/gpu/drm/shmobile/shmob_drm_plane.c +1 -1
index 1d1ee5e51351..cbc464f006b4 100644
@@ -7,10 +7,10 @@
  * Laurent Pinchart ([email protected])
  */
 
-#include <drm/drmP.h>
 #include <drm/drm_crtc.h>
 #include <drm/drm_crtc_helper.h>
 #include <drm/drm_fb_cma_helper.h>
+#include <drm/drm_fourcc.h>
 #include <drm/drm_gem_cma_helper.h>
 
 #include "shmob_drm_drv.h"
drivers/gpu/drm/shmobile/shmob_drm_plane.h +1 -0
index bae67cc8c628..e72b21a4288f 100644
@@ -10,6 +10,7 @@
 #ifndef __SHMOB_DRM_PLANE_H__
 #define __SHMOB_DRM_PLANE_H__
 
+struct drm_plane;
 struct shmob_drm_device;
 
 int shmob_drm_plane_create(struct shmob_drm_device *sdev, unsigned int index);
drivers/gpu/drm/shmobile/shmob_drm_regs.h +3 -0
index 9eb0b3d01df8..058533685c4c 100644
@@ -11,6 +11,9 @@
 #define __SHMOB_DRM_REGS_H__
 
 #include <linux/io.h>
+#include <linux/jiffies.h>
+
+#include "shmob_drm_drv.h"
 
 /* Register definitions */
 #define LDDCKPAT1R		0x400
Signature · 6 lines
2.20.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel