Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp4270012pxv; Tue, 27 Jul 2021 03:12:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzIzWpfwiw2RzAW1sE97G8mEPT7jl4LFvpxMKurjzuGS2q1ZvAg0fHjZMSKDVbX7JuAp3qy X-Received: by 2002:a05:6638:2656:: with SMTP id n22mr20668801jat.64.1627380770258; Tue, 27 Jul 2021 03:12:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627380770; cv=none; d=google.com; s=arc-20160816; b=cdx+6N+L+MgOvoSwKC123Yd1cSK0Rq2x8nGAxWJ58wLRfN9nAVYUQQrsE6P1Q8tLph 0Ee/CcrHioroy5YPdiQcFw1eIyKi+2JylKbn32pKPFU4DtXUqJAUWoM8DvQZbVFwNqS5 XzugLxyBFRoIG2vmqAau1mcOCZ+mUL1leDYj/rq0N1ZOwQkeR3TTiEwddci8SDfvcsjA KOgYFC2O02rwnolSHTUPQHo8MPoTfyakscLeMUdOLaOYYF2/1qErS40A79beJcSx/DGO /o9ZNaLbge2YVdQocj9ecSukt+vaFfqrQB9T9b15h1OxxTvZuAUzShxGuoAsyuyAvBmY ptaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=bptn7EiTWUe1GIsFTyrzBwmYBQieO/hCAN9lcr+MWKQ=; b=BMP17+WADqULb7QcWCm/7qTo3/eBQoR0Kcvo6EBDxkVrV6ofoNKA1EpBjB41rI8m+A Fl93jiNzYlhJyI2BOMDHpb1FKbW0klrTGRgtgKHuBQE5uuoAXnN8Pr2o8Q+R5CmCDjvT 3clHyd7eq0ctQfuz/o/4y1gC5Q1A5pd3Qr+GgjeiPV+v3VRWkP9F6Lx3YG0oH70ydJPQ ZADCD5bKAqPtu+ncZ3B3zh3ofxZJ8LNleZZFgWebVP7nVV7vsiwYksPSQ/5SujwUjQCf yBRWkHVY3/XgXkik69r1c3mYZaZt7XOUxg0UH9VPo4zSTMPpFXFd8K2QKsNUXDA2HGt9 TNeg== ARC-Authentication-Results: i=1; mx.google.com; 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=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g15si3102317ilc.45.2021.07.27.03.12.37; Tue, 27 Jul 2021 03:12:50 -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; 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=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236283AbhG0KLh (ORCPT + 99 others); Tue, 27 Jul 2021 06:11:37 -0400 Received: from mailgw01.mediatek.com ([60.244.123.138]:56530 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S236234AbhG0KLd (ORCPT ); Tue, 27 Jul 2021 06:11:33 -0400 X-UUID: 7efaf46d26de4c91b46913edba84c764-20210727 X-UUID: 7efaf46d26de4c91b46913edba84c764-20210727 Received: from mtkmbs10n1.mediatek.inc [(172.21.101.34)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 2017654221; Tue, 27 Jul 2021 18:11:29 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs07n2.mediatek.inc (172.21.101.141) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 27 Jul 2021 18:11:28 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 27 Jul 2021 18:11:27 +0800 From: Yunfei Dong To: Yunfei Dong , Alexandre Courbot , Hans Verkuil , Tzung-Bi Shih , Tiffany Lin , Andrew-CT Chen , Mauro Carvalho Chehab , Rob Herring , Matthias Brugger , Tomasz Figa CC: Hsin-Yi Wang , Fritz Koenig , Irui Wang , , , , , , , Subject: [PATCH v3, 02/15] media: mtk-vcodec: Align vcodec wake up interrupt interface Date: Tue, 27 Jul 2021 18:10:38 +0800 Message-ID: <20210727101051.24418-3-yunfei.dong@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20210727101051.24418-1-yunfei.dong@mediatek.com> References: <20210727101051.24418-1-yunfei.dong@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Vdec and venc can use the same function to wake up interrupt event. Signed-off-by: Yunfei Dong --- v3: add this new patch to align vdec and venc wake up ctx interface. --- drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_drv.c | 9 +-------- drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h | 8 ++++++++ drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c | 8 -------- 3 files changed, 9 insertions(+), 16 deletions(-) diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_drv.c b/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_drv.c index c4172c18a61f..d4cbb571c734 100644 --- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_drv.c +++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_drv.c @@ -31,13 +31,6 @@ module_param(mtk_v4l2_dbg_level, int, 0644); module_param(mtk_vcodec_dbg, bool, 0644); -/* Wake up context wait_queue */ -static void wake_up_ctx(struct mtk_vcodec_ctx *ctx) -{ - ctx->int_cond = 1; - wake_up_interruptible(&ctx->queue); -} - static irqreturn_t mtk_vcodec_dec_irq_handler(int irq, void *priv) { struct mtk_vcodec_dev *dev = priv; @@ -69,7 +62,7 @@ static irqreturn_t mtk_vcodec_dec_irq_handler(int irq, void *priv) writel((readl(vdec_misc_addr) & ~VDEC_IRQ_CLR), dev->reg_base[VDEC_MISC] + VDEC_IRQ_CFG_REG); - wake_up_ctx(ctx); + wake_up_ctx(ctx, MTK_INST_IRQ_RECEIVED); mtk_v4l2_debug(3, "mtk_vcodec_dec_irq_handler :wake up ctx %d, dec_done_status=%x", diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h b/drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h index d4f840a7bbcb..3b1e5e3a450e 100644 --- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h +++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_drv.h @@ -472,4 +472,12 @@ static inline struct mtk_vcodec_ctx *ctrl_to_ctx(struct v4l2_ctrl *ctrl) return container_of(ctrl->handler, struct mtk_vcodec_ctx, ctrl_hdl); } +/* Wake up context wait_queue */ +static inline void wake_up_ctx(struct mtk_vcodec_ctx *ctx, unsigned int reason) +{ + ctx->int_cond = 1; + ctx->int_type = reason; + wake_up_interruptible(&ctx->queue); +} + #endif /* _MTK_VCODEC_DRV_H_ */ diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c index 4167e865b23f..2828df77020c 100644 --- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c +++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c @@ -73,14 +73,6 @@ static const struct mtk_video_fmt mtk_video_formats_capture_mt8183[] = { }, }; -/* Wake up context wait_queue */ -static void wake_up_ctx(struct mtk_vcodec_ctx *ctx, unsigned int reason) -{ - ctx->int_cond = 1; - ctx->int_type = reason; - wake_up_interruptible(&ctx->queue); -} - static void clean_irq_status(unsigned int irq_status, void __iomem *addr) { if (irq_status & MTK_VENC_IRQ_STATUS_PAUSE) -- 2.25.1