{"id":3852,"url":"https://patchwork.libcamera.org/api/1.1/patches/3852/?format=json","web_url":"https://patchwork.libcamera.org/patch/3852/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/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":"<20200522181435.3174615-1-kieran.bingham@ideasonboard.com>","date":"2020-05-22T18:14:35","name":"[libcamera-devel,RFC] libcamera: pipeline: vimc: Skip unsupported formats","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"746ab692c3476cda77c8c27df73bb28e48dc3fb3","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/1.1/people/4/?format=json","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/3852/mbox/","series":[{"id":925,"url":"https://patchwork.libcamera.org/api/1.1/series/925/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=925","date":"2020-05-22T18:14:35","name":"[libcamera-devel,RFC] libcamera: pipeline: vimc: Skip unsupported formats","version":1,"mbox":"https://patchwork.libcamera.org/series/925/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/3852/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/3852/checks/","tags":{},"headers":{"Return-Path":"<kieran.bingham@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 89969603D7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 22 May 2020 20:14:39 +0200 (CEST)","from localhost.localdomain\n\t(cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 0738E24D;\n\tFri, 22 May 2020 20:14:38 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"p3niiwlX\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1590171279;\n\tbh=tYsESgxI8qVIvCR/O85S2LNyIP8M9T86/31bAlF9T+0=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=p3niiwlXimCnRf9Memg4XtnB1qwKF5TgJX1d8ynwjrkzcGCuFURiq7p56B3W+POPf\n\t0BT8Nu330vViQGAe19jT3qJ1jLAJ72Dw59XjVXcSDJiJafSWnHf4gxHe6ZTNGgAVic\n\t3e1pvROS8gGNFdVeuk2SsXlA8PqDzqeWc0exf9oI=","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","To":"libcamera devel <libcamera-devel@lists.libcamera.org>","Date":"Fri, 22 May 2020 19:14:35 +0100","Message-Id":"<20200522181435.3174615-1-kieran.bingham@ideasonboard.com>","X-Mailer":"git-send-email 2.25.1","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [RFC PATCH] libcamera: pipeline: vimc: Skip\n\tunsupported 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":"Fri, 22 May 2020 18:14:39 -0000"},"content":"Older kernels do not support all 'reported' formats. Skip them on those\nkernels.\n\nSigned-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n---\nMarking this as RFC, as I don't actually yet know what the correct\nkernel version is to condition against.\n\nCurrently, the QCam application can not stream the VIMC Camera for users\nof QT Version less that 5.14 as that is when the BGR888 format becomes a\n'preferred' native format.\n\nUsers of QT < 5.14 will find that qcam will chose a 'preferred' format\nwhich is reported as supported by the kernel, when in fact it isn't.\n\nEnsure that those formats are not reported as supported by the vimc\npipeline handler on older kernels.\n\n\n\n src/libcamera/pipeline/vimc/vimc.cpp | 14 ++++++++++++++\n 1 file changed, 14 insertions(+)","diff":"diff --git a/src/libcamera/pipeline/vimc/vimc.cpp b/src/libcamera/pipeline/vimc/vimc.cpp\nindex 68d65bc785b0..78fb0ece21f8 100644\n--- a/src/libcamera/pipeline/vimc/vimc.cpp\n+++ b/src/libcamera/pipeline/vimc/vimc.cpp\n@@ -171,6 +171,7 @@ CameraConfiguration *PipelineHandlerVimc::generateConfiguration(Camera *camera,\n \tconst StreamRoles &roles)\n {\n \tCameraConfiguration *config = new VimcCameraConfiguration();\n+\tVimcCameraData *data = cameraData(camera);\n \n \tif (roles.empty())\n \t\treturn config;\n@@ -178,6 +179,19 @@ CameraConfiguration *PipelineHandlerVimc::generateConfiguration(Camera *camera,\n \tstd::map<PixelFormat, std::vector<SizeRange>> formats;\n \n \tfor (const auto &pixelformat : pixelformats) {\n+\t\t/*\n+\t\t * \\todo: Update this when the kernel correctly supports other\n+\t\t * reported formats.\n+\t\t */\n+\t\tif (data->media_->version() <= KERNEL_VERSION(5, 7, 0)) {\n+\t\t\tif (pixelformat.first != PixelFormat(DRM_FORMAT_BGR888)) {\n+\t\t\t\tLOG(VIMC, Info)\n+\t\t\t\t\t<< \"Skipping unsupported pixel format\"\n+\t\t\t\t\t<< pixelformat.first.toString();\n+\t\t\t\tcontinue;\n+\t\t\t}\n+\t\t}\n+\n \t\t/* The scaler hardcodes a x3 scale-up ratio. */\n \t\tstd::vector<SizeRange> sizes{\n \t\t\tSizeRange{ { 48, 48 }, { 4096, 2160 } }\n","prefixes":["libcamera-devel","RFC"]}