get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2196461,
    "url": "http://patchwork.ozlabs.org/api/patches/2196461/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260214021240.58657-8-philmd@linaro.org/",
    "project": {
        "id": 14,
        "url": "http://patchwork.ozlabs.org/api/projects/14/?format=api",
        "name": "QEMU Development",
        "link_name": "qemu-devel",
        "list_id": "qemu-devel.nongnu.org",
        "list_email": "qemu-devel@nongnu.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20260214021240.58657-8-philmd@linaro.org>",
    "list_archive_url": null,
    "date": "2026-02-14T02:12:38",
    "name": "[7/8] hw/ppc: Set graphic display dimensions generically",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "a80baead3aef975637080cd21252291d18d045db",
    "submitter": {
        "id": 85046,
        "url": "http://patchwork.ozlabs.org/api/people/85046/?format=api",
        "name": "Philippe Mathieu-Daudé",
        "email": "philmd@linaro.org"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260214021240.58657-8-philmd@linaro.org/mbox/",
    "series": [
        {
            "id": 492154,
            "url": "http://patchwork.ozlabs.org/api/series/492154/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=492154",
            "date": "2026-02-14T02:12:35",
            "name": "system: Absorb globals-target.c within common globals.c",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/492154/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2196461/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2196461/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>",
        "X-Original-To": "incoming@patchwork.ozlabs.org",
        "Delivered-To": "patchwork-incoming@legolas.ozlabs.org",
        "Authentication-Results": [
            "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256\n header.s=google header.b=kXJuLaPM;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org\n (client-ip=209.51.188.17; helo=lists.gnu.org;\n envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=patchwork.ozlabs.org)"
        ],
        "Received": [
            "from lists.gnu.org (lists.gnu.org [209.51.188.17])\n\t(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fCXfB42tMz1xpY\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 14 Feb 2026 13:14:10 +1100 (AEDT)",
            "from localhost ([::1] helo=lists1p.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.90_1)\n\t(envelope-from <qemu-devel-bounces@nongnu.org>)\n\tid 1vr5AD-0003qf-PB; Fri, 13 Feb 2026 21:13:41 -0500",
            "from eggs.gnu.org ([2001:470:142:3::10])\n by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <philmd@linaro.org>) id 1vr5AC-0003p5-G0\n for qemu-devel@nongnu.org; Fri, 13 Feb 2026 21:13:40 -0500",
            "from mail-wm1-x329.google.com ([2a00:1450:4864:20::329])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)\n (Exim 4.90_1) (envelope-from <philmd@linaro.org>) id 1vr5AA-0004dJ-If\n for qemu-devel@nongnu.org; Fri, 13 Feb 2026 21:13:40 -0500",
            "by mail-wm1-x329.google.com with SMTP id\n 5b1f17b1804b1-48379a42f76so2885005e9.0\n for <qemu-devel@nongnu.org>; Fri, 13 Feb 2026 18:13:38 -0800 (PST)",
            "from localhost.localdomain (88-187-86-199.subs.proxad.net.\n [88.187.86.199]) by smtp.gmail.com with ESMTPSA id\n 5b1f17b1804b1-4835dd0deeasm216705805e9.12.2026.02.13.18.13.35\n (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256);\n Fri, 13 Feb 2026 18:13:36 -0800 (PST)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=linaro.org; s=google; t=1771035217; x=1771640017; darn=nongnu.org;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=CxZmHoD4NLKTu0jEJRVbx1DWKJRYt99sqgMKoBjz8/o=;\n b=kXJuLaPMkah1BijVX7sJCFlsCmU4hqY88s0bpLJGUC1jnrhZJVxmAgCzF+QNzuc/CF\n 4c6pmhDVnDJ8DSQpjXG8NTHTTpd5XWfSjAypXS635do6T4A90kdlB8iq0cYylOlAGNvU\n 19mPw2kmFtXb+QP8Gs0sluM/aec/7RMsSiZRX7EHOSApLW54cRzJtJVeN8kfzr3ubveC\n 1yGFp+czouu70WTAa6Tvc/MMebWo17uizog4m3rxJM1cdPn2eRqXi2Gt0MTjybqr3k52\n ojlNvzNesaMSamF8DeyoDDLQi5MZWv4z4AqtRLHgwwIFsCdbdLIGmOoT51KpCE/ry0A9\n H/XQ==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20230601; t=1771035217; x=1771640017;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n :to:cc:subject:date:message-id:reply-to;\n bh=CxZmHoD4NLKTu0jEJRVbx1DWKJRYt99sqgMKoBjz8/o=;\n b=j8X3DROP1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"by 2002:a05:600c:3e06:b0:482:e5d4:b7ca with SMTP id\n 5b1f17b1804b1-48379bac81dmr19399765e9.8.1771035216806;\n Fri, 13 Feb 2026 18:13:36 -0800 (PST)",
        "From": "=?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= <philmd@linaro.org>",
        "To": "qemu-devel@nongnu.org",
        "Cc": "Chinmay Rath <rathc@linux.ibm.com>,\n =?utf-8?q?Herv=C3=A9_Poussineau?= <hpoussin@reactos.org>,\n Harsh Prateek Bora <harshpb@linux.ibm.com>,\n Nicholas Piggin <npiggin@gmail.com>, Artyom Tarasenko <atar4qemu@gmail.com>,\n Pierrick Bouvier <pierrick.bouvier@linaro.org>, qemu-ppc@nongnu.org,\n Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>,\n Laurent Vivier <laurent@vivier.eu>,\n =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= <philmd@linaro.org>",
        "Subject": "[PATCH 7/8] hw/ppc: Set graphic display dimensions generically",
        "Date": "Sat, 14 Feb 2026 03:12:38 +0100",
        "Message-ID": "<20260214021240.58657-8-philmd@linaro.org>",
        "X-Mailer": "git-send-email 2.52.0",
        "In-Reply-To": "<20260214021240.58657-1-philmd@linaro.org>",
        "References": "<20260214021240.58657-1-philmd@linaro.org>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=UTF-8",
        "Content-Transfer-Encoding": "8bit",
        "Received-SPF": "pass client-ip=2a00:1450:4864:20::329;\n envelope-from=philmd@linaro.org; helo=mail-wm1-x329.google.com",
        "X-Spam_score_int": "-20",
        "X-Spam_score": "-2.1",
        "X-Spam_bar": "--",
        "X-Spam_report": "(-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,\n DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,\n RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,\n SPF_PASS=-0.001 autolearn=ham autolearn_force=no",
        "X-Spam_action": "no action",
        "X-BeenThere": "qemu-devel@nongnu.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "qemu development <qemu-devel.nongnu.org>",
        "List-Unsubscribe": "<https://lists.nongnu.org/mailman/options/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>",
        "List-Archive": "<https://lists.nongnu.org/archive/html/qemu-devel>",
        "List-Post": "<mailto:qemu-devel@nongnu.org>",
        "List-Help": "<mailto:qemu-devel-request@nongnu.org?subject=help>",
        "List-Subscribe": "<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=subscribe>",
        "Errors-To": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org",
        "Sender": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org"
    },
    "content": "If a dimension is not set, have the machine init code set\nthe default value by calling the ppc_graphic_dimensions()\nhelper, common to all PowerPC machines. Declare local\nvariables to avoid using the global ones.\n\nSigned-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>\n---\n include/hw/ppc/ppc.h    |  2 ++\n hw/ppc/mac_newworld.c   | 10 ++++++----\n hw/ppc/mac_oldworld.c   | 10 ++++++----\n hw/ppc/ppc.c            |  8 ++++++++\n hw/ppc/prep.c           |  4 ++++\n hw/ppc/spapr.c          |  4 ++++\n system/globals-target.c |  6 ------\n 7 files changed, 30 insertions(+), 14 deletions(-)",
    "diff": "diff --git a/include/hw/ppc/ppc.h b/include/hw/ppc/ppc.h\nindex cb51d704c6d..14cc09ab22b 100644\n--- a/include/hw/ppc/ppc.h\n+++ b/include/hw/ppc/ppc.h\n@@ -102,6 +102,8 @@ enum {\n     ARCH_MAC99_U3,\n };\n \n+void ppc_graphic_dimensions(int *width, int *height, int *depth);\n+\n #define FW_CFG_PPC_WIDTH        (FW_CFG_ARCH_LOCAL + 0x00)\n #define FW_CFG_PPC_HEIGHT       (FW_CFG_ARCH_LOCAL + 0x01)\n #define FW_CFG_PPC_DEPTH        (FW_CFG_ARCH_LOCAL + 0x02)\ndiff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c\nindex 7275563a155..daf0029c01a 100644\n--- a/hw/ppc/mac_newworld.c\n+++ b/hw/ppc/mac_newworld.c\n@@ -156,6 +156,7 @@ static void ppc_core99_init(MachineState *machine)\n     DeviceState *uninorth_internal_dev = NULL, *uninorth_agp_dev = NULL;\n     hwaddr nvram_addr = 0xFFF04000;\n     uint64_t tbfreq = kvm_enabled() ? kvmppc_get_tbfreq() : TBFREQ;\n+    int graphic_width, graphic_height, graphic_depth;\n \n     /* init CPUs */\n     for (i = 0; i < machine->smp.cpus; i++) {\n@@ -432,10 +433,6 @@ static void ppc_core99_init(MachineState *machine)\n \n     pci_vga_init(pci_bus);\n \n-    if (graphic_depth != 15 && graphic_depth != 32 && graphic_depth != 8) {\n-        graphic_depth = 15;\n-    }\n-\n     pci_init_nic_devices(pci_bus, mc->default_nic);\n \n     /* The NewWorld NVRAM is not located in the MacIO device */\n@@ -480,6 +477,11 @@ static void ppc_core99_init(MachineState *machine)\n     fw_cfg_add_i32(fw_cfg, FW_CFG_INITRD_SIZE, initrd_size);\n     fw_cfg_add_i16(fw_cfg, FW_CFG_BOOT_DEVICE, ppc_boot_device);\n \n+    ppc_graphic_dimensions(&graphic_width, &graphic_height, &graphic_depth);\n+    if (graphic_depth != 15 && graphic_depth != 32 && graphic_depth != 8) {\n+        graphic_depth = 15;\n+    }\n+\n     fw_cfg_add_i16(fw_cfg, FW_CFG_PPC_WIDTH, graphic_width);\n     fw_cfg_add_i16(fw_cfg, FW_CFG_PPC_HEIGHT, graphic_height);\n     fw_cfg_add_i16(fw_cfg, FW_CFG_PPC_DEPTH, graphic_depth);\ndiff --git a/hw/ppc/mac_oldworld.c b/hw/ppc/mac_oldworld.c\nindex e679d338985..ea1f778877c 100644\n--- a/hw/ppc/mac_oldworld.c\n+++ b/hw/ppc/mac_oldworld.c\n@@ -108,6 +108,7 @@ static void ppc_heathrow_init(MachineState *machine)\n     DriveInfo *dinfo, *hd[MAX_IDE_BUS * MAX_IDE_DEVS];\n     void *fw_cfg;\n     uint64_t tbfreq = kvm_enabled() ? kvmppc_get_tbfreq() : TBFREQ;\n+    int graphic_width, graphic_height, graphic_depth;\n \n     /* init CPUs */\n     for (i = 0; i < machine->smp.cpus; i++) {\n@@ -288,10 +289,6 @@ static void ppc_heathrow_init(MachineState *machine)\n         pci_create_simple(pci_bus, -1, \"pci-ohci\");\n     }\n \n-    if (graphic_depth != 15 && graphic_depth != 32 && graphic_depth != 8) {\n-        graphic_depth = 15;\n-    }\n-\n     /* No PCI init: the BIOS will do it */\n \n     dev = qdev_new(TYPE_FW_CFG_MEM);\n@@ -321,6 +318,11 @@ static void ppc_heathrow_init(MachineState *machine)\n     fw_cfg_add_i32(fw_cfg, FW_CFG_INITRD_SIZE, initrd_size);\n     fw_cfg_add_i16(fw_cfg, FW_CFG_BOOT_DEVICE, ppc_boot_device);\n \n+    ppc_graphic_dimensions(&graphic_width, &graphic_height, &graphic_depth);\n+    if (graphic_depth != 15 && graphic_depth != 32 && graphic_depth != 8) {\n+        graphic_depth = 15;\n+    }\n+\n     fw_cfg_add_i16(fw_cfg, FW_CFG_PPC_WIDTH, graphic_width);\n     fw_cfg_add_i16(fw_cfg, FW_CFG_PPC_HEIGHT, graphic_height);\n     fw_cfg_add_i16(fw_cfg, FW_CFG_PPC_DEPTH, graphic_depth);\ndiff --git a/hw/ppc/ppc.c b/hw/ppc/ppc.c\nindex a512d4fa647..d7b4466d701 100644\n--- a/hw/ppc/ppc.c\n+++ b/hw/ppc/ppc.c\n@@ -29,6 +29,7 @@\n #include \"qemu/timer.h\"\n #include \"exec/cpu-interrupt.h\"\n #include \"system/cpus.h\"\n+#include \"system/system.h\"\n #include \"qemu/log.h\"\n #include \"qemu/main-loop.h\"\n #include \"qemu/error-report.h\"\n@@ -1557,3 +1558,10 @@ void ppc_irq_reset(PowerPCCPU *cpu)\n         kvmppc_set_interrupt(cpu, PPC_INTERRUPT_EXT, 0);\n     }\n }\n+\n+void ppc_graphic_dimensions(int *width, int *height, int *depth)\n+{\n+    *width = graphic_width ?: 800;\n+    *height = graphic_height ?: 600;\n+    *depth = graphic_depth ?: 32;\n+}\ndiff --git a/hw/ppc/prep.c b/hw/ppc/prep.c\nindex c4efd1d3908..7077b047b25 100644\n--- a/hw/ppc/prep.c\n+++ b/hw/ppc/prep.c\n@@ -43,6 +43,7 @@\n #include \"exec/target_page.h\"\n #include \"system/kvm.h\"\n #include \"system/reset.h\"\n+#include \"system/system.h\"\n #include \"trace.h\"\n #include \"elf.h\"\n #include \"qemu/units.h\"\n@@ -250,6 +251,7 @@ static void ibm_40p_init(MachineState *machine)\n     uint32_t kernel_base = 0, initrd_base = 0;\n     long kernel_size = 0, initrd_size = 0;\n     char boot_device;\n+    int graphic_width, graphic_height, graphic_depth;\n \n     if (kvm_enabled()) {\n         error_report(\"machine %s does not support the KVM accelerator\",\n@@ -412,6 +414,8 @@ static void ibm_40p_init(MachineState *machine)\n     fw_cfg_add_i64(fw_cfg, FW_CFG_RAM_SIZE, (uint64_t)machine->ram_size);\n     fw_cfg_add_i16(fw_cfg, FW_CFG_MACHINE_ID, ARCH_PREP);\n \n+    ppc_graphic_dimensions(&graphic_width, &graphic_height, &graphic_depth);\n+\n     fw_cfg_add_i16(fw_cfg, FW_CFG_PPC_WIDTH, graphic_width);\n     fw_cfg_add_i16(fw_cfg, FW_CFG_PPC_HEIGHT, graphic_height);\n     fw_cfg_add_i16(fw_cfg, FW_CFG_PPC_DEPTH, graphic_depth);\ndiff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c\nindex 274f38785f2..c50c7da34d5 100644\n--- a/hw/ppc/spapr.c\n+++ b/hw/ppc/spapr.c\n@@ -1143,6 +1143,7 @@ static void spapr_dt_chosen(SpaprMachineState *spapr, void *fdt, bool reset)\n {\n     MachineState *machine = MACHINE(spapr);\n     int chosen;\n+    int graphic_width, graphic_height, graphic_depth;\n \n     _FDT(chosen = fdt_add_subnode(fdt, 0, \"chosen\"));\n \n@@ -1177,6 +1178,9 @@ static void spapr_dt_chosen(SpaprMachineState *spapr, void *fdt, bool reset)\n         if (machine->boot_config.has_menu && machine->boot_config.menu) {\n             _FDT((fdt_setprop_cell(fdt, chosen, \"qemu,boot-menu\", true)));\n         }\n+\n+        ppc_graphic_dimensions(&graphic_width, &graphic_height, &graphic_depth);\n+\n         _FDT(fdt_setprop_cell(fdt, chosen, \"qemu,graphic-width\", graphic_width));\n         _FDT(fdt_setprop_cell(fdt, chosen, \"qemu,graphic-height\", graphic_height));\n         _FDT(fdt_setprop_cell(fdt, chosen, \"qemu,graphic-depth\", graphic_depth));\ndiff --git a/system/globals-target.c b/system/globals-target.c\nindex 17a27a06218..ffa6c308b59 100644\n--- a/system/globals-target.c\n+++ b/system/globals-target.c\n@@ -9,12 +9,6 @@\n #include \"qemu/osdep.h\"\n #include \"system/system.h\"\n \n-#if defined(TARGET_SPARC) || defined(TARGET_M68K)\n int graphic_width;\n int graphic_height;\n int graphic_depth;\n-#else\n-int graphic_width = 800;\n-int graphic_height = 600;\n-int graphic_depth = 32;\n-#endif\n",
    "prefixes": [
        "7/8"
    ]
}