Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp3505837pxb; Tue, 20 Apr 2021 09:42:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxNic9U08hxO+0iAhFYej68nBRLtnH8LMCp8Ry0nE/75imGeWt1bsHboKBOaMRY+wHBWDI4 X-Received: by 2002:a17:906:2cd1:: with SMTP id r17mr28114703ejr.429.1618936962601; Tue, 20 Apr 2021 09:42:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618936962; cv=none; d=google.com; s=arc-20160816; b=UB489AgQWsLDzHcxGthfhTvbPT3zrWkni42TK4RXM7fW4fN6FkJzVvnQYimDA7GkWI uHr96+Sf9sNMmUFP4HqHr0kawHLsR76clTXW0jbCnntTtQ5P5hq+1GyLR95GfmVfeeBP Bar7q8A9TPexNiRaRnSUpeX93ITQc1Qh44LjC6pLewjtQC6nu+7uZk8KhLO4NZVQP37R txmdHnyeXgUlgBG2kklg+z1x/C2kxvtSzRPkJTjBXM5Qo25mKPOxOlCapuHTluRrFoc1 2+RVmDRxGo7vHOaf1j4pYGpY4wj6V2l+kn4rBfnSkpoF0Jha6N5LDl70V1lAwygaJ6Ls n1tw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date; bh=ZfKqs9Zr+BTQiXfgeZWr1AZe4cdmYulSQ4Atffn9o1w=; b=dyHYjk6SyQBEA0umEYoCcBELONlYKnFgfdTx50jA5WdgyR7mTh5WVn5lxqoQD7uW2o 6Y7j2lbeL8iF3V8QZfqBp0EWRUmE34vzxajUAGdaOAFzWfddy+PbjQZvKDXm9Y169x5B hKZql99tQN+fAs+q9xrKgvan/8/levTxVAS37ppsg81AxzD4br/JutcB7jhmCv5ObCaK ZibeEqcDFNkQLsTcUCoA8o/tC0u5TFVWQq/8nvyNkjSfl4GTReqn0baZr/JEF2BsoUUe k9UOnYc4JRDTNqkqOq8Mx3AzIqGrU2qgaARAOEmtpd5XRypBaiwg6LyMVIRe4WvBMHPP loMQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jp3si15893615ejb.704.2021.04.20.09.42.18; Tue, 20 Apr 2021 09:42:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233172AbhDTQle (ORCPT + 99 others); Tue, 20 Apr 2021 12:41:34 -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