Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp5252808rwb; Tue, 6 Sep 2022 22:55:47 -0700 (PDT) X-Google-Smtp-Source: AA6agR6ztMvGEA4eXVWHeQ2SyzxNwa85o5Duf538LdlQ+kMQbMeHaE6iABHeeHfdOJMqToA18+zx X-Received: by 2002:aa7:c458:0:b0:44e:9078:5712 with SMTP id n24-20020aa7c458000000b0044e90785712mr1715906edr.25.1662530146824; Tue, 06 Sep 2022 22:55:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662530146; cv=none; d=google.com; s=arc-20160816; b=mM/zqayMOdzIP8IyGr5d608jv7sFDvCqBQImmFk2DrnkrKQfYu+hPC6KM7/T84myjG tJRaZk8Fu60y5CcgPnCrqXZXjI52nKl7mor0EvOk4suepV622ltJFvZeM8Hx1RukjmDL JQDcUwTw+0MFu/vtSg2O4y3J4Pmn7QpOnOyP1PX2GBBXFSpnxQfrQOeuMfLSZ36RTeAZ bbnWoEz/iknMqStFQuMZeBeuh9NOmV5fkH3sv1zhVSeaU3kL6ebc8wzy/x8yhY8CGzCL RXc6bqqxd/PNXARsTxZTchcBAL53Qz+cYdy3HNRThmKO7N27w1EF1eiQWwSTsjPblmKX AlGQ== 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:dkim-signature:dkim-signature; bh=/ftw2hmi+QJuhi5TyErM2+JnKdKAgrGBsgZA2NQ+f/M=; b=hrs5Kj9GHew+38mV/44dP536MNkV/qi/6z9bUvegKV2FjXKX3GQOFA32za0mIE7Ovw Tp9JJSXOfnJ35f05P3981szoNHs5a1c4C2i7xilfh/lpQB1mttwNBcamTR0Dhzo2hGoO EiyUVbxnYL82KAWq1Fnz6AInOp0mUssErbpKZRMa/do1kpUpKkB5xjNJJvgKR5P5bzhs LZds6aN+lAK2tD0KS/tBZs8eX+nRVJ9fNf50TiYBT26tBkgGBXAezOhnoMwQ4ln4oTTz amq73RM05uSnk5CdV/Sz0/P9pUTwxE9bh4FK/xJ3dH4R4BrGKJinoP55e3C2ljAh+JnJ UbHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=kJotDGHB; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w25-20020a170906385900b00744aad5a1a6si9393113ejc.250.2022.09.06.22.55.22; Tue, 06 Sep 2022 22:55:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=kJotDGHB; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229811AbiIGFv2 (ORCPT + 99 others); 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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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