[{"id":5165,"web_url":"https://patchwork.libcamera.org/comment/5165/","msgid":"<20200610143911.GF192296@oden.dyn.berto.se>","date":"2020-06-10T14:39:11","subject":"Re: [libcamera-devel] [PATCH v2 4/7] v4l2: Replace explicit DRM\n\tFourCCs with libcamera formats","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/people/5/","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"content":"Hi Laurent,\n\nThanks for your patch.\n\nOn 2020-06-10 02:23:20 +0300, Laurent Pinchart wrote:\n> Use the new pixel format constants to replace usage of macros from\n> drm_fourcc.h.\n> \n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\nReviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n\n> ---\n>  src/v4l2/v4l2_camera_proxy.cpp | 29 +++++++++++++++--------------\n>  1 file changed, 15 insertions(+), 14 deletions(-)\n> \n> diff --git a/src/v4l2/v4l2_camera_proxy.cpp b/src/v4l2/v4l2_camera_proxy.cpp\n> index 308a8abf9978..58b136053b04 100644\n> --- a/src/v4l2/v4l2_camera_proxy.cpp\n> +++ b/src/v4l2/v4l2_camera_proxy.cpp\n> @@ -16,6 +16,7 @@\n>  #include <unistd.h>\n>  \n>  #include <libcamera/camera.h>\n> +#include <libcamera/formats.h>\n>  #include <libcamera/object.h>\n>  \n>  #include \"libcamera/internal/log.h\"\n> @@ -559,28 +560,28 @@ namespace {\n>  \n>  static const std::array<PixelFormatInfo, 14> pixelFormatInfo = {{\n>  \t/* RGB formats. */\n> -\t{ PixelFormat(DRM_FORMAT_RGB888),\tV4L2_PIX_FMT_BGR24,\t1, {{ { 24, 1, 1 }, {  0, 0, 0 }, {  0, 0, 0 } }} },\n> -\t{ PixelFormat(DRM_FORMAT_BGR888),\tV4L2_PIX_FMT_RGB24,\t1, {{ { 24, 1, 1 }, {  0, 0, 0 }, {  0, 0, 0 } }} },\n> -\t{ PixelFormat(DRM_FORMAT_BGRA8888),\tV4L2_PIX_FMT_ARGB32,\t1, {{ { 32, 1, 1 }, {  0, 0, 0 }, {  0, 0, 0 } }} },\n> +\t{ formats::RGB888,\tV4L2_PIX_FMT_BGR24,\t1, {{ { 24, 1, 1 }, {  0, 0, 0 }, {  0, 0, 0 } }} },\n> +\t{ formats::BGR888,\tV4L2_PIX_FMT_RGB24,\t1, {{ { 24, 1, 1 }, {  0, 0, 0 }, {  0, 0, 0 } }} },\n> +\t{ formats::BGRA8888,\tV4L2_PIX_FMT_ARGB32,\t1, {{ { 32, 1, 1 }, {  0, 0, 0 }, {  0, 0, 0 } }} },\n>  \t/* YUV packed formats. */\n> -\t{ PixelFormat(DRM_FORMAT_UYVY),\t\tV4L2_PIX_FMT_UYVY,\t1, {{ { 16, 1, 1 }, {  0, 0, 0 }, {  0, 0, 0 } }} },\n> -\t{ PixelFormat(DRM_FORMAT_VYUY),\t\tV4L2_PIX_FMT_VYUY,\t1, {{ { 16, 1, 1 }, {  0, 0, 0 }, {  0, 0, 0 } }} },\n> -\t{ PixelFormat(DRM_FORMAT_YUYV),\t\tV4L2_PIX_FMT_YUYV,\t1, {{ { 16, 1, 1 }, {  0, 0, 0 }, {  0, 0, 0 } }} },\n> -\t{ PixelFormat(DRM_FORMAT_YVYU),\t\tV4L2_PIX_FMT_YVYU,\t1, {{ { 16, 1, 1 }, {  0, 0, 0 }, {  0, 0, 0 } }} },\n> +\t{ formats::UYVY,\tV4L2_PIX_FMT_UYVY,\t1, {{ { 16, 1, 1 }, {  0, 0, 0 }, {  0, 0, 0 } }} },\n> +\t{ formats::VYUY,\tV4L2_PIX_FMT_VYUY,\t1, {{ { 16, 1, 1 }, {  0, 0, 0 }, {  0, 0, 0 } }} },\n> +\t{ formats::YUYV,\tV4L2_PIX_FMT_YUYV,\t1, {{ { 16, 1, 1 }, {  0, 0, 0 }, {  0, 0, 0 } }} },\n> +\t{ formats::YVYU,\tV4L2_PIX_FMT_YVYU,\t1, {{ { 16, 1, 1 }, {  0, 0, 0 }, {  0, 0, 0 } }} },\n>  \t/* YUY planar formats. */\n> -\t{ PixelFormat(DRM_FORMAT_NV12),\t\tV4L2_PIX_FMT_NV12,\t2, {{ {  8, 1, 1 }, { 16, 2, 2 }, {  0, 0, 0 } }} },\n> -\t{ PixelFormat(DRM_FORMAT_NV21),\t\tV4L2_PIX_FMT_NV21,\t2, {{ {  8, 1, 1 }, { 16, 2, 2 }, {  0, 0, 0 } }} },\n> -\t{ PixelFormat(DRM_FORMAT_NV16),\t\tV4L2_PIX_FMT_NV16,\t2, {{ {  8, 1, 1 }, { 16, 2, 1 }, {  0, 0, 0 } }} },\n> -\t{ PixelFormat(DRM_FORMAT_NV61),\t\tV4L2_PIX_FMT_NV61,\t2, {{ {  8, 1, 1 }, { 16, 2, 1 }, {  0, 0, 0 } }} },\n> -\t{ PixelFormat(DRM_FORMAT_NV24),\t\tV4L2_PIX_FMT_NV24,\t2, {{ {  8, 1, 1 }, { 16, 1, 1 }, {  0, 0, 0 } }} },\n> -\t{ PixelFormat(DRM_FORMAT_NV42),\t\tV4L2_PIX_FMT_NV42,\t2, {{ {  8, 1, 1 }, { 16, 1, 1 }, {  0, 0, 0 } }} },\n> +\t{ formats::NV12,\tV4L2_PIX_FMT_NV12,\t2, {{ {  8, 1, 1 }, { 16, 2, 2 }, {  0, 0, 0 } }} },\n> +\t{ formats::NV21,\tV4L2_PIX_FMT_NV21,\t2, {{ {  8, 1, 1 }, { 16, 2, 2 }, {  0, 0, 0 } }} },\n> +\t{ formats::NV16,\tV4L2_PIX_FMT_NV16,\t2, {{ {  8, 1, 1 }, { 16, 2, 1 }, {  0, 0, 0 } }} },\n> +\t{ formats::NV61,\tV4L2_PIX_FMT_NV61,\t2, {{ {  8, 1, 1 }, { 16, 2, 1 }, {  0, 0, 0 } }} },\n> +\t{ formats::NV24,\tV4L2_PIX_FMT_NV24,\t2, {{ {  8, 1, 1 }, { 16, 1, 1 }, {  0, 0, 0 } }} },\n> +\t{ formats::NV42,\tV4L2_PIX_FMT_NV42,\t2, {{ {  8, 1, 1 }, { 16, 1, 1 }, {  0, 0, 0 } }} },\n>  \t/* Compressed formats. */\n>  \t/*\n>  \t * \\todo Get a better image size estimate for MJPEG, via\n>  \t * StreamConfiguration, instead of using the worst-case\n>  \t * width * height * bpp of uncompressed data.\n>  \t */\n> -\t{ PixelFormat(DRM_FORMAT_MJPEG),\tV4L2_PIX_FMT_MJPEG,\t1, {{ { 16, 1, 1 }, {  0, 0, 0 }, {  0, 0, 0 } }} },\n> +\t{ formats::MJPEG,\tV4L2_PIX_FMT_MJPEG,\t1, {{ { 16, 1, 1 }, {  0, 0, 0 }, {  0, 0, 0 } }} },\n>  }};\n>  \n>  } /* namespace */\n> -- \n> Regards,\n> \n> Laurent Pinchart\n> \n> _______________________________________________\n> libcamera-devel mailing list\n> libcamera-devel@lists.libcamera.org\n> https://lists.libcamera.org/listinfo/libcamera-devel","headers":{"Return-Path":"<niklas.soderlund@ragnatech.se>","Received":["from mail-lf1-x143.google.com (mail-lf1-x143.google.com\n\t[IPv6:2a00:1450:4864:20::143])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D5564600F7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 10 Jun 2020 16:39:13 +0200 (CEST)","by mail-lf1-x143.google.com with SMTP id d7so1580790lfi.12\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 10 Jun 2020 07:39:13 -0700 (PDT)","from localhost (h-209-203.A463.priv.bahnhof.se. [155.4.209.203])\n\tby smtp.gmail.com with ESMTPSA id\n\t13sm5035759ljj.83.2020.06.10.07.39.12\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 10 Jun 2020 07:39:12 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected)\n\theader.d=ragnatech-se.20150623.gappssmtp.com\n\theader.i=@ragnatech-se.20150623.gappssmtp.com header.b=\"PMCUZm0t\"; \n\tdkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=ragnatech-se.20150623.gappssmtp.com; s=20150623;\n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:content-transfer-encoding:in-reply-to;\n\tbh=kr6/TUCyiAeayKma7eOiiIMOo6V8CaYOmgReOFS3qdg=;\n\tb=PMCUZm0tvFry+lvG67gMe2x0AhUZDnoZbQDVwqc9v7ohn8uB+tUQDZmCR/Mgpicwpb\n\tDFDe/N9Rs+456E2/S4+1DOLx78BNHgSl18MM/Fm+5i4cGqLu3JUnJYAznfP/wjJsX1Va\n\tCXhPg5uSU97YlGU7n2ho5hQRKaktzFyMzD4VeFgq3w8DJ7tU50U1nLYtdQZHaZYxCr7x\n\t1upI4R68/E14NjHhuaLEa4RfRTtJBKqMmjkxRrJZmzyZ5qsdi4XXmVsoCHuYBp1u87n/\n\tf0jjFSllkw9hDdufCWIqkD/WcFmu5J0sA+sVSMyQp6xJknt9MnpVoEkqcB2JNc6WHw75\n\tKQBA==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:content-transfer-encoding\n\t:in-reply-to;\n\tbh=kr6/TUCyiAeayKma7eOiiIMOo6V8CaYOmgReOFS3qdg=;\n\tb=A3B8GynXPfEOEi0CBXJUEOP7w+55BdKZcgAmKtyeZ6vKa7ZOcjQcyFYx9QtCsnaUvk\n\tW3zBFDKh4rdqknblDhhpE44zr/Eye0GtUP0tXVOVdfynDGePn/+QlqYsmri7bcPWtkio\n\t/39JY8skPbGI2UdCmLGKkaoU9OcfO2rjqxA3kbfMGPBPke2OybQemVyVPFUwkqBeiGCV\n\tjSm0wDa43EBvD8yhhxogriDJMR++n+tfh+dO89ey6irktfd4FqWleAqY3fwqDyF4AqGH\n\tLpS6KQViThAGmk2luMnXvxJrupyv5C7BmFNWNO/iB9zdF5+qCYILFziXI+0SXxAiO7lY\n\trw+w==","X-Gm-Message-State":"AOAM532EMdYDmq7ibIcRl8dIrHvtgVFU0tcTLLCk0lf00+aHdKoE5WXq\n\t9dorprdeCOxrXV+6kGKBLsigH9fQYic=","X-Google-Smtp-Source":"ABdhPJwk1f51zQWeL71TTDLJk7WfEVKjjiS8XqFbPCbcvZWlcla8p9R4ulXDRZq4+bJpYAma9Qx/qQ==","X-Received":"by 2002:ac2:5bc1:: with SMTP id u1mr1937993lfn.61.1591799953155; \n\tWed, 10 Jun 2020 07:39:13 -0700 (PDT)","Date":"Wed, 10 Jun 2020 16:39:11 +0200","From":"Niklas =?iso-8859-1?q?S=F6derlund?= <niklas.soderlund@ragnatech.se>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20200610143911.GF192296@oden.dyn.berto.se>","References":"<20200609232323.29628-1-laurent.pinchart@ideasonboard.com>\n\t<20200609232323.29628-5-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=iso-8859-1","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20200609232323.29628-5-laurent.pinchart@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH v2 4/7] v4l2: Replace explicit DRM\n\tFourCCs with libcamera formats","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","X-List-Received-Date":"Wed, 10 Jun 2020 14:39:14 -0000"}}]