* [PATCH] gpu: ipu-v3: image-convert: Wait for channels before disabling
@ 2020-06-10 0:51 Steve Longerbeam
2020-06-17 21:53 ` Steve Longerbeam
0 siblings, 1 reply; 2+ messages in thread
From: Steve Longerbeam @ 2020-06-10 0:51 UTC (permalink / raw)
To: Philipp Zabel; +Cc: dri-devel, Steve Longerbeam
Call ipu_idmac_wait_busy() on each idmac channel to busy wait for the
channel to be idle before disabling. Otherwise it was found that a
conversion would stall after the completion of a tile and the start
of the next tile.
Fixes: 0537db801bb01 ("gpu: ipu-v3: image-convert: reconfigure IC per tile")
Signed-off-by: Steve Longerbeam <slongerbeam@gmail.com>
---
drivers/gpu/ipu-v3/ipu-image-convert.c | 21 +++++++++++++++++----
1 file changed, 17 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/ipu-v3/ipu-image-convert.c b/drivers/gpu/ipu-v3/ipu-image-convert.c
index eeca50d9a1ee..f0938015d2fd 100644
--- a/drivers/gpu/ipu-v3/ipu-image-convert.c
+++ b/drivers/gpu/ipu-v3/ipu-image-convert.c
@@ -1251,6 +1251,19 @@ static int get_run_count(struct ipu_image_convert_ctx *ctx,
return count;
}
+static void stop_channel(struct ipu_image_convert_chan *chan,
+ struct ipuv3_channel *channel)
+{
+ struct ipu_image_convert_priv *priv = chan->priv;
+ int ret;
+
+ ret = ipu_idmac_wait_busy(channel, 1);
+ if (ret == -ETIMEDOUT)
+ dev_warn(priv->ipu->dev, "IDMAC timeout\n");
+
+ ipu_idmac_disable_channel(channel);
+}
+
static void convert_stop(struct ipu_image_convert_run *run)
{
struct ipu_image_convert_ctx *ctx = run->ctx;
@@ -1262,12 +1275,12 @@ static void convert_stop(struct ipu_image_convert_run *run)
/* disable IC tasks and the channels */
ipu_ic_task_disable(chan->ic);
- ipu_idmac_disable_channel(chan->in_chan);
- ipu_idmac_disable_channel(chan->out_chan);
+ stop_channel(chan, chan->in_chan);
+ stop_channel(chan, chan->out_chan);
if (ipu_rot_mode_is_irt(ctx->rot_mode)) {
- ipu_idmac_disable_channel(chan->rotation_in_chan);
- ipu_idmac_disable_channel(chan->rotation_out_chan);
+ stop_channel(chan, chan->rotation_in_chan);
+ stop_channel(chan, chan->rotation_out_chan);
ipu_idmac_unlink(chan->out_chan, chan->rotation_in_chan);
}
--
2.17.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] gpu: ipu-v3: image-convert: Wait for channels before disabling
2020-06-10 0:51 [PATCH] gpu: ipu-v3: image-convert: Wait for channels before disabling Steve Longerbeam
@ 2020-06-17 21:53 ` Steve Longerbeam
0 siblings, 0 replies; 2+ messages in thread
From: Steve Longerbeam @ 2020-06-17 21:53 UTC (permalink / raw)
To: Philipp Zabel; +Cc: dri-devel
Hi Philpp,
Please disregard this patch. A better solution to a busy wait with a
spin lock held is to wait for all required EOF interrupts before doing
tile completion processing. I will submit a new patch series.
Steve
On 6/9/20 5:51 PM, Steve Longerbeam wrote:
> Call ipu_idmac_wait_busy() on each idmac channel to busy wait for the
> channel to be idle before disabling. Otherwise it was found that a
> conversion would stall after the completion of a tile and the start
> of the next tile.
>
> Fixes: 0537db801bb01 ("gpu: ipu-v3: image-convert: reconfigure IC per tile")
> Signed-off-by: Steve Longerbeam <slongerbeam@gmail.com>
> ---
> drivers/gpu/ipu-v3/ipu-image-convert.c | 21 +++++++++++++++++----
> 1 file changed, 17 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/ipu-v3/ipu-image-convert.c b/drivers/gpu/ipu-v3/ipu-image-convert.c
> index eeca50d9a1ee..f0938015d2fd 100644
> --- a/drivers/gpu/ipu-v3/ipu-image-convert.c
> +++ b/drivers/gpu/ipu-v3/ipu-image-convert.c
> @@ -1251,6 +1251,19 @@ static int get_run_count(struct ipu_image_convert_ctx *ctx,
> return count;
> }
>
> +static void stop_channel(struct ipu_image_convert_chan *chan,
> + struct ipuv3_channel *channel)
> +{
> + struct ipu_image_convert_priv *priv = chan->priv;
> + int ret;
> +
> + ret = ipu_idmac_wait_busy(channel, 1);
> + if (ret == -ETIMEDOUT)
> + dev_warn(priv->ipu->dev, "IDMAC timeout\n");
> +
> + ipu_idmac_disable_channel(channel);
> +}
> +
> static void convert_stop(struct ipu_image_convert_run *run)
> {
> struct ipu_image_convert_ctx *ctx = run->ctx;
> @@ -1262,12 +1275,12 @@ static void convert_stop(struct ipu_image_convert_run *run)
>
> /* disable IC tasks and the channels */
> ipu_ic_task_disable(chan->ic);
> - ipu_idmac_disable_channel(chan->in_chan);
> - ipu_idmac_disable_channel(chan->out_chan);
> + stop_channel(chan, chan->in_chan);
> + stop_channel(chan, chan->out_chan);
>
> if (ipu_rot_mode_is_irt(ctx->rot_mode)) {
> - ipu_idmac_disable_channel(chan->rotation_in_chan);
> - ipu_idmac_disable_channel(chan->rotation_out_chan);
> + stop_channel(chan, chan->rotation_in_chan);
> + stop_channel(chan, chan->rotation_out_chan);
> ipu_idmac_unlink(chan->out_chan, chan->rotation_in_chan);
> }
>
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-06-17 21:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-10 0:51 [PATCH] gpu: ipu-v3: image-convert: Wait for channels before disabling Steve Longerbeam
2020-06-17 21:53 ` Steve Longerbeam
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.