From patchwork Sat Oct 22 07:19:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7213 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1090285wrr; Sat, 22 Oct 2022 00:46:25 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6WM4Iuc6sTP25srOylk30inT645MPy2lnmAGFycSRKjuRgdLT53bXb7VgmX9JBsHPbqSo3 X-Received: by 2002:a17:903:32cf:b0:185:c53f:7459 with SMTP id i15-20020a17090332cf00b00185c53f7459mr22129945plr.82.1666424775105; Sat, 22 Oct 2022 00:46:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666424775; cv=none; d=google.com; s=arc-20160816; b=tX3w/7NlMJak8R6X6Y2JF/BQOWPMFHn4uCjMGt5vPBSU/09UPMeZP7ur7JRHVJouLa CgaPqUeUX75GbwZCN57cWpoSWWmkr7C0GPRHJcMlxoIJksracKAgbFuz7FGMh1FGr2oO HfxwZ9QRoG96nn8xEhtATiqPKr25Fom6tPhdAdJg8O4+eAPbs8iQFB4P5CIBqGjbsP3p JM6MjJJoF10NtUtGf2ADl3pIQsfV09Y5yOJjtenL0BR9pMlavwxuSGiatZS6pQG+Vc+8 JgJBy7Y+vHMW9Cu1vCpoAGCUEp8511PQ7jexlTbdPfQ1HaeGFgPgLLygKmitgFiXgP55 SjXA== 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=lIr7zUBh7gEOnVYkFX4fK5I1VdldRrFJBAM1RtwXnjI=; b=fzbHD6Ge2PZQUeo+hFJqdTvt4xddup+6+siS44tiuwHybLntRHZXM7RMiWnoTY15SU cMmJc4ejYjr/L4R8LYbXOeXttZHufoxGNbxBV7yjyv1fxFyOA+tFgZn/3nPxVU1dTeJV 7YgleO/7Dy99wKjIgKjaB84TcwHIQnhEc/M7RmbX+3E+2lVISnj/WRefm2p2wRPmC8lV q/lEzHHRhlvSGem7wTaYDxYCJjQfeHLXJgxOQXSsm3QC8y76JsxcdDPsoJ7wMsTfxlQq MmF41bgXbzVxGi0xTR/D4INcCRhJQkhFjPY3qDVhZ2lySE1klnncTQLycRrB96CdXRUq Pa8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=2s5TM+pX; 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 q29-20020a635c1d000000b0045f83f1eb56si29034985pgb.234.2022.10.22.00.46.02; Sat, 22 Oct 2022 00:46:15 -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=2s5TM+pX; 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 S231371AbiJVHpk (ORCPT + 99 others); Sat, 22 Oct 2022 03:45:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45918 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231330AbiJVHnd (ORCPT ); Sat, 22 Oct 2022 03:43:33 -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 DDA2A5DF20; Sat, 22 Oct 2022 00:42:32 -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 2EC04B82DF7; Sat, 22 Oct 2022 07:38:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7C7BAC433C1; Sat, 22 Oct 2022 07:38:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666424318; bh=gMan5kpbovKahV/1vwN9rBg7BvTH6IpSR+9l0CZ8VNw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2s5TM+pXfRjAfdsEwq4m11jtx8PH+gHLg0ONSgLeD3Om70jr+hjc+I19AyjPSYaaq bL5Zdsyf+RQkst57yrY6diDlqhtvyLwISjPO5DFWjcN/oIIW7QNcWqqMqbQZ8MeHiN 8YBeQSaz3iTMGOGMmgp4VDgQXZyhxCLWPuRZz0ac= 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.19 071/717] drm/udl: Restore display mode on resume Date: Sat, 22 Oct 2022 09:19:10 +0200 Message-Id: <20221022072427.764692624@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.3 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?1747373024764519924?= X-GMAIL-MSGID: =?utf-8?q?1747373024764519924?= 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 @@ -382,9 +382,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); }