From patchwork Mon Oct 24 11:27:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 9002 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp440042wru; Mon, 24 Oct 2022 06:03:41 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5Xp7PF2NmJUgth2AJviqTv+1Ix0z8CSHBAPMVz1xbue1NNPwwI1MlHNeKZc5M4ijebrna0 X-Received: by 2002:a63:b64:0:b0:439:8143:c184 with SMTP id a36-20020a630b64000000b004398143c184mr27750765pgl.22.1666616621208; Mon, 24 Oct 2022 06:03:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666616621; cv=none; d=google.com; s=arc-20160816; b=XmS03MZpfXvTNMYQPKHKvwNBIeJ5X4l7xqBk4D1RhC/uTkAWPBd0+zcUskZFM8ixyh nx7ioUWw9iGoD6PpCscDFGSMGtQQal4duWoqDrmSX3X1d5KgS51Obh966KDaSPbpiSsD AMZAfKe0hYDIYwy1Rr/LCSu9OdKUwe6o+a9cNZIr0hILm9jATObcC3BBUZVH/V48LEkS A22TftIWOxi3dRv149JJwa781vi5EBzadbJF/ZgF9TyGz4xFuULmX+/s5dKRw+e3qEyX IQjiBljBtcm17x6D5pwUXo1Oz+RPpFKG/zi+rWqKf0mtMRTyglgMKoBVWC3YJA/QsS3y MG2A== 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=kHI3whNSxNlxSvC+5gweH4/7CuSyDy7qsZAm86I5RPA=; b=IAH0BQmzZ/BreOf6WF3eLXoQtSqHIUgStY84pIdVyhi3mZi0hDSYiXu2+dUKKSOi5g JupHbkhxHfZWJLusekEOmdhcTJufNi0LkD59u75qJ32wDZu3cBY5Pc+42AgZj9hYlkYL RqloSzkRzpum/tBA7/rkoaEZ/28qGcz+jxMk3AV74kUj0DDa9TSX8Tu5d+LpB/jijuc0 ScZPVORvSvFcPgn9CUqrcUy6iDzGtXW6QeDDiwkHIvP/xy2+MaF9vFIpOmmLmcwJoW6v tbtBhFbeLzFD4lyMuYU/UDX7V3FUKYCMQCf0EdEZNkIVsEtqLe6zpYJ8drZ/qqgIVIlr Wtdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=K6brJhVN; 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 ip14-20020a17090b314e00b00205d6cc25cfsi17634249pjb.72.2022.10.24.06.02.57; Mon, 24 Oct 2022 06:03:41 -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=K6brJhVN; 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 S234969AbiJXNCT (ORCPT + 99 others); Mon, 24 Oct 2022 09:02:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54090 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235150AbiJXM7Z (ORCPT ); Mon, 24 Oct 2022 08:59:25 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE8979A9C4; Mon, 24 Oct 2022 05:18:51 -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 dfw.source.kernel.org (Postfix) with ESMTPS id C4845612CF; Mon, 24 Oct 2022 12:17:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D6A9AC433C1; Mon, 24 Oct 2022 12:17:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666613858; bh=+1wtXQ/SMp/UBtgYnYz8DzxTxECRtHjyku2Osan6gRI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=K6brJhVNU3wAohLZhOld/hYI9xhl2ypt2l66usIO7tHsX9hYBJP+hV3Y1p37eJ+H4 GsOvSNyMqmv36CfrX/6T7gKIppH9HZZNkPmWJF+AOj6qoMJIOuD+hzcFUBJX8nHFuL rxlhqpCoRww8p614Yj3GXpRDyeEjsyf47YJfLIGk= 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.10 040/390] drm/udl: Restore display mode on resume Date: Mon, 24 Oct 2022 13:27:17 +0200 Message-Id: <20221024113024.310920666@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113022.510008560@linuxfoundation.org> References: <20221024113022.510008560@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?1747574190242360290?= X-GMAIL-MSGID: =?utf-8?q?1747574190242360290?= 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 @@ -400,9 +400,6 @@ udl_simple_display_pipe_enable(struct dr udl_handle_damage(fb, 0, 0, fb->width, fb->height); - if (!crtc_state->mode_changed) - return; - /* enable display */ udl_crtc_write_mode_to_hw(crtc); }