Skip to content

Commit 0f6245f

Browse files
slongerbeampH5
authored andcommitted
gpu: ipu-v3: image-convert: Combine rotate/no-rotate irq handlers
Combine the rotate_irq() and norotate_irq() handlers into a single eof_irq() handler. Signed-off-by: Steve Longerbeam <[email protected]> Signed-off-by: Philipp Zabel <[email protected]>
1 parent 22b2cfa commit 0f6245f

File tree

1 file changed

+20
-38
lines changed

1 file changed

+20
-38
lines changed

drivers/gpu/ipu-v3/ipu-image-convert.c

Lines changed: 20 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1709,9 +1709,10 @@ static irqreturn_t do_irq(struct ipu_image_convert_run *run)
17091709
return IRQ_WAKE_THREAD;
17101710
}
17111711

1712-
static irqreturn_t norotate_irq(int irq, void *data)
1712+
static irqreturn_t eof_irq(int irq, void *data)
17131713
{
17141714
struct ipu_image_convert_chan *chan = data;
1715+
struct ipu_image_convert_priv *priv = chan->priv;
17151716
struct ipu_image_convert_ctx *ctx;
17161717
struct ipu_image_convert_run *run;
17171718
unsigned long flags;
@@ -1728,45 +1729,26 @@ static irqreturn_t norotate_irq(int irq, void *data)
17281729

17291730
ctx = run->ctx;
17301731

1731-
if (ipu_rot_mode_is_irt(ctx->rot_mode)) {
1732-
/* this is a rotation operation, just ignore */
1733-
spin_unlock_irqrestore(&chan->irqlock, flags);
1734-
return IRQ_HANDLED;
1735-
}
1736-
1737-
ret = do_irq(run);
1738-
out:
1739-
spin_unlock_irqrestore(&chan->irqlock, flags);
1740-
return ret;
1741-
}
1742-
1743-
static irqreturn_t rotate_irq(int irq, void *data)
1744-
{
1745-
struct ipu_image_convert_chan *chan = data;
1746-
struct ipu_image_convert_priv *priv = chan->priv;
1747-
struct ipu_image_convert_ctx *ctx;
1748-
struct ipu_image_convert_run *run;
1749-
unsigned long flags;
1750-
irqreturn_t ret;
1751-
1752-
spin_lock_irqsave(&chan->irqlock, flags);
1753-
1754-
/* get current run and its context */
1755-
run = chan->current_run;
1756-
if (!run) {
1732+
if (irq == chan->out_eof_irq) {
1733+
if (ipu_rot_mode_is_irt(ctx->rot_mode)) {
1734+
/* this is a rotation op, just ignore */
1735+
ret = IRQ_HANDLED;
1736+
goto out;
1737+
}
1738+
} else if (irq == chan->rot_out_eof_irq) {
1739+
if (!ipu_rot_mode_is_irt(ctx->rot_mode)) {
1740+
/* this was NOT a rotation op, shouldn't happen */
1741+
dev_err(priv->ipu->dev,
1742+
"Unexpected rotation interrupt\n");
1743+
ret = IRQ_HANDLED;
1744+
goto out;
1745+
}
1746+
} else {
1747+
dev_err(priv->ipu->dev, "Received unknown irq %d\n", irq);
17571748
ret = IRQ_NONE;
17581749
goto out;
17591750
}
17601751

1761-
ctx = run->ctx;
1762-
1763-
if (!ipu_rot_mode_is_irt(ctx->rot_mode)) {
1764-
/* this was NOT a rotation operation, shouldn't happen */
1765-
dev_err(priv->ipu->dev, "Unexpected rotation interrupt\n");
1766-
spin_unlock_irqrestore(&chan->irqlock, flags);
1767-
return IRQ_HANDLED;
1768-
}
1769-
17701752
ret = do_irq(run);
17711753
out:
17721754
spin_unlock_irqrestore(&chan->irqlock, flags);
@@ -1859,7 +1841,7 @@ static int get_ipu_resources(struct ipu_image_convert_chan *chan)
18591841
chan->out_chan,
18601842
IPU_IRQ_EOF);
18611843

1862-
ret = request_threaded_irq(chan->out_eof_irq, norotate_irq, do_bh,
1844+
ret = request_threaded_irq(chan->out_eof_irq, eof_irq, do_bh,
18631845
0, "ipu-ic", chan);
18641846
if (ret < 0) {
18651847
dev_err(priv->ipu->dev, "could not acquire irq %d\n",
@@ -1872,7 +1854,7 @@ static int get_ipu_resources(struct ipu_image_convert_chan *chan)
18721854
chan->rotation_out_chan,
18731855
IPU_IRQ_EOF);
18741856

1875-
ret = request_threaded_irq(chan->rot_out_eof_irq, rotate_irq, do_bh,
1857+
ret = request_threaded_irq(chan->rot_out_eof_irq, eof_irq, do_bh,
18761858
0, "ipu-ic", chan);
18771859
if (ret < 0) {
18781860
dev_err(priv->ipu->dev, "could not acquire irq %d\n",

0 commit comments

Comments
 (0)