Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp606818rwi; Thu, 20 Oct 2022 03:01:00 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7Y8HBhKW6oS3IJbmm8BVvvC+stLHoZ6HJa+4TvSA19DuFFvJG7nFkqfWS/AmKtKyCrsq6w X-Received: by 2002:a17:907:2da5:b0:78e:1208:8783 with SMTP id gt37-20020a1709072da500b0078e12088783mr10402895ejc.743.1666260060293; Thu, 20 Oct 2022 03:01:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666260060; cv=none; d=google.com; s=arc-20160816; b=SMdhfBJRLDsmqCqfuEpl+hogZVKhajAmbyHlCu3GPmmCu9pnLblSmkz6EUrOpcogWV 8519YT/MQQSOMJpHXL3gXelYF7rdF4tCtVBN2RxW5Rdaz+Iz2pcZX3UT7lbZVQ9QkHrp w5NN05nnI4W7R+LWbeRej/U8kfcxryyjYIFhzVKgCqlV4/AHJyIRiA50KXQvnlGHm7+u IFVqpHmkjMoUKJCPh+BXULzPWA6ipmr5fxyX+GgUg8LF8spitf4WWQOnECIP9DYjeFhI H4vyFLNGmV53VByEQEZJX1kNrhZvPkdlP3tp2jrixSjpzf9KCCqqEzSSN1RkqwBm0Eqp cNUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=EylialLy65/vIP9RYmxs/Fe64nKsmZuimOi8cns/imQ=; b=aw0vcNIuAfcMxAH2dfQ6942ZJR3KpVjXyoI3Dw8CT4C3iKhxSotVt1MGbawki76kIU /kkWkBGFKTj2uqNDy0HSxGa90lo89qW1/G3/oauWq/JAX/jL1jNwzhu4VfLNvuaYIcyz Z4q1s2IDvmaycfyCU15WIv2LxWGT+q7M5v6KZdW5TZbtiL1BGtmoXcu2DzfK24ChOfIq Gc3rA4YhT2pr38iA7sPkM/lP8bsBHzoGEhCbiy3vCFNuM+/EC78Dg6a/iQp//J0AgYSJ tPosUXOCSlxfyXnDm3oWLVxxyyzq8msO4kLgbQuk8p1wbQ4OzAVd1IQguTX7TJ91uHZu 47Aw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d6-20020a50ea86000000b0045c3592301dsi14983390edo.191.2022.10.20.03.00.30; Thu, 20 Oct 2022 03:01:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229995AbiJTJ4A (ORCPT + 99 others); Thu, 20 Oct 2022 05:56:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229695AbiJTJz5 (ORCPT ); Thu, 20 Oct 2022 05:55:57 -0400 Received: from twspam01.aspeedtech.com (twspam01.aspeedtech.com [211.20.114.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD90E15B104; Thu, 20 Oct 2022 02:55:53 -0700 (PDT) Received: from mail.aspeedtech.com ([192.168.0.24]) by twspam01.aspeedtech.com with ESMTP id 29K9W5Jd085421; Thu, 20 Oct 2022 17:32:05 +0800 (GMT-8) (envelope-from jammy_huang@aspeedtech.com) Received: from [192.168.2.115] (192.168.2.115) by TWMBX02.aspeed.com (192.168.0.24) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 20 Oct 2022 17:54:32 +0800 Message-ID: Date: Thu, 20 Oct 2022 17:54:33 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.13.1 Subject: Re: [PATCH v9 1/4] media: v4l: Add definition for the Aspeed JPEG format Content-Language: en-US To: Sakari Ailus CC: , , , , , , , , , , , , , , References: <20220921025112.13150-1-jammy_huang@aspeedtech.com> <20220921025112.13150-2-jammy_huang@aspeedtech.com> From: Jammy Huang In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit 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 29K9W5Jd085421 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Sakari, Thanks for your review. On 2022/9/23 δΈ‹εˆ 08:56, Sakari Ailus wrote: > Hi Jammy, > > Thanks for the update. > > On Wed, Sep 21, 2022 at 10:51:09AM +0800, Jammy Huang wrote: >> This introduces support for the Aspeed JPEG format, where the new frame >> can refer to previous frame to reduce the amount of compressed data. >> The concept is similar to I/P frame of video compression. It will >> compare the new frame with previous one to decide which macroblock's >> data is changed, and only the changed macroblocks will be compressed. >> >> This Aspeed JPEG format is used by the video engine on Aspeed platforms, >> which is generally adapted for remote KVM. >> >> Signed-off-by: Jammy Huang >> --- >> .../userspace-api/media/v4l/pixfmt-reserved.rst | 17 +++++++++++++++++ >> drivers/media/v4l2-core/v4l2-ioctl.c | 1 + >> include/uapi/linux/videodev2.h | 1 + >> 3 files changed, 19 insertions(+) >> >> diff --git a/Documentation/userspace-api/media/v4l/pixfmt-reserved.rst b/Documentation/userspace-api/media/v4l/pixfmt-reserved.rst >> index 0ff68cd8cf62..f62bc76d606f 100644 >> --- a/Documentation/userspace-api/media/v4l/pixfmt-reserved.rst >> +++ b/Documentation/userspace-api/media/v4l/pixfmt-reserved.rst >> @@ -258,6 +258,23 @@ please make a proposal on the linux-media mailing list. >> and it is used by various multimedia hardware blocks like GPU, display >> controllers, ISP and video accelerators. >> It contains four planes for progressive video. >> + * .. _V4L2-PIX-FMT-AJPG: >> + >> + - ``V4L2_PIX_FMT_AJPG`` >> + - 'AJPG' >> + - ASPEED JPEG format used by the aspeed-video driver on Aspeed platforms, >> + which is generally adapted for remote KVM. >> + On each frame compression, I will compare the new frame with previous >> + one to decide which macroblock's data is changed, and only the changed >> + macroblocks will be compressed. >> + >> + The implementation is based on AST2600 A3 datasheet, revision 0.9, which >> + is not publicly available. Or you can reference Video stream data format >> + – ASPEED mode compression of SDK_User_Guide which available on >> + AspeedTech-BMC/openbmc/releases. >> + >> + Decoder's implementation can be found here, >> + `https://github.com/AspeedTech-BMC/aspeed_codec/ `__ > This is better than the previous versions. > > Can you still run > > $ scripts/checkpatch.pl --strict --max-line-length=80 > > ? I will correct the length to meet the rule. > > On the decoder --- which values is the user supposed to use for mode_420, > selector and advance_selector parameters? I think this needs to be > documented. I will update following information to aspeed_codec's github, and provide recommended values. "The following parameters should be provided by the encoded stream to let decoder know how to work, because Aspeed codec does not include the information needed for decoding in the header. Users can adjust the three parameters, mode420, selector, and advance_selector, to achieve the desired quality level while at the same time reduce the storage size." >> .. raw:: latex >> >> \normalsize >> diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c >> index a1a1b51ac599..c72bc3410bee 100644 >> --- a/drivers/media/v4l2-core/v4l2-ioctl.c >> +++ b/drivers/media/v4l2-core/v4l2-ioctl.c >> @@ -1497,6 +1497,7 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt) >> case V4L2_PIX_FMT_MT21C: descr = "Mediatek Compressed Format"; break; >> case V4L2_PIX_FMT_QC08C: descr = "QCOM Compressed 8-bit Format"; break; >> case V4L2_PIX_FMT_QC10C: descr = "QCOM Compressed 10-bit Format"; break; >> + case V4L2_PIX_FMT_AJPG: descr = "Aspeed JPEG"; break; >> default: >> if (fmt->description[0]) >> return; >> diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h >> index 86cae23cc446..870a7e5ef8ca 100644 >> --- a/include/uapi/linux/videodev2.h >> +++ b/include/uapi/linux/videodev2.h >> @@ -775,6 +775,7 @@ struct v4l2_pix_format { >> #define V4L2_PIX_FMT_HI240 v4l2_fourcc('H', 'I', '2', '4') /* BTTV 8-bit dithered RGB */ >> #define V4L2_PIX_FMT_QC08C v4l2_fourcc('Q', '0', '8', 'C') /* Qualcomm 8-bit compressed */ >> #define V4L2_PIX_FMT_QC10C v4l2_fourcc('Q', '1', '0', 'C') /* Qualcomm 10-bit compressed */ >> +#define V4L2_PIX_FMT_AJPG v4l2_fourcc('A', 'J', 'P', 'G') /* Aspeed JPEG */ >> >> /* 10bit raw packed, 32 bytes for every 25 pixels, last LSB 6 bits unused */ >> #define V4L2_PIX_FMT_IPU3_SBGGR10 v4l2_fourcc('i', 'p', '3', 'b') /* IPU3 packed 10-bit BGGR bayer */ -- Best Regards Jammy