From patchwork Mon May 23 05:25:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marvin Lin X-Patchwork-Id: 12858432 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2202AC433EF for ; Mon, 23 May 2022 05:26:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355600AbiEWF0n (ORCPT ); Mon, 23 May 2022 01:26:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46594 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355608AbiEWF0U (ORCPT ); Mon, 23 May 2022 01:26:20 -0400 Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7FA88BC1C; Sun, 22 May 2022 22:26:16 -0700 (PDT) Received: by mail-pj1-x102a.google.com with SMTP id l20-20020a17090a409400b001dd2a9d555bso12683112pjg.0; Sun, 22 May 2022 22:26:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=W3bZk2RgbGLiBzgiA1wbLysvDZIqXxx7I9gmSpoK2zk=; b=GGZZqE1G6hJLr/ahJFr3gQhYnlnoomS7qy2XXTXrFVfSdeMJqBE/k4+DYwU45vsRSz N+YbHvIFA+fZJwRk5MqDEIfiIaIvoOgROM/qMAdNsbOOW5TLDEJNQ+a63B2TP7VXhTmM 3j6Uau1BEKbaS1GpEe0CWZfiFOkVOMPxFs250Lxxf92LiWmptKSVvcxQ3zwaoh4/q+oZ h7LivN6dKp3+d3k4OiGUW0WjOZ0MfW2bb1rXV7Eq1cdi1EEEwTfQjLFa+Sblb4WcZhU3 oYaw+EzMUKnn+SkLGZN8EyWwRsjnR/D5hDkTIPScarHQvTmd2/yOKcStZmdaJzA3JVlk C1Og== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=W3bZk2RgbGLiBzgiA1wbLysvDZIqXxx7I9gmSpoK2zk=; b=1ZFxPYKz41oUU7A1zweyf7NAsWjZxUNosBPImYNZFrCGfouSktETAoV4Pbuxv8t2ys gvGz8QLKhalaL5IK+wFh7MgNkOEV8picbGN8NqHR6iAvmGaWJZGikZeV0E21FXvzUkF9 SotA22XOsP2mpRbA45S2LB+xfgkg0QhJdJLZoLu9pi74Vf3HCfPpNv8qx92Vyf246GAM Dd0558lRCxJyqRbQd51kiqfokqVoeABu6mue2or7glTjTDSmawyr/MK+R8B0Y/QL+FNU LbFHXt1xA+pH0sOFQvNfLSdai/Uo087drKTEJPzQfnQ8uNR32zSGl0Q9FhXNkz85EjfA JG0g== X-Gm-Message-State: AOAM532FwmXjl04vrH1xdRf/nqKiUQYqHF4UTqBIYozaKwIvx0jbxWuh c2hOv5so3C5cqIuUuRd7Nbw= X-Google-Smtp-Source: ABdhPJwe47I2RtwOfEOVMvSG6THGgoQB0BelOFvSFBpoaS7XBR1cEiNWZrLKxIfwLBlI4mk0tBslHw== X-Received: by 2002:a17:903:1211:b0:15e:8208:8cc0 with SMTP id l17-20020a170903121100b0015e82088cc0mr21755804plh.52.1653283575987; Sun, 22 May 2022 22:26:15 -0700 (PDT) Received: from localhost.localdomain (60-250-192-107.hinet-ip.hinet.net. [60.250.192.107]) by smtp.gmail.com with ESMTPSA id y5-20020a655285000000b003c14af50603sm3871523pgp.27.2022.05.22.22.26.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 May 2022 22:26:15 -0700 (PDT) From: Marvin Lin To: mchehab@kernel.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Cc: openbmc@lists.ozlabs.org, avifishman70@gmail.com, tmaimon77@gmail.com, tali.perry1@gmail.com, kwliu@nuvoton.com, kflin@nuvoton.com, Marvin Lin Subject: [PATCH v4 4/5] media: Add HEXTILE compressed format Date: Mon, 23 May 2022 13:25:47 +0800 Message-Id: <20220523052548.28109-5-milkfafa@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220523052548.28109-1-milkfafa@gmail.com> References: <20220523052548.28109-1-milkfafa@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Add HEXTILE compressed format. This format is defined in Remote Framebuffer Protocol (RFC 6143) and is used by Encoding Compression Engine 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 cabfa34b7db5..bad2b9a2f16e 100644 --- a/Documentation/userspace-api/media/v4l/pixfmt-reserved.rst +++ b/Documentation/userspace-api/media/v4l/pixfmt-reserved.rst @@ -239,6 +239,13 @@ please make a proposal on the linux-media mailing list. It remains an opaque intermediate format and the MDP hardware must be used to convert ``V4L2_PIX_FMT_MT21C`` to ``V4L2_PIX_FMT_NV12M``, ``V4L2_PIX_FMT_YUV420M`` or ``V4L2_PIX_FMT_YVU420``. + * .. _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 96e307fe3aab..9365519d65bb 100644 --- a/drivers/media/v4l2-core/v4l2-ioctl.c +++ b/drivers/media/v4l2-core/v4l2-ioctl.c @@ -1441,6 +1441,7 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt) case V4L2_PIX_FMT_SE401: descr = "GSPCA SE401"; break; case V4L2_PIX_FMT_S5C_UYVY_JPG: descr = "S5C73MX interleaved UYVY/JPEG"; break; case V4L2_PIX_FMT_MT21C: descr = "Mediatek Compressed Format"; 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 3768a0a80830..1c7af015b43b 100644 --- a/include/uapi/linux/videodev2.h +++ b/include/uapi/linux/videodev2.h @@ -746,6 +746,7 @@ struct v4l2_pix_format { #define V4L2_PIX_FMT_INZI v4l2_fourcc('I', 'N', 'Z', 'I') /* Intel Planar Greyscale 10-bit and Depth 16-bit */ #define V4L2_PIX_FMT_CNF4 v4l2_fourcc('C', 'N', 'F', '4') /* Intel 4-bit packed depth confidence information */ #define V4L2_PIX_FMT_HI240 v4l2_fourcc('H', 'I', '2', '4') /* BTTV 8-bit dithered RGB */ +#define V4L2_PIX_FMT_HEXTILE v4l2_fourcc('H', 'X', 'T', 'L') /* Hextile compression */ /* 10bit raw bayer 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 */