From nobody Sun May 5 15:42:56 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 ARC-Seal: i=1; a=rsa-sha256; t=1596798119; cv=none; d=zohomail.com; s=zohoarc; b=WBYUYzZERJhIb+OhcZZ35T+K7rpof5GfyHEnDqHUL8xVAkopX8zeX6akkrOMX0XMY1e0LLq4X5UU1Aa9biRcA7TRxL+CN2egnUkyRQz/74hk6esQimasilNmsTm64SBTJAlmxX0eke99pJ0B9eBU+mKdunxF3Wue2abZE7JUJns= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1596798119; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=PmwWMKYIR8t0/VOY/1X5jWdijd0GauUhWtr1lgNB7rc=; b=bnFaU6B6jnEyVARJt+HgCXtmRLWihkesQQVxEPR9JidxImoYnb2qCwVgHHVPXxQAHK/15A7YwDoMaO2raClie6O4ismtTJdgjf5TaA+eHRmmDCkpNQ3fNfUHS/mOkX0XjGecFVFAJN4hPq8Q1Sz98xJUaUe9ZT9n/L2X8zep4jo= ARC-Authentication-Results: i=1; mx.zohomail.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1596798119461606.446095877587; Fri, 7 Aug 2020 04:01:59 -0700 (PDT) Received: from localhost ([::1]:48688 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k408M-0004gy-0c for importer@patchew.org; Fri, 07 Aug 2020 07:01:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50140) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k407c-0004He-C3 for qemu-devel@nongnu.org; Fri, 07 Aug 2020 07:01:12 -0400 Received: from indium.canonical.com ([91.189.90.7]:47892) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k407Z-0005Jk-Hx for qemu-devel@nongnu.org; Fri, 07 Aug 2020 07:01:12 -0400 Received: from loganberry.canonical.com ([91.189.90.37]) by indium.canonical.com with esmtp (Exim 4.86_2 #2 (Debian)) id 1k407X-00005q-81 for ; Fri, 07 Aug 2020 11:01:07 +0000 Received: from loganberry.canonical.com (localhost [127.0.0.1]) by loganberry.canonical.com (Postfix) with ESMTP id 3979D2E8082 for ; Fri, 7 Aug 2020 11:01:07 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Date: Fri, 07 Aug 2020 10:54:29 -0000 From: Gerd Hoffmann <1882851@bugs.launchpad.net> To: qemu-devel@nongnu.org X-Launchpad-Notification-Type: bug X-Launchpad-Bug: product=qemu; status=New; importance=Undecided; assignee=None; X-Launchpad-Bug-Information-Type: Public X-Launchpad-Bug-Private: no X-Launchpad-Bug-Security-Vulnerability: no X-Launchpad-Bug-Commenters: diego-viola kraxel-redhat X-Launchpad-Bug-Reporter: Diego Viola (diego-viola) X-Launchpad-Bug-Modifier: Gerd Hoffmann (kraxel-redhat) References: <159174217343.32241.17743917589333297614.malonedeb@gac.canonical.com> Message-Id: <20200807105429.24208-1-kraxel@redhat.com> Subject: [Bug 1882851] [PATCH] drm/virtio: fix unblank X-Launchpad-Message-Rationale: Subscriber (QEMU) @qemu-devel-ml X-Launchpad-Message-For: qemu-devel-ml Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="6a138c03da9cc3e2e03f6dd3bbb4a615b0be6ec2"; Instance="production-secrets-lazr.conf" X-Launchpad-Hash: 5ccd1cedc5319524c5cf8dce19780f8b2f807f72 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: none client-ip=91.189.90.7; envelope-from=bounces@canonical.com; helo=indium.canonical.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/07 01:41:01 X-ACL-Warn: Detected OS = Linux 3.11 and newer [fuzzy] X-Spam_score_int: -58 X-Spam_score: -5.9 X-Spam_bar: ----- X-Spam_report: (-5.9 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Bug 1882851 <1882851@bugs.launchpad.net> Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" When going through a disable/enable cycle without changing the framebuffer the optimization added by commit 3954ff10e06e ("drm/virtio: skip set_scanout if framebuffer didn't change") causes the screen stay blank. Add a bool to force an update to fix that. Cc: 1882851@bugs.launchpad.net Fixes: 3954ff10e06e ("drm/virtio: skip set_scanout if framebuffer didn't ch= ange") Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_drv.h | 1 + drivers/gpu/drm/virtio/virtgpu_display.c | 1 + drivers/gpu/drm/virtio/virtgpu_plane.c | 4 +++- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.h b/drivers/gpu/drm/virtio/= virtgpu_drv.h index 9ff9f4ac0522..7b0c319f23c9 100644 --- a/drivers/gpu/drm/virtio/virtgpu_drv.h +++ b/drivers/gpu/drm/virtio/virtgpu_drv.h @@ -138,6 +138,7 @@ struct virtio_gpu_output { int cur_x; int cur_y; bool enabled; + bool need_update; }; #define drm_crtc_to_virtio_gpu_output(x) \ container_of(x, struct virtio_gpu_output, crtc) diff --git a/drivers/gpu/drm/virtio/virtgpu_display.c b/drivers/gpu/drm/vir= tio/virtgpu_display.c index cc7fd957a307..378be5956b30 100644 --- a/drivers/gpu/drm/virtio/virtgpu_display.c +++ b/drivers/gpu/drm/virtio/virtgpu_display.c @@ -100,6 +100,7 @@ static void virtio_gpu_crtc_atomic_enable(struct drm_cr= tc *crtc, struct virtio_gpu_output *output =3D drm_crtc_to_virtio_gpu_output(crtc); =20 output->enabled =3D true; + output->need_update =3D true; } =20 static void virtio_gpu_crtc_atomic_disable(struct drm_crtc *crtc, diff --git a/drivers/gpu/drm/virtio/virtgpu_plane.c b/drivers/gpu/drm/virti= o/virtgpu_plane.c index 52d24179bcec..5948031a9ce8 100644 --- a/drivers/gpu/drm/virtio/virtgpu_plane.c +++ b/drivers/gpu/drm/virtio/virtgpu_plane.c @@ -163,7 +163,8 @@ static void virtio_gpu_primary_plane_update(struct drm_= plane *plane, plane->state->src_w !=3D old_state->src_w || plane->state->src_h !=3D old_state->src_h || plane->state->src_x !=3D old_state->src_x || - plane->state->src_y !=3D old_state->src_y) { + plane->state->src_y !=3D old_state->src_y || + output->need_update) { DRM_DEBUG("handle 0x%x, crtc %dx%d+%d+%d, src %dx%d+%d+%d\n", bo->hw_res_handle, plane->state->crtc_w, plane->state->crtc_h, @@ -178,6 +179,7 @@ static void virtio_gpu_primary_plane_update(struct drm_= plane *plane, plane->state->src_h >> 16, plane->state->src_x >> 16, plane->state->src_y >> 16); + output->need_update =3D false; } =20 virtio_gpu_cmd_resource_flush(vgdev, bo->hw_res_handle, --=20 2.18.4 --=20 You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1882851 Title: QEMU video freezes with "Guest disabled display" (virtio driver) Status in QEMU: New Bug description: I am using Arch Linux as my Guest and Host OS, after starting qemu with the following command: $ qemu-system-x86_64 -enable-kvm -hda arch-zoom.qcow2 -m 4G -vga virtio and waiting for a screen blank, I get this message: Guest disabled display And nothing happens after that, I can move the mouse or hit any key, and the message is still there. I can still reboot the VM but that's not optimal. I can reproduce this with the latest QEMU release (5.0.0) or git master,=20 I also tried this with older releases (4.0.0, 3.0.0) and the issue is sti= ll there. I can't reproduce this with other video drivers (std, qxl). With std/qxl the screen will blank a bit and then continue as normal. To manage notifications about this bug go to: https://bugs.launchpad.net/qemu/+bug/1882851/+subscriptions