{"id":17765,"url":"https://patchwork.libcamera.org/api/covers/17765/?format=json","web_url":"https://patchwork.libcamera.org/cover/17765/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20221110144556.7858-1-david.plowman@raspberrypi.com>","date":"2022-11-10T14:45:50","name":"[libcamera-devel,0/6] Resolve invalid attempts to set sensor flip controls","submitter":{"id":42,"url":"https://patchwork.libcamera.org/api/people/42/?format=json","name":"David Plowman","email":"david.plowman@raspberrypi.com"},"mbox":"https://patchwork.libcamera.org/cover/17765/mbox/","series":[{"id":3602,"url":"https://patchwork.libcamera.org/api/series/3602/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3602","date":"2022-11-10T14:45:50","name":"Resolve invalid attempts to set sensor flip controls","version":1,"mbox":"https://patchwork.libcamera.org/series/3602/mbox/"}],"comments":"https://patchwork.libcamera.org/api/covers/17765/comments/","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 29822BE08B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 10 Nov 2022 14:46:05 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 681FB6307B;\n\tThu, 10 Nov 2022 15:46:04 +0100 (CET)","from mail-wr1-x434.google.com (mail-wr1-x434.google.com\n\t[IPv6:2a00:1450:4864:20::434])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id CD0EE63075\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 10 Nov 2022 15:46:02 +0100 (CET)","by mail-wr1-x434.google.com with SMTP id l14so2593579wrw.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 10 Nov 2022 06:46:02 -0800 (PST)","from pi4-davidp.pitowers.org\n\t([2a00:1098:3142:14:e4a2:3070:eea4:e434])\n\tby smtp.gmail.com with ESMTPSA id\n\tu24-20020a7bc058000000b003b476cabf1csm5249759wmc.26.2022.11.10.06.46.00\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 10 Nov 2022 06:46:01 -0800 (PST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1668091564;\n\tbh=9OADKeLw8HgOVztOydaxFZr1tytD7RiIREmYjiHS/3I=;\n\th=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post:\n\tList-Help:List-Subscribe:From:Reply-To:From;\n\tb=UBW0lqTj89tL6gWuSOZhMQRY8Di/tWsVAanB9QqK+MNVPRQzo7TKdgB9xbrx1feGB\n\tJLWzJEt5kjqP+RoOIAOah+2LuMp/2kLMC2WgzbpzyFaZjH+1t/QpvIVpWEWZyfBNSe\n\tttOYKTFUyH2pctATmCS24O+Yrxx4ZhekiacEXUS74utPTP5k8DDefT8sm+4yEiGV1P\n\tyWqCC/X7ZVTlCbQp7mtAem41BykZ79JZuvftFp3n3gQ3VUoWdhwbVsQsxeZEHVW/jL\n\tqS8PACmoDYPeHyvLhSeqjz4OUYpbHLtYBFDfElBXup9XtGOej/EOFAkQHYL1w8vL65\n\t3nvOEzCwb54VQ==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=content-transfer-encoding:mime-version:message-id:date:subject:cc\n\t:to:from:from:to:cc:subject:date:message-id:reply-to;\n\tbh=nCYPiN1hqy5W681pPKC8EMTYkD8WMWkbLFten5TNAUo=;\n\tb=h2R1cHkoJR1yC6PSYUsh+bWqiGgmOaDRc2CiNUWE/gojnZWmd40wJAQxlj0CJENdse\n\te310LLbrJkpK/5gp1x7z7qH1P0ytVqDIVQc6pNmNmXbLIyiF4b1gMqUKIVBAy3lMjHuz\n\tJ4R/JNnxgKUvghRi8yBaeh9IXT/mz5C9A32Pa6B0CfJb3ZVC6U29q+SjA6JFqf2gdPDS\n\tu1Z73yaUEIzc2KATj2T911ocP+SPx6dXnZTC1xDhL8mezPdA4Snqb58J0BUDVcyrOLRY\n\tBxwvwFwNizho1kiAxr1SdTWuzt8McKWjbKs1oQbcAaJs/DOWU5RDTFcIqD6rKBNE4j90\n\th8wg=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"h2R1cHko\"; dkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=content-transfer-encoding:mime-version:message-id:date:subject:cc\n\t:to:from:x-gm-message-state:from:to:cc:subject:date:message-id\n\t:reply-to;\n\tbh=nCYPiN1hqy5W681pPKC8EMTYkD8WMWkbLFten5TNAUo=;\n\tb=qVvKDwGDRlkTssqomw59kEiEvlLiHS9qlmoW/N79Dp9to/6S1JwR0UoLNCMdvCWCNC\n\tJXcm9Q2xwxz/1bEtefcwrkhPKrvDA6ZoNdmpyStozM/kyVaQozaEbF3VAvOcZhaop/s1\n\tkfFM4lXeP/S76js+BgmqEA7iY/P5WE8cyGRDPEQ8aHaVNA3gm3yUWppCJbAuaWwGP+cq\n\tnutd9QUE8IlQl155GgTQWe3AwUmrIWlsdCOxB/jN1OpHBlZcKeYNkyI/0RgqeBuQL2/v\n\t2zwlc5cRy4e5xEXHSbD1s+MVStyPDXK5c2Vet9wefoy6+9rlydQJvJRSsITP7JCTR4hm\n\td2Cw==","X-Gm-Message-State":"ACrzQf0jkSjDAuLf248GeUJ7Bo70ngh4JoOwKhleuOuifFjpazW1qIUz\n\tl8izFBJlLv704rbvCRmwarljJetj4pd3Yg==","X-Google-Smtp-Source":"AMsMyM5MF80yN/XGPAReaPZ8BK4+JIiQYJkUhWWpqrkyGk8ReX6OzHmwiLk4PHzjtmEVRuDOf9o0Jw==","X-Received":"by 2002:adf:f6c9:0:b0:236:547f:698a with SMTP id\n\ty9-20020adff6c9000000b00236547f698amr40149147wrp.180.1668091561974; \n\tThu, 10 Nov 2022 06:46:01 -0800 (PST)","To":"libcamera-devel@lists.libcamera.org","Date":"Thu, 10 Nov 2022 14:45:50 +0000","Message-Id":"<20221110144556.7858-1-david.plowman@raspberrypi.com>","X-Mailer":"git-send-email 2.30.2","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH 0/6] Resolve invalid attempts to set\n\tsensor flip controls","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":"David Plowman via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"David Plowman <david.plowman@raspberrypi.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Hi everyone\n\nHere's a first proper attempt to submit some patches for what was\npreviously an \"RFC\". The first two patches are the original ones that\nI posted, with some tidy-ups from Jacopo:\n\n1. Add a BayerFormat::toMbusCode method.\n\n2. Don't clear the sensor flip bits, instead query them and transform\nBayer formats to their \"native\" order.\n\nNow there are some extra patches to restore pipeline handlers to their\nprevious behaviours. I've avoided adding or fixing any functionality\nin them even where I had suspected there were some things that needed\naddressing - those should all be subsequent pieces of work. So we\nhave:\n\n3. I've added a V4L2Device::setTransform method. I think we're\nexpecting to push a bit more work to pipeline handlers so this\nfunction is intended to help them.\n\nYou can call it in a \"try\" mode which tells you what transform (h/v\nflips) you will get but without applying them. I expect validate()\nmethods might call this. And you can call it in a \"do\" mode which I\nwould expect configure() methods might use.\n\nI haven't checked for things like the controls being read-only, or\nhaving only one value or strange stuff like that... should I?\n\n4. Fix the uvcvideo PH.\n\n5. Fix the simple PH. Jacopo remarked previously that raw formats are\na theoretical possibility here, but given that it has no particular\nhandling of them currently, then the changes here make no difference\nin that respect. So adding that would be a job for another patch.\n\n6. Fix the rkisp1 PH.\n\nI haven't touched the Raspberry Pi PH because I think it's fine. There\nis possibly a small job of tidying it to use the new setTransform\nmethod, but that's one for another time.\n\nI haven't touched the IPU3 PH because I believe it to set the flips\ncorrectly. I remarked previously that I suspected it wasn't\ntransforming Bayer orders appropriately but again, the changes here\nmake no difference there so that would be a fix for another patch too.\n\nI hope that all makes sense. Do folks agree with this as a way\nforward? Thoughts welcome!\n\nThanks\nDavid\n\nDavid Plowman (6):\n  libcamera: bayer_format: Add toMbusCode method\n  libcamera: camera_sensor: Do not clear camera flips when listing\n    formats\n  libcamera: v4l2_device: Add setTransform method to set a device's flip\n    controls\n  libcamera: pipeline: uvcvideo: Set device's flip controls correctly\n  libcamera: pipeline: simple: Set device's flip controls correctly\n  libcamera: pipeline: rkisp1: Set device's flip controls correctly\n\n include/libcamera/internal/bayer_format.h    |  1 +\n include/libcamera/internal/v4l2_device.h     |  3 ++\n src/libcamera/bayer_format.cpp               | 11 +++++\n src/libcamera/camera_sensor.cpp              | 49 ++++++++++++++++----\n src/libcamera/pipeline/rkisp1/rkisp1.cpp     |  3 ++\n src/libcamera/pipeline/simple/simple.cpp     |  3 ++\n src/libcamera/pipeline/uvcvideo/uvcvideo.cpp |  3 ++\n src/libcamera/v4l2_device.cpp                | 37 +++++++++++++++\n 8 files changed, 100 insertions(+), 10 deletions(-)"}