Patch Detail
Show a patch.
GET /api/patches/16868/?format=api
{ "id": 16868, "url": "https://patchwork.libcamera.org/api/patches/16868/?format=api", "web_url": "https://patchwork.libcamera.org/patch/16868/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20220729145042.531757-1-umang.jain@ideasonboard.com>", "date": "2022-07-29T14:50:42", "name": "[libcamera-devel] libcamera: v4l2: Pass set colorspace flags", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "c247dc74501b203dbb24bfef9b169eab75e42ea7", "submitter": { "id": 86, "url": "https://patchwork.libcamera.org/api/people/86/?format=api", "name": "Umang Jain", "email": "umang.jain@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/16868/mbox/", "series": [ { "id": 3349, "url": "https://patchwork.libcamera.org/api/series/3349/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3349", "date": "2022-07-29T14:50:42", "name": "[libcamera-devel] libcamera: v4l2: Pass set colorspace flags", "version": 1, "mbox": "https://patchwork.libcamera.org/series/3349/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/16868/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/16868/checks/", "tags": {}, "headers": { "Return-Path": "<libcamera-devel-bounces@lists.libcamera.org>", "X-Original-To": "parsemail@patchwork.libcamera.org", "Delivered-To": "parsemail@patchwork.libcamera.org", "Received": [ "from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id C89CEBE173\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 29 Jul 2022 14:51:27 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 05B7E603EC;\n\tFri, 29 Jul 2022 16:51:27 +0200 (CEST)", "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id EEC24603EC\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 29 Jul 2022 16:51:24 +0200 (CEST)", "from perceval.ideasonboard.com (unknown\n\t[IPv6:2401:4900:1f3e:f7a:bc8f:12ed:b45f:c35d])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id E213A6D4;\n\tFri, 29 Jul 2022 16:51:10 +0200 (CEST)" ], "DKIM-Signature": [ "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1659106287;\n\tbh=BPZEkkHv84ifSq76XhHxJTdiOXsmi22+aUgR1F+vj/k=;\n\th=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post:\n\tList-Help:List-Subscribe:From:Reply-To:Cc:From;\n\tb=n17N1pTWtdgHCQQBezjdnn2W8FuwkCs/qfBjwNZDgfIyuq7Bl2QaHpH2EcgHWOhL4\n\tgW5t8mybSfsaoqdfpZPryBEG0uHeRDQTCgRe/7wQDlaSoabeAfU2Hfgy7YkjfuuA27\n\tVNbRzuZyTw4lqtsoRBsQz8sBlY5LcUPA8xYBUwPodIZDLM8uCo6Q1Clp4db0aAgLxd\n\tiUVCqKpnRWSAakTDz0HrjZ/+EqccVYFL5EkGFin3Iiz88lcViHHE2WLflU9ohLVTAu\n\tP4Og86D4KNgVzu5TkpCVZGpSSVZa7yMYiH3Kt3DIeZhS2QcFDonhgryQmfCSOn05ke\n\tok99QIkT/C+8w==", "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1659106284;\n\tbh=BPZEkkHv84ifSq76XhHxJTdiOXsmi22+aUgR1F+vj/k=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=hJ6y8qlBGFBTuhpoCJNfm60/yVWg6SbGYjy690/WCRSIHCojKTsnHB7TDG5/3oaoN\n\t72WWJeAO5/dTMEbtxjYNA9K11cN1yc+bRiR94NUMtzWWhhtc1svr2QK7fIqfITwIMM\n\tDl8BbceIOvGIwfdnhc+iFQQtFewlcbfzYUPVOTWI=" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"hJ6y8qlB\"; dkim-atps=neutral", "To": "libcamera-devel@lists.libcamera.org", "Date": "Fri, 29 Jul 2022 20:20:42 +0530", "Message-Id": "<20220729145042.531757-1-umang.jain@ideasonboard.com>", "X-Mailer": "git-send-email 2.31.1", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH] libcamera: v4l2: Pass set colorspace flags", "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>", "From": "Umang Jain via libcamera-devel <libcamera-devel@lists.libcamera.org>", "Reply-To": "Umang Jain <umang.jain@ideasonboard.com>", "Cc": "rishikeshdonadkar@gmail.com", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "The colorspace fields as read-only from an application point of view,\nboth on video devices and on subdevs, unless the\nV4L2_PIX_FMT_FLAG_SET_CSC or V4L2_MBUS_FRAMEFMT_SET_CSC flags\n(respectively) are set when calling the S_FMT ioctl.\n\nSigned-off-by: Umang Jain <umang.jain@ideasonboard.com>\n---\n src/libcamera/v4l2_subdevice.cpp | 3 ++-\n src/libcamera/v4l2_videodevice.cpp | 6 ++++--\n 2 files changed, 6 insertions(+), 3 deletions(-)", "diff": "diff --git a/src/libcamera/v4l2_subdevice.cpp b/src/libcamera/v4l2_subdevice.cpp\nindex 98a3911a..815c676e 100644\n--- a/src/libcamera/v4l2_subdevice.cpp\n+++ b/src/libcamera/v4l2_subdevice.cpp\n@@ -459,7 +459,8 @@ int V4L2Subdevice::setFormat(unsigned int pad, V4L2SubdeviceFormat *format,\n \tsubdevFmt.format.height = format->size.height;\n \tsubdevFmt.format.code = format->mbus_code;\n \tsubdevFmt.format.field = V4L2_FIELD_NONE;\n-\tfromColorSpace(format->colorSpace, subdevFmt.format);\n+\tif (fromColorSpace(format->colorSpace, subdevFmt.format) == 0)\n+\t\tsubdevFmt.format.flags |= V4L2_MBUS_FRAMEFMT_SET_CSC;\n \n \tint ret = ioctl(VIDIOC_SUBDEV_S_FMT, &subdevFmt);\n \tif (ret) {\ndiff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp\nindex 63911339..a969f7fa 100644\n--- a/src/libcamera/v4l2_videodevice.cpp\n+++ b/src/libcamera/v4l2_videodevice.cpp\n@@ -940,7 +940,8 @@ int V4L2VideoDevice::trySetFormatMultiplane(V4L2DeviceFormat *format, bool set)\n \tpix->pixelformat = format->fourcc;\n \tpix->num_planes = format->planesCount;\n \tpix->field = V4L2_FIELD_NONE;\n-\tfromColorSpace(format->colorSpace, *pix);\n+\tif (fromColorSpace(format->colorSpace, *pix) == 0)\n+\t\tpix->flags |= V4L2_PIX_FMT_FLAG_SET_CSC;\n \n \tASSERT(pix->num_planes <= std::size(pix->plane_fmt));\n \n@@ -1010,7 +1011,8 @@ int V4L2VideoDevice::trySetFormatSingleplane(V4L2DeviceFormat *format, bool set)\n \tpix->pixelformat = format->fourcc;\n \tpix->bytesperline = format->planes[0].bpl;\n \tpix->field = V4L2_FIELD_NONE;\n-\tfromColorSpace(format->colorSpace, *pix);\n+\tif (fromColorSpace(format->colorSpace, *pix) == 0)\n+\t\tpix->flags |= V4L2_PIX_FMT_FLAG_SET_CSC;\n \n \tret = ioctl(set ? VIDIOC_S_FMT : VIDIOC_TRY_FMT, &v4l2Format);\n \tif (ret) {\n", "prefixes": [ "libcamera-devel" ] }