dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Benoit Parrot <bparrot@ti.com>
Cc: Daniel Vetter <daniel@ffwll.ch>, Rob Clark <robdclark@gmail.com>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	Jyri Sarha <jsarha@ti.com>,
	Peter Ujfalusi <peter.ujfalusi@ti.com>,
	Boris Brezillon <boris.brezillon@bootlin.com>,
	Tomi Valkeinen <tomi.valkeinen@ti.com>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Subject: Re: [Patch 1/1] drm/atomic: integrate private objects with suspend/resume helpers
Date: Thu, 14 Mar 2019 17:31:29 +0200	[thread overview]
Message-ID: <20190314153129.GS3888@intel.com> (raw)
In-Reply-To: <20190314134445.19260-1-bparrot@ti.com>

On Thu, Mar 14, 2019 at 08:44:45AM -0500, Benoit Parrot wrote:
> During a suspend cycle the atomic state is saved to be used during the
> restore cycle.
> 
> However the current state duplication logic does not duplicate private
> objects. This leads to state inconsistencies at resume time.
> 
> With private objects modeset lock now integrated, we can make sure that
> private object state are properly saved and restored.
> 
> Signed-off-by: Benoit Parrot <bparrot@ti.com>
> ---
>  drivers/gpu/drm/drm_atomic_helper.c | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
> 
> diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
> index 540a77a2ade9..b108021cc092 100644
> --- a/drivers/gpu/drm/drm_atomic_helper.c
> +++ b/drivers/gpu/drm/drm_atomic_helper.c
> @@ -3189,6 +3189,7 @@ drm_atomic_helper_duplicate_state(struct drm_device *dev,
>  	struct drm_connector_list_iter conn_iter;
>  	struct drm_plane *plane;
>  	struct drm_crtc *crtc;
> +	struct drm_private_obj *privobj;
>  	int err = 0;
>  
>  	state = drm_atomic_state_alloc(dev);
> @@ -3218,6 +3219,16 @@ drm_atomic_helper_duplicate_state(struct drm_device *dev,
>  		}
>  	}
>  
> +	drm_for_each_privobj(privobj, dev) {
> +		struct drm_private_state *priv_state;
> +
> +		priv_state = drm_atomic_get_private_obj_state(state, privobj);
> +		if (IS_ERR(priv_state)) {
> +			err = PTR_ERR(priv_state);
> +			goto free;
> +		}
> +	}
> +
>  	drm_connector_list_iter_begin(dev, &conn_iter);
>  	drm_for_each_connector_iter(conn, &conn_iter) {
>  		struct drm_connector_state *conn_state;
> @@ -3325,12 +3336,17 @@ int drm_atomic_helper_commit_duplicated_state(struct drm_atomic_state *state,
>  	struct drm_connector_state *new_conn_state;
>  	struct drm_crtc *crtc;
>  	struct drm_crtc_state *new_crtc_state;
> +	struct drm_private_obj *privobj;
> +	struct drm_private_state *new_priv_state;
>  
>  	state->acquire_ctx = ctx;
>  
>  	for_each_new_plane_in_state(state, plane, new_plane_state, i)
>  		state->planes[i].old_state = plane->state;
>  
> +	for_each_new_private_obj_in_state(state, privobj, new_priv_state, i)
> +		state->private_objs[i].old_state = privobj->state;
> +
>  	for_each_new_crtc_in_state(state, crtc, new_crtc_state, i)
>  		state->crtcs[i].old_state = crtc->state;

Random order between crtc vs. plane vs. connector vs. priv is tickling
my ocd nerve a bit.

Otherwise looks sensible to me.
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

>  
> -- 
> 2.17.1
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Ville Syrjälä
Intel

  reply	other threads:[~2019-03-14 15:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-14 13:44 [Patch 1/1] drm/atomic: integrate private objects with suspend/resume helpers Benoit Parrot
2019-03-14 15:31 ` Ville Syrjälä [this message]
2019-03-14 15:54   ` Benoit Parrot
2019-03-14 18:19 ` Laurent Pinchart
2019-03-15 10:50 ` Daniel Vetter
2019-03-15 11:56   ` Benoit Parrot
2019-03-25  9:06     ` Daniel Vetter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190314153129.GS3888@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=boris.brezillon@bootlin.com \
    --cc=bparrot@ti.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jsarha@ti.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peter.ujfalusi@ti.com \
    --cc=robdclark@gmail.com \
    --cc=tomi.valkeinen@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).