From patchwork Tue Jun 18 16:00: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: 805251 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:144:b0:362:4979:7f74 with SMTP id r4csp275161wrx; Tue, 18 Jun 2024 09:09:56 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUZcrkhc476en5NfsZ61QuBkPrtUODOpKEzX2wMQIrBnpDvhcLuecJlHOivZsdLxC/FME9JKzEvVtCyYm3moEdg X-Google-Smtp-Source: AGHT+IEPxg1FMZNdL5jey3JlHEZsdkUoNAE0gWOUKpaySws3l596rQN6uEJahg8Vvf4tAfCH+lZw X-Received: by 2002:a05:620a:4722:b0:795:4cde:3b21 with SMTP id af79cd13be357-79bb3e11686mr13067285a.9.1718726996304; Tue, 18 Jun 2024 09:09:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1718726996; cv=none; d=google.com; s=arc-20160816; b=aKC4yWuOUDEFGWNgn/dTtkmO2lT8vmRh7zY+5sOTRivaSzgDMydCfX0XdOmWQZm/OM 3ppq/Gfqty+J91AS3DXYvqOoNBPg9teZoXJBJE8T+z5iKrJq+IzueCWkoQ9+G6UDuuA7 CF9wkPVX649WLEgoBIrLyM4BgxtJ+wEo9iX5TRAEkwBHw+HUgjfbaQLgHoBEZfJ3GygW G3tjqWTmHYsVbCDI4SXq4uOgJ0SNnLYviV/m6DkjHOjZ4As9IRiCeUSPrdOFvBxP5e2Y pcSIei+XENxDvaiY6Qerd22yUBWMzsLpTeTDOcAR6A8JznyPmXCALPL92Uz5rdMNHOQ7 u47A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=hgUnXKkoM7jtlbKnZKLo4tSSRCpVvLzL3fhZptpwhrQ=; fh=BbHsmTn4NGR0nFlicuIKAA0mP6zYQdjnySzQ4lTJJzY=; b=tYkT4BGks0RqfByb+Jf+ghx46oSO3vR4qXvPj+0jff/i4aD5SlTlpcMNuhiHWiT53h YuTULHEoOfM20IEyB3TE/xX2wPa2MENI5DklUztrEiQb7oRk26q2gLO71mk4LDecxt0E QFTpC0eyHxkbSxJygPjieOcYmz0q5WYIJdO5VbzyJ5y66caXwgJRjLbnItyxk96HNzfn FC6cotBDDHf+GViinOfchcp1Zilm79dL6HeYdsg8+F+s94mXYFY5saglTdq2ZI1sNhQ9 jDWe/d362lZsD9G6yCygyefiSMrKAaBPXjBvZxOHXlnW/cieck/PgtFg6VbCimcGok1J /Kmw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qlzVBCze; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-798aadc39e4si1199230985a.211.2024.06.18.09.09.56 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 18 Jun 2024 09:09:56 -0700 (PDT) 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=qlzVBCze; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sJbNA-0004mU-Ps; Tue, 18 Jun 2024 12:07:52 -0400 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 1sJbN9-0004ir-Au for qemu-devel@nongnu.org; Tue, 18 Jun 2024 12:07:51 -0400 Received: from mail-lj1-x232.google.com ([2a00:1450:4864:20::232]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sJbN7-00082d-Dq for qemu-devel@nongnu.org; Tue, 18 Jun 2024 12:07:50 -0400 Received: by mail-lj1-x232.google.com with SMTP id 38308e7fff4ca-2eaae2a6dc1so98808041fa.0 for ; Tue, 18 Jun 2024 09:07:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1718726867; x=1719331667; 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=hgUnXKkoM7jtlbKnZKLo4tSSRCpVvLzL3fhZptpwhrQ=; b=qlzVBCzeNWM3z10jbymipWUzLbHCgfifZ/FNHa3JPNYy1YBOeerfO0Dsr/ZzxWJ+s1 fZrf6xqe0fCQjBSXKFLAF1uK8X8eP+xQht6GKi1VP1j0r0aNmDzWURSZi1wfAoPhMmjk Mcg65UXs7Zm0DIIt1RINE3vLc0ey/Pgi8IBNzu8DYl6AQfWlYellXvRDn7HsNbYfElpG 2hFF6Q5Lb5Mdwj7Zi3VowJIjnAo/7NvGLpEpiohg+SSSFlo3wCWmZbjwPGiA+EhGYYmd M2exSL6FeGqQrJ6dxMu4Ybi/6q2rALaD4dIFKw1EckdGCWPUfQIxf81kRw0PN4h+BTSz 0aFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718726867; x=1719331667; 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=hgUnXKkoM7jtlbKnZKLo4tSSRCpVvLzL3fhZptpwhrQ=; b=XR5m8EJChQT3VYGyJjoxI1rBOuEH/v5QOgQj8mxh/454swanQOuAXF/+SfYygbCuQ5 18yj39Hon7/wMsB4zPfoti+uvUQCc0LQm4or4ReKv3b1IjxeW1P3N69IH1sFez/jp1UL eMG4n5zfJOzbUppsqXQHDOU5EXvyeoIyCfqKtXBRBLlx6jPNiM7703LFQTN5ExA3rkJD 918fKUilMJXRLscWI2+zl/YWWteYC/Pebt6dKbqFpgbAlgBVV6xzmWNIszs5y3LT513n iIJrinRKyTtdaO0RH2yVPVqwydmzhFFDeO9LYVfEA4UQ2qrT1HBDPMQpNczNeTciq5ou ASUg== X-Gm-Message-State: AOJu0YyoFuJng5XxFZIqKu5UsZK/p4/yFBZk8TsP54RiZjlsycXLw6BD 75/JFqxqSU+vdoz1tmo6E32MEvbuewGCQnOIVMR3wRFD3J3LC5JZHx/ba+B0wwg35LptVqX6Htl o X-Received: by 2002:a2e:7814:0:b0:2eb:f365:8751 with SMTP id 38308e7fff4ca-2ec3ced1e1fmr2599821fa.31.1718726867397; Tue, 18 Jun 2024 09:07:47 -0700 (PDT) Received: from m1x-phil.lan ([176.187.212.55]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-422f6320b11sm193452445e9.29.2024.06.18.09.07.46 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 18 Jun 2024 09:07:46 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , qemu-stable@nongnu.org, =?utf-8?q?Mar?= =?utf-8?q?c-Andr=C3=A9_Lureau?= , =?utf-8?q?Ph?= =?utf-8?q?ilippe_Mathieu-Daud=C3=A9?= Subject: [PULL 74/76] stdvga: fix screen blanking Date: Tue, 18 Jun 2024 18:00:36 +0200 Message-ID: <20240618160039.36108-75-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240618160039.36108-1-philmd@linaro.org> References: <20240618160039.36108-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::232; envelope-from=philmd@linaro.org; helo=mail-lj1-x232.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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 From: Gerd Hoffmann In case the display surface uses a shared buffer (i.e. uses vga vram directly instead of a shadow) go unshare the buffer before clearing it. This avoids vga memory corruption, which in turn fixes unblanking not working properly with X11. Cc: qemu-stable@nongnu.org Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2067 Signed-off-by: Gerd Hoffmann Reviewed-by: Marc-André Lureau Message-ID: <20240605131444.797896-2-kraxel@redhat.com> Signed-off-by: Philippe Mathieu-Daudé --- hw/display/vga.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/hw/display/vga.c b/hw/display/vga.c index 30facc6c8e..be2b19b839 100644 --- a/hw/display/vga.c +++ b/hw/display/vga.c @@ -1762,6 +1762,13 @@ static void vga_draw_blank(VGACommonState *s, int full_update) if (s->last_scr_width <= 0 || s->last_scr_height <= 0) return; + if (is_buffer_shared(surface)) { + /* unshare buffer, otherwise the blanking corrupts vga vram */ + surface = qemu_create_displaysurface(s->last_scr_width, + s->last_scr_height); + dpy_gfx_replace_surface(s->con, surface); + } + w = s->last_scr_width * surface_bytes_per_pixel(surface); d = surface_data(surface); for(i = 0; i < s->last_scr_height; i++) {