Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp4746307rwb; Tue, 20 Sep 2022 20:05:39 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5pr84Cd6ZHUUPSIqgasiNDOKJrUXYAZhHE73iSHMP1jWsHtOM74GG9dAQgXzW2AF8QWgxH X-Received: by 2002:a63:e317:0:b0:432:38c0:bde3 with SMTP id f23-20020a63e317000000b0043238c0bde3mr22287292pgh.567.1663729539729; Tue, 20 Sep 2022 20:05:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663729539; cv=none; d=google.com; s=arc-20160816; b=Z+m++UJ4I8TZIxrhh/NCV4OymXIS1LirBCVOoZ+mKSdmRQQoB6vBZdW8rqIVrhOE3u 8Cbd9rIjGso9ziY4EBHUqw5g9NS5gl7VGUOIbzRJ1cS4ibIbyOovNLlf16TEF36eYvUu HR132Lj8aYxDTQevxRtBAcUx/sOK8rRY79RH42ht9NuFIQ5W+QQQ5HaS59m5D1vVi5mU Zww+y5Xnh/gJw/2cyYVXMTUi5fvXetVx7i1AwuUocP+70xvfSIOeMX/Uk/5ROsKZKco4 qGHFSLQDGpRc0OHwsKX38g9KRs6CA7DD549tXITGiVM5lpjZAYRwBHKIf69bIPMiJnK1 1WZw== 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 :references:in-reply-to:message-id:date:subject:to:from; bh=IiGz8bRY7FIclQCdwPE/MlxfwP4lfaHXmh8pHoGFq8Y=; b=IT9OrZJTSG7xn3Mz4B1dCR7vy0W4xtQ21vR8xoSvsllz3XnMT1tmP6IQzzV8CHdSLI ur/LUsmOFAAWzh2x0uZvrJSkdd5gOe5bANFZVriC1SkCi00MXK1OEyaFAuD1Td6WT8gJ xArTPBPBgSiZxWkNqI21aWaZAqeXGHyBHzwWkM4x2bKk+rk7uFHJUUOdQac4xkDPNwU9 MapZ2VMRtkrbgs7O+11RK9tBsjLtFO0SVwQ7hRh1r6y+OyGQM51EjsS5j+lLtI79aXaO 2Er3LNwesVhcqtM8PQD50WGQbU6P1ci8QqqetzUBZBz2+c2sMGDGSVVl5KytZYJB1gf5 j3eg== 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 b10-20020a6541ca000000b00438efb7af04si1658302pgq.800.2022.09.20.20.05.28; Tue, 20 Sep 2022 20:05:39 -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 S231178AbiIUCwy (ORCPT + 99 others); Tue, 20 Sep 2022 22:52:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50124 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229811AbiIUCwn (ORCPT ); Tue, 20 Sep 2022 22:52:43 -0400 Received: from twspam01.aspeedtech.com (twspam01.aspeedtech.com [211.20.114.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 300D8252AB; Tue, 20 Sep 2022 19:52:41 -0700 (PDT) Received: from mail.aspeedtech.com ([192.168.0.24]) by twspam01.aspeedtech.com with ESMTP id 28L2U5Vs024711; Wed, 21 Sep 2022 10:30:06 +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, 21 Sep 2022 10:50:55 +0800 From: Jammy Huang To: , , , , , , , , , , , , , , , Subject: [PATCH v9 1/4] media: v4l: Add definition for the Aspeed JPEG format Date: Wed, 21 Sep 2022 10:51:09 +0800 Message-ID: <20220921025112.13150-2-jammy_huang@aspeedtech.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220921025112.13150-1-jammy_huang@aspeedtech.com> References: <20220921025112.13150-1-jammy_huang@aspeedtech.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" 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 28L2U5Vs024711 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS 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 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/ `__ .. 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 */ -- 2.25.1