Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp959146rwb; Fri, 23 Sep 2022 06:31:32 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6MX8/C9mKvaYMhXVKr7Q5lA1ELgo3PM9IQwrSR9KRSs6/eriKe/esDp938N4BFGD0prAyG X-Received: by 2002:a63:7159:0:b0:43c:5e0:f355 with SMTP id b25-20020a637159000000b0043c05e0f355mr7641950pgn.6.1663939892441; Fri, 23 Sep 2022 06:31:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663939892; cv=none; d=google.com; s=arc-20160816; b=ssk4XU5S8G+WFv8fv4RmQiqta7d9Pwng+QFCgeCBp4RX+7vVkak77ftEJjhWTIy6Un 1ofT2xF2CE4gbiptrThc7OiO4Jkevfi+P+5M73HT7A5hz+14aDZDhoTkdy0HoAW1J8Xw krVtqJa0xhcfPrdgGpkzQhFeb3yGbm50rJRVrb0rzotKrxe19uzDmSC9SR2KMUTPM9Xd 8tbAO5GHQdtlVIhAIqpLk3ya7PUsP47qW2zBfcQ9+75xH47unpblcf4f2qhf8L4eWO0g G5E7XN2s1AgtMgweObnADagujQ/KTUiZdXUANIZGgAOS+ly5fk5mXzLQrlOurpZ5Yu2u C9nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=2QewRIJKYS0roxfpKfy8n/I8tiXbUqNDsVHEGj5j/0Y=; b=brRxlE2YJohh+ptgVN60eraTufIspJ2b/kmtS6jw+LxnI2cM+tLjJeJastTkKcqmok 1oPm9TtvtRiQKaAvQCSLUfOeRNMqWFy+cJ7nni91txmW0LIUsTsI7cKWRZZJg5ok8EjA M+p2aeYOKs+kExQe77N9I0vW8rO4v5raoKupR7TgsZTIiMkMCsN262Zgf54eowpiwTkt dTSW4SP+Q/aq+XCtxzko4qGyP989o3HOMwQJ/XV8FE74MNRqCw6d+nDcAJVah6qz6BNr MCYn1JoFTiH2UWYfPP1B6rIkKdReeAqSrawzuwtxotCLbuEKALi8KnLl9Qa2Mf5RQknn Bgjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=VsXy10Kh; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m13-20020a170902f64d00b00176d229eddasi3006386plg.70.2022.09.23.06.31.19; Fri, 23 Sep 2022 06:31:32 -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; dkim=pass header.i=@intel.com header.s=Intel header.b=VsXy10Kh; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230504AbiIWM4n (ORCPT + 99 others); Fri, 23 Sep 2022 08:56:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47838 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229549AbiIWM4m (ORCPT ); Fri, 23 Sep 2022 08:56:42 -0400 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9B6241397DA; Fri, 23 Sep 2022 05:56:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1663937800; x=1695473800; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=36jlH4FYtvGxIFhDwdZD5Pb0snW6hsWleCbEEs/RP2A=; b=VsXy10KhumrHu61+edBNsw4BW7oxSVjvIQ7MGYXKHvg2amwa+zTHORPp /YSGlD3BYXNkyHh1mGuvzWOvUFO7G7VJins0adTsIAHMZUOJ1Druy+vMC i2rePyuBjspiJCYFywa92hJslS2CQmEJKAXjwyrFdtyZB2r/hP3nx1bfr MrnOxfNs9DSufxUsFQyuDGMxXQmqTllDCuTB9quAsbW91EMWw931dI4hG iy/VZnZgWZepLI6uXoEVD/ENiw8qm5hpST9X21W0Hoctm54x8chDHc483 4TstjfQ+6mrBHeFznnNPY6qZtvp/JW9iKAVpuj7OHqHKki9YQAYhfCVBF g==; X-IronPort-AV: E=McAfee;i="6500,9779,10479"; a="300568210" X-IronPort-AV: E=Sophos;i="5.93,339,1654585200"; d="scan'208";a="300568210" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Sep 2022 05:56:40 -0700 X-IronPort-AV: E=Sophos;i="5.93,339,1654585200"; d="scan'208";a="762606548" Received: from punajuuri.fi.intel.com (HELO paasikivi.fi.intel.com) ([10.237.72.43]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Sep 2022 05:56:36 -0700 Received: from paasikivi.fi.intel.com (localhost [127.0.0.1]) by paasikivi.fi.intel.com (Postfix) with ESMTP id 8E80C20124; Fri, 23 Sep 2022 15:56:34 +0300 (EEST) Date: Fri, 23 Sep 2022 12:56:34 +0000 From: Sakari Ailus To: Jammy Huang Cc: eajames@linux.ibm.com, mchehab@kernel.org, joel@jms.id.au, andrew@aj.id.au, linux-media@vger.kernel.org, openbmc@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org, hverkuil-cisco@xs4all.nl, ezequiel@vanguardiasur.com.ar, nicolas.dufresne@collabora.com, stanimir.varbanov@linaro.org, laurent.pinchart@ideasonboard.com, ribalda@chromium.org Subject: Re: [PATCH v9 1/4] media: v4l: Add definition for the Aspeed JPEG format Message-ID: References: <20220921025112.13150-1-jammy_huang@aspeedtech.com> <20220921025112.13150-2-jammy_huang@aspeedtech.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20220921025112.13150-2-jammy_huang@aspeedtech.com> X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,SPF_HELO_NONE, SPF_NONE 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 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 ? 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. > .. 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 */ -- Kind regards, Sakari Ailus