From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E4841C433B4 for ; Tue, 20 Apr 2021 16:41:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6F6DC613CE for ; Tue, 20 Apr 2021 16:41:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233204AbhDTQlf (ORCPT ); Tue, 20 Apr 2021 12:41:35 -0400 Received: from mx2.suse.de ([195.135.220.15]:58472 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233178AbhDTQld (ORCPT ); Tue, 20 Apr 2021 12:41:33 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 68082ABED; Tue, 20 Apr 2021 16:41:01 +0000 (UTC) Date: Tue, 20 Apr 2021 18:41:01 +0200 Message-ID: From: Takashi Iwai To: Daniel Vetter Cc: dri-devel , Linux Kernel Mailing List , "open list:VIRTIO CORE, NET..." Subject: Re: [PATCH] drm: Fix fbcon blank on QEMU graphics drivers In-Reply-To: References: <20210416125344.13550-1-tiwai@suse.de> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 16 Apr 2021 20:30:05 +0200, Daniel Vetter wrote: > > On Fri, Apr 16, 2021 at 2:53 PM Takashi Iwai wrote: > > > > Currently the DRM fbcon helper for console blank, > > drm_fb_helper_blank(), simply calls drm_fb_helper_dpms() and always > > returns zero, supposing the driver dealing with DPMS or atomic > > crtc->active flip to handle blanking the screen. It works on most of > > devices, but broken on most of KVM/QEMU graphics: bochs, qxl and > > cirrus drivers just ignore crtc->active state change as blanking (or > > cirrus ignoring DPMS). In practice, when you run like > > % setterm --blank force > > on a VT console, the screen freezes without actually blanking. > > > > A simple fix for this problem would be not to rely on DPMS but let > > fbcon performs the generic blank code. This can be achieved just by > > returning an error from drm_fb_helper_blank(). > > > > In this patch, we add a flag, no_dpms_blank, to drm_fb_helper for > > indicating that the driver doesn't handle blank via DPMS or > > crtc->active flip. When this flag is set, drm_fb_helper_blank() > > simply returns an error, so that fbcon falls back to its generic blank > > handler. The flag is set to both bochs and qxl drivers in this patch, > > while cirrus is left untouched as it's declared as to-be-deprecated. > > > > Link: https://lore.kernel.org/dri-devel/20170726205636.19144-1-tiwai@suse.de/ > > BugLink: https://bugzilla.suse.com/show_bug.cgi?id=1095700 > > Signed-off-by: Takashi Iwai > > Uh we're supposed to fix these drivers to actually blank (scan out > black, worst case), not paper over it in higher levels. Atomic kms is > meant to be a somewhat useful abstraction. So now fbcon blanks, but > your desktop still just freezes. > > > --- > > > > Here I whip a dead horse again, revisiting the long-standing issue > > stated in the previous patch set in 2017: > > https://lore.kernel.org/dri-devel/20170726205636.19144-1-tiwai@suse.de/ > > > > I thought to refresh the previous patch set at first, but it seems > > invalid for the atomic modeset case. And for the atomic, it's even > > more difficult to propagate the return from the bottom to up. > > So I ended up with this approach as it's much simpler. > > Yeah that's because atomic assume you can at least blank your screen to black. OK, then there is no other way than fixing those drivers to deal with the blanking... I cooked up an experimental patch for bochs, and will submit later. thanks, Takashi