From patchwork Wed Feb 17 10:36:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 11322 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 0C0B6BD1F6 for ; Wed, 17 Feb 2021 10:36:38 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 9B8AF68204; Wed, 17 Feb 2021 11:36:37 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="Y7tMHFH0"; dkim-atps=neutral Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com [IPv6:2a00:1450:4864:20::52b]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id CF106680A7 for ; Wed, 17 Feb 2021 11:36:35 +0100 (CET) Received: by mail-ed1-x52b.google.com with SMTP id l12so15804449edt.3 for ; Wed, 17 Feb 2021 02:36:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=u1lMSbTw5vBl8FGqw5BHTVCVmZkYE795IYau54/L0hY=; b=Y7tMHFH077i1x1qXS6g4stolT8amnziyXvL1H53ytmpmxz9gWHMw2DtbLHdkLtT7z9 WtEHET0YJyxnvU52XEjk5a2fQOffjSP6y4O0mHM371sLAYnIfewuvLlAUzarU4U+3Egi B8mYh9SSSf5NAGv8Yq1sa1wcntb5mgHyME1NjXL+rgMH3tBxUtO8NMMhG0g5GNbZ2Vnq P45HzFyZmj3Y2+nMsTQlzRh3/fxXBR6ZSv9pmDqzSdsB2op4ZZD+FzuV8MbJs3oFJcsO hMr51qLoTCqklnVdrbdkf5PvQ44pxQMYyzHGqtRRZdojA8g6GSPeq7O90w0fx+8oq3Ca 7xdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=u1lMSbTw5vBl8FGqw5BHTVCVmZkYE795IYau54/L0hY=; b=lgHviHuYaWJwQKRztKYIHLGGHJZZ/YrbIlGXasyALP9AreuhHWUsBfNCQJQjzxjaYW rnnCyMSxDjwgNKyzdYg4R6+tOJuQEDe0dJRZVmEKWmDF+kpI2Mkl1GvMShD4cf0wuJXX 5LsxxJDBGd9sJISf9rJw+ZB/RhciaX1P4hakkcgzm6V7EzpFAV67SxNWchmAJ+WDmNoc ZQB+uzkJE/7+2GO35GS4cmX4CA58KcMMdl4zC0D2ZyAauFYrTxvjCifGNDjvzPNvIy2X rWWxTZq6t85VZCarfnV1414VPFllCSOgZyrmo0f406aEL0kDGSeGCfqZVsUeRp+3cprn wnbg== X-Gm-Message-State: AOAM533uzx22ovjojXTCIdRoFGYB9N89mCar9IIeUNaSkBWQlcdEPVRr O63yQ49rjy9oJxZTOKjhhLcI9HZA+BmW9dwn X-Google-Smtp-Source: ABdhPJxf00m3+4/gSmZnHDqWRw+MugQAfIz7viyVnKg9p3B0pfP/3yWDWVrcNYBldNx5mfbouO27DQ== X-Received: by 2002:a05:6402:19:: with SMTP id d25mr25085395edu.71.1613558195306; Wed, 17 Feb 2021 02:36:35 -0800 (PST) Received: from naush-laptop.patuck.local ([88.97.76.4]) by smtp.gmail.com with ESMTPSA id z16sm789254ejx.73.2021.02.17.02.36.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Feb 2021 02:36:34 -0800 (PST) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Date: Wed, 17 Feb 2021 10:36:26 +0000 Message-Id: <20210217103626.1555692-1-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210217100852.1542397-3-naush@raspberrypi.com> References: <20210217100852.1542397-3-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] pipeline: raspberrypi: Update lens shading control in-place X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Add the dmabuf file descriptor to the lens shading control in-place rather than taking a copy. Signed-off-by: Naushir Patuck --- .../pipeline/raspberrypi/raspberrypi.cpp | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp index 1a0bd6275578..a60415d93705 100644 --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp @@ -1338,18 +1338,15 @@ void RPiCameraData::embeddedComplete(uint32_t bufferId) void RPiCameraData::setIspControls(const ControlList &controls) { - ControlList ctrls = controls; + ControlList ctrls = std::move(controls); if (ctrls.contains(V4L2_CID_USER_BCM2835_ISP_LENS_SHADING)) { - Span s = - ctrls.get(V4L2_CID_USER_BCM2835_ISP_LENS_SHADING).data(); - bcm2835_isp_lens_shading ls = - *reinterpret_cast(s.data()); - ls.dmabuf = lsTable_.fd(); - - ControlValue c(Span{ reinterpret_cast(&ls), - sizeof(ls) }); - ctrls.set(V4L2_CID_USER_BCM2835_ISP_LENS_SHADING, c); + ControlValue &value = + const_cast(ctrls.get(V4L2_CID_USER_BCM2835_ISP_LENS_SHADING)); + Span s = value.data(); + bcm2835_isp_lens_shading *ls = + reinterpret_cast(s.data()); + ls->dmabuf = lsTable_.fd(); } isp_[Isp::Input].dev()->setControls(&ctrls);