From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: dri-devel@lists.freedesktop.org
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v4 4/5] drm/atomic: Convert get_existing_state callers to get_old/new_state, v3.
Date: Wed, 01 Mar 2017 03:04:01 +0200 [thread overview]
Message-ID: <33099096.olWWpuyW68@avalon> (raw)
In-Reply-To: <1487256430-7625-5-git-send-email-maarten.lankhorst@linux.intel.com>
Hi Maarten,
Thank you for the patch.
On Thursday 16 Feb 2017 15:47:09 Maarten Lankhorst wrote:
> This is a straightforward conversion that converts all the users of
> get_existing_state in atomic core to use get_old_state or get_new_state
>
> Changes since v1:
> - Fix using the wrong state in
> drm_atomic_helper_update_legacy_modeset_state. Changes since v2:
> - Use the correct state in disable_outputs()
>
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> ---
> drivers/gpu/drm/drm_atomic.c | 6 ++---
> drivers/gpu/drm/drm_atomic_helper.c | 43 ++++++++++++++----------------
> drivers/gpu/drm/drm_blend.c | 3 +--
> drivers/gpu/drm/drm_simple_kms_helper.c | 4 +--
> 4 files changed, 28 insertions(+), 28 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
> index afec53832145..c9aac9cbf111 100644
> --- a/drivers/gpu/drm/drm_atomic.c
> +++ b/drivers/gpu/drm/drm_atomic.c
> @@ -1358,8 +1358,8 @@ drm_atomic_set_crtc_for_connector(struct
> drm_connector_state *conn_state, return 0;
>
> if (conn_state->crtc) {
> - crtc_state = drm_atomic_get_existing_crtc_state(conn_state-
>state,
> - conn_state-
>crtc);
> + crtc_state = drm_atomic_get_new_crtc_state(conn_state->state,
> + conn_state->crtc);
I believe more *_state -> *_(new|old)_state renames could be useful, but that
can be addressed as a subsequent patch, so
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> crtc_state->connector_mask &=
> ~(1 << drm_connector_index(conn_state->connector));
> @@ -1476,7 +1476,7 @@ drm_atomic_add_affected_planes(struct drm_atomic_state
> *state, {
> struct drm_plane *plane;
>
> - WARN_ON(!drm_atomic_get_existing_crtc_state(state, crtc));
> + WARN_ON(!drm_atomic_get_new_crtc_state(state, crtc));
>
> drm_for_each_plane_mask(plane, state->dev, crtc->state->plane_mask) {
> struct drm_plane_state *plane_state =
> diff --git a/drivers/gpu/drm/drm_atomic_helper.c
> b/drivers/gpu/drm/drm_atomic_helper.c index ea544bddc29b..6296ae6e6aff
> 100644
> --- a/drivers/gpu/drm/drm_atomic_helper.c
> +++ b/drivers/gpu/drm/drm_atomic_helper.c
> @@ -70,8 +70,8 @@ drm_atomic_helper_plane_changed(struct drm_atomic_state
> *state, struct drm_crtc_state *crtc_state;
>
> if (old_plane_state->crtc) {
> - crtc_state = drm_atomic_get_existing_crtc_state(state,
> -
old_plane_state->crtc);
> + crtc_state = drm_atomic_get_new_crtc_state(state,
> + old_plane_state-
>crtc);
>
> if (WARN_ON(!crtc_state))
> return;
> @@ -80,8 +80,7 @@ drm_atomic_helper_plane_changed(struct drm_atomic_state
> *state, }
>
> if (plane_state->crtc) {
> - crtc_state = drm_atomic_get_existing_crtc_state(state,
> - plane_state-
>crtc);
> + crtc_state = drm_atomic_get_new_crtc_state(state, plane_state-
>crtc);
>
> if (WARN_ON(!crtc_state))
> return;
> @@ -150,7 +149,7 @@ static int handle_conflicting_encoders(struct
> drm_atomic_state *state, drm_for_each_connector_iter(connector, &conn_iter)
> {
> struct drm_crtc_state *crtc_state;
>
> - if (drm_atomic_get_existing_connector_state(state, connector))
> + if (drm_atomic_get_new_connector_state(state, connector))
> continue;
>
> encoder = connector->state->best_encoder;
> @@ -178,7 +177,7 @@ static int handle_conflicting_encoders(struct
> drm_atomic_state *state, new_conn_state->crtc->base.id,
> new_conn_state->crtc->name,
> connector->base.id, connector->name);
>
> - crtc_state = drm_atomic_get_existing_crtc_state(state,
> new_conn_state->crtc); + crtc_state =
drm_atomic_get_new_crtc_state(state,
> new_conn_state->crtc);
>
> ret = drm_atomic_set_crtc_for_connector(new_conn_state, NULL);
> if (ret)
> @@ -219,7 +218,7 @@ set_best_encoder(struct drm_atomic_state *state,
> */
> WARN_ON(!crtc && encoder != conn_state->best_encoder);
> if (crtc) {
> - crtc_state = drm_atomic_get_existing_crtc_state(state,
crtc);
> + crtc_state = drm_atomic_get_new_crtc_state(state,
crtc);
>
> crtc_state->encoder_mask &=
> ~(1 << drm_encoder_index(conn_state-
>best_encoder));
> @@ -230,7 +229,7 @@ set_best_encoder(struct drm_atomic_state *state,
> crtc = conn_state->crtc;
> WARN_ON(!crtc);
> if (crtc) {
> - crtc_state = drm_atomic_get_existing_crtc_state(state,
crtc);
> + crtc_state = drm_atomic_get_new_crtc_state(state,
crtc);
>
> crtc_state->encoder_mask |=
> 1 << drm_encoder_index(encoder);
> @@ -263,7 +262,7 @@ steal_encoder(struct drm_atomic_state *state,
>
> set_best_encoder(state, new_connector_state, NULL);
>
> - crtc_state = drm_atomic_get_existing_crtc_state(state,
encoder_crtc);
> + crtc_state = drm_atomic_get_new_crtc_state(state,
encoder_crtc);
> crtc_state->connectors_changed = true;
>
> return;
> @@ -286,12 +285,12 @@ update_connector_routing(struct drm_atomic_state
> *state,
>
> if (old_connector_state->crtc != new_connector_state->crtc) {
> if (old_connector_state->crtc) {
> - crtc_state = drm_atomic_get_existing_crtc_state(state,
> old_connector_state->crtc); + crtc_state =
> drm_atomic_get_new_crtc_state(state, old_connector_state->crtc);
> crtc_state->connectors_changed = true;
> }
>
> if (new_connector_state->crtc) {
> - crtc_state = drm_atomic_get_existing_crtc_state(state,
> new_connector_state->crtc); + crtc_state =
> drm_atomic_get_new_crtc_state(state, new_connector_state->crtc);
> crtc_state->connectors_changed = true;
> }
> }
> @@ -350,7 +349,7 @@ update_connector_routing(struct drm_atomic_state *state,
>
> set_best_encoder(state, new_connector_state, new_encoder);
>
> - crtc_state = drm_atomic_get_existing_crtc_state(state,
> new_connector_state->crtc); + crtc_state =
> drm_atomic_get_new_crtc_state(state, new_connector_state->crtc);
> crtc_state->connectors_changed = true;
>
> DRM_DEBUG_ATOMIC("[CONNECTOR:%d:%s] using [ENCODER:%d:%s] on
> [CRTC:%d:%s]\n", @@ -392,7 +391,7 @@ mode_fixup(struct drm_atomic_state
> *state)
> continue;
>
> new_crtc_state =
> - drm_atomic_get_existing_crtc_state(state,
new_conn_state->crtc);
> + drm_atomic_get_new_crtc_state(state, new_conn_state-
>crtc);
>
> /*
> * Each encoder has at most one connector (since we always
steal
> @@ -704,8 +703,7 @@ disable_outputs(struct drm_device *dev, struct
> drm_atomic_state *old_state) if (!old_conn_state->crtc)
> continue;
>
> - old_crtc_state = drm_atomic_get_existing_crtc_state(old_state,
> -
old_conn_state->crtc);
> + old_crtc_state = drm_atomic_get_old_crtc_state(old_state,
> old_conn_state->crtc);
>
> if (!old_crtc_state->active ||
> !drm_atomic_crtc_needs_modeset(old_conn_state->crtc-
>state))
> @@ -834,14 +832,17 @@ drm_atomic_helper_update_legacy_modeset_state(struct
> drm_device *dev, /* set legacy state in the crtc structure */
> for_each_new_crtc_in_state(old_state, crtc, new_crtc_state, i) {
> struct drm_plane *primary = crtc->primary;
> + struct drm_plane_state *new_plane_state;
>
> crtc->mode = new_crtc_state->mode;
> crtc->enabled = new_crtc_state->enable;
>
> - if (drm_atomic_get_existing_plane_state(old_state, primary) &&
> - primary->state->crtc == crtc) {
> - crtc->x = primary->state->src_x >> 16;
> - crtc->y = primary->state->src_y >> 16;
> + new_plane_state =
> + drm_atomic_get_new_plane_state(old_state, primary);
> +
> + if (new_plane_state && new_plane_state->crtc == crtc) {
> + crtc->x = new_plane_state->src_x >> 16;
> + crtc->y = new_plane_state->src_y >> 16;
> }
>
> if (new_crtc_state->enable)
> @@ -1843,7 +1844,7 @@ 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_existing_plane_state(old_state, plane);
> + drm_atomic_get_old_plane_state(old_state, plane);
> const struct drm_plane_helper_funcs *plane_funcs;
>
> plane_funcs = plane->helper_private;
> @@ -2914,7 +2915,7 @@ int drm_atomic_helper_page_flip_target(
> if (ret != 0)
> goto fail;
>
> - crtc_state = drm_atomic_get_existing_crtc_state(state, crtc);
> + crtc_state = drm_atomic_get_new_crtc_state(state, crtc);
> if (WARN_ON(!crtc_state)) {
> ret = -EINVAL;
> goto fail;
> diff --git a/drivers/gpu/drm/drm_blend.c b/drivers/gpu/drm/drm_blend.c
> index 665aafc6ad68..d7053bb67db6 100644
> --- a/drivers/gpu/drm/drm_blend.c
> +++ b/drivers/gpu/drm/drm_blend.c
> @@ -387,8 +387,7 @@ int drm_atomic_normalize_zpos(struct drm_device *dev,
> if (!crtc)
> continue;
> if (plane->state->zpos != plane_state->zpos) {
> - crtc_state =
> - drm_atomic_get_existing_crtc_state(state,
crtc);
> + crtc_state = drm_atomic_get_new_crtc_state(state,
crtc);
> crtc_state->zpos_changed = true;
> }
> }
> diff --git a/drivers/gpu/drm/drm_simple_kms_helper.c
> b/drivers/gpu/drm/drm_simple_kms_helper.c index 35c5d99296b9..16789faa9291
> 100644
> --- a/drivers/gpu/drm/drm_simple_kms_helper.c
> +++ b/drivers/gpu/drm/drm_simple_kms_helper.c
> @@ -86,8 +86,8 @@ static int drm_simple_kms_plane_atomic_check(struct
> drm_plane *plane, int ret;
>
> pipe = container_of(plane, struct drm_simple_display_pipe, plane);
> - crtc_state = drm_atomic_get_existing_crtc_state(plane_state->state,
> - &pipe->crtc);
> + crtc_state = drm_atomic_get_new_crtc_state(plane_state->state,
> + &pipe->crtc);
> if (crtc_state->enable != !!plane_state->crtc)
> return -EINVAL; /* plane must match crtc enable state */
--
Regards,
Laurent Pinchart
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2017-03-01 1:04 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-16 14:47 [PATCH v4 0/5] drm/atomic: Add accessor macros for all atomic state Maarten Lankhorst
2017-02-16 14:47 ` [PATCH v4 1/5] drm/atomic: Fix atomic helpers to use the new iterator macros, v2 Maarten Lankhorst
2017-03-01 0:49 ` Laurent Pinchart
2017-03-01 9:09 ` Maarten Lankhorst
2017-03-01 9:21 ` [PATCH v4.1 1/5] drm/atomic: Fix atomic helpers to use the new iterator macros, v3 Maarten Lankhorst
2017-03-01 10:06 ` Laurent Pinchart
2017-02-16 14:47 ` [PATCH v4 2/5] drm/atomic: Make drm_atomic_plane_disabling easier to understand Maarten Lankhorst
2017-03-01 0:53 ` Laurent Pinchart
2017-02-16 14:47 ` [PATCH v4 3/5] drm/atomic: Add macros to access existing old/new state, v2 Maarten Lankhorst
2017-03-01 0:56 ` Laurent Pinchart
2017-02-16 14:47 ` [PATCH v4 4/5] drm/atomic: Convert get_existing_state callers to get_old/new_state, v3 Maarten Lankhorst
2017-03-01 1:04 ` Laurent Pinchart [this message]
2017-03-01 9:22 ` [PATCH v4.1 4/5] drm/atomic: Convert get_existing_state callers to get_old/new_state, v4 Maarten Lankhorst
2017-02-16 14:47 ` [PATCH v4 5/5] drm/blend: Use new atomic iterator macros Maarten Lankhorst
2017-03-01 0:58 ` Laurent Pinchart
2017-02-16 19:22 ` ✓ Fi.CI.BAT: success for drm/atomic: Add accessor macros for all atomic state. (rev5) Patchwork
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=33099096.olWWpuyW68@avalon \
--to=laurent.pinchart@ideasonboard.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
/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