{"id":11825,"url":"https://patchwork.libcamera.org/api/patches/11825/?format=json","web_url":"https://patchwork.libcamera.org/patch/11825/","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":"<20210402040340.1364749-1-hiroh@chromium.org>","date":"2021-04-02T04:03:40","name":"[libcamera-devel,v2] android: CameraBuffer: Mark as invalid if cros::CameraBufferManager::Register() fails","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"dbdc115c8b3ee16a596348b376e73e432ced1e7e","submitter":{"id":63,"url":"https://patchwork.libcamera.org/api/people/63/?format=json","name":"Hirokazu Honda","email":"hiroh@chromium.org"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/11825/mbox/","series":[{"id":1884,"url":"https://patchwork.libcamera.org/api/series/1884/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=1884","date":"2021-04-02T04:03:40","name":"[libcamera-devel,v2] android: CameraBuffer: Mark as invalid if cros::CameraBufferManager::Register() fails","version":2,"mbox":"https://patchwork.libcamera.org/series/1884/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/11825/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/11825/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 71485C0DA3\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  2 Apr 2021 04:03:50 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id CE48E68783;\n\tFri,  2 Apr 2021 06:03:49 +0200 (CEST)","from mail-pg1-x531.google.com (mail-pg1-x531.google.com\n\t[IPv6:2607:f8b0:4864:20::531])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B7DB36877C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  2 Apr 2021 06:03:47 +0200 (CEST)","by mail-pg1-x531.google.com with SMTP id h25so2874073pgm.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 01 Apr 2021 21:03:47 -0700 (PDT)","from hiroh2.tok.corp.google.com\n\t([2401:fa00:8f:2:908:1da:b07c:32bc])\n\tby smtp.gmail.com with ESMTPSA id\n\t38sm6517715pgk.30.2021.04.01.21.03.44\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 01 Apr 2021 21:03:45 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=chromium.org header.i=@chromium.org\n\theader.b=\"irUXUay3\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org;\n\ts=google; h=from:to:cc:subject:date:message-id:mime-version\n\t:content-transfer-encoding;\n\tbh=+KJdgHJvgzMEZGQYBG6MDGTXmmtctg3J9xAj8r9oFj8=;\n\tb=irUXUay3qB8D1B2cpEl/VXps4/dn+lu8qoAo1RcObOsrboz2fxj7ftpw3Yzohpe42t\n\tFDy+fA6yzEwnGE1D5VkEiP1AFnJA8uIGj0D48GoN2wG2e68ZuV5/XrqgHHNkphvLXDqK\n\tkziFNw0Y/FbHZwFttqdvMEGnbk3kx1giy7G78=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version\n\t:content-transfer-encoding;\n\tbh=+KJdgHJvgzMEZGQYBG6MDGTXmmtctg3J9xAj8r9oFj8=;\n\tb=lzyRxsh/7pwdcCMqiOKn8drLoFTOsmDu7bN+iA45t/qxUJxWnTzh2xaDYitZX6xjBe\n\tx0oiuAlKE/61fXRaoZksns2Y4MqUiDnTdkOwYBqdG4hZgyMEUoOG8+EfVXJthwdEf4YS\n\tEBX0Jk3H1N1xSq2qBom7Ae3Ux6MGLkreAUJTOdyzZXe1sRkqTdZ5DFmKoAFukEwwBN3/\n\tcgwpniPijatopfXUBSZkfWW5SphGPkiRQiZkpIrTtdNK72igYvnR92SZ8sWAz+GRgFGF\n\tnj7vlZmNzKkVMXaAOa70QOo4rykPAe852kJjyE2SYGY1YWogd6MdRTIwGhlgpd0i6M8H\n\tHXFg==","X-Gm-Message-State":"AOAM533vttCtzENwK76s076sG3+101YV4/o7mAsRU4tz4GCb/14MeRt0\n\tneTyQw1ZBYl1vHsbz6ODOfomA+ETFqccKA==","X-Google-Smtp-Source":"ABdhPJzrj04EmSx+ige30Viv30n8bU5YB0GfhdbNGq3bttA/spaU/CuG/sDYeyQ5EL05tlF4pgufig==","X-Received":"by 2002:a62:6202:0:b029:208:f11c:2143 with SMTP id\n\tw2-20020a6262020000b0290208f11c2143mr10584488pfb.32.1617336226132; \n\tThu, 01 Apr 2021 21:03:46 -0700 (PDT)","From":"Hirokazu Honda <hiroh@chromium.org>","To":"libcamera-devel@lists.libcamera.org","Date":"Fri,  2 Apr 2021 13:03:40 +0900","Message-Id":"<20210402040340.1364749-1-hiroh@chromium.org>","X-Mailer":"git-send-email 2.31.0.208.g409f899ff0-goog","MIME-Version":"1.0","Subject":"[libcamera-devel] [PATCH v2] android: CameraBuffer: Mark as invalid\n\tif cros::CameraBufferManager::Register() fails","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>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"cros::CameraBufferManager::Register() fails if a buffer handle\nis invalid. We should mark CameraBuffer as invalid on the failure\nof Register().\n\nSigned-off-by: Hirokazu Honda <hiroh@chromium.org>\n---\n src/android/mm/cros_camera_buffer.cpp | 12 ++++++++----\n 1 file changed, 8 insertions(+), 4 deletions(-)","diff":"diff --git a/src/android/mm/cros_camera_buffer.cpp b/src/android/mm/cros_camera_buffer.cpp\nindex 7df4f47c..5f98ee44 100644\n--- a/src/android/mm/cros_camera_buffer.cpp\n+++ b/src/android/mm/cros_camera_buffer.cpp\n@@ -53,12 +53,16 @@ CameraBuffer::Private::Private(CameraBuffer *cameraBuffer,\n {\n \tbufferManager_ = cros::CameraBufferManager::GetInstance();\n \n-\tbufferManager_->Register(camera3Buffer);\n+\tint ret = bufferManager_->Register(camera3Buffer);\n+\tif (ret) {\n+\t\tLOG(HAL, Error) << \"Failed registering a buffer: \" << ret;\n+\t\treturn;\n+\t}\n \n \tnumPlanes_ = bufferManager_->GetNumPlanes(camera3Buffer);\n \tswitch (numPlanes_) {\n \tcase 1: {\n-\t\tint ret = bufferManager_->Lock(handle_, 0, 0, 0, 0, 0, &mem.addr);\n+\t\tret = bufferManager_->Lock(handle_, 0, 0, 0, 0, 0, &mem.addr);\n \t\tif (ret) {\n \t\t\tLOG(HAL, Error) << \"Single plane buffer mapping failed\";\n \t\t\treturn;\n@@ -67,8 +71,8 @@ CameraBuffer::Private::Private(CameraBuffer *cameraBuffer,\n \t}\n \tcase 2:\n \tcase 3: {\n-\t\tint ret = bufferManager_->LockYCbCr(handle_, 0, 0, 0, 0, 0,\n-\t\t\t\t\t\t    &mem.ycbcr);\n+\t\tret = bufferManager_->LockYCbCr(handle_, 0, 0, 0, 0, 0,\n+\t\t\t\t\t\t&mem.ycbcr);\n \t\tif (ret) {\n \t\t\tLOG(HAL, Error) << \"YCbCr buffer mapping failed\";\n \t\t\treturn;\n","prefixes":["libcamera-devel","v2"]}