drm/atomic: Rename async to nonblocking.
Subsystems (16)
Maarten Lankhorst
maintainercover drm/atomic: Rename async to nonblocking.
Userspace calls the atomic ioctl with DRM_MODE_ATOMIC_NONBLOCK when it doesn't want the ioctl to block for completion.
In the kernel it's called async commit, which is confusing. The legacy pageflip and atomic ioctl also have a flag DRM_MODE_PAGE_FLIP_ASYNC which means that the flip should happen as soon as possible, even if it causes tearing.
Because of this we should rename async commit to nonblocking commit, which should reduce a lot of the confusion.
This is done partially with a cocci script, and inspection by hand because cocci doesn't patch comments.
Maarten Lankhorst (12):
drm/atomic: Rename async parameter to nonblocking. drm/atomic: Rename drm_atomic_async_commit to nonblocking. drm/arm/hdlcd: Rename async to nonblock. drm/exynos: Rename async to nonblock.
drm/msm: Rename async to nonblock.
drm/omapdrm: Rename async to nonblock. drm/rcar-du: Rename async to nonblock.
drm/sti: Rename async to nonblock.
drm/tegra: Rename async to nonblock. drm/rockchip: Rename async to nonblock.
drm/vc4: Rename async to nonblock.
drm/i915: Rename async to nonblock.
drivers/gpu/drm/arm/hdlcd_drv.c | 2 +- drivers/gpu/drm/drm_atomic.c | 12 +++++------ drivers/gpu/drm/drm_atomic_helper.c | 34 +++++++++++++++--------------- drivers/gpu/drm/exynos/exynos_drm_drv.c | 4 ++-- drivers/gpu/drm/exynos/exynos_drm_drv.h | 2 +- drivers/gpu/drm/i915/intel_display.c | 16 +++++++------- drivers/gpu/drm/msm/msm_atomic.c | 9 ++++---- drivers/gpu/drm/msm/msm_drv.h | 2 +- drivers/gpu/drm/omapdrm/omap_drv.c | 4 ++-- drivers/gpu/drm/rcar-du/rcar_du_kms.c | 5 +++-- drivers/gpu/drm/rockchip/rockchip_drm_fb.c | 6 +++--- drivers/gpu/drm/sti/sti_drv.c | 6 +++--- drivers/gpu/drm/tegra/drm.c | 6 +++--- drivers/gpu/drm/vc4/vc4_kms.c | 6 +++--- include/drm/drm_atomic.h | 2 +- include/drm/drm_atomic_helper.h | 2 +- include/drm/drm_crtc.h | 8 +++---- 17 files changed, 63 insertions(+), 63 deletions(-)
Signature · 6 lines
2.5.5 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Maarten Lankhorst
maintainerPATCH 1/12 drm/atomic: Rename async parameter to nonblocking.
This is the first step of renaming async commit to nonblocking commit. The flag passed by userspace is NONBLOCKING, and async has a different meaning for page flips, where it means as soon as possible.
Fixing up comments in drm core is done manually, to make sure I didn't miss anything.
For drivers, the following cocci script is used to rename bool async to bool nonblock:
@@
identifier I =~ "^async";
identifier func;
@@
func(..., bool
- I
+ nonblock
, ...)
{
<...
- I
+ nonblock
...>
}
@@
identifier func;
type T;
identifier I =~ "^async";
@@
T func(..., bool
- I
+ nonblock
, ...);
Thanks to Tvrtko Ursulin for the cocci script.
--- drivers/gpu/drm/drm_atomic_helper.c | 30 +++++++++++++++--------------- include/drm/drm_atomic_helper.h | 2 +- include/drm/drm_crtc.h | 8 ++++---- 3 files changed, 20 insertions(+), 20 deletions(-)
drivers/gpu/drm/drm_atomic_helper.c +15 -15
@@ -1114,13 +1114,13 @@ EXPORT_SYMBOL(drm_atomic_helper_wait_for_vblanks);* drm_atomic_helper_commit - commit validated state object * @dev: DRM device * @state: the driver state object -* @async: asynchronous commit +* @nonblocking: whether nonblocking behavior is requested. * * This function commits a with drm_atomic_helper_check() pre-validated state * object. This can still fail when e.g. the framebuffer reservation fails. For -* now this doesn't implement asynchronous commits. +* now this doesn't implement nonblocking commits. * -* Note that right now this function does not support async commits, and hence +* Note that right now this function does not support nonblocking commits, hence * driver writers must implement their own version for now. Also note that the * default ordering of how the various stages are called is to match the legacy * modeset helper library closest. One peculiarity of that is that it doesn't
@@ -1141,11 +1141,11 @@ EXPORT_SYMBOL(drm_atomic_helper_wait_for_vblanks);*/ int drm_atomic_helper_commit (struct drm_device *dev,struct drm_atomic_state *state, -bool async) +bool nonblock) {int ret; -if (async) +if (nonblock)return -EBUSY ; ret =drm_atomic_helper_prepare_planes (dev, state);
@@ -1195,20 +1195,20 @@ int drm_atomic_helper_commit(struct drm_device *dev,EXPORT_SYMBOL (drm_atomic_helper_commit);/** -* DOC: implementing async commit +* DOC: implementing nonblocking commit * -* For now the atomic helpers don't support async commit directly. If there is -* real need it could be added though, using the dma-buf fence infrastructure -* for generic synchronization with outstanding rendering. +* For now the atomic helpers don't support nonblocking commit directly. If +* there is real need it could be added though, using the dma-buf fence +* infrastructure for generic synchronization with outstanding rendering. * -* For now drivers have to implement async commit themselves, with the following -* sequence being the recommended one: +* For now drivers have to implement nonblocking commit themselves, with the +* following sequence being the recommended one: * * 1. Run drm_atomic_helper_prepare_planes() first. This is the only function * which commit needs to call which can fail, so we want to run it first and * synchronously. * -* 2. Synchronize with any outstanding asynchronous commit worker threads which +* 2. Synchronize with any outstanding nonblocking commit worker threads which * might be affected the new state update. This can be done by either cancelling * or flushing the work items, depending upon whether the driver can deal with * cancelled updates. Note that it is important to ensure that the framebuffer
@@ -1222,9 +1222,9 @@ EXPORT_SYMBOL(drm_atomic_helper_commit);* 3. The software state is updated synchronously with * drm_atomic_helper_swap_state(). Doing this under the protection of all modeset * locks means concurrent callers never see inconsistent state. And doing this -* while it's guaranteed that no relevant async worker runs means that async -* workers do not need grab any locks. Actually they must not grab locks, for -* otherwise the work flushing will deadlock. +* while it's guaranteed that no relevant nonblocking worker runs means that +* nonblocking workers do not need grab any locks. Actually they must not grab +* locks, for otherwise the work flushing will deadlock. * * 4. Schedule a work item to do all subsequent steps, using the split-out * commit helpers: a) pre-plane commit b) plane commit c) post-plane commit and
include/drm/drm_atomic_helper.h +1 -1
@@ -40,7 +40,7 @@ int drm_atomic_helper_check(struct drm_device *dev, struct drm_atomic_state *state);int drm_atomic_helper_commit (struct drm_device *dev,struct drm_atomic_state *state, -bool async); +bool nonblock);void drm_atomic_helper_wait_for_fences (struct drm_device *dev,struct drm_atomic_state *state);
include/drm/drm_crtc.h +4 -4
@@ -1887,7 +1887,7 @@ struct drm_mode_config_funcs {* drm_atomic_helper_commit(), or one of the exported sub-functions of * it. * -* Asynchronous commits (as indicated with the async parameter) must +* Nonblocking commits (as indicated with the nonblock parameter) must * do any preparatory work which might result in an unsuccessful commit * in the context of this callback. The only exceptions are hardware * errors resulting in -EIO. But even in that case the driver must
@@ -1900,7 +1900,7 @@ struct drm_mode_config_funcs {* The driver must wait for any pending rendering to the new * framebuffers to complete before executing the flip. It should also * wait for any pending rendering from other drivers if the underlying -* buffer is a shared dma-buf. Asynchronous commits must not wait for +* buffer is a shared dma-buf. Nonblocking commits must not wait for * rendering in the context of this callback. * * An application can request to be notified when the atomic commit has
@@ -1931,7 +1931,7 @@ struct drm_mode_config_funcs {* * 0 on success or one of the below negative error codes: * -* - -EBUSY, if an asynchronous updated is requested and there is +* - -EBUSY, if a nonblocking updated is requested and there is * an earlier updated pending. Drivers are allowed to support a queue * of outstanding updates, but currently no driver supports that. * Note that drivers must wait for preceding updates to complete if a
@@ -1961,7 +1961,7 @@ struct drm_mode_config_funcs {*/ int (*atomic_commit)(struct drm_device *dev,struct drm_atomic_state *state, -bool async); +bool nonblock);/** * @atomic_state_alloc:
Signature · 6 lines
2.5.5 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Maarten Lankhorst
maintainerPATCH 2/12 drm/atomic: Rename drm_atomic_async_commit to nonblocking.
In reply to Maarten LankhorstAnother step in renaming async to nonblocking for atomic commit.
--- drivers/gpu/drm/drm_atomic.c | 12 ++++++------ drivers/gpu/drm/drm_atomic_helper.c | 4 ++-- include/drm/drm_atomic.h | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-)
drivers/gpu/drm/drm_atomic.c +6 -6
@@ -143,7 +143,7 @@ void drm_atomic_state_default_clear(struct drm_atomic_state *state)continue ;/* -* FIXME: Async commits can race with connector unplugging and +* FIXME: Nonblocking commits can race with connector unplugging and * there's currently nothing that prevents cleanup up state for * deleted connectors. As long as the callback doesn't look at * the connector we'll be fine though, so make sure that's the
@@ -1388,7 +1388,7 @@ int drm_atomic_commit(struct drm_atomic_state *state)EXPORT_SYMBOL (drm_atomic_commit);/** -* drm_atomic_async_commit - atomic&async configuration commit +* drm_atomic_nonblocking_commit - atomic&nonblocking configuration commit * @state: atomic configuration to check * * Note that this function can return -EDEADLK if the driver needed to acquire
@@ -1403,7 +1403,7 @@ EXPORT_SYMBOL(drm_atomic_commit);* Returns: * 0 on success, negative error code on failure. */ -int drm_atomic_async_commit (struct drm_atomic_state *state) +int drm_atomic_nonblocking_commit (struct drm_atomic_state *state) {struct drm_mode_config *config = &state->dev->mode_config;int ret;
@@ -1412,11 +1412,11 @@ int drm_atomic_async_commit(struct drm_atomic_state *state)if (ret)return ret; -DRM_DEBUG_ATOMIC ("commiting %p asynchronously\n" , state); +DRM_DEBUG_ATOMIC ("commiting %p nonblocking\n" , state);return config->funcs->atomic_commit (state->dev, state, true); } -EXPORT_SYMBOL (drm_atomic_async_commit); +EXPORT_SYMBOL (drm_atomic_nonblocking_commit);/* * The big monstor ioctl
@@ -1685,7 +1685,7 @@ retry:*/ ret =drm_atomic_check_only (state); }else if (arg->flags &DRM_MODE_ATOMIC_NONBLOCK ) { - ret =drm_atomic_async_commit (state); + ret =drm_atomic_nonblocking_commit (state); }else { ret =drm_atomic_commit (state); }
drivers/gpu/drm/drm_atomic_helper.c +2 -2
@@ -2371,11 +2371,11 @@ retry: goto fail; } - ret =drm_atomic_async_commit (state); + ret =drm_atomic_nonblocking_commit (state);if (ret !=0 ) goto fail; -/* Driver takes ownership of state on successful async commit. */ +/* Driver takes ownership of state on successful commit. */ return 0 ; fail:if (ret == -EDEADLK )
include/drm/drm_atomic.h +1 -1
@@ -137,7 +137,7 @@ drm_atomic_clean_old_fb(struct drm_device *dev, unsigned plane_mask, int ret);int __must_check drm_atomic_check_only (struct drm_atomic_state *state);int __must_check drm_atomic_commit (struct drm_atomic_state *state); -int __must_check drm_atomic_async_commit (struct drm_atomic_state *state); +int __must_check drm_atomic_nonblocking_commit (struct drm_atomic_state *state);#define for_each_connector_in_state (state, connector, connector_state, __i) \ for ((__i) = 0; \
Signature · 6 lines
2.5.5 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Maarten Lankhorst
maintainerPATCH 3/12 drm/arm/hdlcd: Rename async to nonblock.
In reply to Maarten LankhorstThe async name is deprecated and should be changed to nonblocking.
--- drivers/gpu/drm/arm/hdlcd_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/arm/hdlcd_drv.c +1 -1
@@ -113,7 +113,7 @@ static void hdlcd_fb_output_poll_changed(struct drm_device *drm) }static int hdlcd_atomic_commit (struct drm_device *dev, -struct drm_atomic_state *state,bool async) +struct drm_atomic_state *state,bool nonblock) {return drm_atomic_helper_commit (dev, state, false); }
Signature · 6 lines
2.5.5 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 03/12] drm/arm/hdlcd: Rename async to nonblock.
Quoted 4 lines · Maarten Lankhorst
The async name is deprecated and should be changed to nonblocking.
Cc Liviu Dudau <[email protected]>Signed-off-by Maarten Lankhorst <[email protected]>
Quoted 24 lines
--- drivers/gpu/drm/arm/hdlcd_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/arm/hdlcd_drv.c +1
-1@@ -113,7 +113,7 @@ static void hdlcd_fb_output_poll_changed(struct drm_device *drm) }static int hdlcd_atomic_commit (struct drm_device *dev, -struct drm_atomic_state *state,bool async) +struct drm_atomic_state *state,bool nonblock) {return drm_atomic_helper_commit (dev, state, false); }Signature · 6 lines
2.5.5 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 12 lines
====================
| I would like to |
| fix the world, |
| but they're not |
| giving me the |
\ source code! /
---------------
¯\_(ツ)_/¯
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-develMaarten Lankhorst
maintainerPATCH 4/12 drm/exynos: Rename async to nonblock.
In reply to Maarten LankhorstThe async name is deprecated and should be changed to nonblocking.
--- drivers/gpu/drm/exynos/exynos_drm_drv.c | 4 ++-- drivers/gpu/drm/exynos/exynos_drm_drv.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_drv.c +2 -2
@@ -270,7 +270,7 @@ static int commit_is_pending(struct exynos_drm_private *priv, u32 crtcs) }int exynos_atomic_commit (struct drm_device *dev,struct drm_atomic_state *state, -bool async) +bool nonblock) {struct exynos_drm_private *priv = dev->dev_private;struct exynos_atomic_commit *commit;
@@ -308,7 +308,7 @@ int exynos_atomic_commit(struct drm_device *dev, struct drm_atomic_state *state,drm_atomic_helper_swap_state (dev, state); -if (async) +if (nonblock)schedule_work (&commit->work);else exynos_atomic_commit_complete (commit);
drivers/gpu/drm/exynos/exynos_drm_drv.h +1 -1
@@ -296,7 +296,7 @@ static inline int exynos_dpi_bind(struct drm_device *dev,#endif int exynos_atomic_commit (struct drm_device *dev,struct drm_atomic_state *state, -bool async); +bool nonblock);extern struct platform_driver fimd_driver;
Signature · 6 lines
2.5.5 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Maarten Lankhorst
maintainerPATCH 5/12 drm/msm: Rename async to nonblock.
In reply to Maarten LankhorstThe async name is deprecated and should be changed to nonblocking.
Also comments seem to be a bit outdated, as it looks like nonblocking commit is supported by msm.
--- drivers/gpu/drm/msm/msm_atomic.c | 9 ++++----- drivers/gpu/drm/msm/msm_drv.h | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-)
drivers/gpu/drm/msm/msm_atomic.c +4 -5
@@ -190,17 +190,16 @@ int msm_atomic_check(struct drm_device *dev,* drm_atomic_helper_commit - commit validated state object * @dev: DRM device * @state: the driver state object -* @async: asynchronous commit +* @nonblock: nonblocking commit * * This function commits a with drm_atomic_helper_check() pre-validated state -* object. This can still fail when e.g. the framebuffer reservation fails. For -* now this doesn't implement asynchronous commits. +* object. This can still fail when e.g. the framebuffer reservation fails. * * RETURNS * Zero for success or -errno. */ int msm_atomic_commit (struct drm_device *dev, -struct drm_atomic_state *state,bool async) +struct drm_atomic_state *state,bool nonblock) {int nplanes = dev->mode_config.num_total_plane;int ncrtcs = dev->mode_config.num_crtc;
@@ -276,7 +275,7 @@ int msm_atomic_commit(struct drm_device *dev,* current layout. */ -if (async) { +if (nonblock) {msm_queue_fence_cb (dev, &c->fence_cb, c->fence);return 0 ; }
drivers/gpu/drm/msm/msm_drv.h +1 -1
@@ -174,7 +174,7 @@ void __msm_fence_worker(struct work_struct *work);int msm_atomic_check (struct drm_device *dev,struct drm_atomic_state *state);int msm_atomic_commit (struct drm_device *dev, -struct drm_atomic_state *state,bool async); +struct drm_atomic_state *state,bool nonblock);int msm_register_mmu (struct drm_device *dev,struct msm_mmu *mmu);
Signature · 6 lines
2.5.5 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Maarten Lankhorst
maintainerPATCH 6/12 drm/omapdrm: Rename async to nonblock.
In reply to Maarten LankhorstThe async name is deprecated and should be changed to nonblocking.
--- drivers/gpu/drm/omapdrm/omap_drv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/omapdrm/omap_drv.c +2 -2
@@ -138,7 +138,7 @@ static bool omap_atomic_is_pending(struct omap_drm_private *priv, }static int omap_atomic_commit (struct drm_device *dev, -struct drm_atomic_state *state,bool async) +struct drm_atomic_state *state,bool nonblock) {struct omap_drm_private *priv = dev->dev_private;struct omap_atomic_state_commit *commit;
@@ -177,7 +177,7 @@ static int omap_atomic_commit(struct drm_device *dev,/* Swap the state, this is the point of no return. */ drm_atomic_helper_swap_state (dev, state); -if (async) +if (nonblock)schedule_work (&commit->work);else omap_atomic_complete (commit);
Signature · 6 lines
2.5.5 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Maarten Lankhorst
maintainerPATCH 7/12 drm/rcar-du: Rename async to nonblock.
In reply to Maarten LankhorstThe async name is deprecated and should be changed to nonblocking.
--- drivers/gpu/drm/rcar-du/rcar_du_kms.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/rcar-du/rcar_du_kms.c +3 -2
@@ -283,7 +283,8 @@ static void rcar_du_atomic_work(struct work_struct *work) }static int rcar_du_atomic_commit (struct drm_device *dev, -struct drm_atomic_state *state,bool async) +struct drm_atomic_state *state, +bool nonblock) {struct rcar_du_device *rcdu = dev->dev_private;struct rcar_du_commit *commit;
@@ -328,7 +329,7 @@ static int rcar_du_atomic_commit(struct drm_device *dev,/* Swap the state, this is the point of no return. */ drm_atomic_helper_swap_state (dev, state); -if (async) +if (nonblock)schedule_work (&commit->work);else rcar_du_atomic_complete (commit);
Signature · 6 lines
2.5.5 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 07/12] drm/rcar-du: Rename async to nonblock.
Hi Maarten,
Thank you for the patch.
Quoted 4 lines · On Tuesday 26 Apr 2016 16:11:40 Maarten Lankhorst wrote:
The async name is deprecated and should be changed to nonblocking.
Cc Laurent Pinchart <[email protected]>Signed-off-by Maarten Lankhorst <[email protected]>
Quoted 28 lines
--- drivers/gpu/drm/rcar-du/rcar_du_kms.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)(quoted diff) +0
-0
b/drivers/gpu/drm/rcar-du/rcar_du_kms.cindex24725bf859b4..e70a4f33d970100644drivers/gpu/drm/rcar-du/rcar_du_kms.c +3
-2@@ -283,7 +283,8 @@ static void rcar_du_atomic_work(struct work_struct *work) }static int rcar_du_atomic_commit (struct drm_device *dev, -struct drm_atomic_state *state,bool async) +struct drm_atomic_state *state, +bool nonblock) {struct rcar_du_device *rcdu = dev->dev_private;struct rcar_du_commit *commit;@@ -328,7 +329,7 @@ static int rcar_du_atomic_commit(struct drm_device *dev,/* Swap the state, this is the point of no return. */ drm_atomic_helper_swap_state (dev, state); -if (async) +if (nonblock)schedule_work (&commit->work);else rcar_du_atomic_complete (commit);
Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Maarten Lankhorst
maintainerPATCH 8/12 drm/sti: Rename async to nonblock.
In reply to Maarten LankhorstThe async name is deprecated and should be changed to nonblocking.
--- drivers/gpu/drm/sti/sti_drv.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/sti/sti_drv.c +3 -3
@@ -202,7 +202,7 @@ static void sti_atomic_work(struct work_struct *work) }static int sti_atomic_commit (struct drm_device *drm, -struct drm_atomic_state *state,bool async) +struct drm_atomic_state *state,bool nonblock) {struct sti_private *private = drm->dev_private;int err;
@@ -211,7 +211,7 @@ static int sti_atomic_commit(struct drm_device *drm,if (err)return err; -/* serialize outstanding asynchronous commits */ +/* serialize outstanding nonblocking commits */ mutex_lock (&private->commit.lock);flush_work (&private->commit.work);
@@ -223,7 +223,7 @@ static int sti_atomic_commit(struct drm_device *drm,drm_atomic_helper_swap_state (drm, state); -if (async) +if (nonblock)sti_atomic_schedule (private, state);else sti_atomic_complete (private, state);
Signature · 6 lines
2.5.5 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 08/12] drm/sti: Rename async to nonblock.
Hi Maarten,
Thanks for the patch.
Quoted 33 lines · Maarten Lankhorst
The async name is deprecated and should be changed to nonblocking.
Cc Benjamin Gaignard <[email protected]>Cc Vincent Abriou <[email protected]>Signed-off-by Maarten Lankhorst <[email protected]>--- drivers/gpu/drm/sti/sti_drv.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/gpu/drm/sti/sti_drv.c +2
-2@@ -202,7 +202,7 @@ static void sti_atomic_work(struct work_struct *work) }static int sti_atomic_commit (struct drm_device *drm, -struct drm_atomic_state *state,bool async) +struct drm_atomic_state *state,bool nonblock) {struct sti_private *private = drm->dev_private;int err;@@ -211,7 +211,7 @@ static int sti_atomic_commit(struct drm_device *drm,if (err)return err; -/* serialize outstanding asynchronous commits */ +/* serialize outstanding nonblocking commits */ mutex_lock (&private->commit.lock);flush_work (&private->commit.work);
drivers/gpu/drm/sti/sti_drv.c static int sti_atomic_commit(struct drm_device *drm, · line 229
Quoted 8 lines
drivers/gpu/drm/sti/sti_drv.c +1
-1@@ -223,7 +223,7 @@ static int sti_atomic_commit(struct drm_device *drm,drm_atomic_helper_swap_state (drm, state); -if (async) +if (nonblock)sti_atomic_schedule (private, state);else sti_atomic_complete (private, state);
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Maarten Lankhorst
maintainerPATCH 9/12 drm/tegra: Rename async to nonblock.
In reply to Maarten LankhorstThe async name is deprecated and should be changed to nonblocking.
--- drivers/gpu/drm/tegra/drm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/tegra/drm.c +3 -3
@@ -74,7 +74,7 @@ static void tegra_atomic_work(struct work_struct *work) }static int tegra_atomic_commit (struct drm_device *drm, -struct drm_atomic_state *state,bool async) +struct drm_atomic_state *state,bool nonblock) {struct tegra_drm *tegra = drm->dev_private;int err;
@@ -83,7 +83,7 @@ static int tegra_atomic_commit(struct drm_device *drm,if (err)return err; -/* serialize outstanding asynchronous commits */ +/* serialize outstanding nonblocking commits */ mutex_lock (&tegra->commit.lock);flush_work (&tegra->commit.work);
@@ -95,7 +95,7 @@ static int tegra_atomic_commit(struct drm_device *drm,drm_atomic_helper_swap_state (drm, state); -if (async) +if (nonblock)tegra_atomic_schedule (tegra, state);else tegra_atomic_complete (tegra, state);
Signature · 6 lines
2.5.5 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Maarten Lankhorst
maintainerPATCH 10/12 drm/rockchip: Rename async to nonblock.
In reply to Maarten LankhorstThe async name is deprecated and should be changed to nonblocking.
--- drivers/gpu/drm/rockchip/rockchip_drm_fb.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/rockchip/rockchip_drm_fb.c +3 -3
@@ -276,7 +276,7 @@ void rockchip_drm_atomic_work(struct work_struct *work)int rockchip_drm_atomic_commit (struct drm_device *dev,struct drm_atomic_state *state, -bool async) +bool nonblock) {struct rockchip_drm_private *private = dev->dev_private;struct rockchip_atomic_commit *commit = &private->commit;
@@ -286,7 +286,7 @@ int rockchip_drm_atomic_commit(struct drm_device *dev,if (ret)return ret; -/* serialize outstanding asynchronous commits */ +/* serialize outstanding nonblocking commits */ mutex_lock (&commit->lock);flush_work (&commit->work);
@@ -295,7 +295,7 @@ int rockchip_drm_atomic_commit(struct drm_device *dev, commit->dev = dev; commit->state = state; -if (async) +if (nonblock)schedule_work (&commit->work);else rockchip_atomic_commit_complete (commit);
Signature · 6 lines
2.5.5 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Maarten Lankhorst
maintainerPATCH 11/12 drm/vc4: Rename async to nonblock.
In reply to Maarten LankhorstThe async name is deprecated and should be changed to nonblocking.
--- drivers/gpu/drm/vc4/vc4_kms.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/vc4/vc4_kms.c +3 -3
@@ -93,7 +93,7 @@ static struct vc4_commit *commit_init(struct drm_atomic_state *state)* vc4_atomic_commit - commit validated state object * @dev: DRM device * @state: the driver state object -* @async: asynchronous commit +* @nonblock: nonblocking commit * * This function commits a with drm_atomic_helper_check() pre-validated state * object. This can still fail when e.g. the framebuffer reservation fails. For
@@ -104,7 +104,7 @@ static struct vc4_commit *commit_init(struct drm_atomic_state *state)*/ static int vc4_atomic_commit (struct drm_device *dev,struct drm_atomic_state *state, -bool async) +bool nonblock) {struct vc4_dev *vc4 =to_vc4_dev (dev);int ret;
@@ -170,7 +170,7 @@ static int vc4_atomic_commit(struct drm_device *dev,* current layout. */ -if (async) { +if (nonblock) {vc4_queue_seqno_cb (dev, &c->cb, wait_seqno, vc4_atomic_complete_commit_seqno_cb); }else {
Signature · 6 lines
2.5.5 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Maarten Lankhorst
maintainerPATCH 12/12 drm/i915: Rename async to nonblock.
In reply to Maarten LankhorstThe async name is deprecated and should be changed to nonblocking.
--- drivers/gpu/drm/i915/intel_display.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/gpu/drm/i915/intel_display.c +8 -8
@@ -13386,7 +13386,7 @@ static int intel_atomic_check(struct drm_device *dev,static int intel_atomic_prepare_commit (struct drm_device *dev,struct drm_atomic_state *state, -bool async) +bool nonblock) {struct drm_i915_private *dev_priv = dev->dev_private;struct drm_plane_state *plane_state;
@@ -13395,8 +13395,8 @@ static int intel_atomic_prepare_commit(struct drm_device *dev,struct drm_crtc *crtc;int i, ret; -if (async) { -DRM_DEBUG_KMS ("i915 does not yet support async commit\n" ); +if (nonblock) { +DRM_DEBUG_KMS ("i915 does not yet support nonblocking commit\n" );return -EINVAL ; }
@@ -13414,7 +13414,7 @@ static int intel_atomic_prepare_commit(struct drm_device *dev,return ret; ret =drm_atomic_helper_prepare_planes (dev, state); -if (!ret && !async && !i915_reset_in_progress (&dev_priv->gpu_error)) { +if (!ret && !nonblock && !i915_reset_in_progress (&dev_priv->gpu_error)) {u32 reset_counter; reset_counter =atomic_read (&dev_priv->gpu_error.reset_counter);
@@ -13519,21 +13519,21 @@ static bool needs_vblank_wait(struct intel_crtc_state *crtc_state)* intel_atomic_commit - commit validated state object * @dev: DRM device * @state: the top-level driver state object -* @async: asynchronous commit +* @nonblock: nonblocking commit * * This function commits a top-level state object that has been validated * with drm_atomic_helper_check(). * * FIXME: Atomic modeset support for i915 is not yet complete. At the moment * we can only handle plane-related operations and do not yet support -* asynchronous commit. +* nonblocking commit. * * RETURNS * Zero for success or -errno. */ static int intel_atomic_commit (struct drm_device *dev,struct drm_atomic_state *state, -bool async) +bool nonblock) {struct intel_atomic_state *intel_state =to_intel_atomic_state (state);struct drm_i915_private *dev_priv = dev->dev_private;
@@ -13545,7 +13545,7 @@ static int intel_atomic_commit(struct drm_device *dev,unsigned long put_domains[I915_MAX_PIPES ] = {};unsigned crtc_vblank_mask =0 ; - ret =intel_atomic_prepare_commit (dev, state, async); + ret =intel_atomic_prepare_commit (dev, state, nonblock);if (ret) {DRM_DEBUG_ATOMIC ("Preparing state failed with %i\n" , ret);return ret;
Signature · 6 lines
2.5.5 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 14 lines · Maarten Lankhorst
Userspace calls the atomic ioctl with
DRM_MODE_ATOMIC_NONBLOCKwhen it doesn't want the ioctl to block for completion.In the kernel it's called async commit, which is confusing. The legacy pageflip and atomic ioctl also have a flag
DRM_MODE_PAGE_FLIP_ASYNCwhich means that the flip should happen as soon as possible, even if it causes tearing.Because of this we should rename async commit to nonblocking commit, which should reduce a lot of the confusion.
This is done partially with a cocci script, and inspection by hand because cocci doesn't patch comments.
Quoted 13 lines
Maarten Lankhorst (12):
drm/atomic: Rename async parameter to nonblocking. drm/atomic: Renamedrm_atomic_async_committo nonblocking. drm/arm/hdlcd: Rename async to nonblock. drm/exynos: Rename async to nonblock.
drm/msm: Rename async to nonblock.
drm/omapdrm: Rename async to nonblock. drm/rcar-du: Rename async to nonblock.
drm/sti: Rename async to nonblock.
drm/tegra: Rename async to nonblock. drm/rockchip: Rename async to nonblock.
drm/vc4: Rename async to nonblock.
drm/i915: Rename async to nonblock.
Yeah, this clarifies stuff a lot imo. Bit a funny split-up in the first two patches, but meh.
I think I'll apply it all to drm-misc once driver maintainers had some time to ack, but will merge anyway if they miss.
-Daniel
Quoted 27 lines
drivers/gpu/drm/arm/hdlcd_drv.c | 2 +- drivers/gpu/drm/drm_atomic.c | 12 +++++------ drivers/gpu/drm/drm_atomic_helper.c | 34 +++++++++++++++--------------- drivers/gpu/drm/exynos/exynos_drm_drv.c | 4 ++-- drivers/gpu/drm/exynos/exynos_drm_drv.h | 2 +- drivers/gpu/drm/i915/intel_display.c | 16 +++++++------- drivers/gpu/drm/msm/msm_atomic.c | 9 ++++---- drivers/gpu/drm/msm/msm_drv.h | 2 +- drivers/gpu/drm/omapdrm/omap_drv.c | 4 ++-- drivers/gpu/drm/rcar-du/rcar_du_kms.c | 5 +++-- drivers/gpu/drm/rockchip/rockchip_drm_fb.c | 6 +++--- drivers/gpu/drm/sti/sti_drv.c | 6 +++--- drivers/gpu/drm/tegra/drm.c | 6 +++--- drivers/gpu/drm/vc4/vc4_kms.c | 6 +++--- include/drm/drm_atomic.h | 2 +- include/drm/drm_atomic_helper.h | 2 +- include/drm/drm_crtc.h | 8 +++---- 17 files changed, 63 insertions(+), 63 deletions(-)Signature · 6 lines
2.5.5 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 29 lines · Daniel Vetter
Quoted 14 lines · Maarten Lankhorst
Userspace calls the atomic ioctl with
DRM_MODE_ATOMIC_NONBLOCKwhen it doesn't want the ioctl to block for completion.In the kernel it's called async commit, which is confusing. The legacy pageflip and atomic ioctl also have a flag
DRM_MODE_PAGE_FLIP_ASYNCwhich means that the flip should happen as soon as possible, even if it causes tearing.Because of this we should rename async commit to nonblocking commit, which should reduce a lot of the confusion.
This is done partially with a cocci script, and inspection by hand because cocci doesn't patch comments.
Quoted 13 lines
Maarten Lankhorst (12):
drm/atomic: Rename async parameter to nonblocking. drm/atomic: Renamedrm_atomic_async_committo nonblocking. drm/arm/hdlcd: Rename async to nonblock. drm/exynos: Rename async to nonblock.
drm/msm: Rename async to nonblock.
drm/omapdrm: Rename async to nonblock. drm/rcar-du: Rename async to nonblock.
drm/sti: Rename async to nonblock.
drm/tegra: Rename async to nonblock. drm/rockchip: Rename async to nonblock.
drm/vc4: Rename async to nonblock.
drm/i915: Rename async to nonblock.
Quoted 5 lines
Yeah, this clarifies stuff a lot imo. Bit a funny split-up in the first two patches, but meh.
I think I'll apply it all to drm-misc once driver maintainers had some time to ack, but will merge anyway if they miss.
Ok, pulled this all into drm-misc. There's new drivers now in drm-next, can you please re-run the cocci for those?
Thanks, Daniel
Quoted 34 lines
-Daniel
Quoted 27 lines
drivers/gpu/drm/arm/hdlcd_drv.c | 2 +- drivers/gpu/drm/drm_atomic.c | 12 +++++------ drivers/gpu/drm/drm_atomic_helper.c | 34 +++++++++++++++--------------- drivers/gpu/drm/exynos/exynos_drm_drv.c | 4 ++-- drivers/gpu/drm/exynos/exynos_drm_drv.h | 2 +- drivers/gpu/drm/i915/intel_display.c | 16 +++++++------- drivers/gpu/drm/msm/msm_atomic.c | 9 ++++---- drivers/gpu/drm/msm/msm_drv.h | 2 +- drivers/gpu/drm/omapdrm/omap_drv.c | 4 ++-- drivers/gpu/drm/rcar-du/rcar_du_kms.c | 5 +++-- drivers/gpu/drm/rockchip/rockchip_drm_fb.c | 6 +++--- drivers/gpu/drm/sti/sti_drv.c | 6 +++--- drivers/gpu/drm/tegra/drm.c | 6 +++--- drivers/gpu/drm/vc4/vc4_kms.c | 6 +++--- include/drm/drm_atomic.h | 2 +- include/drm/drm_atomic_helper.h | 2 +- include/drm/drm_crtc.h | 8 +++---- 17 files changed, 63 insertions(+), 63 deletions(-)Signature · 6 lines
2.5.5 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-develSignature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.BAT: failure for drm/atomic: Rename async to nonblocking.
In reply to Maarten Lankhorst== Series Details ==
== Series Details ==
Series: drm/atomic: Rename async to nonblocking.
URL : https://patchwork.freedesktop.org/series/6339/
State : failure
== Summary ==
CC drivers/video/fbdev/efifb.o LD [M] drivers/net/ethernet/intel/igbvf/igbvf.o CC drivers/usb/host/xhci.o CC drivers/usb/storage/initializers.o CC drivers/usb/storage/sierra_ms.o CC drivers/usb/storage/option_ms.o CC drivers/usb/host/xhci-mem.o CC drivers/usb/storage/usual-tables.o LD drivers/usb/gadget/libcomposite.o CC drivers/usb/host/xhci-ring.o CC drivers/usb/host/xhci-dbg.o CC drivers/usb/host/xhci-hub.o CC drivers/usb/host/xhci-trace.o CC drivers/usb/host/xhci-pci.o LD [M] drivers/usb/serial/usbserial.o LD drivers/usb/core/usbcore.o LD drivers/usb/core/built-in.o LD drivers/video/fbdev/built-in.o LD drivers/video/built-in.o LD drivers/usb/gadget/udc/built-in.o LD drivers/usb/gadget/built-in.o LD drivers/usb/storage/usb-storage.o LD drivers/usb/storage/built-in.o LD drivers/net/ethernet/built-in.o LD drivers/net/built-in.o LD drivers/usb/host/xhci-hcd.o LD drivers/usb/host/built-in.o LD drivers/usb/built-in.o
Makefile:962: recipe for target 'drivers' failed
make: *** [drivers] Error 2
Full logs at /archive/deploy/logs/CI_Patchwork_build_2076
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx