Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1248644pxa; Thu, 20 Aug 2020 06:44:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxPg0s3V5Qncf4Aaa6LMUs6jxXMrBpXNplfiISPilwcvKIToXiqSgBS5TmzqPZm/eO4nlu0 X-Received: by 2002:a17:906:6a84:: with SMTP id p4mr3456616ejr.374.1597931041434; Thu, 20 Aug 2020 06:44:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597931041; cv=none; d=google.com; s=arc-20160816; b=LNmGceHpcXbP34irQNd41NdvMxeAUaLuhl0aAGQ1rcNUwTMGTHQzLuE89wiGo4eq0L epRM7uo5Rnecy70vUod4SInSiBjsrVWKeEZdBzKjQUgvDfvzTlWwYcx1Ad+iUUrwZddE Egs5THvP8uj5JAWl+msemawwnvFLitnfxh7Pi2Qye8qu0JOL1nlaHGCA27GXx2v6dr9C 9NamCMYdBE1FS2hkS3i0Wu8GwjsnH4v+zurenP7XxEcu2v5i7u6/mm3TRjze3vcVY4Em FhMWC3w0A05vMPFWzQ66MD11yQ64xMHtEcFSKP3MvF8mAHw99fH7lFOCV/OgqloB7CYZ 2eaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=4XPOEk3Ib6+QG5NlrRyoFDWg89VSy1e0bRFckz96hbo=; b=CBtLpO7EjHXNTYYf3hqXn/YsQJr4tJIPagXjqvJMTpx970+XjfhQ3BzH7KMQzVl3l3 MpBM0xdS+t7CPcVLRPjUkjn2xdbZTPAJ/yhbc/cvmMK+CXcQI/+8VBGdEi5z5EYuXK3r Jf+wM4Ub1RXS6r0128PlCgQJMaAhKKIKD3h2042xKRoK0tEF4vLKoLUmXJp8pyxhaxsS 40h8/eE6aE6ljiFkY3WXGymXwp6+Vxq+Afqeu0rh9P7q8E6DRKgUNHMrNiJsMr/sAPgP msCardT/RdXK0dOmMH3MwhKmvpUgyZiniRy74a42ASpCJ47/TqLbpHsDU2OKN7gpst3O wayQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=B68X85c5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l21si1309329edw.181.2020.08.20.06.43.37; Thu, 20 Aug 2020 06:44:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=B68X85c5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730612AbgHTNk4 (ORCPT + 99 others); Thu, 20 Aug 2020 09:40:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:41406 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728149AbgHTJaY (ORCPT ); Thu, 20 Aug 2020 05:30:24 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id EE61D21744; Thu, 20 Aug 2020 09:30:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597915824; bh=sL0968/HFFbREq/hgGicNt4OaxmzlMEkH2rS4F4Lc48=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=B68X85c53kI6vDcJF5qCf4K1E9GEK6YQkBYUSgdegq0aoMhQKQDAF2Iv4mdLPFAF6 twdNNNk0Mod6Rn7rpXViQFrBUNvjrw2SmUSlNE+Xuk3jZCsKq3kp6XGB0jm7czSfT5 JUeGTPq6Z8X7vIErGOSV7xg2Te8YagZXrTO0sp74= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Steve Longerbeam , Philipp Zabel , Sasha Levin Subject: [PATCH 5.8 146/232] gpu: ipu-v3: image-convert: Combine rotate/no-rotate irq handlers Date: Thu, 20 Aug 2020 11:19:57 +0200 Message-Id: <20200820091619.893382114@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200820091612.692383444@linuxfoundation.org> References: <20200820091612.692383444@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Steve Longerbeam [ Upstream commit 0f6245f42ce9b7e4d20f2cda8d5f12b55a44d7d1 ] Combine the rotate_irq() and norotate_irq() handlers into a single eof_irq() handler. Signed-off-by: Steve Longerbeam Signed-off-by: Philipp Zabel Signed-off-by: Sasha Levin --- drivers/gpu/ipu-v3/ipu-image-convert.c | 58 +++++++++----------------- 1 file changed, 20 insertions(+), 38 deletions(-) diff --git a/drivers/gpu/ipu-v3/ipu-image-convert.c b/drivers/gpu/ipu-v3/ipu-image-convert.c index eeca50d9a1ee4..f8b031ded3cf2 100644 --- a/drivers/gpu/ipu-v3/ipu-image-convert.c +++ b/drivers/gpu/ipu-v3/ipu-image-convert.c @@ -1709,9 +1709,10 @@ static irqreturn_t do_irq(struct ipu_image_convert_run *run) return IRQ_WAKE_THREAD; } -static irqreturn_t norotate_irq(int irq, void *data) +static irqreturn_t eof_irq(int irq, void *data) { struct ipu_image_convert_chan *chan = data; + struct ipu_image_convert_priv *priv = chan->priv; struct ipu_image_convert_ctx *ctx; struct ipu_image_convert_run *run; unsigned long flags; @@ -1728,45 +1729,26 @@ static irqreturn_t norotate_irq(int irq, void *data) ctx = run->ctx; - if (ipu_rot_mode_is_irt(ctx->rot_mode)) { - /* this is a rotation operation, just ignore */ - spin_unlock_irqrestore(&chan->irqlock, flags); - return IRQ_HANDLED; - } - - ret = do_irq(run); -out: - spin_unlock_irqrestore(&chan->irqlock, flags); - return ret; -} - -static irqreturn_t rotate_irq(int irq, void *data) -{ - struct ipu_image_convert_chan *chan = data; - struct ipu_image_convert_priv *priv = chan->priv; - struct ipu_image_convert_ctx *ctx; - struct ipu_image_convert_run *run; - unsigned long flags; - irqreturn_t ret; - - spin_lock_irqsave(&chan->irqlock, flags); - - /* get current run and its context */ - run = chan->current_run; - if (!run) { + if (irq == chan->out_eof_irq) { + if (ipu_rot_mode_is_irt(ctx->rot_mode)) { + /* this is a rotation op, just ignore */ + ret = IRQ_HANDLED; + goto out; + } + } else if (irq == chan->rot_out_eof_irq) { + if (!ipu_rot_mode_is_irt(ctx->rot_mode)) { + /* this was NOT a rotation op, shouldn't happen */ + dev_err(priv->ipu->dev, + "Unexpected rotation interrupt\n"); + ret = IRQ_HANDLED; + goto out; + } + } else { + dev_err(priv->ipu->dev, "Received unknown irq %d\n", irq); ret = IRQ_NONE; goto out; } - ctx = run->ctx; - - if (!ipu_rot_mode_is_irt(ctx->rot_mode)) { - /* this was NOT a rotation operation, shouldn't happen */ - dev_err(priv->ipu->dev, "Unexpected rotation interrupt\n"); - spin_unlock_irqrestore(&chan->irqlock, flags); - return IRQ_HANDLED; - } - ret = do_irq(run); out: spin_unlock_irqrestore(&chan->irqlock, flags); @@ -1859,7 +1841,7 @@ static int get_ipu_resources(struct ipu_image_convert_chan *chan) chan->out_chan, IPU_IRQ_EOF); - ret = request_threaded_irq(chan->out_eof_irq, norotate_irq, do_bh, + ret = request_threaded_irq(chan->out_eof_irq, eof_irq, do_bh, 0, "ipu-ic", chan); if (ret < 0) { 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) chan->rotation_out_chan, IPU_IRQ_EOF); - ret = request_threaded_irq(chan->rot_out_eof_irq, rotate_irq, do_bh, + ret = request_threaded_irq(chan->rot_out_eof_irq, eof_irq, do_bh, 0, "ipu-ic", chan); if (ret < 0) { dev_err(priv->ipu->dev, "could not acquire irq %d\n", -- 2.25.1