Show a patch.

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

{
    "id": 15585,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/15585/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/15585/",
    "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": "<20220329130221.31972-1-ecurtin@redhat.com>",
    "date": "2022-03-29T13:02:21",
    "name": "[libcamera-devel,v3] cam: kms_sink: Remove limitation that camera and display must match",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "fbdca91b221803ec6b1d0c2e80458838592704c6",
    "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/15585/mbox/",
    "series": [
        {
            "id": 3014,
            "url": "https://patchwork.libcamera.org/api/1.1/series/3014/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3014",
            "date": "2022-03-29T13:02:21",
            "name": "[libcamera-devel,v3] cam: kms_sink: Remove limitation that camera and display must match",
            "version": 3,
            "mbox": "https://patchwork.libcamera.org/series/3014/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/15585/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/15585/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 C2B18C0F1B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 29 Mar 2022 13:02:35 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 33A99604C5;\n\tTue, 29 Mar 2022 15:02:35 +0200 (CEST)",
            "from us-smtp-delivery-124.mimecast.com\n\t(us-smtp-delivery-124.mimecast.com [170.10.129.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 4019960135\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 29 Mar 2022 15:02:33 +0200 (CEST)",
            "from mail-wr1-f69.google.com (mail-wr1-f69.google.com\n\t[209.85.221.69]) 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-481-y8NuMXD8Momb2OqKmlcvXg-1; Tue, 29 Mar 2022 09:02:30 -0400",
            "by mail-wr1-f69.google.com with SMTP id\n\tz1-20020adfec81000000b001f1f7e7ec99so5044251wrn.17\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 29 Mar 2022 06:02:30 -0700 (PDT)",
            "from p1.Home ([2001:8a0:6724:4500:a69c:e66f:828e:b340])\n\tby smtp.gmail.com with ESMTPSA id\n\tm3-20020a5d6243000000b001e33760776fsm14804330wrv.10.2022.03.29.06.02.27\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 29 Mar 2022 06:02:27 -0700 (PDT)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1648558955;\n\tbh=C6CUWvwA8Yll6z+vU04qdwV5Pp5haM//IuaBI2z4WqI=;\n\th=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post:\n\tList-Help:List-Subscribe:From:Reply-To:From;\n\tb=SoDSBGNpXPSV7fuwqIgcWBAx7qc4OrravfHD0ALZWMLHV8vo5MMYGx4oxlTKoIkob\n\t5txd7cXObtvk2v62uaRRKYH9kDXNHjdkIi5jVXnZUcDyanb3/UwwmRBhAiSeMWlPLK\n\tmtEOM/vSFM+qvgTImtedOgbkmYDVBSLRuvurx8tatj2HzaWFDqEtLjpfQrXiyR47QL\n\t2h8f9oYpicnjZt1E13JXxUAkR3fWSDCuG9nnjYytsdOVvDLXywzvtwNn6prCL6lDcm\n\tTOrKHpjQLk7q4d7zkJ9WjHYQlGWkJ4LJzwNzplD8HeZbesmwnjNv+jdD4PAWAo6AgX\n\tpye3FjGfYnKjA==",
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1648558952;\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=EQJVlohLk3bwktDvP+k7cN4qz9JVFBof77e2hkOnHhs=;\n\tb=NFw4OvoXXCHfhGy21AeRqbm3yqxXpWjYUphNvHrNIcWozKJ5JYd7FnpKu0O0Rc2cl70Ieb\n\tONqFW9/LcwwDEp7LQ7T8/J70pyGPBoaB+nWY1GhFMkH70WDts81JGotNTzfL8uTIvN/JoX\n\tC79z3mjhY1UDVyt5CEXdtcIiXFY5R6c="
        ],
        "Authentication-Results": [
            "lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=redhat.com\n\theader.i=@redhat.com header.b=\"NFw4OvoX\"; \n\tdkim-atps=neutral",
            "relay.mimecast.com;\n\tauth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ecurtin@redhat.com"
        ],
        "X-MC-Unique": "y8NuMXD8Momb2OqKmlcvXg-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=EQJVlohLk3bwktDvP+k7cN4qz9JVFBof77e2hkOnHhs=;\n\tb=xamMY9qh4cxn/81QaEr20hclJsXzdA0Lw0mtcCbW3CB5pcTHtdUl68Ob4HTXLkbkAg\n\tGdFxF4Qr6nIJny0rkkxXXVb6dS1eH1uCYg5SuSsU0N2zp89GMo20BX7rG8MZRHJ2BVI5\n\tCw+hgA272wNtwkwLv0eFpDB7d/yAKzCNo7KYDwCObFnr+odI5Xl+dsedL2/iIHT8KXza\n\tuc4yUdUMoxogFy1i+gpWxG3kHlpn3xTKX5ftSTzTGsdDykLzmwwnmnJkTc0/lvRtzLZK\n\tme+5gMC0pmiUNQN0e6dlnoPVlesKVD2zOWsUQerM/ImpEBhX50DoxdC+QZfWSpZDiH9N\n\trbmA==",
        "X-Gm-Message-State": "AOAM5318VFsBnvKnsbvIM/cux3kgOIw5GTWl1mpuLwtDoFoB7/GK0L+r\n\tRMguie9xx+YMlL/qE473QPKA07+otrFayMQEOjOld6xbB0W36aGKgSH8yxswiSBj9Etke7rWflx\n\t1OPLCP53PLEgJKaE2qyN4CehO1gSpNnOlS+/a33uQ3XimLCZiA0ZXV6kIMEkCz1FgF+OjOo02Gl\n\t9IQBuWgMwa",
        "X-Received": [
            "by 2002:a7b:c925:0:b0:38c:82d7:868d with SMTP id\n\th5-20020a7bc925000000b0038c82d7868dmr6572664wml.100.1648558948591; \n\tTue, 29 Mar 2022 06:02:28 -0700 (PDT)",
            "by 2002:a7b:c925:0:b0:38c:82d7:868d with SMTP id\n\th5-20020a7bc925000000b0038c82d7868dmr6572597wml.100.1648558948033; \n\tTue, 29 Mar 2022 06:02:28 -0700 (PDT)"
        ],
        "X-Google-Smtp-Source": "ABdhPJy/uINRd1Pmegd381U1iTWHpWGpkF2eXX726h+YCHsGoGT0sBL+JFRodl3we95H7FWo9CFCqg==",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Tue, 29 Mar 2022 14:02:21 +0100",
        "Message-Id": "<20220329130221.31972-1-ecurtin@redhat.com>",
        "X-Mailer": "git-send-email 2.35.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\"; x-default=true",
        "Subject": "[libcamera-devel] [PATCH v3] cam: kms_sink: Remove limitation that\n\tcamera and display must match",
        "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>",
        "From": "Eric Curtin via libcamera-devel <libcamera-devel@lists.libcamera.org>",
        "Reply-To": "Eric Curtin <ecurtin@redhat.com>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "There is a limitation that requires input and output to be pixel\nfor pixel identical in terms of height and width. Remove this\nlimitation to enable more hardware that doesn't match. Just start\ndrawing from top right 0, 0 corner.\n\nSigned-off-by: Eric Curtin <ecurtin@redhat.com>\n---\nChanges in v2:\n- Tested and support drawing from negative pixel range\n  kernel parameter (video=960x540@60) was useful here\nChanges in v3:\n- Much simplified version of the patch where we just attempt to\n  draw from point 0, 0. Only in the case where we do not find a\n  matching mode. Can expand to do centralization, scaling, etc.\n  in further patches if needs be.\n---\n src/cam/kms_sink.cpp | 22 +++++++++++++---------\n 1 file changed, 13 insertions(+), 9 deletions(-)",
    "diff": "diff --git a/src/cam/kms_sink.cpp b/src/cam/kms_sink.cpp\nindex da579846..5847c4e1 100644\n--- a/src/cam/kms_sink.cpp\n+++ b/src/cam/kms_sink.cpp\n@@ -119,17 +119,21 @@ int KMSSink::configure(const libcamera::CameraConfiguration &config)\n \t\t\t\t\t\t      mode.vdisplay == cfg.size.height;\n \t\t\t\t       });\n \tif (iter == modes.end()) {\n-\t\tstd::cerr\n-\t\t\t<< \"No mode matching \" << cfg.size.toString()\n-\t\t\t<< std::endl;\n-\t\treturn -EINVAL;\n+                if (modes.empty()) {\n+        \t\tstd::cerr << \"No modes\\n\";\n+        \t\treturn -EINVAL;\n+                }\n+\n+                mode_ = &modes[0];\n \t}\n+        else {\n+                mode_ = &*iter;\n+        }\n \n \tint ret = configurePipeline(cfg.pixelFormat);\n \tif (ret < 0)\n \t\treturn ret;\n \n-\tmode_ = &*iter;\n \tsize_ = cfg.size;\n \tstride_ = cfg.stride;\n \n@@ -297,12 +301,12 @@ bool KMSSink::processRequest(libcamera::Request *camRequest)\n \t\tdrmRequest->addProperty(plane_, \"CRTC_ID\", crtc_->id());\n \t\tdrmRequest->addProperty(plane_, \"SRC_X\", 0 << 16);\n \t\tdrmRequest->addProperty(plane_, \"SRC_Y\", 0 << 16);\n-\t\tdrmRequest->addProperty(plane_, \"SRC_W\", mode_->hdisplay << 16);\n-\t\tdrmRequest->addProperty(plane_, \"SRC_H\", mode_->vdisplay << 16);\n+\t\tdrmRequest->addProperty(plane_, \"SRC_W\", size_.width << 16);\n+\t\tdrmRequest->addProperty(plane_, \"SRC_H\", size_.height << 16);\n \t\tdrmRequest->addProperty(plane_, \"CRTC_X\", 0);\n \t\tdrmRequest->addProperty(plane_, \"CRTC_Y\", 0);\n-\t\tdrmRequest->addProperty(plane_, \"CRTC_W\", mode_->hdisplay);\n-\t\tdrmRequest->addProperty(plane_, \"CRTC_H\", mode_->vdisplay);\n+\t\tdrmRequest->addProperty(plane_, \"CRTC_W\", size_.width);\n+\t\tdrmRequest->addProperty(plane_, \"CRTC_H\", size_.height);\n \n \t\tflags |= DRM::AtomicRequest::FlagAllowModeset;\n \t}\n",
    "prefixes": [
        "libcamera-devel",
        "v3"
    ]
}