Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1627976pxp; Sun, 6 Mar 2022 21:29:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJy2rOMhU2hOAQB+6O470BmhO/1/BeNSaJzRadbhpfcod4goFAftBkvIRSMimGTIIkNhCaEc X-Received: by 2002:a17:907:8a0a:b0:6d8:85a6:4d42 with SMTP id sc10-20020a1709078a0a00b006d885a64d42mr8248234ejc.138.1646630960776; Sun, 06 Mar 2022 21:29:20 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1646630960; cv=pass; d=google.com; s=arc-20160816; b=OSqmRlTmvMbr3kxmuYu8vyLP/A6bdYGVrZU5UFPAt2aSdjr9n/vOkcw7At6uZGw/AU NJOED1yO9aX7P7gVPp/iL+RS+bzRUoh/Ib3NfcTdxcn01F2TwL6KxzdlGxBaDNJD4Yux te6g24Q/R9MUI1gU01Ejxm0CJSrh0LjFUMclVN4ZzMo6Pvwx+LeAoB6aEiOc8x8HapVK Fuglnj8IHbCxTir+UKvCQOu8QJjp8FI6KCH4ypFLO25SicuixaqFT43vuXi0JlMsyV/M 3P4M6VooggkWVPrKahd9loWq5o/N02esj1ekMjMzit4bX6BhLh0lHdNEnLi/+TeipYFr 4x5Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature; bh=Y26M5nx/fY+YMNAHRfqQZm1EZfr/r1P+2DPFObWjD/s=; b=tG7SqvQtstQtivEdNUl41fULXnOPGTINcituxVdKrLLY5Q7ErwkZaIzy/9mMTgsI6f JK3PfvwhznyY/ieXGX12aopbfYhoDJmjO9bqzRTMrKb1EzQtLtRqumPVkwmQ3KN8xY5O cn5fLmXxecopT36j67GffC4MmjYORSnI7W4sbJGnI9rlJGW/U94sCEaxxlpDN/D7FApx 8IityJNE4GitvLrJZJbLZ/Ll5BvYipQEdpjAVF6GVCQctTTsPhpd0U2PUMCnVo7jPSan Cr/5p0rLlIXZchvgDZOZh9UU5Pdzf/OIcfrqZqToVY7HziHueYJd8QXVkOxMWUZXb+/d GogQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=J2CMZjGA; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); 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=nxp.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t8-20020a056402524800b00415b3b4664asi9497406edd.221.2022.03.06.21.28.58; Sun, 06 Mar 2022 21:29:20 -0800 (PST) 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=@nxp.com header.s=selector2 header.b=J2CMZjGA; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); 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=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234712AbiCGCer (ORCPT + 99 others); Sun, 6 Mar 2022 21:34:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56046 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233163AbiCGCeq (ORCPT ); Sun, 6 Mar 2022 21:34:46 -0500 Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40078.outbound.protection.outlook.com [40.107.4.78]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8029B50E05 for ; Sun, 6 Mar 2022 18:33:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KRYBzs3+IviMIxMJCQccojJCCHOcu/EWT3plkRT8OBY0F2WxbSD8xn37ZBrQe7kxdSlKkR3tRVXG+FAxkKIH06/MpmpCdISBZe0PymFiFZATNVejL73HVieDmYdjRNjZ1nBK5vYNiM4g3zGBz6Jzk+O92DZoo5fbslLsllUNprLQ9FrlGgGJOq2OYzyq2fb4t7YI+96UiW2tL82hKPl7I9v9XUNMni6n339WtjoW+/NxacBVheWcGFDxner5kG6x5a0jLtz7HDRmgaz7fNyh8nb1Y8Yk4npRpz0tC64K7zc7faxh7mr7EDHY6LVaN1jdLWh36D0QQLrWHtH3KTP1EQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Y26M5nx/fY+YMNAHRfqQZm1EZfr/r1P+2DPFObWjD/s=; b=gjvVp5GvH2NcZhzc1f5iHDLulNRyVuFWr7bmxN/T+EkIwiZ04k42U6jcoQkZAOQY5/ohNgVfkY/JPV0ivupT6+/g+36Z/GPYE6Tu6+ZX5/pc452Fs0B/v5GhlOHhOGOSxVTHtE0qQttqZDxvYtRgAhP71fVkItf3NgvmQf+SV5YOhDmW2XAGZjrL+xohYjsxuq/DLqK7/WhWW//4zjIQZHvuB9i7LIV7hw5no+xlTaVeQVhFHhbFA2Wio5u0KizT3YWI5dwF42T2lmVMc6hYtOYjn5U3jVYJX5iCYvaG7nqT//IMdsVDptu6rG5UWhlS+O5vhPXRjP/8REUgayl1YA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Y26M5nx/fY+YMNAHRfqQZm1EZfr/r1P+2DPFObWjD/s=; b=J2CMZjGAg4bVLniaUbzu39VhcGoCTFoaeRgZzzh8BDeXaxO4/VxkqgsztEByTu5+Y8lXdnclb48l4J3Z8S7UAUIe4jItNoqYQCXgFmFdCqLZi+pFmV3kh8R8qK2mKidlHuS2TTStIXuFb7qCMcQ44MUaclcwnQtjZcNYs6CnFQ0= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) by AM5PR0402MB2785.eurprd04.prod.outlook.com (2603:10a6:203:98::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5038.18; Mon, 7 Mar 2022 02:33:50 +0000 Received: from AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::6117:74ed:7550:b3b3]) by AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::6117:74ed:7550:b3b3%6]) with mapi id 15.20.5038.026; Mon, 7 Mar 2022 02:33:50 +0000 Message-ID: <9ac021dcf3c6a7a3dfa3d88dfcde18fac8a74243.camel@nxp.com> Subject: Re: [PATCH RESEND] drm/self_refresh: Don't trigger the entry timer for self refresh work if CRTC state is inactive From: Liu Ying To: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: linux-imx@nxp.com, Rob Clark , Sean Paul , Zain Wang , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter Date: Mon, 07 Mar 2022 10:33:41 +0800 In-Reply-To: <20220207054617.987811-1-victor.liu@nxp.com> References: <20220207054617.987811-1-victor.liu@nxp.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.4-0ubuntu1 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: SG2PR04CA0202.apcprd04.prod.outlook.com (2603:1096:4:187::20) To AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9b0c4ecf-74d7-4814-fc86-08d9ffe2e9ce X-MS-TrafficTypeDiagnostic: AM5PR0402MB2785:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: uMJU45enmlp8gxAJn5y59Sh6H9GNqF7SViAHd17WRjfKCTMEPyXzVwfyfL+gWgoTsC00afcP+dqnwXjp7VcoivdVox+MWsu/f8aS95NQ2x1+L1NmhMSFlaBfLPtHIwdXRGDQXmbyoceqhTFRDsIoLvgoGl/RoFCn1EX76jHJ5ol2mtcyKnmPXKTvjxY/IZEel5w8vB4mr3bxoSN6jr0lxHZv81PTffRImDnl5YyC5roA+hD6Vad8yMqzcmJlHRIHXUgnT8wByeGAdnBOvyNLFG82d2z0/tafBvj2aBUIzAjJ6lDQM2cesm+0E1CiZPcblqxfdt0uL1RvSkGXcGat6G9gemu0KCEqvkkcGMkhdasu1XrmwVIRtK9q7s0bxk/8zJlcUhywQemeGOIOa9kako/FXFu9txq7ZQrGIerqv/qJrf1xfVFbvVXT3Wq+Wowxp6Lp8XcxBwdYwNEQaPmfAQ8EhUT1oSM5GqURl2TB781jD/k4IKcXfezk7suLStWWaIq2nTmqobxSQ/+CWHxbcSU43qWPZqb9e9zBod546fDoIfEbz2RaBmJSFSwoM9jbkzJz+q2TFxgvUXosTc9gqLeweyH8ocgtLwCP1gvjKMpr9c6Cb/sd/ssN8mNq3SISD5kzFyXWSypPxZU96ItfISSNE8NuRGScW1T9uxwEkKjX40808NssoLajiy1DUPadUKwnzB2t4c8Oa0z8wRxBSA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM7PR04MB7046.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(66476007)(66556008)(6486002)(36756003)(4326008)(8676002)(83380400001)(66946007)(8936002)(498600001)(54906003)(7416002)(6506007)(38100700002)(86362001)(186003)(6512007)(38350700002)(2616005)(26005)(2906002)(5660300002)(6666004)(52116002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?Q2l6bEZtMDJmL05LUUlsQ1ArTXVwOTJRRy9WSVJDeE9jMGRMQlNUQUFKdU1z?= =?utf-8?B?VDY5RzhZRVVxUFY1N3VJWkJ0dXUxcDg4ZlZvbmNJMkNBQ0ttQWhLazN1U1I3?= =?utf-8?B?WW1vUVRUeENFWHBETW5Qak9Oc2d4OUNITFQ2TUs5QnlncSt6c09hZFN5bkhq?= =?utf-8?B?bHMrU3JhOFgxTXdrRy9vWVBYZlBWMGsrZWd0eTF3TTBhSEdXM2UyRWlqQTRM?= =?utf-8?B?eG5mOVBZL0tCcTBEWmZRV2grUUZjMDVsdm4ybUhSdmlwcVZMZW5ZVVpkVVhD?= =?utf-8?B?YlZNdC9iemlvVFBVQVhMcHZyeVNSVnZlUW00VExQeHEzbmdXNktlbWxwbk5o?= =?utf-8?B?Y05EZmRsdnpseXpuU1lUNDhPbUJhK0NoRzNVVUU0TVpKRDlFNFdtSDZVYkhG?= =?utf-8?B?WStsa2VFM0djR05mZmc5bXZCSDNxTWtLdGU2SEI5ckFDcUpXY2haelAzaUdl?= =?utf-8?B?TXZCSkNvbXRacGpYenhTTVYzS21KUzA0eTh2YU1OZTdsZ0ZCR3E2WlF6VFhl?= =?utf-8?B?cmxIWThreXo0S3VVUDlZRTRq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BzM0hGR29qbEZnQ0VMQktYanJORGhZU2IyTXlDYUwrZ0IwV1lo?= =?utf-8?B?eTArS1lVL0FQMlIxclpHTDhEelZlY1FUTUpYUDdZRFVLZDhselZZcWNGcGx0?= =?utf-8?B?T0VpT0pLbmFDWHJFQmF6NlgxUVpqRWM5QVJERGxQMk5GVUZJM0xTd2F6UnJM?= =?utf-8?B?YW9LNXdOUXhFanV0OVpOdzIzQzh1ZzhkUDV4QmNzUlU5LzBja3J3MHJieE9J?= =?utf-8?B?N3U1N3JWdHUxaE5XZitsQjV2cVpKTjRNOXc0b0xTY3VlNTdYTG9xYUNjcU5r?= =?utf-8?B?U3JVdlpvUk1VQVpFcU9nNUNUeGxKT0k4ZURYay9KVk5zazhzUG5qU01wZk91?= =?utf-8?B?M0dEdXhla3VJb25EZmVXYlZLemYrYVVwRzl2dTNTRCtZbEE0VDZ3SXNBajhi?= =?utf-8?B?WVhVK2NLSWd2VDRQMHJkU0FzR1NxUE1xaGliVFJTaGgreWp2MjdTYmkyZ1Bp?= =?utf-8?B?TCtqZHV2YVJad0NVSzlCaldIUmQ0WWE0a2lkUzA1cEJiRXZwVm5LRXB3UDd2?= =?utf-8?B?Vmd0akw2a2FQY1ppRDdmazlxb29oakZPVFNQTFM1d1UyZDlEZlJNSXViTk9D?= =?utf-8?B?cXVjNFA3NVJGTitiU2pYQ05Tb2Z0aXhVeFEzdUd2bmNCYWlmdlRlL3YydXE3?= =?utf-8?B?NWJrUDJFMEMxb09SMU9GRitMWGdvYlBxL3lmNkRhTGpvSlhnSnZFVWtUdUVm?= =?utf-8?Q?m0SLLtjaNZnnUFg3o5s+qHs=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9b0c4ecf-74d7-4814-fc86-08d9ffe2e9ce X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7046.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Mar 2022 02:33:50.1702 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: FfBlBwKO6usX1F3ku0bVOA1TtgcPQbyYt2am15wODYIhVsW4Js17JmkOxSvereipPxkkOF8DHro3Utvxk+3lzQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0402MB2785 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,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 Mon, 2022-02-07 at 13:46 +0800, Liu Ying wrote: > If the CRTC state is already inactive, it doesn't make sense to trigger > the entry timer for self refresh work to make the display enter self > refresh mode, because the disabled CRTC hints that either the entire > display pipeline is disabled or the previous atomic commit is triggered > by the self refresh work(the CRTC is disabled, while the relevant encoder > and bridges could be disabled or not depending on the drivers). > > Cc: Rob Clark > Cc: Sean Paul > Cc: Zain Wang > Cc: Maarten Lankhorst > Cc: Maxime Ripard > Cc: Thomas Zimmermann > Cc: David Airlie > Cc: Daniel Vetter > Signed-off-by: Liu Ying Gentle ping... Thanks, Liu Ying > --- > drivers/gpu/drm/drm_self_refresh_helper.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/drm_self_refresh_helper.c b/drivers/gpu/drm/drm_self_refresh_helper.c > index dd33fec5aabd..e76eb3cd22c7 100644 > --- a/drivers/gpu/drm/drm_self_refresh_helper.c > +++ b/drivers/gpu/drm/drm_self_refresh_helper.c > @@ -204,8 +204,12 @@ void drm_self_refresh_helper_alter_state(struct drm_atomic_state *state) > struct drm_self_refresh_data *sr_data; > unsigned int delay; > > - /* Don't trigger the entry timer when we're already in SR */ > - if (crtc_state->self_refresh_active) > + /* > + * Don't trigger the entry timer when we're already inactive. > + * Note that the inactive state hints that either we're already > + * in SR or the entire display pipeline is already disabled. > + */ > + if (!crtc_state->active) > continue; > > sr_data = crtc->self_refresh_data;