From patchwork Wed Nov 29 09:29:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 13472541 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A8122C07CB1 for ; Wed, 29 Nov 2023 09:31:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=nClAK1E4dsUXERKCVFtq7PkKMu6I2sSSQjDD7o+7eu8=; b=349AWAy2srNNNa L1CcJqtXSIZ2QKgIp1Cq7nC4OCmIqxLy5ILX+Wiw9FrNHcJBUq6EC9D9b1KXZb+HSaCuqPc/C0lbI uYnKUQviUEeglLYoRMezNe2T9O0VBR6/Mqu/1mEHeMOqwXBynNHIkgWef8ZcX5U5RxFffsBHlCzta eThGVTINOoFWLq/7wlNYq6T1mS+6sbmpOHToOLoNYe020aQ/qD0nlEj8GfgM4eHI/lgtvo62GCVt1 CUeheM7/hbAJsGFa7ilqZ7SPiGQQ9yPi4Q8wnJQpkzzMfRnNIfhKo2qv770vsZILX8CTJS/aXwacK kSZipK7x8smRGUsl9bQg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r8Gtv-007ff3-0r; Wed, 29 Nov 2023 09:30:35 +0000 Received: from perceval.ideasonboard.com ([213.167.242.64]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r8Gtc-007fMQ-10; Wed, 29 Nov 2023 09:30:19 +0000 Received: from pyrite.hamster-moth.ts.net (h175-177-049-135.catv02.itscom.jp [175.177.49.135]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 2ED54842; Wed, 29 Nov 2023 10:29:34 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1701250179; bh=d913GvalhZxn+cluGTlKdnL8La1aX9Ez3xY0EWSP+nU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=u9KwFIwRde9YwrXdkzhtyJv7WMrmme/6jbLjReptabv01EmKMkkqBvxiaDUvy/wyq LmBCFVi7ryr+JHWR1ev3oVk0/gI+pKdm676/uxor3y+MWK+eMlXchRp5E0a1f94w1o jZr9DpBPCTEtyx9Tm6CQxOmEeQ3SUccFZwj2vC+A= From: Paul Elder To: linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org Cc: kieran.bingham@ideasonboard.com, tomi.valkeinen@ideasonboard.com, umang.jain@ideasonboard.com, Paul Elder , Dafna Hirschfeld , Laurent Pinchart , Mauro Carvalho Chehab , Heiko Stuebner , linux-arm-kernel@lists.infradead.org (moderated list:ARM/Rockchip SoC support), linux-kernel@vger.kernel.org (open list) Subject: [PATCH 1/3] media: rkisp1: regs: Consolidate MI interrupt wrap fields Date: Wed, 29 Nov 2023 18:29:54 +0900 Message-Id: <20231129092956.250129-2-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231129092956.250129-1-paul.elder@ideasonboard.com> References: <20231129092956.250129-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231129_013016_535403_F925F27E X-CRM114-Status: GOOD ( 10.61 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Consolidate the wraparound fields in the memory interface interrupt status registers, so that it can be more succinctly expressed by taking the stream ID (main or self) as a parameter. Signed-off-by: Paul Elder Reviewed-by: Kieran Bingham Reviewed-by: Laurent Pinchart --- drivers/media/platform/rockchip/rkisp1/rkisp1-regs.h | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-regs.h b/drivers/media/platform/rockchip/rkisp1/rkisp1-regs.h index 350f452e676f..bea69a0d766a 100644 --- a/drivers/media/platform/rockchip/rkisp1/rkisp1-regs.h +++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-regs.h @@ -172,12 +172,9 @@ #define RKISP1_CIF_MI_FRAME(stream) BIT((stream)->id) #define RKISP1_CIF_MI_MBLK_LINE BIT(2) #define RKISP1_CIF_MI_FILL_MP_Y BIT(3) -#define RKISP1_CIF_MI_WRAP_MP_Y BIT(4) -#define RKISP1_CIF_MI_WRAP_MP_CB BIT(5) -#define RKISP1_CIF_MI_WRAP_MP_CR BIT(6) -#define RKISP1_CIF_MI_WRAP_SP_Y BIT(7) -#define RKISP1_CIF_MI_WRAP_SP_CB BIT(8) -#define RKISP1_CIF_MI_WRAP_SP_CR BIT(9) +#define RKISP1_CIF_MI_WRAP_Y(stream) BIT(4 + (stream)->id * 3) +#define RKISP1_CIF_MI_WRAP_CB(stream) BIT(5 + (stream)->id * 3) +#define RKISP1_CIF_MI_WRAP_CR(stream) BIT(6 + (stream)->id * 3) #define RKISP1_CIF_MI_DMA_READY BIT(11) /* MI_STATUS */ From patchwork Wed Nov 29 09:29:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 13472543 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0D383C4167B for ; Wed, 29 Nov 2023 09:31:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=aI10k7gT6xUj1bl93CGby4uIDNRpZ4eKwzXUblLf2PM=; b=CGtCDYzRbk7o4x vNzKN5j9NWR1QhkawpWAxiTr8RRJjVyAXozFWSvqTFK95QDMDmV2/VgmE0BPUyErDSB0WMV0qkl1t LLzTqWtA7hY+UDHSTuLIPi4INL5LB3AlaU4cDe/TAlmAvbVXTjE5jZn9hl9LynLOPlhUJ4MIVxZTx LZH7Y9tYQHfAG8R8r+N3ON927ZDLPgfFxBIKLZ8oetMJwq6REmdO1GW6Rqjz3n1skfWYgb6ZtcPBO RWGwOlXp9++kLubd5h5oa+SgqZFsPavuorhUlVYA14+IXv1MhTjoO1rYsgUxfiBw470w/RdptTmD+ taUuBih9KNwJAB9V45ZQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r8Gtx-007fhH-2A; Wed, 29 Nov 2023 09:30:37 +0000 Received: from perceval.ideasonboard.com ([213.167.242.64]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r8Gth-007fR4-1O; Wed, 29 Nov 2023 09:30:23 +0000 Received: from pyrite.hamster-moth.ts.net (h175-177-049-135.catv02.itscom.jp [175.177.49.135]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 565F289D; Wed, 29 Nov 2023 10:29:40 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1701250184; bh=x5DGL3arJhhL6cHx1o46byLPKXKRQq29+jIxhF3wWFY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nhfCHa/UZW2Ewa8Uz+2l85e5dnvhDjW2zCDWDhZ/HjrqSnbeQ6CjnYYHM04tp4sSK 9YTW7mvC0UeQM9BEdQkQS1fR+0ofIp5zOkd/UsVTWewly106P5pm23k/kko0/szIeh gO4BvK3sc4SdMKUJjYjvsGWbIHAITa9eb5BA8aB0= From: Paul Elder To: linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org Cc: kieran.bingham@ideasonboard.com, tomi.valkeinen@ideasonboard.com, umang.jain@ideasonboard.com, Paul Elder , Dafna Hirschfeld , Laurent Pinchart , Mauro Carvalho Chehab , Heiko Stuebner , linux-arm-kernel@lists.infradead.org (moderated list:ARM/Rockchip SoC support), linux-kernel@vger.kernel.org (open list) Subject: [PATCH 2/3] media: rkisp1: debug: Add register dump for IS Date: Wed, 29 Nov 2023 18:29:55 +0900 Message-Id: <20231129092956.250129-3-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231129092956.250129-1-paul.elder@ideasonboard.com> References: <20231129092956.250129-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231129_013021_626312_23CB9181 X-CRM114-Status: GOOD ( 10.58 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add register dump for the image stabilizer module to debugfs. Signed-off-by: Paul Elder Tested-by: Alexander Stein Reviewed-by: Kieran Bingham --- .../platform/rockchip/rkisp1/rkisp1-debug.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-debug.c b/drivers/media/platform/rockchip/rkisp1/rkisp1-debug.c index 71df3dc95e6f..f66b9754472e 100644 --- a/drivers/media/platform/rockchip/rkisp1/rkisp1-debug.c +++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-debug.c @@ -139,6 +139,21 @@ static int rkisp1_debug_dump_mi_mp_show(struct seq_file *m, void *p) } DEFINE_SHOW_ATTRIBUTE(rkisp1_debug_dump_mi_mp); +static int rkisp1_debug_dump_is_show(struct seq_file *m, void *p) +{ + static const struct rkisp1_debug_register registers[] = { + RKISP1_DEBUG_SHD_REG(ISP_IS_H_OFFS), + RKISP1_DEBUG_SHD_REG(ISP_IS_V_OFFS), + RKISP1_DEBUG_SHD_REG(ISP_IS_H_SIZE), + RKISP1_DEBUG_SHD_REG(ISP_IS_V_SIZE), + { /* Sentinel */ }, + }; + struct rkisp1_device *rkisp1 = m->private; + + return rkisp1_debug_dump_regs(rkisp1, m, 0, registers); +} +DEFINE_SHOW_ATTRIBUTE(rkisp1_debug_dump_is); + #define RKISP1_DEBUG_DATA_COUNT_BINS 32 #define RKISP1_DEBUG_DATA_COUNT_STEP (4096 / RKISP1_DEBUG_DATA_COUNT_BINS) @@ -235,6 +250,9 @@ void rkisp1_debug_init(struct rkisp1_device *rkisp1) debugfs_create_file("mi_mp", 0444, regs_dir, rkisp1, &rkisp1_debug_dump_mi_mp_fops); + + debugfs_create_file("is", 0444, regs_dir, rkisp1, + &rkisp1_debug_dump_is_fops); } void rkisp1_debug_cleanup(struct rkisp1_device *rkisp1) From patchwork Wed Nov 29 09:29:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 13472542 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 501CFC4167B for ; Wed, 29 Nov 2023 09:31:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=wlyzsbwNJ+D0h0/1gRy1iyl4OsED6LRzM9utQL9yIcU=; b=11GJsKsD10UScJ b213+mGzrW99M5vK2ouGAcsJPtS3SaSUBMdX6icNxx3ZB5sO78xmyFU3K7VJQ7YA+26vE6G6Uj4cE TdMPe6PZW4YbYo/ZTdcoHpdnNkwo8Shhjwy2kpExUJr/UBtfqVCsQtWxNWbjv1h8xc+PHwb8JPxJN Yzs+eXwGk5qfArd+s//xhzzTgj1OYiL2vl+5kyOr3AA9VShcKQPvbYBXy6RwUdbsQaM/NQAOKp1n4 ngpuX01/qqDcPhlnShrEsiHkzyWOFvB/2kQNitOKt/FFf7RiHGrPNddBiL+OWDI1En41sWkojU90Q hvcgwoBLh0Pg2UfYyqxw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r8Gtz-007fjG-3A; Wed, 29 Nov 2023 09:30:39 +0000 Received: from perceval.ideasonboard.com ([213.167.242.64]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r8Gtm-007fVs-1F; Wed, 29 Nov 2023 09:30:28 +0000 Received: from pyrite.hamster-moth.ts.net (h175-177-049-135.catv02.itscom.jp [175.177.49.135]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 434AE9DE; Wed, 29 Nov 2023 10:29:44 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1701250189; bh=fjlSyQdMYtU8mW5I8BqFXL1GZm5w0VnY/a4rJLCH7MI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SnJUy4FMVoyYIwSo1aWARUKrsjaOtcpy2nBIR5hOf7pGMzNBBEtgEn+/cMTNiqiwR YzDl5O05Y1Zo5hs/3QgoA7l5QIm1Px+M75jC8dTjsf+mlS3ae9nZw9Y9M3mqUWsGZ3 zrA/7nvYFHza46WuU5Auer9y/nGM4IGljnDztL5A= From: Paul Elder To: linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org Cc: kieran.bingham@ideasonboard.com, tomi.valkeinen@ideasonboard.com, umang.jain@ideasonboard.com, Paul Elder , Dafna Hirschfeld , Laurent Pinchart , Mauro Carvalho Chehab , Heiko Stuebner , linux-arm-kernel@lists.infradead.org (moderated list:ARM/Rockchip SoC support), linux-kernel@vger.kernel.org (open list) Subject: [PATCH 3/3] media: rkisp1: debug: Count completed frame interrupts Date: Wed, 29 Nov 2023 18:29:56 +0900 Message-Id: <20231129092956.250129-4-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231129092956.250129-1-paul.elder@ideasonboard.com> References: <20231129092956.250129-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231129_013026_605373_77283B8D X-CRM114-Status: GOOD ( 11.68 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add a counter to debugfs to count the number of frame-end interrupts. Signed-off-by: Paul Elder Reviewed-by: Alexander Stein Reviewed-by: Kieran Bingham Reviewed-by: Laurent Pinchart --- drivers/media/platform/rockchip/rkisp1/rkisp1-common.h | 1 + drivers/media/platform/rockchip/rkisp1/rkisp1-debug.c | 2 ++ drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c | 2 ++ 3 files changed, 5 insertions(+) diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-common.h b/drivers/media/platform/rockchip/rkisp1/rkisp1-common.h index 1e7cea1bea5e..be69173958a4 100644 --- a/drivers/media/platform/rockchip/rkisp1/rkisp1-common.h +++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-common.h @@ -417,6 +417,7 @@ struct rkisp1_debug { unsigned long stats_error; unsigned long stop_timeout[2]; unsigned long frame_drop[2]; + unsigned long complete_frames; }; /* diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-debug.c b/drivers/media/platform/rockchip/rkisp1/rkisp1-debug.c index f66b9754472e..1b1edfd3ab6c 100644 --- a/drivers/media/platform/rockchip/rkisp1/rkisp1-debug.c +++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-debug.c @@ -232,6 +232,8 @@ void rkisp1_debug_init(struct rkisp1_device *rkisp1) &debug->frame_drop[RKISP1_MAINPATH]); debugfs_create_ulong("sp_frame_drop", 0444, debug->debugfs_dir, &debug->frame_drop[RKISP1_SELFPATH]); + debugfs_create_ulong("complete_frames", 0444, debug->debugfs_dir, + &debug->complete_frames); debugfs_create_file("input_status", 0444, debug->debugfs_dir, rkisp1, &rkisp1_debug_input_status_fops); diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c b/drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c index 64a956b9f2d0..06cdb4edf19c 100644 --- a/drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c +++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c @@ -991,6 +991,8 @@ irqreturn_t rkisp1_isp_isr(int irq, void *ctx) if (status & RKISP1_CIF_ISP_FRAME) { u32 isp_ris; + rkisp1->debug.complete_frames++; + /* New frame from the sensor received */ isp_ris = rkisp1_read(rkisp1, RKISP1_CIF_ISP_RIS); if (isp_ris & RKISP1_STATS_MEAS_MASK)