Re: [PATCH] drm/atomic-helper: Check encoder/crtc constraints

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxx>
> Cc: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>
> Cc: Daniel Stone <daniels@xxxxxxxxxxxxx>
> Signed-off-by: Daniel Vetter <daniel.vetter@xxxxxxxxx>

Reviewed-by: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>
Tested-by: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>

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
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux