From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH v3 7/7] drm/atomic: Clean up update_connector_routing.
Date: Fri, 4 Mar 2016 15:29:03 +0200 [thread overview]
Message-ID: <20160304132903.GT10446@intel.com> (raw)
In-Reply-To: <1456996662-8704-8-git-send-email-maarten.lankhorst@linux.intel.com>
On Thu, Mar 03, 2016 at 10:17:42AM +0100, Maarten Lankhorst wrote:
> connector_state->crtc can no longer be unset by accident,
> so that check can be removed. The other code open-codes
> drm_atomic_get_existing_crtc_state, so use that.
>
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> ---
> drivers/gpu/drm/drm_atomic_helper.c | 17 ++++-------------
> 1 file changed, 4 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
> index 2395201eb7ab..9f0d16eb04b2 100644
> --- a/drivers/gpu/drm/drm_atomic_helper.c
> +++ b/drivers/gpu/drm/drm_atomic_helper.c
> @@ -265,7 +265,7 @@ update_connector_routing(struct drm_atomic_state *state,
> const struct drm_connector_helper_funcs *funcs;
> struct drm_encoder *new_encoder;
> struct drm_crtc_state *crtc_state;
> - int idx, ret;
> + int ret;
>
> DRM_DEBUG_ATOMIC("Updating routing for [CONNECTOR:%d:%s]\n",
> connector->base.id,
> @@ -273,16 +273,12 @@ update_connector_routing(struct drm_atomic_state *state,
>
> if (connector->state->crtc != connector_state->crtc) {
> if (connector->state->crtc) {
> - idx = drm_crtc_index(connector->state->crtc);
> -
> - crtc_state = state->crtc_states[idx];
> + crtc_state = drm_atomic_get_existing_crtc_state(state, connector->state->crtc);
> crtc_state->connectors_changed = true;
> }
>
> if (connector_state->crtc) {
> - idx = drm_crtc_index(connector_state->crtc);
> -
> - crtc_state = state->crtc_states[idx];
> + crtc_state = drm_atomic_get_existing_crtc_state(state, connector_state->crtc);
> crtc_state->connectors_changed = true;
> }
> }
> @@ -336,14 +332,9 @@ update_connector_routing(struct drm_atomic_state *state,
>
> steal_encoder(state, new_encoder);
>
> - if (WARN_ON(!connector_state->crtc))
> - return -EINVAL;
> -
I was going to suggest just this when I read the code previously.
> set_best_encoder(state, connector_state, new_encoder);
>
> - idx = drm_crtc_index(connector_state->crtc);
> -
> - crtc_state = state->crtc_states[idx];
> + crtc_state = drm_atomic_get_existing_crtc_state(state, connector_state->crtc);
These could have been a separate patch, but no biggie
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> crtc_state->connectors_changed = true;
>
> DRM_DEBUG_ATOMIC("[CONNECTOR:%d:%s] using [ENCODER:%d:%s] on [CRTC:%d:%s]\n",
> --
> 2.1.0
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Ville Syrjälä
Intel OTC
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2016-03-04 13:29 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-03 9:17 [PATCH v3 0/7] drm/atomic: Fix encoder stealing, v3 Maarten Lankhorst
2016-03-03 9:17 ` [PATCH v3 1/7] drm/atomic: Clean up update_output_state Maarten Lankhorst
2016-03-03 9:17 ` [PATCH v3 2/7] drm/atomic: Pass connector and state to update_connector_routing Maarten Lankhorst
2016-03-03 9:17 ` [PATCH v3 3/7] drm/atomic: Always call steal_encoder, v2 Maarten Lankhorst
2016-03-03 9:17 ` [PATCH v3 4/7] drm/atomic: Handle encoder stealing from set_config better Maarten Lankhorst
2016-03-03 9:17 ` [PATCH v3 5/7] drm/atomic: Handle encoder assignment conflicts in a separate check, v3 Maarten Lankhorst
2016-03-04 13:24 ` Ville Syrjälä
2016-03-03 9:17 ` [PATCH v3 6/7] drm/atomic: Clean up steal_encoder, v2 Maarten Lankhorst
2016-03-03 9:41 ` [Intel-gfx] " kbuild test robot
2016-03-04 13:27 ` Ville Syrjälä
2016-03-03 9:17 ` [PATCH v3 7/7] drm/atomic: Clean up update_connector_routing Maarten Lankhorst
2016-03-04 13:29 ` Ville Syrjälä [this message]
2016-03-08 12:20 ` Daniel Vetter
2016-03-03 9:25 ` ✗ Fi.CI.BAT: failure for drm/atomic: Fix encoder stealing, v3 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=20160304132903.GT10446@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=maarten.lankhorst@linux.intel.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