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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 60E95ECAAD3 for ; Wed, 7 Sep 2022 05:51:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229816AbiIGFv2 (ORCPT ); Wed, 7 Sep 2022 01:51:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58780 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229812AbiIGFv0 (ORCPT ); Wed, 7 Sep 2022 01:51:26 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D701B86C27 for ; Tue, 6 Sep 2022 22:51:07 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 41D2A20002; Wed, 7 Sep 2022 05:51:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1662529866; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=/ftw2hmi+QJuhi5TyErM2+JnKdKAgrGBsgZA2NQ+f/M=; b=kJotDGHB+PvIJ8fHk+kUbNp2sTfFugYjrWoRpCTmRBpkEZvLADeMM5LJL/pYSXigyUVuUE AAUbbN4ihKh+EcTalB7j7YleHgnkm5MMzvdfvUic0Z7xeZnf9+B/+FChZ1E1duIY5p8D55 DNzJ/nZnJQ5oTYta14xqajfTohK/RBs= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1662529866; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=/ftw2hmi+QJuhi5TyErM2+JnKdKAgrGBsgZA2NQ+f/M=; b=QKq1x1TtmN3hHaP26czN/wXX2n0kugYUOFDhU2da8HYJSoCWWu/FoLQZHoUImL82wYdWp+ Z4VwXfc7GkWHJ2Cg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 1CF63139C7; Wed, 7 Sep 2022 05:51:06 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id tf1JBkoxGGNaUwAAMHmgww (envelope-from ); Wed, 07 Sep 2022 05:51:06 +0000 Date: Wed, 07 Sep 2022 07:51:05 +0200 Message-ID: <87sfl3enqu.wl-tiwai@suse.de> From: Takashi Iwai To: Daniel Vetter Cc: Takashi Iwai , Thomas Zimmermann , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: Re: [PATCH 01/12] drm/udl: Restore display mode on resume In-Reply-To: References: <20220816153655.27526-1-tiwai@suse.de> <20220816153655.27526-2-tiwai@suse.de> User-Agent: Wanderlust/2.15.9 (Almost Unreal) Emacs/27.2 Mule/6.0 MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 06 Sep 2022 22:06:55 +0200, Daniel Vetter wrote: > > On Tue, Aug 16, 2022 at 05:36:44PM +0200, Takashi Iwai wrote: > > From: Thomas Zimmermann > > > > Restore the display mode whne resuming from suspend. Currently, the > > display remains dark. > > > > On resume, the CRTC's mode does not change, but the 'active' flag > > changes to 'true'. Taking this into account when considering a mode > > switch restores the display mode. > > > > The bug is reproducable by using Gnome with udl and observing the > > adapter's suspend/resume behavior. > > > > Signed-off-by: Thomas Zimmermann > > Signed-off-by: Takashi Iwai > > This patch isn't great and incomplete, see > > https://lore.kernel.org/dri-devel/YxegiQFAv+OWjjqE@phenom.ffwll.local/ > > You need cc: stable and fixes: 997d33c35618 and actually just remove the > entire check :-) OK, then is something like below? I already submitted v2 yesterday (as I overlooked your reply), so I'll respin v3 with this (and your ack) if that's OK. thanks, Takashi -- 8< -- From: Takashi Iwai Subject: [PATCH] drm/udl: Restore display mode on resume Restore the display mode whne resuming from suspend. Currently, the display remains dark. On resume, the CRTC's mode does not change, but the 'active' flag changes to 'true'. Taking this into account when considering a mode switch restores the display mode. The bug is reproducable by using Gnome with udl and observing the adapter's suspend/resume behavior. Actually, the whole check added in udl_simple_display_pipe_enable() about the crtc_state->mode_changed was bogus. We should drop the whole check and always apply the mode change in this function. [ tiwai -- Drop the mode_changed check entirely instead, per Daniel's suggestion ] Fixes: 997d33c35618 ("drm/udl: Inline DPMS code into CRTC enable and disable functions") Cc: Signed-off-by: Thomas Zimmermann Suggested-by: Daniel Vetter Signed-off-by: Takashi Iwai --- drivers/gpu/drm/udl/udl_modeset.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/gpu/drm/udl/udl_modeset.c b/drivers/gpu/drm/udl/udl_modeset.c index 169110d8fc2e..34ce5b43c5db 100644 --- a/drivers/gpu/drm/udl/udl_modeset.c +++ b/drivers/gpu/drm/udl/udl_modeset.c @@ -382,9 +382,6 @@ udl_simple_display_pipe_enable(struct drm_simple_display_pipe *pipe, udl_handle_damage(fb, &shadow_plane_state->data[0], 0, 0, fb->width, fb->height); - if (!crtc_state->mode_changed) - return; - /* enable display */ udl_crtc_write_mode_to_hw(crtc); } -- 2.35.3