Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp516629pxb; Tue, 14 Sep 2021 02:52:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxmqtRYB9c11/MAI7UxS5RD5vkX6cSm04xmL+KHeovCKprDp1xrLVIJvSxezbSZfeVG+sVQ X-Received: by 2002:a17:906:2c0b:: with SMTP id e11mr18078737ejh.284.1631613176092; Tue, 14 Sep 2021 02:52:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631613176; cv=none; d=google.com; s=arc-20160816; b=kcRAoi75MJk3V6mzkRIVvxkglIj5kLsqCkpNM7ubZJBUneNJM5kLvVXtRUQQCgdJLc 5ia6mbZIWNEzlqTOoZoVXIIp4q3eyPHi4lcTif85GQ4NEOa9pWyaRp/GZKZhMfJdBRG6 CeAHhUnUJxuunTl6cKpNSqyg50ssQH8sQAE0qAsaV6Enc6AvNVEnoCSvKPMf0HOqILAL /9zl8i8R/Y5LVT9Usf+sV6WuK7l/KS62HBeeJxRoCCWX1oHkQiqD++B6cNWAfPPq3Vfs 4WqPQ4CsqCUqu35TVcvFQCkw+tU8QVbIB56qqSCUKILpSfS7jgxWhq8K2HKZdlIa81kO jxRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=r4ci80ERq4snpKFMpM018P39PiILjth6wuzDmaxD+MU=; b=EQ1EdUr1cPojC7qT0N7PaK5Gx2UjoXcp3IegweYRd4jAQ5hKBAcs1VOFLluSnt+sxZ TTdIGiJ9nAvSLuYVdOpvxBwu3gBA3RBBHFlYNHoaSYkPAiBrT5jr95IdFEkPTM4wMCgL epNgohlB2Ho4MeM7Ie/VdO5ANK8O58LineQFJxP9Wl1CcoWwMKOPNjzOWODogOQ3TEnL YNZBCkMRbpAI7rG3DMPK0KEPdTu8vasj+v5S7D9T3Aut3QDEjWycMd3B9BVfX8TcjOVu vBH/GUrsE1TXzJP1A7rp98jBbp/zTu2hOMRUTk2Wys7XvNeMmVZ5IOfyn4cPHUsuJXL0 /u3g== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p14si7332788ejn.499.2021.09.14.02.52.32; Tue, 14 Sep 2021 02:52:56 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230346AbhINJwB (ORCPT + 99 others); Tue, 14 Sep 2021 05:52:01 -0400 Received: from twspam01.aspeedtech.com ([211.20.114.71]:16359 "EHLO twspam01.aspeedtech.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229906AbhINJv6 (ORCPT ); Tue, 14 Sep 2021 05:51:58 -0400 Received: from mail.aspeedtech.com ([192.168.0.24]) by twspam01.aspeedtech.com with ESMTP id 18E9Uefk047557; Tue, 14 Sep 2021 17:30:40 +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; Tue, 14 Sep 2021 17:50:30 +0800 From: Jammy Huang To: , , , , , , , , CC: Subject: [PATCH resend] media: aspeed: refine to avoid full jpeg update Date: Tue, 14 Sep 2021 17:49:20 +0800 Message-ID: <20210914094919.3506-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 18E9Uefk047557 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The switch of jpeg 420/444 subsampling will update full jpeg header for aspeed now. Just update the 420/444 subsampling part of jpeg header is fine. Signed-off-by: Jammy Huang --- resend the patch becuase cc-list isn't complete. drivers/media/platform/aspeed-video.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/aspeed-video.c b/drivers/media/platform/aspeed-video.c index 3c90f3f3cf14..8b3939b8052d 100644 --- a/drivers/media/platform/aspeed-video.c +++ b/drivers/media/platform/aspeed-video.c @@ -401,6 +401,21 @@ static void aspeed_video_init_jpeg_table(u32 *table, bool yuv420) } } +// just update jpeg dct table per 420/444 +static void aspeed_video_update_jpeg_table(u32 *table, bool yuv420) +{ + int i; + unsigned int base; + + for (i = 0; i < ASPEED_VIDEO_JPEG_NUM_QUALITIES; i++) { + base = 256 * i; /* AST HW requires this header spacing */ + base += ASPEED_VIDEO_JPEG_HEADER_SIZE + + ASPEED_VIDEO_JPEG_DCT_SIZE; + + table[base + 2] = (yuv420) ? 0x00220103 : 0x00110103; + } +} + static void aspeed_video_update(struct aspeed_video *video, u32 reg, u32 clear, u32 bits) { @@ -1274,7 +1289,7 @@ static void aspeed_video_update_jpeg_quality(struct aspeed_video *video) static void aspeed_video_update_subsampling(struct aspeed_video *video) { if (video->jpeg.virt) - aspeed_video_init_jpeg_table(video->jpeg.virt, video->yuv420); + aspeed_video_update_jpeg_table(video->jpeg.virt, video->yuv420); if (video->yuv420) aspeed_video_update(video, VE_SEQ_CTRL, 0, VE_SEQ_CTRL_YUV420); -- 2.25.1