From nobody Mon May 20 23:16:55 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1658750574; cv=none; d=zohomail.com; s=zohoarc; b=GFI9TF54PSbL45YsuJID/4mJ0DKg95ETHqU7tRo87RJ0E2G0/HqHEAyx5X+VgkYGOF8xPzUXUJ5hmpibroAcTKK5DtK9/Bx4b9KW7OlzOVtFldLwrvncAah57UivMxEMyO1v7MnBlxwfuhiD2xV+Zg9jzJkQbvLw2weOC2fZ14o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658750574; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=gh1CF9/skxxtps1WwbLkaNJbKti0bR9znmqXATo6rcQ=; b=jUzAhdNBUI0Su8UEElM12mT2MYv5eR9rVE5Y3LQnIgY5YdkBdvwgTj0BhlOc7RzHqZLMvRrm07xNljC9jX19QtMGoIWaRaAwi5R+FeSgaciRrcyfd+LiRNjHKO0yDN3JGWYXFr4Xk+w0OptgdNHjOk6zs8Lr9/fsHa2hfO1wcO8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1658750574118935.3208526888353; Mon, 25 Jul 2022 05:02:54 -0700 (PDT) Received: from localhost ([::1]:34130 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oFwnU-0005u8-Uo for importer@patchew.org; Mon, 25 Jul 2022 08:02:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43214) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oFwjE-000402-Ro for qemu-devel@nongnu.org; Mon, 25 Jul 2022 07:58:29 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:28817) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oFwjB-0001fy-2n for qemu-devel@nongnu.org; Mon, 25 Jul 2022 07:58:26 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-448-Z7e9RGT7MxKUAawP3wpCiA-1; Mon, 25 Jul 2022 07:58:20 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id EBF4F3801F4B; Mon, 25 Jul 2022 11:58:19 +0000 (UTC) Received: from localhost (unknown [10.39.208.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0053A492C3B; Mon, 25 Jul 2022 11:58:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658750303; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gh1CF9/skxxtps1WwbLkaNJbKti0bR9znmqXATo6rcQ=; b=LgYgJZzZrctg1tE4HAY1PkI6H3tOjolPgQjL64z/I1S9bm0QKIYl+VsoGu3ZLpQx3zfk8D Ji+UVlY6GneLzPy179oRKEzyb4PYYqv9vMAQ3hH4caGM0FYSjnGLgEMCIFg5zZuimbRUKK XSBcTXiIS38Y1SU5vl9E3YJkkHHcdMU= X-MC-Unique: Z7e9RGT7MxKUAawP3wpCiA-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: kraxel@redhat.com, mark.cave-ayland@ilande.co.uk, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH] ui/console: fix qemu_console_resize() regression Date: Mon, 25 Jul 2022 15:58:15 +0400 Message-Id: <20220725115815.2461322-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, 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, T_SCC_BODY_TEXT_LINE=-0.01 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1658750576048100001 From: Marc-Andr=C3=A9 Lureau The display may be corrupted when changing screen colour depth in qemu-system-ppc/MacOS since 7.0. Do not short-cut qemu_console_resize() if the surface is backed by vga vram. When the scanout isn't set, or it is already allocated, or opengl, and the size is fitting, we still avoid the reallocation & replace path. Fixes: commit cb8962c1 ("ui: do not create a surface when resizing a GL sca= nout") Reported-by: Mark Cave-Ayland Signed-off-by: Marc-Andr=C3=A9 Lureau Acked-by: Gerd Hoffmann Tested-by: Mark Cave-Ayland --- ui/console.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ui/console.c b/ui/console.c index e139f7115e1f..765892f84f1c 100644 --- a/ui/console.c +++ b/ui/console.c @@ -2575,11 +2575,13 @@ static void vc_chr_open(Chardev *chr, =20 void qemu_console_resize(QemuConsole *s, int width, int height) { - DisplaySurface *surface; + DisplaySurface *surface =3D qemu_console_surface(s); =20 assert(s->console_type =3D=3D GRAPHIC_CONSOLE); =20 - if (qemu_console_get_width(s, -1) =3D=3D width && + if ((s->scanout.kind !=3D SCANOUT_SURFACE || + (surface && surface->flags & QEMU_ALLOCATED_FLAG)) && + qemu_console_get_width(s, -1) =3D=3D width && qemu_console_get_height(s, -1) =3D=3D height) { return; } --=20 2.37.0.rc0