{"id":13943,"url":"https://patchwork.libcamera.org/api/covers/13943/?format=json","web_url":"https://patchwork.libcamera.org/cover/13943/","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":"<20210927104821.2526508-1-hiroh@chromium.org>","date":"2021-09-27T10:48:19","name":"[libcamera-devel,RFC,0/2] android: Fix the issue with Type::Mapped only request","submitter":{"id":63,"url":"https://patchwork.libcamera.org/api/people/63/?format=json","name":"Hirokazu Honda","email":"hiroh@chromium.org"},"mbox":"https://patchwork.libcamera.org/cover/13943/mbox/","series":[{"id":2572,"url":"https://patchwork.libcamera.org/api/series/2572/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2572","date":"2021-09-27T10:48:19","name":"android: Fix the issue with Type::Mapped only request","version":1,"mbox":"https://patchwork.libcamera.org/series/2572/mbox/"}],"comments":"https://patchwork.libcamera.org/api/covers/13943/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 8287DC3243\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 27 Sep 2021 10:48:32 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9B1296918D;\n\tMon, 27 Sep 2021 12:48:31 +0200 (CEST)","from mail-pg1-x536.google.com (mail-pg1-x536.google.com\n\t[IPv6:2607:f8b0:4864:20::536])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 93F446012C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 27 Sep 2021 12:48:29 +0200 (CEST)","by mail-pg1-x536.google.com with SMTP id m21so17373436pgu.13\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 27 Sep 2021 03:48:29 -0700 (PDT)","from hiroh2.tok.corp.google.com\n\t([2401:fa00:8f:203:7cac:9967:6683:8845])\n\tby smtp.gmail.com with ESMTPSA id\n\tb11sm18694452pge.57.2021.09.27.03.48.25\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 27 Sep 2021 03:48:26 -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=\"SG/uA4X5\"; 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=kIgClH2jhSSOF5H3+OdYOPvse59Nf74Qs578mvWmcnQ=;\n\tb=SG/uA4X56SIdRe77W9MAMntB7n6gNIIjwNWdPbPiERfxJ2/j3iyrOv5KnFtTIPqdDC\n\tkbrAgfJESS0SwsGgxlsZZzyfsU9sfFUejnu9I8SjsxKH/6YlbV8txoczFw/HHNjJOHiD\n\t3QPYbfDw713DErx4/v1uL837OnuyG1zwnBBq8=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version\n\t:content-transfer-encoding;\n\tbh=kIgClH2jhSSOF5H3+OdYOPvse59Nf74Qs578mvWmcnQ=;\n\tb=noFhyINZhiljTBBQmXQpY6lXuTtaeYScsnKUMM6YrBd+CpPzuYY3uMwM/rq4+L4KEd\n\tjRqWaj6blSrtne2SbeJhQ6oDVZaPssTEou5RAp7aeoaSjB7AXyZlMZ6oZekhF2U63hHn\n\tcYAdclYgzHiDwbwLOHEzpLgB5dx5r6TadG/CS8R24oovpIAaTjosa1fJraPL8sNigE+i\n\tT63JuoSmD1ke3sCRYSiJWnLitSL1/5LLKYGPQDioR2mcIT+EMdIFZGCN53EQ64nQjVu0\n\tWXAQQM+QuoYMziN7VaqsantGrtWXVotZc5nezAWUpzML0xoKZSIRESMcWIwSNpaCl+RA\n\tv65A==","X-Gm-Message-State":"AOAM531vmbj+ficwkUWZhA4ypsL6S1qiRydOy11+LD9RWYv/vrqiNJuR\n\tg51V4Dxy8WBah1PDMMqCGBjrahDwpwqSYA==","X-Google-Smtp-Source":"ABdhPJx9+cKC583utNIx6f0pFkagLmxn9HwAjWAL8Ser3oFjEvPZlHZZHOZk5a5hiu/+mV7z0/GLzw==","X-Received":"by 2002:a63:125f:: with SMTP id 31mr15879657pgs.98.1632739707396;\n\tMon, 27 Sep 2021 03:48:27 -0700 (PDT)","From":"Hirokazu Honda <hiroh@chromium.org>","To":"libcamera-devel@lists.libcamera.org","Date":"Mon, 27 Sep 2021 19:48:19 +0900","Message-Id":"<20210927104821.2526508-1-hiroh@chromium.org>","X-Mailer":"git-send-email 2.33.0.685.g46640cef36-goog","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [RFC PATCH 0/2] android: Fix the issue with\n\tType::Mapped only request","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":"We have the problem that no buffer is not provided to a native camera\nif a request given in CameraDevice::processCaptureRequest() contains\nonly streams that are resolved as CameraStream::Type::Mapped in\nCameraDevice::configureStreams(). See the example in below.\n\n```\n[0:27:06.863311142] [15203] DEBUG HAL camera_device.cpp:980\n'\\_SB_.PCI0.I2C2.CAM0': Queueing request 139090704005584 with 2\nstreams\n[0:27:06.863389502] [15203] DEBUG HAL camera_device.cpp:1005\n'\\_SB_.PCI0.I2C2.CAM0': 0 - (320x240)[0x00000022] -> (320x240)[NV12]\n(mapped)\n[0:27:06.863436331] [15203] DEBUG HAL camera_device.cpp:1005\n'\\_SB_.PCI0.I2C2.CAM0': 1 - (320x240)[0x00000021] -> (320x240)[NV12]\n(mapped)\n[0:27:06.863487886] [15203] DEBUG HAL camera_device.cpp:1043\n'\\_SB_.PCI0.I2C2.CAM0': buffers=0\n[0:27:06.863561912] [15218] ERROR Camera camera.cpp:1031 Request\ncontains no buffers\n```\n\nThis patch series fixes the issue by looking up the stream\nalternatively sent to a native camera. To do that, we have to\nallocate a FrameBuffer for the stream. One possible way is to use\nFrameBufferAllocator. However, FrameBufferAllocator::allocate must\nbe called when the state of Camera is Configured, but not Running.\nSo we have to allocate buffers during configureStreams(). But\nallocating buffers for CameraStrems whose type is Direct wastes\nmemory as they tends to not be used at all.\n\nI would rather have a new class that allocates FrameBuffers in a\nplatform-dependent way, cros::CameraBufferManager on ChromeOS and\ngralloc API on other platforms.\n\nWith this patch, android.hardware.camera2.cts.SurfaceViewPreviewTest#testDeferredSurfaces passed.\n\nHirokazu Honda (2):\n  android: Introduce PlatformFrameBufferAllocator\n  android: Send alternative stream configuration if no buffer to be sent\n    exists\n\n src/android/camera_device.cpp           |  50 ++++++++--\n src/android/camera_device.h             |   4 +\n src/android/camera_stream.cpp           |  37 +++++++-\n src/android/camera_stream.h             |  10 +-\n src/android/frame_buffer.h              |  53 +++++++++++\n src/android/mm/cros_frame_buffer.cpp    |  85 +++++++++++++++++\n src/android/mm/generic_frame_buffer.cpp | 116 ++++++++++++++++++++++++\n src/android/mm/meson.build              |   6 +-\n 8 files changed, 344 insertions(+), 17 deletions(-)\n create mode 100644 src/android/frame_buffer.h\n create mode 100644 src/android/mm/cros_frame_buffer.cpp\n create mode 100644 src/android/mm/generic_frame_buffer.cpp\n\n--\n2.33.0.685.g46640cef36-goog"}