Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp962036pxb; Wed, 3 Mar 2021 22:39:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJy2SZXiJ+NlUBzOKOmhHEEVQRqdeWosoSTH2pkD8yurpqo2c07ucwsF8YNixYpCT5wBQuHJ X-Received: by 2002:a17:906:b042:: with SMTP id bj2mr2535344ejb.261.1614839988444; Wed, 03 Mar 2021 22:39:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614839988; cv=none; d=google.com; s=arc-20160816; b=qqw79CP0N4z6NQ8NXYsklNmN7vMPlKlCEbgJuFakiR0MscgKS/6nzs8Xxmjgd4IYKW dWW28KRtkTL+trVfNAp2BCwb7OXU+JH9d/yZXek4+G0iwUmVUzvQ1JIAO7SkMsEw7QwI 3bz9Oi5XIgdhhwqxuBJ9LTkz1egVDX84HpomQYsnEGoQR9zfpJMYuHRyxznZAhAl0Eoi 5VQf9AwzLONxIkh0RrUtnspV5UNOafzYwniKovZvUCzsTDEowzhHjKeRkB6vpa+QR2P9 y9V9qJYICCO4PWgI0TZg0sAbOEGb2KZPxe5yAnssHS9I0tjrqwCzTLFLkLVG0zd2UtPd /bYg== 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 :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature; bh=NgErhWjVYS40cse08ZsXc39yhag5uGkh43eRrKni6lg=; b=tg/M0HJNy+5ifEyJCzKpvgwz8yEKeKkMEIW0qFbph8wHi0CmdZhSn/ESDQyO+xgdpg /AG5WASDEP3rHEmnAAyXdy6m+2pBGZGpObXEM9TtkVSDdbPkxFqci4u8XNTqMnM7y8x4 rwrl+Ts9/F32RigR2Ihe2G41FKwK7Fd8UKvJYLaaxCWaUICOZywf8qda7Xkq9Y5D3Vcg 3HmuUfluSsFjpVKv5QmHexfaEV1wtZPgrXI1qzk7lvRQdV4VQpxfKW7fPT15dKYAd9i2 UdMXd0kRRq0W/6QGdMGxwR+84Spy4xHL9QJft08rqgcceInBHNgfu2nwiUx456EumIA7 +BeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ndufresne-ca.20150623.gappssmtp.com header.s=20150623 header.b=ur8sCkRb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p23si17011648edw.196.2021.03.03.22.39.25; Wed, 03 Mar 2021 22:39:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ndufresne-ca.20150623.gappssmtp.com header.s=20150623 header.b=ur8sCkRb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1446245AbhCBU2I (ORCPT + 99 others); Tue, 2 Mar 2021 15:28:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50154 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241549AbhCBRjB (ORCPT ); Tue, 2 Mar 2021 12:39:01 -0500 Received: from mail-qt1-x836.google.com (mail-qt1-x836.google.com [IPv6:2607:f8b0:4864:20::836]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DBCBCC0617A9 for ; Tue, 2 Mar 2021 09:38:39 -0800 (PST) Received: by mail-qt1-x836.google.com with SMTP id v3so15381613qtw.4 for ; Tue, 02 Mar 2021 09:38:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ndufresne-ca.20150623.gappssmtp.com; s=20150623; h=message-id:subject:from:to:cc:date:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=NgErhWjVYS40cse08ZsXc39yhag5uGkh43eRrKni6lg=; b=ur8sCkRb3FMUhgW+QJadn9dMy4JISPa7I7yRBZGwGimMjGgjJvScQD944W2s39N1KK 5ZwY/Uref8JP5Hz0AoZk7uJej9PkNpVO5lnBNAd1BNMQLDR3FeLf5o3O2/Nl9o52Jz6c Mkl8fwYqr2OqxRunNzd9U2N5r/AG1omvgceB2aliRb5FS4hQJJHBiTYgLL9O1hr5jyqH 0mVCAU7VU9tlR+GoEy4FhWqk4WtQr03iwT7iAhKCfE+b/QojvK4/Na3r+NROo6aI6Rqg ZcitjEHBOZg2knRRNRzkoZxcHDVvk3aPSYJBewyYgbapyQ4VkDGgyFlqgXTcEheiJK9j rlCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=NgErhWjVYS40cse08ZsXc39yhag5uGkh43eRrKni6lg=; b=GkDLj1B5SpY3x7OXSK+/H9HUdVo/kytoLoS+PHD0Js1BW16jo5dGMlpU77ytRCZKfm PQeVZFt+4Ygv2owpN3J+keofpjN72EXVfcLagHiNJMepbTyTwvjxmVUqGSIxQdC3qE1x e/xvKdjZuU+ucUlzAxxWBqdVmwOE5oJ7d/Azp6nuAMw3xr8riBOlzSqgL+53p6YmH7QE FLKKtV7ZScA23cxueomdDKYcF60a08ySZ63IRxOpO+UeWZ22sRHWAqUV5HQfrjwd2nHa b5xia9A7LCHelN0Mkh+3yNM3uVt+OUYqgSFrJ/pH4Uw/nIZcZgXR8iEuD4EiOEKPEaOo 8GVQ== X-Gm-Message-State: AOAM5312FsnAyf4c3mGhp6jKCFoN69vQMtBCgi7JbMWgJyTMa+U7u6d2 rpH5t4vLb9PaYP5m3bwq41ibQw== X-Received: by 2002:ac8:4249:: with SMTP id r9mr18127959qtm.285.1614706718945; Tue, 02 Mar 2021 09:38:38 -0800 (PST) Received: from nicolas-tpx395.lan (173-246-12-168.qc.cable.ebox.net. [173.246.12.168]) by smtp.gmail.com with ESMTPSA id t6sm15339867qkd.127.2021.03.02.09.38.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Mar 2021 09:38:38 -0800 (PST) Message-ID: <4cb93f828695f7f6307077da466a58ba478c9824.camel@ndufresne.ca> Subject: Re: [PATCH v2 3/8] media: add Mediatek's MM21 format From: Nicolas Dufresne To: Alexandre Courbot , Tiffany Lin , Andrew-CT Chen , Rob Herring , Yunfei Dong Cc: Mauro Carvalho Chehab , Hans Verkuil , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org Date: Tue, 02 Mar 2021 12:38:37 -0500 In-Reply-To: <20210225101612.2832444-4-acourbot@chromium.org> References: <20210225101612.2832444-1-acourbot@chromium.org> <20210225101612.2832444-4-acourbot@chromium.org> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.38.3 (3.38.3-1.fc33) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le jeudi 25 février 2021 à 19:16 +0900, Alexandre Courbot a écrit : > Add Mediatek's non-compressed 8 bit block video mode. This format is > produced by the MT8183 codec and can be converted to a non-proprietary > format by the MDP3 component. > > Signed-off-by: Alexandre Courbot > --- >  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 c9231e18859b..187ea89f7a25 100644 > --- a/Documentation/userspace-api/media/v4l/pixfmt-reserved.rst > +++ b/Documentation/userspace-api/media/v4l/pixfmt-reserved.rst > @@ -242,6 +242,13 @@ please make a proposal on the linux-media mailing list. >         It is 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-MM21: > + > +      - ``V4L2_PIX_FMT_MM21`` > +      - 'MM21' > +      - Non-compressed, tiled two-planar format used by Mediatek MT8183. > +       This is an opaque intermediate format and the MDP3 hardware can be > +       used to convert it to other formats. >      * .. _V4L2-PIX-FMT-SUNXI-TILED-NV12: The SUNXI one was a mistake, it's linear layout 32x32 tiles. The problem with calling this a vendor format, is that other vendor might be using it too. But they won't know and the format might endup duplicated, even if it's the same one. So here's my request, have you tried to understand a bit more what the tiling layout is ? Could be tiled + SAND, could use zigzag layout like Samsung do. I think if we can avoid vendor formats, we can preserve the pixel format list sanity here. Most of the HW I've encoutered was very easy to reverse, even if undocumented (except the compressed one). If not possible, I would like to suggest: V4L2_PIX_FMT_MTK_NV21 The important part is to add a clear seperation for the vendor name, it easy to recognize then. >   >        - ``V4L2_PIX_FMT_SUNXI_TILED_NV12`` > diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2- > core/v4l2-ioctl.c > index 31d1342e61e8..0b85b2bbc628 100644 > --- a/drivers/media/v4l2-core/v4l2-ioctl.c > +++ b/drivers/media/v4l2-core/v4l2-ioctl.c > @@ -1384,6 +1384,7 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt) >         case V4L2_PIX_FMT_TM6000:       descr = "A/V + VBI Mux Packet"; break; >         case V4L2_PIX_FMT_CIT_YYVYUY:   descr = "GSPCA CIT YYVYUY"; break; >         case V4L2_PIX_FMT_KONICA420:    descr = "GSPCA KONICA420"; break; > +       case V4L2_PIX_FMT_MM21:         descr = "Mediatek 8-bit block format"; > break; >         case V4L2_PIX_FMT_HSV24:        descr = "24-bit HSV 8-8-8"; break; >         case V4L2_PIX_FMT_HSV32:        descr = "32-bit XHSV 8-8-8-8"; break; >         case V4L2_SDR_FMT_CU8:          descr = "Complex U8"; break; > diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h > index 79dbde3bcf8d..e6890dae76ec 100644 > --- a/include/uapi/linux/videodev2.h > +++ b/include/uapi/linux/videodev2.h > @@ -731,6 +731,7 @@ struct v4l2_pix_format { >  #define V4L2_PIX_FMT_Y12I     v4l2_fourcc('Y', '1', '2', 'I') /* Greyscale > 12-bit L/R interleaved */ >  #define V4L2_PIX_FMT_Z16      v4l2_fourcc('Z', '1', '6', ' ') /* Depth data > 16-bit */ >  #define V4L2_PIX_FMT_MT21C    v4l2_fourcc('M', 'T', '2', '1') /* Mediatek > compressed block mode  */ > +#define V4L2_PIX_FMT_MM21     v4l2_fourcc('M', 'M', '2', '1') /* Mediatek 8- > bit block mode, two non-contiguous planes */ >  #define V4L2_PIX_FMT_INZI     v4l2_fourcc('I', 'N', 'Z', 'I') /* Intel Planar > Greyscale 10-bit and Depth 16-bit */ >  #define V4L2_PIX_FMT_SUNXI_TILED_NV12 v4l2_fourcc('S', 'T', '1', '2') /* > Sunxi Tiled NV12 Format */ >  #define V4L2_PIX_FMT_CNF4     v4l2_fourcc('C', 'N', 'F', '4') /* Intel 4-bit > packed depth confidence information */