Re: [PATCH 10/23] drm: omapdrm: Use atomic state instead of local device state

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

 



On 26/04/16 23:35, Laurent Pinchart wrote:
> Instead of conditioning planes update based on the hardware device
> state, use the CRTC state stored in the atomic state. This reduces the
> dependency from the DRM layer to the DSS layer.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx>
> ---
>  drivers/gpu/drm/omapdrm/omap_crtc.c | 23 ++++++++++++++---------
>  1 file changed, 14 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/gpu/drm/omapdrm/omap_crtc.c b/drivers/gpu/drm/omapdrm/omap_crtc.c
> index 6359d7933b93..4c56d6a68390 100644
> --- a/drivers/gpu/drm/omapdrm/omap_crtc.c
> +++ b/drivers/gpu/drm/omapdrm/omap_crtc.c
> @@ -381,18 +381,23 @@ static void omap_crtc_atomic_flush(struct drm_crtc *crtc,
>  
>  	WARN_ON(omap_crtc->vblank_irq.registered);
>  
> -	if (dispc_mgr_is_enabled(omap_crtc->channel)) {
> +	/*
> +	 * Only flush the CRTC if it is currently active. CRTCs that require a
> +	 * mode set are disabled prior plane updates and enabled afterwards.
> +	 * They are thus not active, regardless of what their state report.
> +	 */
> +	if (!crtc->state->active || drm_atomic_crtc_needs_modeset(crtc->state))
> +		return;

If the DRM core doesn't track whether a CRTC HW is enabled at the
moment, maybe omapdrm should? I guess the above works, but that if()
makes me a bit uneasy, as it's not really obvious, and the logic behind
it could possibly change later...

A "if (crtc->is_hw_enabled)" would be much more readable.

 Tomi

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://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