get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2225564,
    "url": "http://patchwork.ozlabs.org/api/patches/2225564/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-tegra/patch/20260421073646.144712-4-tzimmermann@suse.de/",
    "project": {
        "id": 21,
        "url": "http://patchwork.ozlabs.org/api/projects/21/?format=api",
        "name": "Linux Tegra Development",
        "link_name": "linux-tegra",
        "list_id": "linux-tegra.vger.kernel.org",
        "list_email": "linux-tegra@vger.kernel.org",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20260421073646.144712-4-tzimmermann@suse.de>",
    "list_archive_url": null,
    "date": "2026-04-21T07:29:07",
    "name": "[3/5] drm/tegra: fbdev: Calculate buffer geometry with format helpers",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "d68f777213d13e3c04bd027142a6712895a8eeaf",
    "submitter": {
        "id": 74535,
        "url": "http://patchwork.ozlabs.org/api/people/74535/?format=api",
        "name": "Thomas Zimmermann",
        "email": "tzimmermann@suse.de"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linux-tegra/patch/20260421073646.144712-4-tzimmermann@suse.de/mbox/",
    "series": [
        {
            "id": 500750,
            "url": "http://patchwork.ozlabs.org/api/series/500750/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linux-tegra/list/?series=500750",
            "date": "2026-04-21T07:29:04",
            "name": "drm/tegra: fbdev: Use client buffers",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/500750/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2225564/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2225564/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "\n <linux-tegra+bounces-13828-incoming=patchwork.ozlabs.org@vger.kernel.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "linux-tegra@vger.kernel.org"
        ],
        "Delivered-To": "patchwork-incoming@legolas.ozlabs.org",
        "Authentication-Results": [
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c15:e001:75::12fc:5321; helo=sin.lore.kernel.org;\n envelope-from=linux-tegra+bounces-13828-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)",
            "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=195.135.223.131",
            "smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=suse.de",
            "smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=suse.de",
            "smtp-out2.suse.de;\n\tnone"
        ],
        "Received": [
            "from sin.lore.kernel.org (sin.lore.kernel.org\n [IPv6:2600:3c15:e001:75::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g0DwM38Zqz1yGs\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 21 Apr 2026 17:47:31 +1000 (AEST)",
            "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sin.lore.kernel.org (Postfix) with ESMTP id A18ED3000BA6\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 21 Apr 2026 07:36:59 +0000 (UTC)",
            "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 1606E331A78;\n\tTue, 21 Apr 2026 07:36:58 +0000 (UTC)",
            "from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id 9AA022FF641\n\tfor <linux-tegra@vger.kernel.org>; Tue, 21 Apr 2026 07:36:56 +0000 (UTC)",
            "from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org\n [IPv6:2a07:de40:b281:104:10:150:64:97])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest\n SHA256)\n\t(No client certificate requested)\n\tby smtp-out2.suse.de (Postfix) with ESMTPS id 1B2BF5BCC2;\n\tTue, 21 Apr 2026 07:36:55 +0000 (UTC)",
            "from imap1.dmz-prg2.suse.org (localhost [127.0.0.1])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest\n SHA256)\n\t(No client certificate requested)\n\tby imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id BE6AA593AF;\n\tTue, 21 Apr 2026 07:36:54 +0000 (UTC)",
            "from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167])\n\tby imap1.dmz-prg2.suse.org with ESMTPSA\n\tid CIwMLRYp52lgMQAAD6G6ig\n\t(envelope-from <tzimmermann@suse.de>); Tue, 21 Apr 2026 07:36:54 +0000"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1776757017; cv=none;\n b=sTleVtLe3TGN7Bicm/iccfKO5SQar0PYZot+UohlIC74x7SO/RP45dPXaajC4gm5ADPzzDd3OFRpmjYZ4xJ3ku5QGh5r7wDyZbojhxdPnffwamMpA7rOrBpOHvpDmqRBLRoF2T7v3EMUPFKaDMuKQ93fhFICjL4ffqdDwcNloWY=",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1776757017; c=relaxed/simple;\n\tbh=COXteqBl+6s/BtDtlqfxIq28A50KdLRinP0syYufukY=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=CZJv5iPgMlkkcL6M1OwzFgWDl4MzMtW8f/xe10e5F0BTyX/i79fS9Jfst8FKzHVsthflWtEHqKD81tX8ibzEXx3k5V8KT4qn+Vavz9OOcf8Obo3w4UP2APovkK2snX12vZlmUJLas5udox0s9uR04IhzYBYigoE4dIcJu04JS68=",
        "ARC-Authentication-Results": "i=1; smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=suse.de;\n spf=pass smtp.mailfrom=suse.de; arc=none smtp.client-ip=195.135.223.131",
        "From": "Thomas Zimmermann <tzimmermann@suse.de>",
        "To": "thierry.reding@gmail.com,\n\tmperttunen@nvidia.com,\n\tairlied@gmail.com,\n\tsimona@ffwll.ch,\n\tjonathanh@nvidia.com",
        "Cc": "dri-devel@lists.freedesktop.org,\n\tlinux-tegra@vger.kernel.org,\n\tThomas Zimmermann <tzimmermann@suse.de>",
        "Subject": "[PATCH 3/5] drm/tegra: fbdev: Calculate buffer geometry with format\n helpers",
        "Date": "Tue, 21 Apr 2026 09:29:07 +0200",
        "Message-ID": "<20260421073646.144712-4-tzimmermann@suse.de>",
        "X-Mailer": "git-send-email 2.53.0",
        "In-Reply-To": "<20260421073646.144712-1-tzimmermann@suse.de>",
        "References": "<20260421073646.144712-1-tzimmermann@suse.de>",
        "Precedence": "bulk",
        "X-Mailing-List": "linux-tegra@vger.kernel.org",
        "List-Id": "<linux-tegra.vger.kernel.org>",
        "List-Subscribe": "<mailto:linux-tegra+subscribe@vger.kernel.org>",
        "List-Unsubscribe": "<mailto:linux-tegra+unsubscribe@vger.kernel.org>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "X-Rspamd-Pre-Result": [
            "action=no action;\n\tmodule=replies;\n\tMessage is reply to one we originated",
            "action=no action;\n\tmodule=replies;\n\tMessage is reply to one we originated"
        ],
        "X-Rspamd-Queue-Id": "1B2BF5BCC2",
        "X-Rspamd-Action": "no action",
        "X-Spam-Score": "-4.00",
        "X-Spam-Level": "",
        "X-Spam-Flag": "NO",
        "X-Spamd-Result": "default: False [-4.00 / 50.00];\n\tREPLY(-4.00)[];\n\tTAGGED_RCPT(0.00)[]",
        "X-Rspamd-Server": "rspamd1.dmz-prg2.suse.org"
    },
    "content": "Replace the geometry and size calculation in tegra's fbdev emulation\nwith DRM format helpers. This consists of a 4CC lookup from the fbdev\nparameters, format lookup, pitch calculation and size calculation.\nThen allocate the GEM buffer object for the framebuffer memory from\nthe calculated size.\n\nSet up mode_cmd with the calculated values just before allocating the\nframebuffer. This code will later be replaced with a DRM client buffer.\n\nSet framebuffer size fields in struct fb_info from the size stored in\nthe GEM buffer object instead of what has been requested. The requested\nsize is an estimate, while the buffer size is the exact value rounded\nto the correct alignment.\n\nSigned-off-by: Thomas Zimmermann <tzimmermann@suse.de>\n---\n drivers/gpu/drm/tegra/fbdev.c | 34 ++++++++++++++++------------------\n 1 file changed, 16 insertions(+), 18 deletions(-)",
    "diff": "diff --git a/drivers/gpu/drm/tegra/fbdev.c b/drivers/gpu/drm/tegra/fbdev.c\nindex 793849199783..bcf32cfcf818 100644\n--- a/drivers/gpu/drm/tegra/fbdev.c\n+++ b/drivers/gpu/drm/tegra/fbdev.c\n@@ -74,31 +74,29 @@ int tegra_fbdev_driver_fbdev_probe(struct drm_fb_helper *helper,\n \tstruct drm_device *drm = helper->dev;\n \tstruct drm_mode_fb_cmd2 cmd = { 0 };\n \tstruct fb_info *info = helper->info;\n-\tunsigned int bytes_per_pixel;\n+\tu32 fourcc, pitch;\n+\tu64 size;\n+\tconst struct drm_format_info *format;\n \tstruct drm_framebuffer *fb;\n \tstruct tegra_bo *bo;\n-\tsize_t size;\n \tint err;\n \n-\tbytes_per_pixel = DIV_ROUND_UP(sizes->surface_bpp, 8);\n-\n-\tcmd.width = sizes->surface_width;\n-\tcmd.height = sizes->surface_height;\n-\tcmd.pitches[0] = round_up(sizes->surface_width * bytes_per_pixel,\n-\t\t\t\t  tegra->pitch_align);\n-\n-\tcmd.pixel_format = drm_mode_legacy_fb_format(sizes->surface_bpp,\n-\t\t\t\t\t\t     sizes->surface_depth);\n-\n-\tsize = cmd.pitches[0] * cmd.height;\n+\tfourcc = drm_mode_legacy_fb_format(sizes->surface_bpp, sizes->surface_depth);\n+\tformat = drm_get_format_info(drm, fourcc, DRM_FORMAT_MOD_LINEAR);\n+\tpitch = round_up(drm_format_info_min_pitch(format, 0, sizes->surface_width),\n+\t\t\t tegra->pitch_align);\n+\tsize = ALIGN(pitch * sizes->surface_height, PAGE_SIZE);\n \n \tbo = tegra_bo_create(drm, size, 0);\n \tif (IS_ERR(bo))\n \t\treturn PTR_ERR(bo);\n \n-\tfb = tegra_fb_alloc(drm,\n-\t\t\t    drm_get_format_info(drm, cmd.pixel_format, cmd.modifier[0]),\n-\t\t\t    &cmd, &bo, 1);\n+\tcmd.pixel_format = fourcc;\n+\tcmd.width = sizes->surface_width;\n+\tcmd.height = sizes->surface_height;\n+\tcmd.pitches[0] = pitch;\n+\n+\tfb = tegra_fb_alloc(drm, format, &cmd, &bo, 1);\n \tif (IS_ERR(fb)) {\n \t\terr = PTR_ERR(fb);\n \t\tdev_err(drm->dev, \"failed to allocate DRM framebuffer: %d\\n\",\n@@ -126,9 +124,9 @@ int tegra_fbdev_driver_fbdev_probe(struct drm_fb_helper *helper,\n \n \tinfo->flags |= FBINFO_VIRTFB;\n \tinfo->screen_buffer = bo->vaddr;\n-\tinfo->screen_size = size;\n+\tinfo->screen_size = bo->gem.size;\n \tinfo->fix.smem_start = (unsigned long)(bo->iova);\n-\tinfo->fix.smem_len = size;\n+\tinfo->fix.smem_len = bo->gem.size;\n \n \treturn 0;\n \n",
    "prefixes": [
        "3/5"
    ]
}