dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Philipp Zabel <p.zabel@pengutronix.de>
To: Lucas Stach <l.stach@pengutronix.de>
Cc: kernel@pengutronix.de, dri-devel@lists.freedesktop.org,
	patchwork-lst@pengutronix.de
Subject: Re: [PATCH 3/4] drm/imx: ipuv3-plane: add function to query atomic update status
Date: Fri, 05 Oct 2018 16:16:48 +0200	[thread overview]
Message-ID: <1538749008.3545.34.camel@pengutronix.de> (raw)
In-Reply-To: <20180914165917.8464-3-l.stach@pengutronix.de>

On Fri, 2018-09-14 at 18:59 +0200, Lucas Stach wrote:
> This function allows upper layer to check if a requested atomic update
> to the plane has been applied or is still pending.
> 
> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
> ---
>  drivers/gpu/drm/imx/ipuv3-plane.c | 20 ++++++++++++++++++++
>  drivers/gpu/drm/imx/ipuv3-plane.h |  2 ++
>  2 files changed, 22 insertions(+)
> 
> diff --git a/drivers/gpu/drm/imx/ipuv3-plane.c b/drivers/gpu/drm/imx/ipuv3-plane.c
> index 203f247d4854..c95a2fc51741 100644
> --- a/drivers/gpu/drm/imx/ipuv3-plane.c
> +++ b/drivers/gpu/drm/imx/ipuv3-plane.c
> @@ -587,6 +587,7 @@ static void ipu_plane_atomic_update(struct drm_plane *plane,
>  		active = ipu_idmac_get_current_buffer(ipu_plane->ipu_ch);
>  		ipu_cpmem_set_buffer(ipu_plane->ipu_ch, !active, eba);
>  		ipu_idmac_select_buffer(ipu_plane->ipu_ch, !active);
> +		ipu_plane->next_buf = !active;
>  		if (ipu_plane_separate_alpha(ipu_plane)) {
>  			active = ipu_idmac_get_current_buffer(ipu_plane->alpha_ch);
>  			ipu_cpmem_set_buffer(ipu_plane->alpha_ch, !active,
> @@ -713,6 +714,7 @@ static void ipu_plane_atomic_update(struct drm_plane *plane,
>  	ipu_cpmem_set_buffer(ipu_plane->ipu_ch, 0, eba);
>  	ipu_cpmem_set_buffer(ipu_plane->ipu_ch, 1, eba);
>  	ipu_idmac_lock_enable(ipu_plane->ipu_ch, num_bursts);
> +	ipu_plane->next_buf = -1;
>  	ipu_plane_enable(ipu_plane);
>  }
>  
> @@ -723,6 +725,24 @@ static const struct drm_plane_helper_funcs ipu_plane_helper_funcs = {
>  	.atomic_update = ipu_plane_atomic_update,
>  };
>  
> +bool ipu_plane_atomic_update_done(struct drm_plane *plane)

bool ipu_plane_atomic_update_pending

> +{
> +	struct ipu_plane *ipu_plane = to_ipu_plane(plane);
> +	struct drm_plane_state *state = plane->state;
> +	struct ipu_plane_state *ipu_state = to_ipu_plane_state(state);
> +
> +	/* disabled crtcs must not block the update */
> +	if (!state->crtc)
> +		return true;
> +
> +	if (ipu_state->use_pre)
> +		return ipu_prg_channel_configure_done(ipu_plane->ipu_ch);

This hides the -EINVAL return value being interpreted as true, better
have this return bool.

regards
Philipp
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2018-10-05 14:16 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-14 16:59 [PATCH 1/4] gpu: ipu-v3: pre: add double buffer status readback Lucas Stach
2018-09-14 16:59 ` [PATCH 2/4] gpu: ipu-v3: prg: add function to get channel configure status Lucas Stach
2018-10-05 14:16   ` Philipp Zabel
2018-09-14 16:59 ` [PATCH 3/4] drm/imx: ipuv3-plane: add function to query atomic update status Lucas Stach
2018-10-05 14:16   ` Philipp Zabel [this message]
2018-09-14 16:59 ` [PATCH 4/4] drm/imx: only send commit done event when all state has been applied Lucas Stach
2018-10-05 15:11   ` Philipp Zabel
2019-01-23 11:35     ` Philipp Zabel
2019-01-23 13:04       ` Daniel Vetter
2018-10-05 14:16 ` [PATCH 1/4] gpu: ipu-v3: pre: add double buffer status readback Philipp Zabel

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=1538749008.3545.34.camel@pengutronix.de \
    --to=p.zabel@pengutronix.de \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kernel@pengutronix.de \
    --cc=l.stach@pengutronix.de \
    --cc=patchwork-lst@pengutronix.de \
    /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