From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 44881C433EF for ; Wed, 12 Jan 2022 06:06:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347905AbiALGGu (ORCPT ); Wed, 12 Jan 2022 01:06:50 -0500 Received: from twspam01.aspeedtech.com ([211.20.114.71]:52675 "EHLO twspam01.aspeedtech.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237360AbiALGGu (ORCPT ); Wed, 12 Jan 2022 01:06:50 -0500 Received: from mail.aspeedtech.com ([192.168.0.24]) by twspam01.aspeedtech.com with ESMTP id 20C60Bfr088741; Wed, 12 Jan 2022 14:00:11 +0800 (GMT-8) (envelope-from jammy_huang@aspeedtech.com) Received: from JammyHuang-PC.aspeed.com (192.168.2.115) by TWMBX02.aspeed.com (192.168.0.24) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 12 Jan 2022 14:06:48 +0800 From: Jammy Huang To: , , , , , , , , Subject: [PATCH v2] media: aspeed: Fix no complete irq for non-64-aligned width Date: Wed, 12 Jan 2022 14:07:25 +0800 Message-ID: <20220112060725.13751-1-jammy_huang@aspeedtech.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [192.168.2.115] X-ClientProxiedBy: TWMBX02.aspeed.com (192.168.0.24) To TWMBX02.aspeed.com (192.168.0.24) X-DNSRBL: X-MAIL: twspam01.aspeedtech.com 20C60Bfr088741 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In ast2500, engine will stop occasionally for 1360x768. This is a bug which has been addressed, but the workaround is specific for 1680 only. Here we make it more complete. Signed-off-by: Jammy Huang Reviewed-by: Joel Stanley --- drivers/media/platform/aspeed-video.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/media/platform/aspeed-video.c b/drivers/media/platform/aspeed-video.c index 4c75dc58a33c..4f5f5dd364ee 100644 --- a/drivers/media/platform/aspeed-video.c +++ b/drivers/media/platform/aspeed-video.c @@ -1068,18 +1068,19 @@ static void aspeed_video_set_resolution(struct aspeed_video *video) /* Set capture/compression frame sizes */ aspeed_video_calc_compressed_size(video, size); - if (video->active_timings.width == 1680) { + if (!IS_ALIGNED(act->width, 64)) { /* - * This is a workaround to fix a silicon bug on A1 and A2 - * revisions. Since it doesn't break capturing operation of + * This is a workaround to fix a AST2500 silicon bug on A1 and + * A2 revisions. Since it doesn't break capturing operation of * other revisions, use it for all revisions without checking - * the revision ID. It picked 1728 which is a very next - * 64-pixels aligned value to 1680 to minimize memory bandwidth + * the revision ID. It picked new width which is a very next + * 64-pixels aligned value to minimize memory bandwidth * and to get better access speed from video engine. */ - aspeed_video_write(video, VE_CAP_WINDOW, - 1728 << 16 | act->height); - size += (1728 - 1680) * video->active_timings.height; + u32 width = ALIGN(act->width, 64); + + aspeed_video_write(video, VE_CAP_WINDOW, width << 16 | act->height); + size = width * act->height; } else { aspeed_video_write(video, VE_CAP_WINDOW, act->width << 16 | act->height); -- 2.25.1 From mboxrd@z Thu Jan 1 00:00:00 1970 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 50DEDC433EF for ; Wed, 12 Jan 2022 22:10:17 +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:Message-ID:Date:Subject:To :From:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=KdhP+G06ycG+ltXbEGQaYFZ5vzmL5zUNXkcsH+aFsu0=; b=mtytpI/5e/4y3C /q8XKWa03kk1XLVBnDEAyb/F3W6XS3cexQAQ/xz3+8s4SlcwzWNPz9rjgCSrPcf+c6Oy4tk+YSRay WoPTHnLxxgj+zhSFpr40mdweeillOuuJ1FOL4KroQOyAgVEUORUqEZ90fYOjQ0u0+kirhIj5c4qS/ TFb/I3ViDSLX9TMncTN7GamLKY+Pw1u9iKB974M1EaDkiLaZGbHWYacoI2GTQbi8GFOzEvigpF3HI mSBv7E1MxCleUBtfZvtFSTlr21TPF4x5NOF3aHwJEuXJ9r5BPfUEZlPyuSq5oGCKFdhJJuKjJEtxj nmCmDj0VVr4mJoFjL93w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n7lnL-003uYV-Ma; Wed, 12 Jan 2022 22:08:39 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n7lnJ-003uYA-Rk for linux-arm-kernel@bombadil.infradead.org; Wed, 12 Jan 2022 22:08:37 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Type:Content-Transfer-Encoding :MIME-Version:Message-ID:Date:Subject:To:From:Sender:Reply-To:Cc:Content-ID: Content-Description:In-Reply-To:References; bh=uvX0ivjkBli1iBzpuUt9n0SNP/ePcIckxX4wmKUzu7c=; b=nr98rClPDnggcPrSV1k5D/uD4t w2N4H6m33pMQP4c0HZaF9vyFg01Tucyz7QPLEPNVdXFbCdqA2/AE9iDsTcTzwBao83nZvFJzrRAgp IlJuU+CIeBZpe2InmIr96RHMcxQ47G+/Rqk+lygr7U8ss2+MPSE0Nu72Gv8A6io7bsHbji4XQ0dyN ziWpVxT0crERHCwiAGiKy192iu0K52cEG0yZDVQ+PxWfuNz9QdRvoyDIXWrSWWxUlHZhfXBy4K1mV GTseKDe+RwObd1sTzi33xV6nYge45VvJwxBE5rvJCbY5KeoBbeMfJHMe676LW+lidc3a8zLxpiyji lOa7KebA==; Received: from twspam01.aspeedtech.com ([211.20.114.71]) by desiato.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n7Wmp-000kDI-Pc for linux-arm-kernel@lists.infradead.org; Wed, 12 Jan 2022 06:07:10 +0000 Received: from mail.aspeedtech.com ([192.168.0.24]) by twspam01.aspeedtech.com with ESMTP id 20C60Bfr088741; Wed, 12 Jan 2022 14:00:11 +0800 (GMT-8) (envelope-from jammy_huang@aspeedtech.com) Received: from JammyHuang-PC.aspeed.com (192.168.2.115) by TWMBX02.aspeed.com (192.168.0.24) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 12 Jan 2022 14:06:48 +0800 From: Jammy Huang To: , , , , , , , , Subject: [PATCH v2] media: aspeed: Fix no complete irq for non-64-aligned width Date: Wed, 12 Jan 2022 14:07:25 +0800 Message-ID: <20220112060725.13751-1-jammy_huang@aspeedtech.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [192.168.2.115] X-ClientProxiedBy: TWMBX02.aspeed.com (192.168.0.24) To TWMBX02.aspeed.com (192.168.0.24) X-DNSRBL: X-MAIL: twspam01.aspeedtech.com 20C60Bfr088741 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220112_060708_472707_D82E5454 X-CRM114-Status: GOOD ( 13.73 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org In ast2500, engine will stop occasionally for 1360x768. This is a bug which has been addressed, but the workaround is specific for 1680 only. Here we make it more complete. Signed-off-by: Jammy Huang Reviewed-by: Joel Stanley --- drivers/media/platform/aspeed-video.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/media/platform/aspeed-video.c b/drivers/media/platform/aspeed-video.c index 4c75dc58a33c..4f5f5dd364ee 100644 --- a/drivers/media/platform/aspeed-video.c +++ b/drivers/media/platform/aspeed-video.c @@ -1068,18 +1068,19 @@ static void aspeed_video_set_resolution(struct aspeed_video *video) /* Set capture/compression frame sizes */ aspeed_video_calc_compressed_size(video, size); - if (video->active_timings.width == 1680) { + if (!IS_ALIGNED(act->width, 64)) { /* - * This is a workaround to fix a silicon bug on A1 and A2 - * revisions. Since it doesn't break capturing operation of + * This is a workaround to fix a AST2500 silicon bug on A1 and + * A2 revisions. Since it doesn't break capturing operation of * other revisions, use it for all revisions without checking - * the revision ID. It picked 1728 which is a very next - * 64-pixels aligned value to 1680 to minimize memory bandwidth + * the revision ID. It picked new width which is a very next + * 64-pixels aligned value to minimize memory bandwidth * and to get better access speed from video engine. */ - aspeed_video_write(video, VE_CAP_WINDOW, - 1728 << 16 | act->height); - size += (1728 - 1680) * video->active_timings.height; + u32 width = ALIGN(act->width, 64); + + aspeed_video_write(video, VE_CAP_WINDOW, width << 16 | act->height); + size = width * act->height; } else { aspeed_video_write(video, VE_CAP_WINDOW, act->width << 16 | act->height); -- 2.25.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel