From patchwork Fri Sep 22 06:24:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marvin Lin X-Patchwork-Id: 143514 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp5677095vqi; Fri, 22 Sep 2023 08:45:39 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFMICn5pzB3LFS+rZTIhp9u4x0YDr6HYYhm8K/7pYOmS6R8ju2jzv16+cM+DIR2elmN4WDr X-Received: by 2002:a05:6a00:1508:b0:68b:c562:da65 with SMTP id q8-20020a056a00150800b0068bc562da65mr9232268pfu.26.1695397539232; Fri, 22 Sep 2023 08:45:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695397539; cv=none; d=google.com; s=arc-20160816; b=Xyxb7/FObrSJA2OwLUECCEDOSoTcKfGYJUzqFaAPj7glclNMLY1m0HyeFWXXWLHFSJ HsjCDMxTFxZ0A5WmBLopx0QHO4KqcI8ih4WW+tOyn9PVckA+Ae851JPR0B6NmeiKsNb7 emO/RWbMaF77GDPWVPR/SjH/m5Djlv+T+jI/2qIRhEqOd473Dd2iuwwI61RmFtyyFeBB zI0F2m1cOe1dDGKZGmwMRbHvYLj0kb7AgG6zMSYNF8ist2y0Og6SlI+RDa09EEnY0lgS Vsu2doex76eXZSnU5fy0HRpHynYHVmYvPcyAk4uIjWTCT/bLxg/3nPmQB/pkVct/lutR L2vg== 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:cc:to:from :dkim-signature; bh=MwbtYXnybBb97SoCFL69GICK++fjeLJoanazsQv4oQE=; fh=xBghLVJ38U+eRNIQrKEyVqy4BQd/TtV/mGsuI9aroXU=; b=ZdIYEUng+u3Ul8w1U8UpyK66mPIkOAiiVAB2emKMs0bM/rfIWdYHEBYLw/fLPaQDRI ndHHuYCA6jJJP3bZWLChhOVDNaya2aBHXPkCbNqYrfairK56uu3lHmWuoxF1X90hg7s9 DwmlNggb4TadB/w6dhxBFRlRVyVfyuGsWwBrfZlYRlsrIpy49AyQWZrZ8iJYKZHdOOSe Aue7yQBam5MpQiEozkkY4gpbr7f6Po0iWWT6rj0LIjXoP1GCPRBlESPsS1whmw+51UVb FFm6RU9dk2nu+92wVLdtGIBJHxRXutcBj3TG1+9VBzR6PNhX1D/XXWcmpICUhLHcH7UB RIRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=BnM94DqY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id by6-20020a056a00400600b0068fc2f7cef3si3938693pfb.358.2023.09.22.08.45.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Sep 2023 08:45:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=BnM94DqY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id B9635803FC1D; Thu, 21 Sep 2023 23:26:02 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231548AbjIVGZF (ORCPT + 30 others); Fri, 22 Sep 2023 02:25:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231352AbjIVGYh (ORCPT ); Fri, 22 Sep 2023 02:24:37 -0400 Received: from mail-pf1-x42b.google.com (mail-pf1-x42b.google.com [IPv6:2607:f8b0:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C331B1A1; Thu, 21 Sep 2023 23:24:30 -0700 (PDT) Received: by mail-pf1-x42b.google.com with SMTP id d2e1a72fcca58-692ada71d79so152539b3a.1; Thu, 21 Sep 2023 23:24:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695363870; x=1695968670; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=MwbtYXnybBb97SoCFL69GICK++fjeLJoanazsQv4oQE=; b=BnM94DqYWYL6US+1UU/yEFnWFTuia6k7MTucJ//NknNK6cQMdac2OEFcaVMJMGlNo0 UQUNlKOTywP627GGuBgQox/pCcVUtKby8KPbLUAHfQQ0HIX2qCJfcIS51R9Oj673sst4 /8yXkHPWTIj7s17GyhcOKQyMoePxAupnr817gaoGu7Ej/Ovm45pamRKDE/z1/P2mjL9g zhIIBuTT4HK4QSTOBwe4Nq4VyM1Gfv9hiWiXlxYy2Tic9XpjMtIRSd/x18YetpeuUaVI MCmGisRmMGqY8fzYmY8WymwQlVG7vB0M2gGsJof5rLnIjA1Dgphb1DnBnrzgj8HZWFQo PqDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695363870; x=1695968670; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MwbtYXnybBb97SoCFL69GICK++fjeLJoanazsQv4oQE=; b=YuR+xjNxyc+0GplBkxRuyTj5Ux3GqKQ+tu06aNcdPXPk/sDymqwJy3HrOqPPM2EFi0 AcSzG6llcCz/oyB7zvywowz3Kk1KvuOnwR1be0WcJETf0+kg2RXXIg/O4Cq4p+BbnjWN 4oXqn3TZtrv3cdxA1ws4LbmWuqSflEi4Bt0Vj11oMVdZJpIC/bE2Oid105O/P34vC69x h9XBgLVBlUB5Xw8LIgT21FzKQTZoj14xV/D61sNfYYM9yqC+VbQf1RTrvtwesEmd8YhC IZhjxUBwiNVPqrXDGtWiACq7vn/9sAyaHEkGOaGknLKtDlbjpi24Dxgg56hsWlLNyRbw lM2Q== X-Gm-Message-State: AOJu0YzOw0WHhpX1Kt0ZtQvew3Pc/z54ZgieO8TVNdpQpvGUsgTa91t+ 66fHW6pVbawEm+lfvf7IjON3G+UQ0KEVbg== X-Received: by 2002:a05:6a20:325a:b0:153:73dd:282c with SMTP id hm26-20020a056a20325a00b0015373dd282cmr6678561pzc.58.1695363870144; Thu, 21 Sep 2023 23:24:30 -0700 (PDT) Received: from hcdev-d520mt2.. (60-250-192-107.hinet-ip.hinet.net. [60.250.192.107]) by smtp.gmail.com with ESMTPSA id m11-20020a17090ade0b00b00274de7c8aacsm4157417pjv.45.2023.09.21.23.24.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Sep 2023 23:24:29 -0700 (PDT) From: Marvin Lin To: mchehab@kernel.org, hverkuil-cisco@xs4all.nl, avifishman70@gmail.com, tmaimon77@gmail.com, tali.perry1@gmail.com, venture@google.com, yuenn@google.com, benjaminfair@google.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, andrzej.p@collabora.com Cc: devicetree@vger.kernel.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, openbmc@lists.ozlabs.org, kwliu@nuvoton.com, kflin@nuvoton.com, Marvin Lin , Nicolas Dufresne Subject: [PATCH v16 4/7] media: v4l: Add HEXTILE compressed format Date: Fri, 22 Sep 2023 14:24:02 +0800 Message-Id: <20230922062405.2571850-5-milkfafa@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230922062405.2571850-1-milkfafa@gmail.com> References: <20230922062405.2571850-1-milkfafa@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Thu, 21 Sep 2023 23:26:02 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777753169793075236 X-GMAIL-MSGID: 1777753169793075236 Add HEXTILE compressed format which is defined in Remote Framebuffer Protocol (RFC 6143, chapter 7.7.4 Hextile Encoding) and is used by Encoding Compression Engine (ECE) present on Nuvoton NPCM SoCs. Signed-off-by: Marvin Lin Reviewed-by: Nicolas Dufresne --- Documentation/userspace-api/media/v4l/pixfmt-reserved.rst | 7 +++++++ drivers/media/v4l2-core/v4l2-ioctl.c | 1 + include/uapi/linux/videodev2.h | 1 + 3 files changed, 9 insertions(+) diff --git a/Documentation/userspace-api/media/v4l/pixfmt-reserved.rst b/Documentation/userspace-api/media/v4l/pixfmt-reserved.rst index 296ad2025e8d..886ba7b08d6b 100644 --- a/Documentation/userspace-api/media/v4l/pixfmt-reserved.rst +++ b/Documentation/userspace-api/media/v4l/pixfmt-reserved.rst @@ -288,6 +288,13 @@ please make a proposal on the linux-media mailing list. - 'MT2110R' - This format is two-planar 10-Bit raster mode and having similitude with ``V4L2_PIX_FMT_MM21`` in term of alignment and tiling. Used for AVC. + * .. _V4L2-PIX-FMT-HEXTILE: + + - ``V4L2_PIX_FMT_HEXTILE`` + - 'HXTL' + - Compressed format used by Nuvoton NPCM video driver. This format is + defined in Remote Framebuffer Protocol (RFC 6143, chapter 7.7.4 Hextile + Encoding). .. raw:: latex \normalsize diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c index f4d9d6279094..9b1de54ce379 100644 --- a/drivers/media/v4l2-core/v4l2-ioctl.c +++ b/drivers/media/v4l2-core/v4l2-ioctl.c @@ -1510,6 +1510,7 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt) case V4L2_PIX_FMT_AV1_FRAME: descr = "AV1 Frame"; break; case V4L2_PIX_FMT_MT2110T: descr = "Mediatek 10bit Tile Mode"; break; case V4L2_PIX_FMT_MT2110R: descr = "Mediatek 10bit Raster Mode"; break; + case V4L2_PIX_FMT_HEXTILE: descr = "Hextile Compressed Format"; break; default: if (fmt->description[0]) return; diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h index 78260e5d9985..c3d4e490ce7c 100644 --- a/include/uapi/linux/videodev2.h +++ b/include/uapi/linux/videodev2.h @@ -804,6 +804,7 @@ struct v4l2_pix_format { #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 */ +#define V4L2_PIX_FMT_HEXTILE v4l2_fourcc('H', 'X', 'T', 'L') /* Hextile compressed */ /* 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 */