Skip to contentSkip to conversation

gpu: ipu-v3: image-convert: Wait for channels before disabling

PATCH In review Steve Longerbeam 1 participant 2 messages Jun 10, 2020 – Jun 17, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gpu: ipu-v3: image-convert: Wait for channels before disabling

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")
---
 drivers/gpu/ipu-v3/ipu-image-convert.c | 21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)
drivers/gpu/ipu-v3/ipu-image-convert.c +17 -4
index eeca50d9a1ee..f0938015d2fd 100644
@@ -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);
 	}
 
Signature · 6 lines
2.17.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#1 lore raw

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

Quoted 42 lines · 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")
---
  drivers/gpu/ipu-v3/ipu-image-convert.c | 21 +++++++++++++++++----
  1 file changed, 17 insertions(+), 4 deletions(-)
drivers/gpu/ipu-v3/ipu-image-convert.c +14 -2
index eeca50d9a1ee..f0938015d2fd 100644
@@ -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);

drivers/gpu/ipu-v3/ipu-image-convert.c static void convert_stop(struct ipu_image_convert_run *run) · line 1286

Quoted 10 lines
drivers/gpu/ipu-v3/ipu-image-convert.c +3 -2
+	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
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel