Show a patch.

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

{
    "id": 8590,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/8590/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/8590/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/1.1/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": "<20200703154730.3908-1-laurent.pinchart@ideasonboard.com>",
    "date": "2020-07-03T15:47:30",
    "name": "[libcamera-devel] libcamera: Use Size::isNull()",
    "commit_ref": "b5f6a2ce2fae423f40c4bdaf1be43ad5070b3868",
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "78edbe1cdf52bb6e5b5061b33661a0b0a61385a0",
    "submitter": {
        "id": 2,
        "url": "https://patchwork.libcamera.org/api/1.1/people/2/?format=api",
        "name": "Laurent Pinchart",
        "email": "laurent.pinchart@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/8590/mbox/",
    "series": [
        {
            "id": 1079,
            "url": "https://patchwork.libcamera.org/api/1.1/series/1079/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1079",
            "date": "2020-07-03T15:47:30",
            "name": "[libcamera-devel] libcamera: Use Size::isNull()",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/1079/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/8590/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/8590/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 A0C8ABFFE2\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  3 Jul 2020 15:47:40 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 26C2B60C5F;\n\tFri,  3 Jul 2020 17:47:40 +0200 (CEST)",
            "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 B3997603B1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  3 Jul 2020 17:47:38 +0200 (CEST)",
            "from pendragon.bb.dnainternet.fi (81-175-216-236.bb.dnainternet.fi\n\t[81.175.216.236])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 2F79529E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  3 Jul 2020 17:47:38 +0200 (CEST)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"qap1YSIp\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1593791258;\n\tbh=DCYJLdSayoF1X98aPrkV0cPgAtnC1FUiQbj8MM4ybew=;\n\th=From:To:Subject:Date:From;\n\tb=qap1YSIpCYvZBLKTfXj1VMHBjeQHXLgaNs+UzKsKHhUKNbCqaZh1iwphqx//+ytIV\n\ttOyM7AMW74DqZhsmA/gbnFT9TqDXY0H2YLJMK7rDZnfteDQKsClTAigd9Yab1/b4MV\n\tOs+MQVxWpHSFmZgJANEvV3CJAQaoLB83S4EsHcjg=",
        "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Fri,  3 Jul 2020 18:47:30 +0300",
        "Message-Id": "<20200703154730.3908-1-laurent.pinchart@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.27.0",
        "MIME-Version": "1.0",
        "Subject": "[libcamera-devel] [PATCH] libcamera: Use Size::isNull()",
        "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": "Use the new Size::isNull() function through the code base to replace\nmanual checks. While the new code isn't equivalent, as isNull() checks\nthat both width and height are zero, it catches the same conditions in\npractice.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/libcamera/pipeline/ipu3/ipu3.cpp     | 2 +-\n src/libcamera/pipeline/rkisp1/rkisp1.cpp | 4 ++--\n test/v4l2_subdevice/test_formats.cpp     | 2 +-\n 3 files changed, 4 insertions(+), 4 deletions(-)",
    "diff": "diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\nindex 00559ce318e1..af51fb2d1718 100644\n--- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n@@ -185,7 +185,7 @@ void IPU3CameraConfiguration::adjustStream(StreamConfiguration &cfg, bool scale)\n \t\t * Provide a suitable default that matches the sensor aspect\n \t\t * ratio.\n \t\t */\n-\t\tif (!cfg.size.width || !cfg.size.height) {\n+\t\tif (cfg.size.isNull()) {\n \t\t\tcfg.size.width = 1280;\n \t\t\tcfg.size.height = 1280 * cio2Configuration_.size.height\n \t\t\t\t\t/ cio2Configuration_.size.width;\ndiff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\nindex 3c3f3f3a8049..051d77a68b55 100644\n--- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n+++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n@@ -506,7 +506,7 @@ CameraConfiguration::Status RkISP1CameraConfiguration::validate()\n \t\t\t\t\t    MEDIA_BUS_FMT_SGRBG8_1X8,\n \t\t\t\t\t    MEDIA_BUS_FMT_SRGGB8_1X8 },\n \t\t\t\t\t  cfg.size);\n-\tif (!sensorFormat_.size.width || !sensorFormat_.size.height)\n+\tif (sensorFormat_.size.isNull())\n \t\tsensorFormat_.size = sensor->resolution();\n \n \t/*\n@@ -517,7 +517,7 @@ CameraConfiguration::Status RkISP1CameraConfiguration::validate()\n \t */\n \tconst Size size = cfg.size;\n \n-\tif (!cfg.size.width || !cfg.size.height) {\n+\tif (cfg.size.isNull()) {\n \t\tcfg.size.width = 1280;\n \t\tcfg.size.height = 1280 * sensorFormat_.size.height\n \t\t\t\t/ sensorFormat_.size.width;\ndiff --git a/test/v4l2_subdevice/test_formats.cpp b/test/v4l2_subdevice/test_formats.cpp\nindex 9635c9948946..679f50b62c4d 100644\n--- a/test/v4l2_subdevice/test_formats.cpp\n+++ b/test/v4l2_subdevice/test_formats.cpp\n@@ -67,7 +67,7 @@ int FormatHandlingTest::run()\n \t\treturn TestFail;\n \t}\n \n-\tif (format.size.width == 0 || format.size.height == 0) {\n+\tif (format.size.isNull()) {\n \t\tcerr << \"Failed to update image format\" << endl;\n \t\treturn TestFail;\n \t}\n",
    "prefixes": [
        "libcamera-devel"
    ]
}