* [PATCH] drm/atomic-helper: Use old/new state in drm_atomic_helper_commit_planes_on_crtc()
@ 2018-06-26 20:41 Ville Syrjala
2018-06-27 8:59 ` [Intel-gfx] " Daniel Vetter
0 siblings, 1 reply; 3+ messages in thread
From: Ville Syrjala @ 2018-06-26 20:41 UTC (permalink / raw)
To: dri-devel; +Cc: intel-gfx
From: Ville Syrjälä <ville.syrjala@linux.intel.com>
Update drm_atomic_helper_commit_planes_on_crtc() to use explicit old/new
states instead of relying on obj->state.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
drivers/gpu/drm/drm_atomic_helper.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index e022cacdae34..8008a7de2e10 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -2342,11 +2342,13 @@ drm_atomic_helper_commit_planes_on_crtc(struct drm_crtc_state *old_crtc_state)
const struct drm_crtc_helper_funcs *crtc_funcs;
struct drm_crtc *crtc = old_crtc_state->crtc;
struct drm_atomic_state *old_state = old_crtc_state->state;
+ struct drm_crtc_state *new_crtc_state =
+ drm_atomic_get_new_crtc_state(old_state, crtc);
struct drm_plane *plane;
unsigned plane_mask;
plane_mask = old_crtc_state->plane_mask;
- plane_mask |= crtc->state->plane_mask;
+ plane_mask |= new_crtc_state->plane_mask;
crtc_funcs = crtc->helper_private;
if (crtc_funcs && crtc_funcs->atomic_begin)
@@ -2355,6 +2357,8 @@ drm_atomic_helper_commit_planes_on_crtc(struct drm_crtc_state *old_crtc_state)
drm_for_each_plane_mask(plane, crtc->dev, plane_mask) {
struct drm_plane_state *old_plane_state =
drm_atomic_get_old_plane_state(old_state, plane);
+ struct drm_plane_state *new_plane_state =
+ drm_atomic_get_new_plane_state(old_state, plane);
const struct drm_plane_helper_funcs *plane_funcs;
plane_funcs = plane->helper_private;
@@ -2362,13 +2366,14 @@ drm_atomic_helper_commit_planes_on_crtc(struct drm_crtc_state *old_crtc_state)
if (!old_plane_state || !plane_funcs)
continue;
- WARN_ON(plane->state->crtc && plane->state->crtc != crtc);
+ WARN_ON(new_plane_state->crtc &&
+ new_plane_state->crtc != crtc);
- if (drm_atomic_plane_disabling(old_plane_state, plane->state) &&
+ if (drm_atomic_plane_disabling(old_plane_state, new_plane_state) &&
plane_funcs->atomic_disable)
plane_funcs->atomic_disable(plane, old_plane_state);
- else if (plane->state->crtc ||
- drm_atomic_plane_disabling(old_plane_state, plane->state))
+ else if (new_plane_state->crtc ||
+ drm_atomic_plane_disabling(old_plane_state, new_plane_state))
plane_funcs->atomic_update(plane, old_plane_state);
}
--
2.16.4
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Intel-gfx] [PATCH] drm/atomic-helper: Use old/new state in drm_atomic_helper_commit_planes_on_crtc()
2018-06-26 20:41 [PATCH] drm/atomic-helper: Use old/new state in drm_atomic_helper_commit_planes_on_crtc() Ville Syrjala
@ 2018-06-27 8:59 ` Daniel Vetter
2018-07-02 15:55 ` Ville Syrjälä
0 siblings, 1 reply; 3+ messages in thread
From: Daniel Vetter @ 2018-06-27 8:59 UTC (permalink / raw)
To: Ville Syrjala; +Cc: intel-gfx, dri-devel
On Tue, Jun 26, 2018 at 11:41:44PM +0300, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Update drm_atomic_helper_commit_planes_on_crtc() to use explicit old/new
> states instead of relying on obj->state.
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> ---
> drivers/gpu/drm/drm_atomic_helper.c | 15 ++++++++++-----
> 1 file changed, 10 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
> index e022cacdae34..8008a7de2e10 100644
> --- a/drivers/gpu/drm/drm_atomic_helper.c
> +++ b/drivers/gpu/drm/drm_atomic_helper.c
> @@ -2342,11 +2342,13 @@ drm_atomic_helper_commit_planes_on_crtc(struct drm_crtc_state *old_crtc_state)
> const struct drm_crtc_helper_funcs *crtc_funcs;
> struct drm_crtc *crtc = old_crtc_state->crtc;
> struct drm_atomic_state *old_state = old_crtc_state->state;
> + struct drm_crtc_state *new_crtc_state =
> + drm_atomic_get_new_crtc_state(old_state, crtc);
> struct drm_plane *plane;
> unsigned plane_mask;
>
> plane_mask = old_crtc_state->plane_mask;
> - plane_mask |= crtc->state->plane_mask;
> + plane_mask |= new_crtc_state->plane_mask;
>
> crtc_funcs = crtc->helper_private;
> if (crtc_funcs && crtc_funcs->atomic_begin)
> @@ -2355,6 +2357,8 @@ drm_atomic_helper_commit_planes_on_crtc(struct drm_crtc_state *old_crtc_state)
> drm_for_each_plane_mask(plane, crtc->dev, plane_mask) {
> struct drm_plane_state *old_plane_state =
> drm_atomic_get_old_plane_state(old_state, plane);
> + struct drm_plane_state *new_plane_state =
> + drm_atomic_get_new_plane_state(old_state, plane);
> const struct drm_plane_helper_funcs *plane_funcs;
>
> plane_funcs = plane->helper_private;
> @@ -2362,13 +2366,14 @@ drm_atomic_helper_commit_planes_on_crtc(struct drm_crtc_state *old_crtc_state)
> if (!old_plane_state || !plane_funcs)
> continue;
>
> - WARN_ON(plane->state->crtc && plane->state->crtc != crtc);
> + WARN_ON(new_plane_state->crtc &&
> + new_plane_state->crtc != crtc);
>
> - if (drm_atomic_plane_disabling(old_plane_state, plane->state) &&
> + if (drm_atomic_plane_disabling(old_plane_state, new_plane_state) &&
> plane_funcs->atomic_disable)
> plane_funcs->atomic_disable(plane, old_plane_state);
> - else if (plane->state->crtc ||
> - drm_atomic_plane_disabling(old_plane_state, plane->state))
> + else if (new_plane_state->crtc ||
> + drm_atomic_plane_disabling(old_plane_state, new_plane_state))
> plane_funcs->atomic_update(plane, old_plane_state);
> }
>
> --
> 2.16.4
>
> _______________________________________________
> 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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Intel-gfx] [PATCH] drm/atomic-helper: Use old/new state in drm_atomic_helper_commit_planes_on_crtc()
2018-06-27 8:59 ` [Intel-gfx] " Daniel Vetter
@ 2018-07-02 15:55 ` Ville Syrjälä
0 siblings, 0 replies; 3+ messages in thread
From: Ville Syrjälä @ 2018-07-02 15:55 UTC (permalink / raw)
To: Daniel Vetter; +Cc: intel-gfx, dri-devel
On Wed, Jun 27, 2018 at 10:59:49AM +0200, Daniel Vetter wrote:
> On Tue, Jun 26, 2018 at 11:41:44PM +0300, Ville Syrjala wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >
> > Update drm_atomic_helper_commit_planes_on_crtc() to use explicit old/new
> > states instead of relying on obj->state.
> >
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Thansk. Pushed to drm-misc-next.
>
> > ---
> > drivers/gpu/drm/drm_atomic_helper.c | 15 ++++++++++-----
> > 1 file changed, 10 insertions(+), 5 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
> > index e022cacdae34..8008a7de2e10 100644
> > --- a/drivers/gpu/drm/drm_atomic_helper.c
> > +++ b/drivers/gpu/drm/drm_atomic_helper.c
> > @@ -2342,11 +2342,13 @@ drm_atomic_helper_commit_planes_on_crtc(struct drm_crtc_state *old_crtc_state)
> > const struct drm_crtc_helper_funcs *crtc_funcs;
> > struct drm_crtc *crtc = old_crtc_state->crtc;
> > struct drm_atomic_state *old_state = old_crtc_state->state;
> > + struct drm_crtc_state *new_crtc_state =
> > + drm_atomic_get_new_crtc_state(old_state, crtc);
> > struct drm_plane *plane;
> > unsigned plane_mask;
> >
> > plane_mask = old_crtc_state->plane_mask;
> > - plane_mask |= crtc->state->plane_mask;
> > + plane_mask |= new_crtc_state->plane_mask;
> >
> > crtc_funcs = crtc->helper_private;
> > if (crtc_funcs && crtc_funcs->atomic_begin)
> > @@ -2355,6 +2357,8 @@ drm_atomic_helper_commit_planes_on_crtc(struct drm_crtc_state *old_crtc_state)
> > drm_for_each_plane_mask(plane, crtc->dev, plane_mask) {
> > struct drm_plane_state *old_plane_state =
> > drm_atomic_get_old_plane_state(old_state, plane);
> > + struct drm_plane_state *new_plane_state =
> > + drm_atomic_get_new_plane_state(old_state, plane);
> > const struct drm_plane_helper_funcs *plane_funcs;
> >
> > plane_funcs = plane->helper_private;
> > @@ -2362,13 +2366,14 @@ drm_atomic_helper_commit_planes_on_crtc(struct drm_crtc_state *old_crtc_state)
> > if (!old_plane_state || !plane_funcs)
> > continue;
> >
> > - WARN_ON(plane->state->crtc && plane->state->crtc != crtc);
> > + WARN_ON(new_plane_state->crtc &&
> > + new_plane_state->crtc != crtc);
> >
> > - if (drm_atomic_plane_disabling(old_plane_state, plane->state) &&
> > + if (drm_atomic_plane_disabling(old_plane_state, new_plane_state) &&
> > plane_funcs->atomic_disable)
> > plane_funcs->atomic_disable(plane, old_plane_state);
> > - else if (plane->state->crtc ||
> > - drm_atomic_plane_disabling(old_plane_state, plane->state))
> > + else if (new_plane_state->crtc ||
> > + drm_atomic_plane_disabling(old_plane_state, new_plane_state))
> > plane_funcs->atomic_update(plane, old_plane_state);
> > }
> >
> > --
> > 2.16.4
> >
> > _______________________________________________
> > 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
--
Ville Syrjälä
Intel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-07-02 15:55 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-26 20:41 [PATCH] drm/atomic-helper: Use old/new state in drm_atomic_helper_commit_planes_on_crtc() Ville Syrjala
2018-06-27 8:59 ` [Intel-gfx] " Daniel Vetter
2018-07-02 15:55 ` Ville Syrjälä
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox