Show a patch.

GET /api/patches/2071/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 2071,
    "url": "https://patchwork.libcamera.org/api/patches/2071/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/2071/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/projects/1/?format=api",
        "name": "libcamera",
        "link_name": "libcamera",
        "list_id": "libcamera_core",
        "list_email": "libcamera-devel@lists.libcamera.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": ""
    },
    "msgid": "<20190930053520.2711-3-paul.elder@ideasonboard.com>",
    "date": "2019-09-30T05:35:20",
    "name": "[libcamera-devel,RFC,3/3] android: camera_hal_manager: error on init if cameras not initialized",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "8af1d82c813e4254f9c29977d79bb1a0462fb895",
    "submitter": {
        "id": 17,
        "url": "https://patchwork.libcamera.org/api/people/17/?format=api",
        "name": "Paul Elder",
        "email": "paul.elder@ideasonboard.com"
    },
    "delegate": {
        "id": 17,
        "url": "https://patchwork.libcamera.org/api/users/17/?format=api",
        "username": "epaul",
        "first_name": "Paul",
        "last_name": "Elder",
        "email": "paul.elder@ideasonboard.com"
    },
    "mbox": "https://patchwork.libcamera.org/patch/2071/mbox/",
    "series": [
        {
            "id": 513,
            "url": "https://patchwork.libcamera.org/api/series/513/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=513",
            "date": "2019-09-30T05:35:18",
            "name": "[libcamera-devel,RFC,1/3] libcamera: pipeline: Add device IDs",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/513/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/2071/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/2071/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<paul.elder@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 2AF85616FF\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 30 Sep 2019 07:35:39 +0200 (CEST)",
            "from neptunite.amanokami.net (unknown [96.44.9.94])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 76AB733E;\n\tMon, 30 Sep 2019 07:35:38 +0200 (CEST)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1569821738;\n\tbh=5JGPeX95v15oEyuLbdZVjlU/1AeTb+w5JennIhaW6PM=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=HAQzkCIQVPtMx9hTLZxRYvAhfAu0GHDwlXn2r82VXKJTLKdD9IlPtgmdnhOHWUDva\n\tv5aa3TSpCg+1LGBTAg8M64LOIK3Be0aVru1hfeKCJC7iRAACUDLoJyC9TR1KXH2Xrq\n\te6fxS9B96wy0Q/NspQt0mHSbQbKbPyw1lbWiSk/A=",
        "From": "Paul Elder <paul.elder@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Mon, 30 Sep 2019 01:35:20 -0400",
        "Message-Id": "<20190930053520.2711-3-paul.elder@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.23.0",
        "In-Reply-To": "<20190930053520.2711-1-paul.elder@ideasonboard.com>",
        "References": "<20190930053520.2711-1-paul.elder@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [RFC PATCH 3/3] android: camera_hal_manager:\n\terror on init if cameras not initialized",
        "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": "Mon, 30 Sep 2019 05:35:39 -0000"
    },
    "content": "Return error from hal_init() if the built-in cameras have not been\ninitialized yet. On Chromium OS, this causes Upstart to restart the\ncamera service at a later time, allowing the built-in cameras to be\nenumerated correctly. This fixes the problem where the camera service\nis started before the camera device nodes are available.\n\nSigned-off-by: Paul Elder <paul.elder@ideasonboard.com>\n---\n src/android/camera3_hal.cpp        |  4 +---\n src/android/camera_hal_manager.cpp | 11 ++++++++++-\n 2 files changed, 11 insertions(+), 4 deletions(-)",
    "diff": "diff --git a/src/android/camera3_hal.cpp b/src/android/camera3_hal.cpp\nindex 8d2629ca..9d18b999 100644\n--- a/src/android/camera3_hal.cpp\n+++ b/src/android/camera3_hal.cpp\n@@ -56,9 +56,7 @@ static int hal_init()\n {\n \tLOG(HAL, Info) << \"Initialising Android camera HAL\";\n \n-\tcameraManager.init();\n-\n-\treturn 0;\n+\treturn cameraManager.init();\n }\n \n /*------------------------------------------------------------------------------\ndiff --git a/src/android/camera_hal_manager.cpp b/src/android/camera_hal_manager.cpp\nindex 22f0323b..af0114fc 100644\n--- a/src/android/camera_hal_manager.cpp\n+++ b/src/android/camera_hal_manager.cpp\n@@ -13,11 +13,14 @@\n \n #include \"camera_device.h\"\n #include \"camera_proxy.h\"\n+#include \"device_enumerator.h\"\n \n using namespace libcamera;\n \n LOG_DECLARE_CATEGORY(HAL);\n \n+static int initRet = 0;\n+\n /*\n  * \\class CameraHalManager\n  *\n@@ -49,7 +52,7 @@ int CameraHalManager::init()\n \tMutexLocker locker(mutex_);\n \tcv_.wait(locker);\n \n-\treturn 0;\n+\treturn initRet;\n }\n \n void CameraHalManager::run()\n@@ -68,6 +71,12 @@ void CameraHalManager::run()\n \t\treturn;\n \t}\n \n+\tif (!DeviceEnumerator::haveExpectedCameras(cameraManager_)) {\n+\t\tLOG(HAL, Warning) << \"Expected cameras not loaded\";\n+\t\tinitRet = -EAGAIN;\n+\t\tcv_.notify_one();\n+\t}\n+\n \t/*\n \t * For each Camera registered in the system, a CameraProxy\n \t * gets created here to wraps a camera device.\n",
    "prefixes": [
        "libcamera-devel",
        "RFC",
        "3/3"
    ]
}