Show a patch.

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

{
    "id": 14982,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/14982/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/14982/",
    "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": "<20211201164413.95396-1-ecurtin@redhat.com>",
    "date": "2021-12-01T16:44:13",
    "name": "[libcamera-devel] cam: kms_sink: select valid crtc",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "a668e1e63d3b434f1838a2f3b875a3f0d9912a10",
    "submitter": {
        "id": 101,
        "url": "https://patchwork.libcamera.org/api/1.1/people/101/?format=api",
        "name": "Eric Curtin",
        "email": "ecurtin@redhat.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/14982/mbox/",
    "series": [
        {
            "id": 2798,
            "url": "https://patchwork.libcamera.org/api/1.1/series/2798/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2798",
            "date": "2021-12-01T16:44:13",
            "name": "[libcamera-devel] cam: kms_sink: select valid crtc",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/2798/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/14982/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/14982/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 B02D5BDB13\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  1 Dec 2021 16:46:23 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 1164D6082A;\n\tWed,  1 Dec 2021 17:46:23 +0100 (CET)",
            "from us-smtp-delivery-124.mimecast.com\n\t(us-smtp-delivery-124.mimecast.com [170.10.133.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 0DDE5607DE\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  1 Dec 2021 17:46:20 +0100 (CET)",
            "from mail-wm1-f72.google.com (mail-wm1-f72.google.com\n\t[209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS\n\t(version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n\tus-mta-144-3GfKWquBO1qVmXimXcQYwA-1; Wed, 01 Dec 2021 11:46:18 -0500",
            "by mail-wm1-f72.google.com with SMTP id\n\to18-20020a05600c511200b00332fa17a02eso1175308wms.5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 01 Dec 2021 08:46:18 -0800 (PST)",
            "from curtine-ThinkPad-P1-Gen-3.Home\n\t(86-40-122-19-dynamic.agg7.rlc.lmk-mlw.eircom.net. [86.40.122.19])\n\tby smtp.gmail.com with ESMTPSA id\n\ts8sm293034wro.19.2021.12.01.08.46.16\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 01 Dec 2021 08:46:16 -0800 (PST)"
        ],
        "Authentication-Results": [
            "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=redhat.com header.i=@redhat.com\n\theader.b=\"LZXGdNbW\"; dkim-atps=neutral",
            "relay.mimecast.com;\n\tauth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ecurtin@redhat.com"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1638377179;\n\th=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n\tto:to:cc:cc:mime-version:mime-version:content-type:content-type:\n\tcontent-transfer-encoding:content-transfer-encoding;\n\tbh=sK1Hm5hfY97GDSm3GmKgL6pVEINx3VnDGeB5CnHEJ7s=;\n\tb=LZXGdNbWOV/BZfr5mu0YEYkSHmoz9ttz9wlDUeSyz3O6EuqLEut/r4CCwzG183dAZYUF2R\n\tbcqWBDtyza48/0EhFMVJu+LfdebJkGI7l4+VCjQ6ZUe0wKUPAyDTFpR68Q6H2pot2bjTGX\n\t/07TzznagaDoi1AH0Jsb8yzDuJ7dKvM=",
        "X-MC-Unique": "3GfKWquBO1qVmXimXcQYwA-1",
        "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=sK1Hm5hfY97GDSm3GmKgL6pVEINx3VnDGeB5CnHEJ7s=;\n\tb=Zlku/O0d+IxjWZoZr9zZmEp9u5u1RF4jaO6JN+ZqVurwam5DgEbA1ZHCv+/CHY5CHA\n\t6bNS8XA8UHznNPulARxQhPFfBM6yEIAHd2k1OjzUc7/VNLTgqjGMFELZQlbPfq3xEZpn\n\tv/dTCKP20Mplh+LyXGKGlZCZfVxE8f2hbpD+FqwzpS0huGorLAMCplxE5N9J8yNr/pVj\n\tauvBchIQTr0IJHRZ2C5CXfGabqgnKa/cP4h12f4K0200GK2nIoKrNoAhur6L2d+Wjfv+\n\tXMYN/zhrurzucTpMIouQv8b2ipVPmmEGbOXFASMdu/gIsugln1pBddvRkuHvj0FdMUYa\n\tsOgg==",
        "X-Gm-Message-State": "AOAM530RrO11cvVRSZWmNDZVOJ+OXu1ev5/ptlM7r+pWdyyU4aZML2Xb\n\tklpLVRvKlYkjxtk16NuGaNy/diRi8cJOAHjiOcOrjlfZeinIYwe0KHVRmK0RbJPtrsPd/eRIqm8\n\tuxQKGIcD4TpUxyD5aK+zl1hXBPu79dE1bVXfNLKXQq+vRFue3d2a9ZOdpgzpLRiTy1/TJpSczxI\n\tQQKgKRPVeX",
        "X-Received": [
            "by 2002:adf:cf0a:: with SMTP id o10mr8372544wrj.84.1638377177462;\n\tWed, 01 Dec 2021 08:46:17 -0800 (PST)",
            "by 2002:adf:cf0a:: with SMTP id o10mr8372520wrj.84.1638377177236;\n\tWed, 01 Dec 2021 08:46:17 -0800 (PST)"
        ],
        "X-Google-Smtp-Source": "ABdhPJzlonVBoFSfrNNp2OaYMBAb46gR3bNGqwTr3L8OTim6AqX/r6sbjKazVzjdw4ux/WsoS1EsJg==",
        "From": "Eric Curtin <ecurtin@redhat.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Wed,  1 Dec 2021 16:44:13 +0000",
        "Message-Id": "<20211201164413.95396-1-ecurtin@redhat.com>",
        "X-Mailer": "git-send-email 2.33.1",
        "MIME-Version": "1.0",
        "X-Mimecast-Spam-Score": "0",
        "X-Mimecast-Originator": "redhat.com",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain; charset=\"US-ASCII\"",
        "Subject": "[libcamera-devel] [PATCH] cam: kms_sink: select valid crtc",
        "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": "When looping through possibleCrtcs on my machine, the only valid crtc is\nactually the first one. This can be identified by checking if the clock\nvariable is non-zero.\n\nSigned-off-by: Eric Curtin <ecurtin@redhat.com>\n---\n src/cam/drm.cpp      | 2 +-\n src/cam/drm.h        | 2 ++\n src/cam/kms_sink.cpp | 4 ++++\n 3 files changed, 7 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/src/cam/drm.cpp b/src/cam/drm.cpp\nindex f2530091..808e5a87 100644\n--- a/src/cam/drm.cpp\n+++ b/src/cam/drm.cpp\n@@ -128,7 +128,7 @@ std::unique_ptr<Blob> Mode::toBlob(Device *dev) const\n }\n \n Crtc::Crtc(Device *dev, const drmModeCrtc *crtc, unsigned int index)\n-\t: Object(dev, crtc->crtc_id, Object::TypeCrtc), index_(index)\n+\t: Object(dev, crtc->crtc_id, Object::TypeCrtc), index_(index), crtc_(crtc)\n {\n }\n \ndiff --git a/src/cam/drm.h b/src/cam/drm.h\nindex de57e445..d05e6d13 100644\n--- a/src/cam/drm.h\n+++ b/src/cam/drm.h\n@@ -149,12 +149,14 @@ public:\n \tCrtc(Device *dev, const drmModeCrtc *crtc, unsigned int index);\n \n \tunsigned int index() const { return index_; }\n+\tuint32_t clock() const { return crtc_->mode.clock; }\n \tconst std::vector<const Plane *> &planes() const { return planes_; }\n \n private:\n \tfriend Device;\n \n \tunsigned int index_;\n+\tconst drmModeCrtc *crtc_;\n \tstd::vector<const Plane *> planes_;\n };\n \ndiff --git a/src/cam/kms_sink.cpp b/src/cam/kms_sink.cpp\nindex d30fba78..aa0b7a3c 100644\n--- a/src/cam/kms_sink.cpp\n+++ b/src/cam/kms_sink.cpp\n@@ -166,6 +166,10 @@ int KMSSink::configurePipeline(const libcamera::PixelFormat &format)\n \t */\n \tfor (const DRM::Encoder *encoder : connector_->encoders()) {\n \t\tfor (const DRM::Crtc *crtc : encoder->possibleCrtcs()) {\n+\t\t\tif (!crtc->clock()) {\n+\t\t\t\tcontinue;\n+\t\t\t}\n+\n \t\t\tfor (const DRM::Plane *plane : crtc->planes()) {\n \t\t\t\tif (plane->type() != DRM::Plane::TypePrimary)\n \t\t\t\t\tcontinue;\n",
    "prefixes": [
        "libcamera-devel"
    ]
}