Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2196463/?format=api
{ "id": 2196463, "url": "http://patchwork.ozlabs.org/api/patches/2196463/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-ppc/patch/20260214021240.58657-8-philmd@linaro.org/", "project": { "id": 69, "url": "http://patchwork.ozlabs.org/api/projects/69/?format=api", "name": "QEMU powerpc development", "link_name": "qemu-ppc", "list_id": "qemu-ppc.nongnu.org", "list_email": "qemu-ppc@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-ppc/patch/20260214021240.58657-8-philmd@linaro.org/mbox/", "series": [ { "id": 492153, "url": "http://patchwork.ozlabs.org/api/series/492153/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-ppc/list/?series=492153", "date": "2026-02-14T02:12:32", "name": "system: Absorb globals-target.c within common globals.c", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/492153/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2196463/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2196463/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<qemu-ppc-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-ppc-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 4fCXfF3Fy4z1xwj\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 14 Feb 2026 13:14:13 +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-ppc-bounces@nongnu.org>)\n\tid 1vr5AE-0003rX-8n; Fri, 13 Feb 2026 21:13:42 -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-0003p6-GZ\n for qemu-ppc@nongnu.org; Fri, 13 Feb 2026 21:13:40 -0500", "from mail-wm1-x333.google.com ([2a00:1450:4864:20::333])\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-0004dH-79\n for qemu-ppc@nongnu.org; Fri, 13 Feb 2026 21:13:40 -0500", "by mail-wm1-x333.google.com with SMTP id\n 5b1f17b1804b1-4836f363d0dso12339015e9.3\n for <qemu-ppc@nongnu.org>; Fri, 13 Feb 2026 18:13:37 -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=RmR46iC/jdRZHUuIksWLtQn9RPVDngvrJdrT8Db/tdOoB79kKRUICC5p8Qhg96h56K\n CwWQFk/n5Mx8IgYODpMCvrmU7eZKngGeSS83De8fooHyjKisbrwZhqdY/RNdyI3kS5tn\n hRvIk7hdfjHdI5IiFAvcueU9DNQaszeClQA1WVRLzdWxWOSJu7WE/UG5nmKtX0X7WTBy\n /kfMVUtYrAeGO6KFcXwLJViMu57nZ7W6Zw8DZOkxTWl3QMd1MdwwCEBgG6Rk6Hny3Lz2\n PQk7qmFd+wT4YnlAR0W5ejtOWXdRfcDer5ca+WOggcOUj0kMOhDX4TwDv8J+EuT4YZ9v\n j6rQ==", "X-Forwarded-Encrypted": "i=1;\n AJvYcCW1EnMOdcBuz3SfNmBy65IUtnWGHVMGlqgkp6ENWZ5XGA22ggbTkcT2Inz0QMPcZavzxJOnOtVEuQ==@nongnu.org", "X-Gm-Message-State": "AOJu0Yy7duFByeYlO3UaI6Nbagwfw5V+14tUCaf5B3S3p9UAOqENwRd7\n 6LYfkqdRJawuJ6Tjxwz1Udvz4qBAON91srSw9rEiNuQI5qC1P9VjlVxoDUJbHurziImdRvO2RUG\n uTd/+avs=", "X-Gm-Gg": "AZuq6aLoYEb6wrX0Vb8TCn5BdzbUMS/iinoeHmKubvbNIksXEA8J41N6IICuhJrp8b7\n PqLgGL/cdLBUukabyOAEIjSJ6m63eekBPT1jWYOMZy0KwX4OiB+DqkGn7/RTmiPjjuGrzG8ni/U\n 813Jl8Ei8QHa51br9BpodXKF33gp9DXyeoVgXmnnwStX8XOmNQj2CEdFggFX8FuOWExR080Hjp6\n KdtdqQTBRTSIkqnNmExyvWvb+2vCtIqn1PJZGSqfMc86I/v89UXNGGBI+WtbqGJiHH1eQox5FDs\n U2FaMiktZM8sQIwMX3hcH6mA3E1Yl66IYbS7gbRg0XAUZ3NVpluLTiGWbDkk8qZtoZvcuHjMS/n\n aj4Np6yH1z2OVQZievSsXjrxh5AsyhGlL2hUvqmu0LA5RpGgUnkiGH8qBSEnWg3xVa/tRzNj9T8\n +Ffhhwp5xKJpBP9VY6PMqoujq/CI9bPgv78vulDxHea6PMBPfy0ts0F4cVMudf5+D/tYgpjowp", "X-Received": "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::333;\n envelope-from=philmd@linaro.org; helo=mail-wm1-x333.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-ppc@nongnu.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "<qemu-ppc.nongnu.org>", "List-Unsubscribe": "<https://lists.nongnu.org/mailman/options/qemu-ppc>,\n <mailto:qemu-ppc-request@nongnu.org?subject=unsubscribe>", "List-Archive": "<https://lists.nongnu.org/archive/html/qemu-ppc>", "List-Post": "<mailto:qemu-ppc@nongnu.org>", "List-Help": "<mailto:qemu-ppc-request@nongnu.org?subject=help>", "List-Subscribe": "<https://lists.nongnu.org/mailman/listinfo/qemu-ppc>,\n <mailto:qemu-ppc-request@nongnu.org?subject=subscribe>", "Errors-To": "qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org", "Sender": "qemu-ppc-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" ] }