From patchwork Tue Dec 3 11:31:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 846953 Delivered-To: patch@linaro.org Received: by 2002:a5d:44cd:0:b0:385:e875:8a9e with SMTP id z13csp424636wrr; Tue, 3 Dec 2024 03:33:09 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXgesNl4glKbT20Ocp6v6ymrZEpfZ65z9LAB85sQIZB7a6v7iBqAYxUdozh3TEiKbpXq2yWtg==@linaro.org X-Google-Smtp-Source: AGHT+IHv7jMJCxrurq7rIXGBb0LdObQvz2O8kipUxL62+UCeKKzCJ6kTuknlOU3XeX2UZS6VoaoP X-Received: by 2002:ad4:5c6c:0:b0:6d4:12c:c6cc with SMTP id 6a1803df08f44-6d8b7385f0fmr40866596d6.25.1733225589566; Tue, 03 Dec 2024 03:33:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1733225589; cv=none; d=google.com; s=arc-20240605; b=ARndweQcmbQnSxRtI/s2tNyNbRfa4i1HDPqoYMI7K4NZpTxAYOvz89+0R0DhvUIzay 8ILWFbb4zz5XNAhGUWEh3dvk7uRWN7AOE+5TmBWhuFyNANhVHkpd/7auSNlbXZyLS6/e TntWDsAmCNcfEn/zW+2GZXbtAd8f5lTE05TfVWsziDgsyAStEcI8171m1GaRCGyd+M5t UPSs/LWs5xDBKeL+qSC1Ka0UFEp0XsnSm6I+ciYx7qyXezljq8S5B1R3njJLHZzmCXLg ItxN3aNnkhL7B6kWW6ztAXb/CsHj2fw/GXh6wK6cGBiq/QRqXFqCqBACl6YNaj1X313u 6tQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=8t8QZY/FN9UNn+m+6+g6e/VW+X5qrUlO0/BnLyYU4FA=; fh=0XtXTUbn8xZU8pj5Y33pO81yY/nX6jps34El+2xFlSM=; b=anaLrRelfoYASoGvlPmoqncIhnYxxE7ySLBkB/Npz0o1fx1i+DxnV6R3YTWOXe9Swc /8FlOgQ2hXQTcyn5cRlpdxZp3xx22LqNYiENqEZnATe5lvwqbeq4m3pY9ZOpzhoCjc4l YWbHTnvUsNJweh/sOTCCLO3WUtgNQ6/ZBhNO4vSqTC5desJNDV99J3llS/dJC0yoUaSd +KKtXCEbUJq5Ary2iAx0api2oT1FHV0jOMHa3zz2BLW57lUPP+rbYW7u2qvpcLOZ4m09 DrmXLj/jylgLGLP6CdeMb24Bq6eDWmvIW+l9JVYZEwLFjiPH0qtlV/E1dONelQxIy1x0 iGcg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TUh0Qxu+; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6d89cff671fsi80833206d6.491.2024.12.03.03.33.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 03 Dec 2024 03:33:09 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TUh0Qxu+; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tIR8s-0000n8-B3; Tue, 03 Dec 2024 06:32:34 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tIR8q-0000k3-ND for qemu-devel@nongnu.org; Tue, 03 Dec 2024 06:32:32 -0500 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tIR8p-0000bC-8a for qemu-devel@nongnu.org; Tue, 03 Dec 2024 06:32:32 -0500 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-4349e4e252dso50350465e9.0 for ; Tue, 03 Dec 2024 03:32:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733225549; x=1733830349; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8t8QZY/FN9UNn+m+6+g6e/VW+X5qrUlO0/BnLyYU4FA=; b=TUh0Qxu+rCrm1E9zC/MBR5dQxsKbjavqPE1wneuyH1/q3rqK2CMtZAQH+C0YfC0KTI Z7/KvltAxNegvhDoqZ1CCpRC0JtjdTawrjWQSFWDnEb5Jfa6WM1opB/It24yHQMQEJt3 YJ2XAEFElSLwwl1V0kjdmNOpmd8fpzgwAw9UsV2TF1l0UyxNE5m2xPcn0onyROylBzTE lW792qqMedKZwce6b7ErFNKGQB2mnob7mbT0eIW8GDHLbD2JqHeehkRD6uiLj6w749zY 85kNZ3xjz0YdtKTQAEEwlhf5anKpw9Y7XmPQbMpJq0S5yBX4NR0uax1q+IF91lkws9OU H0kA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733225549; x=1733830349; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8t8QZY/FN9UNn+m+6+g6e/VW+X5qrUlO0/BnLyYU4FA=; b=DLpNeUh+GxdxjNCS7HED2QYliuhz8Wp3Eq3nqDZ81gCRvj9nB2CMuYVMeRX3PespDn calIjYCHWHOd20HBpxDXSuyv9PE/MQVO45UMuY5IR9xTZXcvlIEr7rXnRBQAwsMqIcsK UVI7Ibn+PG1nT4WCm5+42SwUM6hhEiP8sMv8qOH7yKrR+U1SGc/YoWW860ZcR4rCpSYB sARdbak6cHCaxZLNuEGi5qpkz/prw6+GvRTwMBTjg+UCXlevdvgZVMhY1jbgX3fOpPuv KnTxbx5dYKQMaIqFvS1HLm4JMu1321L8FdRkPt16RVYEcrwzJzIcWlYUvU8K/PHnpKdQ M+ZA== X-Gm-Message-State: AOJu0YwPiTTTV2HcTqMR2KG3L8F59xso4n9ZVr754uBT0FKTUlbrqW8f GzlHXNgepODJ8LOtpqOp4+jkRciSEdaBRODoJbmU9dg/4EDZGROMF6DJVhm18Uwd5b3MVTSToN+ attA= X-Gm-Gg: ASbGncshBcd6KD/kN03KIhLSyeNqbTh7DWidkXENFK+1IwEfZ2SQaBSsYucuNR4qyQ5 9Z09JqSBURWPhv627qfs3uPBQA6wwBGoOJ4SDH5N7eOukpjJV7RwTqzypuW04xBoZYFLNJNvjM2 Egmn/fw9t8pUXWqLX5eMWquGdygK8mhq7mcqoJW+XcgwKytySDL3meVWgRUkiiewI8d/5eUliqK qJQwpJvGdn4j+aohJDyXJmm4hUHmEhRLhP2o6DlK16j3c1H4MwTI+a9LBThD3xwSGL0sYiO X-Received: by 2002:a05:600c:220b:b0:434:a815:2b5d with SMTP id 5b1f17b1804b1-434d1116ebbmr17064875e9.24.1733225549547; Tue, 03 Dec 2024 03:32:29 -0800 (PST) Received: from localhost.localdomain ([176.187.209.146]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-385e13e8eadsm11039936f8f.28.2024.12.03.03.32.28 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 03 Dec 2024 03:32:28 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Benjamin Herrenschmidt Subject: [PULL 09/13] hw/display/vga: Do not reset 'big_endian_fb' in vga_common_reset() Date: Tue, 3 Dec 2024 12:31:36 +0100 Message-ID: <20241203113140.63513-10-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241203113140.63513-1-philmd@linaro.org> References: <20241203113140.63513-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=philmd@linaro.org; helo=mail-wm1-x331.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, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, 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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org The 'pci-vga' device allow setting a 'big-endian-framebuffer' property since commit 3c2784fc864 ("vga: Expose framebuffer byteorder as a QOM property"). Similarly, the 'virtio-vga' device since commit 8be61ce2ce3 ("virtio-vga: implement big-endian-framebuffer property"). Both call vga_common_reset() in their reset handler, respectively pci_secondary_vga_reset() and virtio_vga_base_reset_hold(), which reset 'big_endian_fb', overwritting the property. This is not correct: the hardware is expected to keep its configured endianness during resets. Move 'big_endian_fb' assignment from vga_common_reset() to vga_common_init() which is called once when the common VGA state is initialized. Signed-off-by: Philippe Mathieu-Daudé Acked-by: Benjamin Herrenschmidt Message-Id: <20241129101721.17836-2-philmd@linaro.org> --- hw/display/vga.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/display/vga.c b/hw/display/vga.c index 892fedc8dce..b074b58c90d 100644 --- a/hw/display/vga.c +++ b/hw/display/vga.c @@ -1873,7 +1873,6 @@ void vga_common_reset(VGACommonState *s) s->cursor_start = 0; s->cursor_end = 0; s->cursor_offset = 0; - s->big_endian_fb = s->default_endian_fb; memset(s->invalidated_y_table, '\0', sizeof(s->invalidated_y_table)); memset(s->last_palette, '\0', sizeof(s->last_palette)); memset(s->last_ch_attr, '\0', sizeof(s->last_ch_attr)); @@ -2266,6 +2265,7 @@ bool vga_common_init(VGACommonState *s, Object *obj, Error **errp) * all target endian dependencies from this file. */ s->default_endian_fb = target_words_bigendian(); + s->big_endian_fb = s->default_endian_fb; vga_dirty_log_start(s);