* [PATCH v2 02/12] drm/atomic: Change drm_atomic_helper_swap_state to return an error.
[not found] <20170711143314.2148-1-maarten.lankhorst@linux.intel.com>
@ 2017-07-11 14:33 ` Maarten Lankhorst
2017-07-14 14:30 ` [Intel-gfx] " Daniel Vetter
0 siblings, 1 reply; 3+ messages in thread
From: Maarten Lankhorst @ 2017-07-11 14:33 UTC (permalink / raw)
To: dri-devel; +Cc: intel-gfx, Maarten Lankhorst, linux-kernel
We want to change swap_state to wait indefinitely, but to do this
swap_state should wait interruptibly. This requires propagating
the error to each driver.
Cc: dri-devel@lists.freedesktop.org
Cc: linux-kernel@vger.kernel.org
Cc: intel-gfx@lists.freedesktop.org
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
drivers/gpu/drm/drm_atomic_helper.c | 22 ++++++++++++++++------
include/drm/drm_atomic_helper.h | 3 +--
2 files changed, 17 insertions(+), 8 deletions(-)
diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index 667ec97d4efb..bfb98fbd0e0e 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -1510,10 +1510,8 @@ int drm_atomic_helper_commit(struct drm_device *dev,
if (!nonblock) {
ret = drm_atomic_helper_wait_for_fences(dev, state, true);
- if (ret) {
- drm_atomic_helper_cleanup_planes(dev, state);
- return ret;
- }
+ if (ret)
+ goto err;
}
/*
@@ -1522,7 +1520,9 @@ int drm_atomic_helper_commit(struct drm_device *dev,
* the software side now.
*/
- drm_atomic_helper_swap_state(state, true);
+ ret = drm_atomic_helper_swap_state(state, true);
+ if (ret)
+ goto err;
/*
* Everything below can be run asynchronously without the need to grab
@@ -1551,6 +1551,10 @@ int drm_atomic_helper_commit(struct drm_device *dev,
commit_tail(state);
return 0;
+
+err:
+ drm_atomic_helper_cleanup_planes(dev, state);
+ return ret;
}
EXPORT_SYMBOL(drm_atomic_helper_commit);
@@ -2254,8 +2258,12 @@ EXPORT_SYMBOL(drm_atomic_helper_cleanup_planes);
* the &drm_plane.state, &drm_crtc.state or &drm_connector.state pointer. With
* the current atomic helpers this is almost always the case, since the helpers
* don't pass the right state structures to the callbacks.
+ *
+ * Returns:
+ *
+ * Always returns 0, cannot fail yet.
*/
-void drm_atomic_helper_swap_state(struct drm_atomic_state *state,
+int drm_atomic_helper_swap_state(struct drm_atomic_state *state,
bool stall)
{
int i;
@@ -2332,6 +2340,8 @@ void drm_atomic_helper_swap_state(struct drm_atomic_state *state,
__for_each_private_obj(state, obj, obj_state, i, funcs)
funcs->swap_state(obj, &state->private_objs[i].obj_state);
+
+ return 0;
}
EXPORT_SYMBOL(drm_atomic_helper_swap_state);
diff --git a/include/drm/drm_atomic_helper.h b/include/drm/drm_atomic_helper.h
index dd196cc0afd7..37c9534ff691 100644
--- a/include/drm/drm_atomic_helper.h
+++ b/include/drm/drm_atomic_helper.h
@@ -84,8 +84,7 @@ void
drm_atomic_helper_disable_planes_on_crtc(struct drm_crtc_state *old_crtc_state,
bool atomic);
-void drm_atomic_helper_swap_state(struct drm_atomic_state *state,
- bool stall);
+int drm_atomic_helper_swap_state(struct drm_atomic_state *state, bool stall);
/* nonblocking commit helpers */
int drm_atomic_helper_setup_commit(struct drm_atomic_state *state,
--
2.11.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Intel-gfx] [PATCH v2 02/12] drm/atomic: Change drm_atomic_helper_swap_state to return an error.
2017-07-11 14:33 ` [PATCH v2 02/12] drm/atomic: Change drm_atomic_helper_swap_state to return an error Maarten Lankhorst
@ 2017-07-14 14:30 ` Daniel Vetter
2017-07-14 14:55 ` Sean Paul
0 siblings, 1 reply; 3+ messages in thread
From: Daniel Vetter @ 2017-07-14 14:30 UTC (permalink / raw)
To: Maarten Lankhorst; +Cc: dri-devel, intel-gfx, linux-kernel
On Tue, Jul 11, 2017 at 04:33:04PM +0200, Maarten Lankhorst wrote:
> We want to change swap_state to wait indefinitely, but to do this
> swap_state should wait interruptibly. This requires propagating
> the error to each driver.
>
> Cc: dri-devel@lists.freedesktop.org
> Cc: linux-kernel@vger.kernel.org
> Cc: intel-gfx@lists.freedesktop.org
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> ---
> drivers/gpu/drm/drm_atomic_helper.c | 22 ++++++++++++++++------
> include/drm/drm_atomic_helper.h | 3 +--
> 2 files changed, 17 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
> index 667ec97d4efb..bfb98fbd0e0e 100644
> --- a/drivers/gpu/drm/drm_atomic_helper.c
> +++ b/drivers/gpu/drm/drm_atomic_helper.c
> @@ -1510,10 +1510,8 @@ int drm_atomic_helper_commit(struct drm_device *dev,
>
> if (!nonblock) {
> ret = drm_atomic_helper_wait_for_fences(dev, state, true);
> - if (ret) {
> - drm_atomic_helper_cleanup_planes(dev, state);
> - return ret;
> - }
> + if (ret)
> + goto err;
> }
>
> /*
> @@ -1522,7 +1520,9 @@ int drm_atomic_helper_commit(struct drm_device *dev,
> * the software side now.
> */
>
> - drm_atomic_helper_swap_state(state, true);
> + ret = drm_atomic_helper_swap_state(state, true);
> + if (ret)
> + goto err;
>
> /*
> * Everything below can be run asynchronously without the need to grab
> @@ -1551,6 +1551,10 @@ int drm_atomic_helper_commit(struct drm_device *dev,
> commit_tail(state);
>
> return 0;
> +
> +err:
> + drm_atomic_helper_cleanup_planes(dev, state);
> + return ret;
> }
> EXPORT_SYMBOL(drm_atomic_helper_commit);
>
> @@ -2254,8 +2258,12 @@ EXPORT_SYMBOL(drm_atomic_helper_cleanup_planes);
> * the &drm_plane.state, &drm_crtc.state or &drm_connector.state pointer. With
> * the current atomic helpers this is almost always the case, since the helpers
> * don't pass the right state structures to the callbacks.
> + *
> + * Returns:
> + *
> + * Always returns 0, cannot fail yet.
> */
> -void drm_atomic_helper_swap_state(struct drm_atomic_state *state,
> +int drm_atomic_helper_swap_state(struct drm_atomic_state *state,
> bool stall)
> {
> int i;
> @@ -2332,6 +2340,8 @@ void drm_atomic_helper_swap_state(struct drm_atomic_state *state,
>
> __for_each_private_obj(state, obj, obj_state, i, funcs)
> funcs->swap_state(obj, &state->private_objs[i].obj_state);
> +
> + return 0;
> }
> EXPORT_SYMBOL(drm_atomic_helper_swap_state);
>
> diff --git a/include/drm/drm_atomic_helper.h b/include/drm/drm_atomic_helper.h
> index dd196cc0afd7..37c9534ff691 100644
> --- a/include/drm/drm_atomic_helper.h
> +++ b/include/drm/drm_atomic_helper.h
> @@ -84,8 +84,7 @@ void
> drm_atomic_helper_disable_planes_on_crtc(struct drm_crtc_state *old_crtc_state,
> bool atomic);
>
> -void drm_atomic_helper_swap_state(struct drm_atomic_state *state,
> - bool stall);
> +int drm_atomic_helper_swap_state(struct drm_atomic_state *state, bool stall);
>
> /* nonblocking commit helpers */
> int drm_atomic_helper_setup_commit(struct drm_atomic_state *state,
> --
> 2.11.0
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Intel-gfx] [PATCH v2 02/12] drm/atomic: Change drm_atomic_helper_swap_state to return an error.
2017-07-14 14:30 ` [Intel-gfx] " Daniel Vetter
@ 2017-07-14 14:55 ` Sean Paul
0 siblings, 0 replies; 3+ messages in thread
From: Sean Paul @ 2017-07-14 14:55 UTC (permalink / raw)
To: Maarten Lankhorst, dri-devel, intel-gfx, linux-kernel
On Fri, Jul 14, 2017 at 04:30:30PM +0200, Daniel Vetter wrote:
> On Tue, Jul 11, 2017 at 04:33:04PM +0200, Maarten Lankhorst wrote:
> > We want to change swap_state to wait indefinitely, but to do this
> > swap_state should wait interruptibly. This requires propagating
> > the error to each driver.
> >
> > Cc: dri-devel@lists.freedesktop.org
> > Cc: linux-kernel@vger.kernel.org
> > Cc: intel-gfx@lists.freedesktop.org
> > Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
>
> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
>
> > ---
> > drivers/gpu/drm/drm_atomic_helper.c | 22 ++++++++++++++++------
> > include/drm/drm_atomic_helper.h | 3 +--
> > 2 files changed, 17 insertions(+), 8 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
> > index 667ec97d4efb..bfb98fbd0e0e 100644
> > --- a/drivers/gpu/drm/drm_atomic_helper.c
> > +++ b/drivers/gpu/drm/drm_atomic_helper.c
> > @@ -1510,10 +1510,8 @@ int drm_atomic_helper_commit(struct drm_device *dev,
> >
> > if (!nonblock) {
> > ret = drm_atomic_helper_wait_for_fences(dev, state, true);
> > - if (ret) {
> > - drm_atomic_helper_cleanup_planes(dev, state);
> > - return ret;
> > - }
> > + if (ret)
> > + goto err;
> > }
> >
> > /*
> > @@ -1522,7 +1520,9 @@ int drm_atomic_helper_commit(struct drm_device *dev,
> > * the software side now.
> > */
> >
> > - drm_atomic_helper_swap_state(state, true);
> > + ret = drm_atomic_helper_swap_state(state, true);
> > + if (ret)
> > + goto err;
> >
> > /*
> > * Everything below can be run asynchronously without the need to grab
> > @@ -1551,6 +1551,10 @@ int drm_atomic_helper_commit(struct drm_device *dev,
> > commit_tail(state);
> >
> > return 0;
> > +
> > +err:
> > + drm_atomic_helper_cleanup_planes(dev, state);
> > + return ret;
> > }
> > EXPORT_SYMBOL(drm_atomic_helper_commit);
> >
> > @@ -2254,8 +2258,12 @@ EXPORT_SYMBOL(drm_atomic_helper_cleanup_planes);
> > * the &drm_plane.state, &drm_crtc.state or &drm_connector.state pointer. With
> > * the current atomic helpers this is almost always the case, since the helpers
> > * don't pass the right state structures to the callbacks.
While you're changing this comment... would you mind s/proceeding/preceding/ and
s/swaped/swapped/ ?
Otherwise,
Reviewed-by: Sean Paul <seanpaul@chromium.org>
> > + *
> > + * Returns:
> > + *
> > + * Always returns 0, cannot fail yet.
> > */
> > -void drm_atomic_helper_swap_state(struct drm_atomic_state *state,
> > +int drm_atomic_helper_swap_state(struct drm_atomic_state *state,
> > bool stall)
> > {
> > int i;
> > @@ -2332,6 +2340,8 @@ void drm_atomic_helper_swap_state(struct drm_atomic_state *state,
> >
> > __for_each_private_obj(state, obj, obj_state, i, funcs)
> > funcs->swap_state(obj, &state->private_objs[i].obj_state);
> > +
> > + return 0;
> > }
> > EXPORT_SYMBOL(drm_atomic_helper_swap_state);
> >
> > diff --git a/include/drm/drm_atomic_helper.h b/include/drm/drm_atomic_helper.h
> > index dd196cc0afd7..37c9534ff691 100644
> > --- a/include/drm/drm_atomic_helper.h
> > +++ b/include/drm/drm_atomic_helper.h
> > @@ -84,8 +84,7 @@ void
> > drm_atomic_helper_disable_planes_on_crtc(struct drm_crtc_state *old_crtc_state,
> > bool atomic);
> >
> > -void drm_atomic_helper_swap_state(struct drm_atomic_state *state,
> > - bool stall);
> > +int drm_atomic_helper_swap_state(struct drm_atomic_state *state, bool stall);
> >
> > /* nonblocking commit helpers */
> > int drm_atomic_helper_setup_commit(struct drm_atomic_state *state,
> > --
> > 2.11.0
> >
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/intel-gfx
>
> --
> Daniel Vetter
> Software Engineer, Intel Corporation
> http://blog.ffwll.ch
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
--
Sean Paul, Software Engineer, Google / Chromium OS
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-07-14 14:55 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20170711143314.2148-1-maarten.lankhorst@linux.intel.com>
2017-07-11 14:33 ` [PATCH v2 02/12] drm/atomic: Change drm_atomic_helper_swap_state to return an error Maarten Lankhorst
2017-07-14 14:30 ` [Intel-gfx] " Daniel Vetter
2017-07-14 14:55 ` Sean Paul
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome