{"id":22067,"url":"https://patchwork.libcamera.org/api/covers/22067/?format=json","web_url":"https://patchwork.libcamera.org/cover/22067/","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":"<20241125151430.2437285-1-stefan.klug@ideasonboard.com>","date":"2024-11-25T15:14:09","name":"[v2,0/8] rkisp1: Fix aspect ratio and ScalerCrop","submitter":{"id":184,"url":"https://patchwork.libcamera.org/api/people/184/?format=json","name":"Stefan Klug","email":"stefan.klug@ideasonboard.com"},"mbox":"https://patchwork.libcamera.org/cover/22067/mbox/","series":[{"id":4818,"url":"https://patchwork.libcamera.org/api/series/4818/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=4818","date":"2024-11-25T15:14:09","name":"rkisp1: Fix aspect ratio and ScalerCrop","version":2,"mbox":"https://patchwork.libcamera.org/series/4818/mbox/"}],"comments":"https://patchwork.libcamera.org/api/covers/22067/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 DA963C32A3\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 25 Nov 2024 15:14:37 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 1E57465F66;\n\tMon, 25 Nov 2024 16:14:37 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A2DC265F56\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 25 Nov 2024 16:14:35 +0100 (CET)","from ideasonboard.com (unknown\n\t[IPv6:2a00:6020:448c:6c00:4cf:a935:de6f:a329])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id CC5C46B5;\n\tMon, 25 Nov 2024 16:14:13 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"GDRwSyz2\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1732547653;\n\tbh=r3wA85z8+2WEj3IXuFb9LN5Vn1QrlT6CxKw7xc5yCRU=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=GDRwSyz2ZoQs473xlEVx+rDwZU7MgmNPCiSEkI1riMZVVJmQRHjw3xFr+kHp7j+wx\n\tkYjzPAHuhAMyAPT7J6484eF8S0868wmDZ59QINl9lc3usxZk1yS5cNOvAsFflHzki/\n\tuK1oqgL2M19GkiTuZttTzwziOWi2Bl9032/lMyE4=","From":"Stefan Klug <stefan.klug@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Cc":"Stefan Klug <stefan.klug@ideasonboard.com>","Subject":"[PATCH v2 0/8] rkisp1: Fix aspect ratio and ScalerCrop","Date":"Mon, 25 Nov 2024 16:14:09 +0100","Message-ID":"<20241125151430.2437285-1-stefan.klug@ideasonboard.com>","X-Mailer":"git-send-email 2.43.0","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Hi all,\n\nThis series contains fixes for a few issues on the imx8mp that I'd like\nto get in before the next release.\n\nPatch 1/8 is a drive by fix\n\nPatch 2/8 Fixes the aspect ratio on the imx8mp. There exists code to\nkeep the aspect ratio in the rkisp1 pipeline that adjust the input crop\non the resizer stage. On the imx8mp however the resizer hardware is\nmissing that functionality and cropping needs to be done on the ISP\noutput. Patch 2 implements that.\n\nPatches 3-8 fix the ScalerCrop control. The existing implementation\nimplements ScalerCrop in dewarper coordinates (After scaling down).\nThis is incorrect as ScalerCrop is specified to be in sensor\ncoordinates. To fix that, patches 3-6 do preparatory changes and patch 6\nimplements the correct ScalerCrop control. Patch 8 adds\nScalerMaximumCrop for completeness sake.\n\nNote that this solution while being correct on the numbers is still not\nideal, because the aspect ratio preserving crop on the ISP output is\nstill applied unconditionally. That will get fixed in an upcoming\nseries, where the full sensor size get's passed to the dewarper and all\ncropping/scaling gets handled there.\n\nBest regards,\nStefan\n\nChanges in v2:\n- Some smaller fixes from review (see individual changelogs)\n- Added [PATCH v2 6/8] libcamera: converter_v4l2_m2m: Improve crop\n  bounds support to be able to provide sane default values for\nScalerCrop before configure()\n\nStefan Klug (8):\n  libcamera: rkisp1: Fix scope of dewarper stop() exit action\n  libcamera: rkisp1: Keep aspect ratio on imx8mp\n  libcamera: geometry: Add Rectangle::transformedBetween()\n  pipeline: rkisp1: Split inputCrop and outputCrop\n  pipeline: rkisp1: Reorder sensorInfo collection code\n  libcamera: converter_v4l2_m2m: Improve crop bounds support\n  pipeline: rkisp1: Fix ScalerCrop to be in sensor coordinates\n  pipeline: rkisp1: Add ScalerMaximumCrop property\n\n include/libcamera/geometry.h                  |   3 +\n .../internal/converter/converter_v4l2_m2m.h   |   1 +\n src/libcamera/converter.cpp                   |   3 +\n .../converter/converter_v4l2_m2m.cpp          | 113 +++++++++---------\n src/libcamera/geometry.cpp                    |  37 ++++++\n src/libcamera/pipeline/rkisp1/rkisp1.cpp      |  99 +++++++++++----\n src/libcamera/pipeline/rkisp1/rkisp1_path.cpp |  13 +-\n 7 files changed, 182 insertions(+), 87 deletions(-)"}