From patchwork Mon Oct 24 11:26:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 9495 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp481160wru; Mon, 24 Oct 2022 07:22:34 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5LA3ezYEiEyY6MYWUX6k4hdIQYxHwSnXBERNrYsIxzdYpxfdRp08WIBQuHjO/BHGwrsF/T X-Received: by 2002:a17:907:6e11:b0:78e:3057:f631 with SMTP id sd17-20020a1709076e1100b0078e3057f631mr27168142ejc.333.1666621354094; Mon, 24 Oct 2022 07:22:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666621354; cv=none; d=google.com; s=arc-20160816; b=Hq75ExnSHk6LHGzjYGB0Rqf5T2uDSa6sixn0INTPh/+cTa62q0gHMEm/R+iWl4YXp4 xzMLkjuTNZKj8H7lmgkCW+pgDo+RxHqb80p9EDexkKJbjbFJGS286jvijeewEkOjexoO qjRCeAvyM8pDmFylojhuZZR0Si0I0aMYB8MyE8wY0sMp7lh4VdNPTz+ETOKLRMxgvKHy LprJSpF7uDwhA7GRD0RRA1jlVfATmguhHo4WObZRCvwPBmX8E6zZmS2memWsefNziHfP gR8qpXijDy0+9GQlh8te+OZ46ChOs/KwBl7KvEvYNtf+v8QYkbx16WORu6DS8qOsaQ0r qf5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=vaY6wTD3uU+X0qogxWHGA1F8rlX3tw9f4/UZ9vDy9yc=; b=CuIyaiuxU9XzeF6gEOkwtOc7sllRFjU5FollLdIlrfGNwYb2CCFo32IDNnLN6+n1tu CD7brKNaeEE4HAEsAho9PIue+cpToTv+4MNSyyJmVmffCas8xsEqn13EIov6wN9+ugoE 3IxVI52aN9JUWPagacMupkvcRsFsRASLed5ENe325ZY0g5a+NVx8W/Puga1CbbV3uPSf VQbmmLYyZOiJ2IS62zP3GY9gH5K8ARll8e07h5glfnPCZg97WdSp7oa2/6t8hhYaoHAN h70YYnAA1FujZV0P8lPH8rAeXKL23XPCMIxxzN3GWfRmH6EqBpUF3yZjya0mKFTl8Tys bxlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Vdmf+NKM; 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=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hw8-20020a170907a0c800b00780e89aecd1si26457999ejc.849.2022.10.24.07.22.09; Mon, 24 Oct 2022 07:22:34 -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=@linuxfoundation.org header.s=korg header.b=Vdmf+NKM; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236942AbiJXOTc (ORCPT + 99 others); Mon, 24 Oct 2022 10:19:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36904 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236184AbiJXOPN (ORCPT ); Mon, 24 Oct 2022 10:15:13 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 82B9937427; Mon, 24 Oct 2022 05:55:11 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id D987FB8164E; Mon, 24 Oct 2022 12:35:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3DEE6C433D7; Mon, 24 Oct 2022 12:35:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666614925; bh=Jm/wjfemqwD3BHdAZhQrcXEYvzl1G60yWCQYHFr+tcI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Vdmf+NKMIl5Qk+qymSK+XcE/0NLeWyX9qWb15hpkbjcxLM8NlwdWDgHGD/0CSW77Y 2YfvhnPE2ORuVwU0yOaGqpzj/IgTaz/pVBM/6oAyMEvAD+NvcHt79B2uh2au75715Q +MkjKHqVDn/jlpnKahD/b8bSynqH0SttHAtbMUTc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Daniel Vetter , Takashi Iwai , Thomas Zimmermann Subject: [PATCH 5.15 055/530] drm/udl: Restore display mode on resume Date: Mon, 24 Oct 2022 13:26:39 +0200 Message-Id: <20221024113047.527423292@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113044.976326639@linuxfoundation.org> References: <20221024113044.976326639@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747579153157799459?= X-GMAIL-MSGID: =?utf-8?q?1747579153157799459?= From: Takashi Iwai commit 6d6e732835db92e66c28dbcf258a7e3d3c71420d upstream. 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: Suggested-by: Daniel Vetter Reviewed-by: Daniel Vetter Signed-off-by: Takashi Iwai Signed-off-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20220908095115.23396-2-tiwai@suse.de Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/udl/udl_modeset.c | 3 --- 1 file changed, 3 deletions(-) --- a/drivers/gpu/drm/udl/udl_modeset.c +++ b/drivers/gpu/drm/udl/udl_modeset.c @@ -381,9 +381,6 @@ udl_simple_display_pipe_enable(struct dr 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); }