First patch from Jani fixes so drm_print.h is self-contained. Next two patches are trivial removal of uapi dependencies.
ati_pcigart is fixed to drop use of drm_os_linux.h
drm_vblank is likewise fixed to drop use of drm_os_linux.h This was a non-trivial conversion, *review requested!*
The remaining patches are preparation for and removal of uapi/drm/drmh from drm_file.h. There were a few files where we had to push include of drm/drm.h out to to have a clean build.
CK Hu - please let me apply the mediatek patch to drm-misc-next, as it is required for the final patch. Or push it to drm-misc-next yourself.
Sam
Jani Nikula (1): drm/panel: make drm_panel.h self-contained
Sam Ravnborg (10): drm: drop uapi dependency from drm_print.h drm: drop uapi dependency from drm_vblank.h drm/ati_pcigart: drop dependency on drm_os_linux.h drm/vblank: drop use of DRM_WAIT_ON() drm: direct include of drm.h in drm_gem.c drm: direct include of drm.h in drm_gem_shmem_helper.c drm: direct include of drm.h in drm_prime.c drm: direct include of drm.h in drm_syncobj.c drm/mediatek: direct include of drm.h in mtk_drm_gem.c drm: drop uapi dependency from drm_file.h
drivers/gpu/drm/ati_pcigart.c | 10 ++++++---- drivers/gpu/drm/drm_gem.c | 1 + drivers/gpu/drm/drm_gem_shmem_helper.c | 1 + drivers/gpu/drm/drm_prime.c | 1 + drivers/gpu/drm/drm_syncobj.c | 1 + drivers/gpu/drm/drm_vblank.c | 29 ++++++++++++++++++++--------- drivers/gpu/drm/mediatek/mtk_drm_gem.c | 1 + include/drm/drm_file.h | 4 +--- include/drm/drm_panel.h | 1 + include/drm/drm_print.h | 4 +--- include/drm/drm_vblank.h | 1 - 11 files changed, 34 insertions(+), 20 deletions(-)
From: Jani Nikula jani.nikula@intel.com
Fix build warning if drm_panel.h is built with CONFIG_OF=n or CONFIG_DRM_PANEL=n and included without the prerequisite err.h:
./include/drm/drm_panel.h: In function ‘of_drm_find_panel’: ./include/drm/drm_panel.h:203:9: error: implicit declaration of function ‘ERR_PTR’ [-Werror=implicit-function-declaration] return ERR_PTR(-ENODEV); ^~~~~~~ ./include/drm/drm_panel.h:203:9: error: returning ‘int’ from a function with return type ‘struct drm_panel *’ makes pointer from integer without a cast [-Werror=int-conversion] return ERR_PTR(-ENODEV); ^~~~~~~~~~~~~~~~
Fixes: 5fa8e4a22182 ("drm/panel: Make of_drm_find_panel() return an ERR_PTR() instead of NULL") Cc: Boris Brezillon boris.brezillon@bootlin.com Signed-off-by: Jani Nikula jani.nikula@intel.com Acked-by: Thierry Reding treding@nvidia.com Reviewed-by: Sam Ravnborg sam@ravnborg.org --- include/drm/drm_panel.h | 1 + 1 file changed, 1 insertion(+)
diff --git a/include/drm/drm_panel.h b/include/drm/drm_panel.h index 8c738c0e6e9f..26377836141c 100644 --- a/include/drm/drm_panel.h +++ b/include/drm/drm_panel.h @@ -24,6 +24,7 @@ #ifndef __DRM_PANEL_H__ #define __DRM_PANEL_H__
+#include <linux/err.h> #include <linux/errno.h> #include <linux/list.h>
On Thu, Jul 18, 2019 at 06:14:57PM +0200, Sam Ravnborg wrote:
From: Jani Nikula jani.nikula@intel.com
Fix build warning if drm_panel.h is built with CONFIG_OF=n or CONFIG_DRM_PANEL=n and included without the prerequisite err.h:
./include/drm/drm_panel.h: In function ‘of_drm_find_panel’: ./include/drm/drm_panel.h:203:9: error: implicit declaration of function ‘ERR_PTR’ [-Werror=implicit-function-declaration] return ERR_PTR(-ENODEV); ^~~~~~~ ./include/drm/drm_panel.h:203:9: error: returning ‘int’ from a function with return type ‘struct drm_panel *’ makes pointer from integer without a cast [-Werror=int-conversion] return ERR_PTR(-ENODEV); ^~~~~~~~~~~~~~~~
Fixes: 5fa8e4a22182 ("drm/panel: Make of_drm_find_panel() return an ERR_PTR() instead of NULL") Cc: Boris Brezillon boris.brezillon@bootlin.com Signed-off-by: Jani Nikula jani.nikula@intel.com Acked-by: Thierry Reding treding@nvidia.com Reviewed-by: Sam Ravnborg sam@ravnborg.org
Reviewed-by: Sean Paul sean@poorly.run
include/drm/drm_panel.h | 1 + 1 file changed, 1 insertion(+)
diff --git a/include/drm/drm_panel.h b/include/drm/drm_panel.h index 8c738c0e6e9f..26377836141c 100644 --- a/include/drm/drm_panel.h +++ b/include/drm/drm_panel.h @@ -24,6 +24,7 @@ #ifndef __DRM_PANEL_H__ #define __DRM_PANEL_H__
+#include <linux/err.h> #include <linux/errno.h> #include <linux/list.h>
-- 2.20.1
drm_print.h used DRM_NAME - thus adding a dependency from include/drm/drm_print.h => uapi/drm/drm.h
Hardcode the name "drm" to break this dependency. The idea is that there shall be a minimal dependency between include/drm/* and uapi/*
Signed-off-by: Sam Ravnborg sam@ravnborg.org Suggested-by: Daniel Vetter daniel@ffwll.ch Reviewed-by: Daniel Vetter daniel.vetter@ffwll.ch Cc: Maarten Lankhorst maarten.lankhorst@linux.intel.com Cc: Maxime Ripard maxime.ripard@bootlin.com Cc: Sean Paul sean@poorly.run Cc: David Airlie airlied@linux.ie Cc: Rob Clark robdclark@gmail.com Cc: Sean Paul seanpaul@chromium.org Cc: Chris Wilson chris@chris-wilson.co.uk Cc: Daniel Vetter daniel@ffwll.ch --- include/drm/drm_print.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h index a5d6f2f3e430..760d1bd0eaf1 100644 --- a/include/drm/drm_print.h +++ b/include/drm/drm_print.h @@ -32,8 +32,6 @@ #include <linux/device.h> #include <linux/debugfs.h>
-#include <drm/drm.h> - /** * DOC: print * @@ -287,7 +285,7 @@ void drm_err(const char *format, ...); /* Macros to make printk easier */
#define _DRM_PRINTK(once, level, fmt, ...) \ - printk##once(KERN_##level "[" DRM_NAME "] " fmt, ##__VA_ARGS__) + printk##once(KERN_##level "[drm] " fmt, ##__VA_ARGS__)
#define DRM_INFO(fmt, ...) \ _DRM_PRINTK(, INFO, fmt, ##__VA_ARGS__)
Quoting Sam Ravnborg (2019-07-18 17:14:58)
drm_print.h used DRM_NAME - thus adding a dependency from include/drm/drm_print.h => uapi/drm/drm.h
Hardcode the name "drm" to break this dependency. The idea is that there shall be a minimal dependency between include/drm/* and uapi/*
Signed-off-by: Sam Ravnborg sam@ravnborg.org Suggested-by: Daniel Vetter daniel@ffwll.ch Reviewed-by: Daniel Vetter daniel.vetter@ffwll.ch Cc: Maarten Lankhorst maarten.lankhorst@linux.intel.com Cc: Maxime Ripard maxime.ripard@bootlin.com Cc: Sean Paul sean@poorly.run Cc: David Airlie airlied@linux.ie Cc: Rob Clark robdclark@gmail.com Cc: Sean Paul seanpaul@chromium.org Cc: Chris Wilson chris@chris-wilson.co.uk Cc: Daniel Vetter daniel@ffwll.ch
include/drm/drm_print.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h index a5d6f2f3e430..760d1bd0eaf1 100644 --- a/include/drm/drm_print.h +++ b/include/drm/drm_print.h @@ -32,8 +32,6 @@ #include <linux/device.h> #include <linux/debugfs.h>
-#include <drm/drm.h>
/**
- DOC: print
@@ -287,7 +285,7 @@ void drm_err(const char *format, ...); /* Macros to make printk easier */
#define _DRM_PRINTK(once, level, fmt, ...) \
printk##once(KERN_##level "[" DRM_NAME "] " fmt, ##__VA_ARGS__)
printk##once(KERN_##level "[drm] " fmt, ##__VA_ARGS__)
I guess I'm th only one who
#undef DRM_NAME #define DRM_NAME i915
just so that I didn't have inane logs?
One might suggest that instead of hardcoding it, follow the pr_fmt() pattern and only add "[drm]" for the drm core.
Even then it so useless (which drm driver is this message for???) that I want to remove them all :( -Chris
Am 18.07.19 um 18:46 schrieb Chris Wilson:
Quoting Sam Ravnborg (2019-07-18 17:14:58)
drm_print.h used DRM_NAME - thus adding a dependency from include/drm/drm_print.h => uapi/drm/drm.h
Hardcode the name "drm" to break this dependency. The idea is that there shall be a minimal dependency between include/drm/* and uapi/*
Signed-off-by: Sam Ravnborg sam@ravnborg.org Suggested-by: Daniel Vetter daniel@ffwll.ch Reviewed-by: Daniel Vetter daniel.vetter@ffwll.ch Cc: Maarten Lankhorst maarten.lankhorst@linux.intel.com Cc: Maxime Ripard maxime.ripard@bootlin.com Cc: Sean Paul sean@poorly.run Cc: David Airlie airlied@linux.ie Cc: Rob Clark robdclark@gmail.com Cc: Sean Paul seanpaul@chromium.org Cc: Chris Wilson chris@chris-wilson.co.uk Cc: Daniel Vetter daniel@ffwll.ch
include/drm/drm_print.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h index a5d6f2f3e430..760d1bd0eaf1 100644 --- a/include/drm/drm_print.h +++ b/include/drm/drm_print.h @@ -32,8 +32,6 @@ #include <linux/device.h> #include <linux/debugfs.h>
-#include <drm/drm.h>
- /**
- DOC: print
@@ -287,7 +285,7 @@ void drm_err(const char *format, ...); /* Macros to make printk easier */
#define _DRM_PRINTK(once, level, fmt, ...) \
printk##once(KERN_##level "[" DRM_NAME "] " fmt, ##__VA_ARGS__)
printk##once(KERN_##level "[drm] " fmt, ##__VA_ARGS__)
I guess I'm th only one who
#undef DRM_NAME #define DRM_NAME i915
just so that I didn't have inane logs?
One might suggest that instead of hardcoding it, follow the pr_fmt() pattern and only add "[drm]" for the drm core.
Even then it so useless (which drm driver is this message for???) that I want to remove them all :(
Yeah, agree. I mean it is nice if the core drm functions use a prefix for debug output.
But I actually don't see the point for individual drivers.
Christian.
-Chris
On Fri, 19 Jul 2019, "Koenig, Christian" Christian.Koenig@amd.com wrote:
Am 18.07.19 um 18:46 schrieb Chris Wilson:
Quoting Sam Ravnborg (2019-07-18 17:14:58)
drm_print.h used DRM_NAME - thus adding a dependency from include/drm/drm_print.h => uapi/drm/drm.h
Hardcode the name "drm" to break this dependency. The idea is that there shall be a minimal dependency between include/drm/* and uapi/*
Signed-off-by: Sam Ravnborg sam@ravnborg.org Suggested-by: Daniel Vetter daniel@ffwll.ch Reviewed-by: Daniel Vetter daniel.vetter@ffwll.ch Cc: Maarten Lankhorst maarten.lankhorst@linux.intel.com Cc: Maxime Ripard maxime.ripard@bootlin.com Cc: Sean Paul sean@poorly.run Cc: David Airlie airlied@linux.ie Cc: Rob Clark robdclark@gmail.com Cc: Sean Paul seanpaul@chromium.org Cc: Chris Wilson chris@chris-wilson.co.uk Cc: Daniel Vetter daniel@ffwll.ch
include/drm/drm_print.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h index a5d6f2f3e430..760d1bd0eaf1 100644 --- a/include/drm/drm_print.h +++ b/include/drm/drm_print.h @@ -32,8 +32,6 @@ #include <linux/device.h> #include <linux/debugfs.h>
-#include <drm/drm.h>
- /**
- DOC: print
@@ -287,7 +285,7 @@ void drm_err(const char *format, ...); /* Macros to make printk easier */
#define _DRM_PRINTK(once, level, fmt, ...) \
printk##once(KERN_##level "[" DRM_NAME "] " fmt, ##__VA_ARGS__)
printk##once(KERN_##level "[drm] " fmt, ##__VA_ARGS__)
I guess I'm th only one who
#undef DRM_NAME #define DRM_NAME i915
just so that I didn't have inane logs?
One might suggest that instead of hardcoding it, follow the pr_fmt() pattern and only add "[drm]" for the drm core.
Even then it so useless (which drm driver is this message for???) that I want to remove them all :(
Yeah, agree. I mean it is nice if the core drm functions use a prefix for debug output.
But I actually don't see the point for individual drivers.
We should all migrate to the versions with device...
BR, Jani.
Christian.
-Chris
dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Even then it so useless (which drm driver is this message for???) that I want to remove them all :(
Yeah, agree. I mean it is nice if the core drm functions use a prefix for debug output.
But I actually don't see the point for individual drivers.
We should all migrate to the versions with device...
Just to do an xkdc.com/927 I have considered:
drm_err(const struct drm_device *drm, ...) drm_info(const struct drm_device *drm, ...)
drm_kms_err(const struct drm_device *drm, ...) drm_kms_info(const struct drm_device *drm, ...))
And so on for vbl, primse. lease, state etc.
Then we could fish out relevant info from the drm device and present this nicely.
For the cases where no drm_device is available the fallback is: drm_dev_err(const struct drm_device *drm, ...) drm_dev_info(const struct drm_device *drm, ...))
We could modify the existing UPPERCASE macros to be placeholders for the more reader friendly lower cases variants and base it all on the established infrastructure.
But this is just idle thinking, as only a serious patch would stir the relevant discussions.
For now this is far from the top of my TODO list.
Sam
Am 29.07.19 um 16:35 schrieb Sam Ravnborg:
Even then it so useless (which drm driver is this message for???) that I want to remove them all :(
Yeah, agree. I mean it is nice if the core drm functions use a prefix for debug output.
But I actually don't see the point for individual drivers.
We should all migrate to the versions with device...
Just to do an xkdc.com/927 I have considered:
drm_err(const struct drm_device *drm, ...) drm_info(const struct drm_device *drm, ...)
drm_kms_err(const struct drm_device *drm, ...) drm_kms_info(const struct drm_device *drm, ...))
Why not get completely rid of those and just use dev_err, dev_warn, pr_err, pr_warn etc?
I mean is it useful to have this extra printing subsystem in DRM while the standard Linux one actually does a better job?
Christian.
And so on for vbl, primse. lease, state etc.
Then we could fish out relevant info from the drm device and present this nicely.
For the cases where no drm_device is available the fallback is: drm_dev_err(const struct drm_device *drm, ...) drm_dev_info(const struct drm_device *drm, ...))
We could modify the existing UPPERCASE macros to be placeholders for the more reader friendly lower cases variants and base it all on the established infrastructure.
But this is just idle thinking, as only a serious patch would stir the relevant discussions.
For now this is far from the top of my TODO list.
Sam
Hi Christian.
On Mon, Jul 29, 2019 at 03:28:15PM +0000, Koenig, Christian wrote:
Am 29.07.19 um 16:35 schrieb Sam Ravnborg:
Even then it so useless (which drm driver is this message for???) that I want to remove them all :(
Yeah, agree. I mean it is nice if the core drm functions use a prefix for debug output.
But I actually don't see the point for individual drivers.
We should all migrate to the versions with device...
Just to do an xkdc.com/927 I have considered:
drm_err(const struct drm_device *drm, ...) drm_info(const struct drm_device *drm, ...)
drm_kms_err(const struct drm_device *drm, ...) drm_kms_info(const struct drm_device *drm, ...))
Why not get completely rid of those and just use dev_err, dev_warn, pr_err, pr_warn etc?
I mean is it useful to have this extra printing subsystem in DRM while the standard Linux one actually does a better job?
The added functionality of drm_xxx_err would be to keep the current drm.debug=0x1f filtering on the command-line. I do not think we can do this with the standard logging.
And then we can prefix every logging with driver name and device name.
The idea is to make a thin layer on top of the existing pr_xxx() functions. So not a full subsystem, only a wrapper on top of what we already have.
Anyway, idle talk only. We need patches and sample output if we should discuss more.
Sam
On Mon, 29 Jul 2019, Sam Ravnborg sam@ravnborg.org wrote:
Hi Christian.
On Mon, Jul 29, 2019 at 03:28:15PM +0000, Koenig, Christian wrote:
Am 29.07.19 um 16:35 schrieb Sam Ravnborg:
Even then it so useless (which drm driver is this message for???) that I want to remove them all :(
Yeah, agree. I mean it is nice if the core drm functions use a prefix for debug output.
But I actually don't see the point for individual drivers.
We should all migrate to the versions with device...
Just to do an xkdc.com/927 I have considered:
drm_err(const struct drm_device *drm, ...) drm_info(const struct drm_device *drm, ...)
drm_kms_err(const struct drm_device *drm, ...) drm_kms_info(const struct drm_device *drm, ...))
Why not get completely rid of those and just use dev_err, dev_warn, pr_err, pr_warn etc?
I mean is it useful to have this extra printing subsystem in DRM while the standard Linux one actually does a better job?
The added functionality of drm_xxx_err would be to keep the current drm.debug=0x1f filtering on the command-line. I do not think we can do this with the standard logging.
Correct. I'd love the benefits of dynamic debug, but there's no support for the kind of message categories that we do with drm.debug.
I've contemplated switching i915 over to using the variants where you pass the device, but I really really don't like the idea of:
- DRM_DEBUG_KMS("hello\n"); + DRM_DEV_DEBUG_KMS(i915->drm.dev, "hello\n");
Where i915 is our private wrapper for drm_device. I think it's just too much ugly uppercase boilerplate, and a large portion of the debugs would have to span at least an extra line after that.
I'd also very much prefer passing just struct *drm_device instead of struct *device. In that, I think the needs of the few have prevailed over the needs of the many. I'd definitely prefer drm_err(const struct drm_device *drm, ...) and friends over the current ones.
Frankly, I've actually ended up thinking about adding our own, short i915 wrappers for our needs. :(
BR, Jani.
And then we can prefix every logging with driver name and device name.
The idea is to make a thin layer on top of the existing pr_xxx() functions. So not a full subsystem, only a wrapper on top of what we already have.
Anyway, idle talk only. We need patches and sample output if we should discuss more.
Sam
Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Hi Jani.
I mean is it useful to have this extra printing subsystem in DRM while the standard Linux one actually does a better job?
The added functionality of drm_xxx_err would be to keep the current drm.debug=0x1f filtering on the command-line. I do not think we can do this with the standard logging.
Correct. I'd love the benefits of dynamic debug, but there's no support for the kind of message categories that we do with drm.debug.
I've contemplated switching i915 over to using the variants where you pass the device, but I really really don't like the idea of:
- DRM_DEBUG_KMS("hello\n");
- DRM_DEV_DEBUG_KMS(i915->drm.dev, "hello\n");
Where i915 is our private wrapper for drm_device. I think it's just too much ugly uppercase boilerplate, and a large portion of the debugs would have to span at least an extra line after that.
I'd also very much prefer passing just struct *drm_device instead of struct *device. In that, I think the needs of the few have prevailed over the needs of the many. I'd definitely prefer drm_err(const struct drm_device *drm, ...) and friends over the current ones.
This is from my notes:
" drm_err(const struct drm_device *drm, ...) drm_info(const struct drm_device *drm, ...)
drm_kms_err(const struct drm_device *drm, ...) drm_kms_info(const struct drm_device *drm, ...))
etc.
Then we could fish out relevant info from the drm device and present this nicely.
For the cases where no drm_device is available the fallback is: drm_dev_err(const struct drm_device *drm, ...) drm_dev_info(const struct drm_device *drm, ...))
We could modify the existing UPPERCASE macros to be placeholders for the more reader friendly lower cases variants. "
So we seems to be aligned here. In other words - if you throw time after this then try to add the new logging variants to drm_print.h for the benefit of all. The we can maybe later do some mass conversion if we want to get rid of some of the older logging systems.
I have not yet found time/energy to throw after this myself.
Sam
On Thu, Jul 18, 2019 at 06:14:58PM +0200, Sam Ravnborg wrote:
drm_print.h used DRM_NAME - thus adding a dependency from include/drm/drm_print.h => uapi/drm/drm.h
Hardcode the name "drm" to break this dependency. The idea is that there shall be a minimal dependency between include/drm/* and uapi/*
You might also want to clean up the other uses of DRM_NAME in armada and i915 while you're at it. The easiest way to satisfy Chris' usecase and remove the dependency would be to add #define DRM_PRINT_NAME "drm" in drm_print.h and use that.
Sean
Signed-off-by: Sam Ravnborg sam@ravnborg.org Suggested-by: Daniel Vetter daniel@ffwll.ch Reviewed-by: Daniel Vetter daniel.vetter@ffwll.ch Cc: Maarten Lankhorst maarten.lankhorst@linux.intel.com Cc: Maxime Ripard maxime.ripard@bootlin.com Cc: Sean Paul sean@poorly.run Cc: David Airlie airlied@linux.ie Cc: Rob Clark robdclark@gmail.com Cc: Sean Paul seanpaul@chromium.org Cc: Chris Wilson chris@chris-wilson.co.uk Cc: Daniel Vetter daniel@ffwll.ch
include/drm/drm_print.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h index a5d6f2f3e430..760d1bd0eaf1 100644 --- a/include/drm/drm_print.h +++ b/include/drm/drm_print.h @@ -32,8 +32,6 @@ #include <linux/device.h> #include <linux/debugfs.h>
-#include <drm/drm.h>
/**
- DOC: print
@@ -287,7 +285,7 @@ void drm_err(const char *format, ...); /* Macros to make printk easier */
#define _DRM_PRINTK(once, level, fmt, ...) \
- printk##once(KERN_##level "[" DRM_NAME "] " fmt, ##__VA_ARGS__)
- printk##once(KERN_##level "[drm] " fmt, ##__VA_ARGS__)
#define DRM_INFO(fmt, ...) \ _DRM_PRINTK(, INFO, fmt, ##__VA_ARGS__) -- 2.20.1
drm_vblank.h included uapi/drm/drm.h. It turns out this include was not required - delete it.
Note: uapi/drm/drm.h is included indirect via drm_file.h, but there are no dependencies in drm_vblank.h so the removal is legit.
Signed-off-by: Sam Ravnborg sam@ravnborg.org Reviewed-by: Daniel Vetter daniel.vetter@ffwll.ch Cc: Maarten Lankhorst maarten.lankhorst@linux.intel.com Cc: Maxime Ripard maxime.ripard@bootlin.com Cc: Sean Paul sean@poorly.run Cc: David Airlie airlied@linux.ie Cc: Daniel Vetter daniel@ffwll.ch Cc: Stefan Agner stefan@agner.ch Cc: Thierry Reding treding@nvidia.com --- include/drm/drm_vblank.h | 1 - 1 file changed, 1 deletion(-)
diff --git a/include/drm/drm_vblank.h b/include/drm/drm_vblank.h index e528bb2f659d..9fe4ba8bc622 100644 --- a/include/drm/drm_vblank.h +++ b/include/drm/drm_vblank.h @@ -30,7 +30,6 @@
#include <drm/drm_file.h> #include <drm/drm_modes.h> -#include <uapi/drm/drm.h>
struct drm_device; struct drm_crtc;
On Thu, Jul 18, 2019 at 06:14:59PM +0200, Sam Ravnborg wrote:
drm_vblank.h included uapi/drm/drm.h. It turns out this include was not required - delete it.
Note: uapi/drm/drm.h is included indirect via drm_file.h, but there are no dependencies in drm_vblank.h so the removal is legit.
Signed-off-by: Sam Ravnborg sam@ravnborg.org Reviewed-by: Daniel Vetter daniel.vetter@ffwll.ch Cc: Maarten Lankhorst maarten.lankhorst@linux.intel.com Cc: Maxime Ripard maxime.ripard@bootlin.com Cc: Sean Paul sean@poorly.run Cc: David Airlie airlied@linux.ie Cc: Daniel Vetter daniel@ffwll.ch Cc: Stefan Agner stefan@agner.ch Cc: Thierry Reding treding@nvidia.com
Reviewed-by: Sean Paul sean@poorly.run
include/drm/drm_vblank.h | 1 - 1 file changed, 1 deletion(-)
diff --git a/include/drm/drm_vblank.h b/include/drm/drm_vblank.h index e528bb2f659d..9fe4ba8bc622 100644 --- a/include/drm/drm_vblank.h +++ b/include/drm/drm_vblank.h @@ -30,7 +30,6 @@
#include <drm/drm_file.h> #include <drm/drm_modes.h> -#include <uapi/drm/drm.h>
struct drm_device; struct drm_crtc; -- 2.20.1
The drm_os_linux.h header is deprecated. Just opencode the sole DRM_WRITE32().
Signed-off-by: Sam Ravnborg sam@ravnborg.org Cc: Maarten Lankhorst maarten.lankhorst@linux.intel.com Cc: Maxime Ripard maxime.ripard@bootlin.com Cc: Sean Paul sean@poorly.run Cc: David Airlie airlied@linux.ie Cc: Daniel Vetter daniel@ffwll.ch --- drivers/gpu/drm/ati_pcigart.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/ati_pcigart.c b/drivers/gpu/drm/ati_pcigart.c index 2a413e291a60..580aa2676358 100644 --- a/drivers/gpu/drm/ati_pcigart.c +++ b/drivers/gpu/drm/ati_pcigart.c @@ -35,7 +35,6 @@
#include <drm/ati_pcigart.h> #include <drm/drm_device.h> -#include <drm/drm_os_linux.h> #include <drm/drm_pci.h> #include <drm/drm_print.h>
@@ -169,6 +168,7 @@ int drm_ati_pcigart_init(struct drm_device *dev, struct drm_ati_pcigart_info *ga page_base = (u32) entry->busaddr[i];
for (j = 0; j < (PAGE_SIZE / ATI_PCIGART_PAGE_SIZE); j++) { + u32 offset; u32 val;
switch(gart_info->gart_reg_if) { @@ -184,10 +184,12 @@ int drm_ati_pcigart_init(struct drm_device *dev, struct drm_ati_pcigart_info *ga break; } if (gart_info->gart_table_location == - DRM_ATI_GART_MAIN) + DRM_ATI_GART_MAIN) { pci_gart[gart_idx] = cpu_to_le32(val); - else - DRM_WRITE32(map, gart_idx * sizeof(u32), val); + } else { + offset = gart_idx * sizeof(u32); + writel(val, (void __iomem *)map->handle + offset); + } gart_idx++; page_base += ATI_PCIGART_PAGE_SIZE; }
On Thu, Jul 18, 2019 at 06:15:00PM +0200, Sam Ravnborg wrote:
The drm_os_linux.h header is deprecated. Just opencode the sole DRM_WRITE32().
Any plans for the other users of DRM_WRITE<N>()? It seems like it'd be trivial to fix it up for via and mga. I don't really have any background on drm_os_linux.h, but it doesn't seem like it'd be that much more effort to just remove the whole thing.
Sean
Signed-off-by: Sam Ravnborg sam@ravnborg.org Cc: Maarten Lankhorst maarten.lankhorst@linux.intel.com Cc: Maxime Ripard maxime.ripard@bootlin.com Cc: Sean Paul sean@poorly.run Cc: David Airlie airlied@linux.ie Cc: Daniel Vetter daniel@ffwll.ch
drivers/gpu/drm/ati_pcigart.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/ati_pcigart.c b/drivers/gpu/drm/ati_pcigart.c index 2a413e291a60..580aa2676358 100644 --- a/drivers/gpu/drm/ati_pcigart.c +++ b/drivers/gpu/drm/ati_pcigart.c @@ -35,7 +35,6 @@
#include <drm/ati_pcigart.h> #include <drm/drm_device.h> -#include <drm/drm_os_linux.h> #include <drm/drm_pci.h> #include <drm/drm_print.h>
@@ -169,6 +168,7 @@ int drm_ati_pcigart_init(struct drm_device *dev, struct drm_ati_pcigart_info *ga page_base = (u32) entry->busaddr[i];
for (j = 0; j < (PAGE_SIZE / ATI_PCIGART_PAGE_SIZE); j++) {
u32 offset; u32 val; switch(gart_info->gart_reg_if) {
@@ -184,10 +184,12 @@ int drm_ati_pcigart_init(struct drm_device *dev, struct drm_ati_pcigart_info *ga break; } if (gart_info->gart_table_location ==
DRM_ATI_GART_MAIN)
DRM_ATI_GART_MAIN) { pci_gart[gart_idx] = cpu_to_le32(val);
else
DRM_WRITE32(map, gart_idx * sizeof(u32), val);
} else {
offset = gart_idx * sizeof(u32);
writel(val, (void __iomem *)map->handle + offset);
}} gart_idx++; page_base += ATI_PCIGART_PAGE_SIZE;
-- 2.20.1
Hi Sean.
Any plans for the other users of DRM_WRITE<N>()? It seems like it'd be trivial to fix it up for via and mga. I don't really have any background on drm_os_linux.h, but it doesn't seem like it'd be that much more effort to just remove the whole thing.
During the drmP.h removal I also took care of drm_os_linux.h, so when the patches land then there will be no users left. I look forward to delete that file.
For via I only just posted the patches today. For mga they already landed in drm-misc-next.
I expect that we after next merge window can delete both drm_os_linux.h and drmP.h.
Sam
On Thu, Jul 18, 2019 at 08:11:35PM +0200, Sam Ravnborg wrote:
Hi Sean.
Any plans for the other users of DRM_WRITE<N>()? It seems like it'd be trivial to fix it up for via and mga. I don't really have any background on drm_os_linux.h, but it doesn't seem like it'd be that much more effort to just remove the whole thing.
During the drmP.h removal I also took care of drm_os_linux.h, so when the patches land then there will be no users left. I look forward to delete that file.
For via I only just posted the patches today. For mga they already landed in drm-misc-next.
Awesome! I think I was looking at drm-next instead of -misc-next, so happy to hear the future is bright :)
Reviewed-by: Sean Paul sean@poorly.run
I expect that we after next merge window can delete both drm_os_linux.h and drmP.h.
Sam
DRM_WAIT_ON() is from the deprecated drm_os_linux header and the modern replacement is the wait_event_*.
The return values differ, so a conversion is needed to keep the original interface towards userspace. Introduced a switch/case to make code obvious and to allow different debug prints depending on the result.
Signed-off-by: Sam Ravnborg sam@ravnborg.org Cc: Maarten Lankhorst maarten.lankhorst@linux.intel.com Cc: Maxime Ripard maxime.ripard@bootlin.com Cc: Sean Paul sean@poorly.run Cc: David Airlie airlied@linux.ie Cc: Daniel Vetter daniel@ffwll.ch --- drivers/gpu/drm/drm_vblank.c | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-)
diff --git a/drivers/gpu/drm/drm_vblank.c b/drivers/gpu/drm/drm_vblank.c index 603ab105125d..8e9ac187500e 100644 --- a/drivers/gpu/drm/drm_vblank.c +++ b/drivers/gpu/drm/drm_vblank.c @@ -31,7 +31,6 @@ #include <drm/drm_drv.h> #include <drm/drm_framebuffer.h> #include <drm/drm_print.h> -#include <drm/drm_os_linux.h> #include <drm/drm_vblank.h>
#include "drm_internal.h" @@ -1672,19 +1671,31 @@ int drm_wait_vblank_ioctl(struct drm_device *dev, void *data, if (req_seq != seq) { DRM_DEBUG("waiting on vblank count %llu, crtc %u\n", req_seq, pipe); - DRM_WAIT_ON(ret, vblank->queue, 3 * HZ, - vblank_passed(drm_vblank_count(dev, pipe), - req_seq) || - !READ_ONCE(vblank->enabled)); + ret = wait_event_interruptible_timeout(vblank->queue, + vblank_passed(drm_vblank_count(dev, pipe), req_seq) || + !READ_ONCE(vblank->enabled), + msecs_to_jiffies(3000)); }
- if (ret != -EINTR) { + switch (ret) { + case 0: + /* timeout */ + ret = -EBUSY; drm_wait_vblank_reply(dev, pipe, &vblwait->reply); - - DRM_DEBUG("crtc %d returning %u to client\n", + DRM_DEBUG("timeout waiting for vblank. crtc %d returning %u to client\n", pipe, vblwait->reply.sequence); - } else { + break; + case -ERESTARTSYS: + /* interrupted by signal */ + ret = -EINTR; DRM_DEBUG("crtc %d vblank wait interrupted by signal\n", pipe); + break; + default: + ret = 0; + drm_wait_vblank_reply(dev, pipe, &vblwait->reply); + DRM_DEBUG("crtc %d returning %u to client\n", + pipe, vblwait->reply.sequence); + break; }
done:
On Thu, Jul 18, 2019 at 06:15:01PM +0200, Sam Ravnborg wrote:
DRM_WAIT_ON() is from the deprecated drm_os_linux header and the modern replacement is the wait_event_*.
The return values differ, so a conversion is needed to keep the original interface towards userspace. Introduced a switch/case to make code obvious and to allow different debug prints depending on the result.
Signed-off-by: Sam Ravnborg sam@ravnborg.org
Reviewed-by: Sean Paul sean@poorly.run
Cc: Maarten Lankhorst maarten.lankhorst@linux.intel.com Cc: Maxime Ripard maxime.ripard@bootlin.com Cc: Sean Paul sean@poorly.run Cc: David Airlie airlied@linux.ie Cc: Daniel Vetter daniel@ffwll.ch
drivers/gpu/drm/drm_vblank.c | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-)
diff --git a/drivers/gpu/drm/drm_vblank.c b/drivers/gpu/drm/drm_vblank.c index 603ab105125d..8e9ac187500e 100644 --- a/drivers/gpu/drm/drm_vblank.c +++ b/drivers/gpu/drm/drm_vblank.c @@ -31,7 +31,6 @@ #include <drm/drm_drv.h> #include <drm/drm_framebuffer.h> #include <drm/drm_print.h> -#include <drm/drm_os_linux.h> #include <drm/drm_vblank.h>
#include "drm_internal.h" @@ -1672,19 +1671,31 @@ int drm_wait_vblank_ioctl(struct drm_device *dev, void *data, if (req_seq != seq) { DRM_DEBUG("waiting on vblank count %llu, crtc %u\n", req_seq, pipe);
DRM_WAIT_ON(ret, vblank->queue, 3 * HZ,
vblank_passed(drm_vblank_count(dev, pipe),
req_seq) ||
!READ_ONCE(vblank->enabled));
ret = wait_event_interruptible_timeout(vblank->queue,
vblank_passed(drm_vblank_count(dev, pipe), req_seq) ||
!READ_ONCE(vblank->enabled),
}msecs_to_jiffies(3000));
- if (ret != -EINTR) {
- switch (ret) {
- case 0:
/* timeout */
drm_wait_vblank_reply(dev, pipe, &vblwait->reply);ret = -EBUSY;
DRM_DEBUG("crtc %d returning %u to client\n",
DRM_DEBUG("timeout waiting for vblank. crtc %d returning %u to client\n", pipe, vblwait->reply.sequence);
- } else {
break;
- case -ERESTARTSYS:
/* interrupted by signal */
DRM_DEBUG("crtc %d vblank wait interrupted by signal\n", pipe);ret = -EINTR;
break;
- default:
ret = 0;
drm_wait_vblank_reply(dev, pipe, &vblwait->reply);
DRM_DEBUG("crtc %d returning %u to client\n",
pipe, vblwait->reply.sequence);
}break;
done:
2.20.1
Do not rely on including drm.h from drm_file.h, as the include in drm_file.h will be dropped.
Signed-off-by: Sam Ravnborg sam@ravnborg.org Cc: Maarten Lankhorst maarten.lankhorst@linux.intel.com Cc: Maxime Ripard maxime.ripard@bootlin.com Cc: Sean Paul sean@poorly.run Cc: David Airlie airlied@linux.ie Cc: Daniel Vetter daniel@ffwll.ch Cc: Eric Anholt eric@anholt.net Cc: Thomas Zimmermann tzimmermann@suse.de Cc: Rob Herring robh@kernel.org --- drivers/gpu/drm/drm_gem.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c index e6c12c6ec728..243f43d70f42 100644 --- a/drivers/gpu/drm/drm_gem.c +++ b/drivers/gpu/drm/drm_gem.c @@ -39,6 +39,7 @@ #include <linux/mem_encrypt.h> #include <linux/pagevec.h>
+#include <drm/drm.h> #include <drm/drm_device.h> #include <drm/drm_drv.h> #include <drm/drm_file.h>
On Thu, Jul 18, 2019 at 06:15:02PM +0200, Sam Ravnborg wrote:
Do not rely on including drm.h from drm_file.h, as the include in drm_file.h will be dropped.
Signed-off-by: Sam Ravnborg sam@ravnborg.org
Reviewed-by: Sean Paul sean@poorly.run
Cc: Maarten Lankhorst maarten.lankhorst@linux.intel.com Cc: Maxime Ripard maxime.ripard@bootlin.com Cc: Sean Paul sean@poorly.run Cc: David Airlie airlied@linux.ie Cc: Daniel Vetter daniel@ffwll.ch Cc: Eric Anholt eric@anholt.net Cc: Thomas Zimmermann tzimmermann@suse.de Cc: Rob Herring robh@kernel.org
drivers/gpu/drm/drm_gem.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c index e6c12c6ec728..243f43d70f42 100644 --- a/drivers/gpu/drm/drm_gem.c +++ b/drivers/gpu/drm/drm_gem.c @@ -39,6 +39,7 @@ #include <linux/mem_encrypt.h> #include <linux/pagevec.h>
+#include <drm/drm.h> #include <drm/drm_device.h> #include <drm/drm_drv.h>
#include <drm/drm_file.h>
2.20.1
Do not rely on including drm.h from drm_file.h, as the include in drm_file.h will be dropped.
Signed-off-by: Sam Ravnborg sam@ravnborg.org Cc: Maarten Lankhorst maarten.lankhorst@linux.intel.com Cc: Maxime Ripard maxime.ripard@bootlin.com Cc: Sean Paul sean@poorly.run Cc: David Airlie airlied@linux.ie Cc: Daniel Vetter daniel@ffwll.ch Cc: Eric Anholt eric@anholt.net Cc: Thomas Zimmermann tzimmermann@suse.de Cc: Rob Herring robh@kernel.org --- drivers/gpu/drm/drm_gem_shmem_helper.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/drm_gem_shmem_helper.c b/drivers/gpu/drm/drm_gem_shmem_helper.c index 472ea5d81f82..2f64667ac805 100644 --- a/drivers/gpu/drm/drm_gem_shmem_helper.c +++ b/drivers/gpu/drm/drm_gem_shmem_helper.c @@ -10,6 +10,7 @@ #include <linux/slab.h> #include <linux/vmalloc.h>
+#include <drm/drm.h> #include <drm/drm_device.h> #include <drm/drm_drv.h> #include <drm/drm_gem_shmem_helper.h>
On Thu, Jul 18, 2019 at 06:15:03PM +0200, Sam Ravnborg wrote:
Do not rely on including drm.h from drm_file.h, as the include in drm_file.h will be dropped.
Signed-off-by: Sam Ravnborg sam@ravnborg.org
Reviewed-by: Sean Paul sean@poorly.run
Cc: Maarten Lankhorst maarten.lankhorst@linux.intel.com Cc: Maxime Ripard maxime.ripard@bootlin.com Cc: Sean Paul sean@poorly.run Cc: David Airlie airlied@linux.ie Cc: Daniel Vetter daniel@ffwll.ch Cc: Eric Anholt eric@anholt.net Cc: Thomas Zimmermann tzimmermann@suse.de Cc: Rob Herring robh@kernel.org
drivers/gpu/drm/drm_gem_shmem_helper.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/drm_gem_shmem_helper.c b/drivers/gpu/drm/drm_gem_shmem_helper.c index 472ea5d81f82..2f64667ac805 100644 --- a/drivers/gpu/drm/drm_gem_shmem_helper.c +++ b/drivers/gpu/drm/drm_gem_shmem_helper.c @@ -10,6 +10,7 @@ #include <linux/slab.h> #include <linux/vmalloc.h>
+#include <drm/drm.h> #include <drm/drm_device.h> #include <drm/drm_drv.h>
#include <drm/drm_gem_shmem_helper.h>
2.20.1
Do not rely on including drm.h from drm_file.h, as the include in drm_file.h will be dropped.
Signed-off-by: Sam Ravnborg sam@ravnborg.org Cc: Maarten Lankhorst maarten.lankhorst@linux.intel.com Cc: Maxime Ripard maxime.ripard@bootlin.com Cc: Sean Paul sean@poorly.run Cc: David Airlie airlied@linux.ie Cc: Daniel Vetter daniel@ffwll.ch Cc: Christian König christian.koenig@amd.com Cc: Noralf Trønnes noralf@tronnes.org Cc: Chris Wilson chris@chris-wilson.co.uk Cc: Eric Anholt eric@anholt.net --- drivers/gpu/drm/drm_prime.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm/drm_prime.c index 189d980402ad..eca484106cc2 100644 --- a/drivers/gpu/drm/drm_prime.c +++ b/drivers/gpu/drm/drm_prime.c @@ -30,6 +30,7 @@ #include <linux/dma-buf.h> #include <linux/rbtree.h>
+#include <drm/drm.h> #include <drm/drm_drv.h> #include <drm/drm_file.h> #include <drm/drm_framebuffer.h>
On Thu, Jul 18, 2019 at 06:15:04PM +0200, Sam Ravnborg wrote:
Do not rely on including drm.h from drm_file.h, as the include in drm_file.h will be dropped.
Signed-off-by: Sam Ravnborg sam@ravnborg.org
Reviewed-by: Sean Paul sean@poorly.run
Cc: Maarten Lankhorst maarten.lankhorst@linux.intel.com Cc: Maxime Ripard maxime.ripard@bootlin.com Cc: Sean Paul sean@poorly.run Cc: David Airlie airlied@linux.ie Cc: Daniel Vetter daniel@ffwll.ch Cc: Christian König christian.koenig@amd.com Cc: Noralf Trønnes noralf@tronnes.org Cc: Chris Wilson chris@chris-wilson.co.uk Cc: Eric Anholt eric@anholt.net
drivers/gpu/drm/drm_prime.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm/drm_prime.c index 189d980402ad..eca484106cc2 100644 --- a/drivers/gpu/drm/drm_prime.c +++ b/drivers/gpu/drm/drm_prime.c @@ -30,6 +30,7 @@ #include <linux/dma-buf.h> #include <linux/rbtree.h>
+#include <drm/drm.h> #include <drm/drm_drv.h> #include <drm/drm_file.h>
#include <drm/drm_framebuffer.h>
2.20.1
Do not rely on including drm.h from drm_file.h, as the include in drm_file.h will be dropped.
Signed-off-by: Sam Ravnborg sam@ravnborg.org Cc: Maarten Lankhorst maarten.lankhorst@linux.intel.com Cc: Maxime Ripard maxime.ripard@bootlin.com Cc: Sean Paul sean@poorly.run Cc: David Airlie airlied@linux.ie Cc: Daniel Vetter daniel@ffwll.ch Cc: Lionel Landwerlin lionel.g.landwerlin@intel.com Cc: Chunming Zhou david1.zhou@amd.com Cc: Christian König ckoenig.leichtzumerken@gmail.com --- drivers/gpu/drm/drm_syncobj.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/drm_syncobj.c b/drivers/gpu/drm/drm_syncobj.c index a199c8d56b95..75cb4bb7619e 100644 --- a/drivers/gpu/drm/drm_syncobj.c +++ b/drivers/gpu/drm/drm_syncobj.c @@ -53,6 +53,7 @@ #include <linux/sync_file.h> #include <linux/uaccess.h>
+#include <drm/drm.h> #include <drm/drm_drv.h> #include <drm/drm_file.h> #include <drm/drm_gem.h>
On Thu, Jul 18, 2019 at 06:15:05PM +0200, Sam Ravnborg wrote:
Do not rely on including drm.h from drm_file.h, as the include in drm_file.h will be dropped.
Signed-off-by: Sam Ravnborg sam@ravnborg.org
Reviewed-by: Sean Paul sean@poorly.run
Cc: Maarten Lankhorst maarten.lankhorst@linux.intel.com Cc: Maxime Ripard maxime.ripard@bootlin.com Cc: Sean Paul sean@poorly.run Cc: David Airlie airlied@linux.ie Cc: Daniel Vetter daniel@ffwll.ch Cc: Lionel Landwerlin lionel.g.landwerlin@intel.com Cc: Chunming Zhou david1.zhou@amd.com Cc: Christian König ckoenig.leichtzumerken@gmail.com
drivers/gpu/drm/drm_syncobj.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/drm_syncobj.c b/drivers/gpu/drm/drm_syncobj.c index a199c8d56b95..75cb4bb7619e 100644 --- a/drivers/gpu/drm/drm_syncobj.c +++ b/drivers/gpu/drm/drm_syncobj.c @@ -53,6 +53,7 @@ #include <linux/sync_file.h> #include <linux/uaccess.h>
+#include <drm/drm.h> #include <drm/drm_drv.h> #include <drm/drm_file.h>
#include <drm/drm_gem.h>
2.20.1
Do not rely on including drm.h from drm_file.h, as the include in drm_file.h will be dropped.
Signed-off-by: Sam Ravnborg sam@ravnborg.org Cc: CK Hu ck.hu@mediatek.com Cc: Philipp Zabel p.zabel@pengutronix.de Cc: Matthias Brugger matthias.bgg@gmail.com Cc: linux-arm-kernel@lists.infradead.org Cc: linux-mediatek@lists.infradead.org --- drivers/gpu/drm/mediatek/mtk_drm_gem.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/mediatek/mtk_drm_gem.c b/drivers/gpu/drm/mediatek/mtk_drm_gem.c index 9434f88c6341..ca672f1d140d 100644 --- a/drivers/gpu/drm/mediatek/mtk_drm_gem.c +++ b/drivers/gpu/drm/mediatek/mtk_drm_gem.c @@ -5,6 +5,7 @@
#include <linux/dma-buf.h>
+#include <drm/drm.h> #include <drm/drm_device.h> #include <drm/drm_gem.h> #include <drm/drm_prime.h>
On Thu, Jul 18, 2019 at 06:15:06PM +0200, Sam Ravnborg wrote:
Do not rely on including drm.h from drm_file.h, as the include in drm_file.h will be dropped.
Signed-off-by: Sam Ravnborg sam@ravnborg.org
Reviewed-by: Sean Paul sean@poorly.run
Cc: CK Hu ck.hu@mediatek.com Cc: Philipp Zabel p.zabel@pengutronix.de Cc: Matthias Brugger matthias.bgg@gmail.com Cc: linux-arm-kernel@lists.infradead.org Cc: linux-mediatek@lists.infradead.org
drivers/gpu/drm/mediatek/mtk_drm_gem.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/mediatek/mtk_drm_gem.c b/drivers/gpu/drm/mediatek/mtk_drm_gem.c index 9434f88c6341..ca672f1d140d 100644 --- a/drivers/gpu/drm/mediatek/mtk_drm_gem.c +++ b/drivers/gpu/drm/mediatek/mtk_drm_gem.c @@ -5,6 +5,7 @@
#include <linux/dma-buf.h>
+#include <drm/drm.h> #include <drm/drm_device.h> #include <drm/drm_gem.h>
#include <drm/drm_prime.h>
2.20.1
On Thu, 2019-07-18 at 18:15 +0200, Sam Ravnborg wrote:
Do not rely on including drm.h from drm_file.h, as the include in drm_file.h will be dropped.
Acked-by: CK Hu ck.hu@mediatek.com
Signed-off-by: Sam Ravnborg sam@ravnborg.org Cc: CK Hu ck.hu@mediatek.com Cc: Philipp Zabel p.zabel@pengutronix.de Cc: Matthias Brugger matthias.bgg@gmail.com Cc: linux-arm-kernel@lists.infradead.org Cc: linux-mediatek@lists.infradead.org
drivers/gpu/drm/mediatek/mtk_drm_gem.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/mediatek/mtk_drm_gem.c b/drivers/gpu/drm/mediatek/mtk_drm_gem.c index 9434f88c6341..ca672f1d140d 100644 --- a/drivers/gpu/drm/mediatek/mtk_drm_gem.c +++ b/drivers/gpu/drm/mediatek/mtk_drm_gem.c @@ -5,6 +5,7 @@
#include <linux/dma-buf.h>
+#include <drm/drm.h> #include <drm/drm_device.h> #include <drm/drm_gem.h> #include <drm/drm_prime.h>
Hi, Sam:
You could apply this patch into drm-misc-next by yourself, thanks.
Regards, CK
On Fri, 2019-07-19 at 09:30 +0800, CK Hu wrote:
On Thu, 2019-07-18 at 18:15 +0200, Sam Ravnborg wrote:
Do not rely on including drm.h from drm_file.h, as the include in drm_file.h will be dropped.
Acked-by: CK Hu ck.hu@mediatek.com
Signed-off-by: Sam Ravnborg sam@ravnborg.org Cc: CK Hu ck.hu@mediatek.com Cc: Philipp Zabel p.zabel@pengutronix.de Cc: Matthias Brugger matthias.bgg@gmail.com Cc: linux-arm-kernel@lists.infradead.org Cc: linux-mediatek@lists.infradead.org
drivers/gpu/drm/mediatek/mtk_drm_gem.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/mediatek/mtk_drm_gem.c b/drivers/gpu/drm/mediatek/mtk_drm_gem.c index 9434f88c6341..ca672f1d140d 100644 --- a/drivers/gpu/drm/mediatek/mtk_drm_gem.c +++ b/drivers/gpu/drm/mediatek/mtk_drm_gem.c @@ -5,6 +5,7 @@
#include <linux/dma-buf.h>
+#include <drm/drm.h> #include <drm/drm_device.h> #include <drm/drm_gem.h> #include <drm/drm_prime.h>
drm_file used drm_magic_t from uapi/drm/drm.h. This is a simple unsigned int. Just opencode it as such to break the dependency from this header file to uapi.
Signed-off-by: Sam Ravnborg sam@ravnborg.org Suggested-by: Daniel Vetter daniel.vetter@ffwll.ch Cc: Sean Paul seanpaul@chromium.org Cc: Liviu Dudau Liviu.Dudau@arm.com Cc: Chris Wilson chris@chris-wilson.co.uk Cc: Maarten Lankhorst maarten.lankhorst@linux.intel.com Cc: Maxime Ripard maxime.ripard@bootlin.com Cc: David Airlie airlied@linux.ie Cc: Daniel Vetter daniel@ffwll.ch Cc: Jani Nikula jani.nikula@intel.com Cc: Eric Anholt eric@anholt.net --- include/drm/drm_file.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/include/drm/drm_file.h b/include/drm/drm_file.h index 67af60bb527a..046cd1bf91eb 100644 --- a/include/drm/drm_file.h +++ b/include/drm/drm_file.h @@ -34,8 +34,6 @@ #include <linux/completion.h> #include <linux/idr.h>
-#include <uapi/drm/drm.h> - #include <drm/drm_prime.h>
struct dma_fence; @@ -227,7 +225,7 @@ struct drm_file { struct pid *pid;
/** @magic: Authentication magic, see @authenticated. */ - drm_magic_t magic; + unsigned int magic;
/** * @lhead:
On Thu, Jul 18, 2019 at 06:15:07PM +0200, Sam Ravnborg wrote:
drm_file used drm_magic_t from uapi/drm/drm.h. This is a simple unsigned int. Just opencode it as such to break the dependency from this header file to uapi.
Signed-off-by: Sam Ravnborg sam@ravnborg.org
Passes my build tests, thanks for the clean-ups!
Reviewed-by: Sean Paul sean@poorly.run
Suggested-by: Daniel Vetter daniel.vetter@ffwll.ch Cc: Sean Paul seanpaul@chromium.org Cc: Liviu Dudau Liviu.Dudau@arm.com Cc: Chris Wilson chris@chris-wilson.co.uk Cc: Maarten Lankhorst maarten.lankhorst@linux.intel.com Cc: Maxime Ripard maxime.ripard@bootlin.com Cc: David Airlie airlied@linux.ie Cc: Daniel Vetter daniel@ffwll.ch Cc: Jani Nikula jani.nikula@intel.com Cc: Eric Anholt eric@anholt.net
include/drm/drm_file.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/include/drm/drm_file.h b/include/drm/drm_file.h index 67af60bb527a..046cd1bf91eb 100644 --- a/include/drm/drm_file.h +++ b/include/drm/drm_file.h @@ -34,8 +34,6 @@ #include <linux/completion.h> #include <linux/idr.h>
-#include <uapi/drm/drm.h>
#include <drm/drm_prime.h>
struct dma_fence; @@ -227,7 +225,7 @@ struct drm_file { struct pid *pid;
/** @magic: Authentication magic, see @authenticated. */
- drm_magic_t magic;
unsigned int magic;
/**
- @lhead:
-- 2.20.1
Am 18.07.19 um 18:15 schrieb Sam Ravnborg:
drm_file used drm_magic_t from uapi/drm/drm.h. This is a simple unsigned int. Just opencode it as such to break the dependency from this header file to uapi.
Mhm, why do you want to remove UAPI dependency here in the first place?
I mean the type can't change because it is UAPI, but it is rather bad for a documentation point of view.
Christian.
Signed-off-by: Sam Ravnborg sam@ravnborg.org Suggested-by: Daniel Vetter daniel.vetter@ffwll.ch Cc: Sean Paul seanpaul@chromium.org Cc: Liviu Dudau Liviu.Dudau@arm.com Cc: Chris Wilson chris@chris-wilson.co.uk Cc: Maarten Lankhorst maarten.lankhorst@linux.intel.com Cc: Maxime Ripard maxime.ripard@bootlin.com Cc: David Airlie airlied@linux.ie Cc: Daniel Vetter daniel@ffwll.ch Cc: Jani Nikula jani.nikula@intel.com Cc: Eric Anholt eric@anholt.net
include/drm/drm_file.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/include/drm/drm_file.h b/include/drm/drm_file.h index 67af60bb527a..046cd1bf91eb 100644 --- a/include/drm/drm_file.h +++ b/include/drm/drm_file.h @@ -34,8 +34,6 @@ #include <linux/completion.h> #include <linux/idr.h>
-#include <uapi/drm/drm.h>
#include <drm/drm_prime.h>
struct dma_fence;
@@ -227,7 +225,7 @@ struct drm_file { struct pid *pid;
/** @magic: Authentication magic, see @authenticated. */
- drm_magic_t magic;
unsigned int magic;
/**
- @lhead:
Hi Christian.
Thanks for your comments and very valid question.
On Fri, Jul 19, 2019 at 06:56:47AM +0000, Koenig, Christian wrote:
Am 18.07.19 um 18:15 schrieb Sam Ravnborg:
drm_file used drm_magic_t from uapi/drm/drm.h. This is a simple unsigned int. Just opencode it as such to break the dependency from this header file to uapi.
Mhm, why do you want to remove UAPI dependency here in the first place?
The idea is to make include/drm/* independent of uapi/drm/* so the header files are less tangled up thus easier to read and comprehend.
.c files that requires uapi can then include the uapi headers.
For now my focus was solely on uapi/drm/drm.h - so I dunno if this is an achievable goal for include/drm/*.
For uapi/drm/* headers things are more clear. They shall be independent of include/drm/* as they are exported.
I mean the type can't change because it is UAPI, but it is rather bad for a documentation point of view.
For a widely used type I would agree. For struct auth, that is ony used in drm_auth.c then the documentation impact is minor. But your point is indeed valid. (struct auth has one field of type magic_t).
I will await further feedback before we decide to apply this patch or not. The patches that pushes include of drm/drm.h to the respective .c files are legit as we drop the dependency on an indirectly included header file. I will process these patches.
Sam
On Thu, Jul 18, 2019 at 06:14:56PM +0200, Sam Ravnborg wrote:
First patch from Jani fixes so drm_print.h is self-contained. Next two patches are trivial removal of uapi dependencies.
ati_pcigart is fixed to drop use of drm_os_linux.h
drm_vblank is likewise fixed to drop use of drm_os_linux.h This was a non-trivial conversion, *review requested!*
The remaining patches are preparation for and removal of uapi/drm/drmh from drm_file.h. There were a few files where we had to push include of drm/drm.h out to to have a clean build.
CK Hu - please let me apply the mediatek patch to drm-misc-next, as it is required for the final patch. Or push it to drm-misc-next yourself.
Sam
Jani Nikula (1): drm/panel: make drm_panel.h self-contained
Sam Ravnborg (10): drm: drop uapi dependency from drm_print.h drm: drop uapi dependency from drm_vblank.h drm/ati_pcigart: drop dependency on drm_os_linux.h drm/vblank: drop use of DRM_WAIT_ON() drm: direct include of drm.h in drm_gem.c drm: direct include of drm.h in drm_gem_shmem_helper.c drm: direct include of drm.h in drm_prime.c drm: direct include of drm.h in drm_syncobj.c drm/mediatek: direct include of drm.h in mtk_drm_gem.c drm: drop uapi dependency from drm_file.h
Added relevant acks and pushed following patches to drm-misc-next: drm/panel: make drm_panel.h self-contained drm: drop uapi dependency from drm_vblank.h drm/ati_pcigart: drop dependency on drm_os_linux.h drm: direct include of drm.h in drm_gem.c drm: direct include of drm.h in drm_gem_shmem_helper.c drm: direct include of drm.h in drm_prime.c drm: direct include of drm.h in drm_syncobj.c drm/mediatek: direct include of drm.h in mtk_drm_gem.c
Following patches was dropped: drm: drop uapi dependency from drm_print.h - There was not a clear consensus what to do here, and the patch broke one way to use the DRM_(PRINT) macros. - I did not have the time/enegy to start a logging debate. There is too much that could be done and it is not the right time for me to look into the possibilities.
drm: drop uapi dependency from drm_file.h - There were relevant push back from loosing the information that a uapi type was used to represent 'magic'
Following patch is worked on: drm/vblank: drop use of DRM_WAIT_ON() - Got excellent feedback from Michel Dänzer and Daniel Vetter. - An updated version will be posted when I have tested it at my local setup
Sam
dri-devel@lists.freedesktop.org