public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Daniel Vetter <daniel.vetter@intel.com>,
	Intel Graphics Development <intel-gfx@lists.freedesktop.org>,
	Daniel Stone <daniels@collabora.com>,
	DRI Development <dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH] drm/atomic-helper: Check encoder/crtc constraints
Date: Thu, 19 Nov 2015 12:12:28 +0200	[thread overview]
Message-ID: <20151119101228.GQ4437@intel.com> (raw)
In-Reply-To: <1447868808-10266-1-git-send-email-daniel.vetter@ffwll.ch>

On Wed, Nov 18, 2015 at 06:46:48PM +0100, Daniel Vetter wrote:
> This was totally lost when I originally created the atomic helpers.
> 
> We probably should also check possible_clones in the helpers, but
> since the legacy ones didn't do that this is for a separate patch.
> 
> Reported-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Cc: Daniel Stone <daniels@collabora.com>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Tested-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

But the rest of update_connector_routing() still looks somewhat bonkers
to me. For one, it assumes that both the old and new crtc for the
connector are part of the atomic state, but drm_atomic_set_crtc_for_connector()
only adds the new crtc, not the old one.

> ---
>  drivers/gpu/drm/drm_atomic_helper.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
> index 0c6f62168776..cfdc9931b08a 100644
> --- a/drivers/gpu/drm/drm_atomic_helper.c
> +++ b/drivers/gpu/drm/drm_atomic_helper.c
> @@ -210,6 +210,14 @@ update_connector_routing(struct drm_atomic_state *state, int conn_idx)
>  		return -EINVAL;
>  	}
>  
> +	if (!drm_encoder_crtc_ok(new_encoder, connector_state->crtc)) {
> +		DRM_DEBUG_ATOMIC("[ENCODER:%d:%s] incompatible with [CRTC:%d]\n",
> +				 new_encoder->base.id,
> +				 new_encoder->name,
> +				 connector_state->crtc->base.id);
> +		return -EINVAL;
> +	}
> +
>  	if (new_encoder == connector_state->best_encoder) {
>  		DRM_DEBUG_ATOMIC("[CONNECTOR:%d:%s] keeps [ENCODER:%d:%s], now on [CRTC:%d]\n",
>  				 connector->base.id,
> -- 
> 2.5.1

-- 
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2015-11-19 10:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-18 17:46 [PATCH] drm/atomic-helper: Check encoder/crtc constraints Daniel Vetter
2015-11-19  8:50 ` [Intel-gfx] " Daniel Stone
2015-11-19 10:12 ` Ville Syrjälä [this message]
2015-11-19 14:02   ` Daniel Vetter
2015-11-19 14:24     ` Ville Syrjälä
2015-11-19 14:44       ` Daniel Vetter
2015-11-19 15:38 ` Jani Nikula

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=20151119101228.GQ4437@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=daniel.vetter@intel.com \
    --cc=daniels@collabora.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