Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 06732C433EF for ; Sat, 8 Jan 2022 02:07:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233255AbiAHCHm (ORCPT ); Fri, 7 Jan 2022 21:07:42 -0500 Received: from mail-eopbgr20080.outbound.protection.outlook.com ([40.107.2.80]:65090 "EHLO EUR02-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229912AbiAHCHl (ORCPT ); Fri, 7 Jan 2022 21:07:41 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dE0Bjyw072d9vPbFGeJKNxHeoDTpLQg5XpMIRP+GjhtNZRcOpZSESPsqDY1+mo05opIlpaA0TTNVBzhlYflVSp3sukOdtEcnMS9BLS3z3NROVPuAuONgorygZGVWsBKViB0XtEcmNlVKHBuIVFnT/YV3YeFlfm0SHxIhbobczDUhhbGj6ZZ5gg5J6cA9Gtk78M2MQkWtMgPC8lWmZGInTGoWO36UPYF7MTVSjqq6FdPybmCP2uisfX+1Ga6hf0PJJXCQwzPwJPhoqeMxSgqGi5pFtPvk58bF03XeY/HOXWHcekrVY0Qkr87AgdpCh4XyG6z6Duy+Px3LCz0N78mEqw== 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=+scWIVR4jHo3y3nIzStTpCKFaaHWUnRMm0OP670WJO0=; b=eidcgC1yQOHB6PEFQYEVEXhNjKSTkAXpXg/H3ZW0IzwOOd+uYKpCfJrpDnwYQKGBHp4HexYS1Pol/wBrGrmeczFLocUjpWPGCYMhkJzKfMVmobS6hsoO3iQCYpy5EAOFD5JVCPMmo3zHGgJ+K8cMOs+ZkcBXRPW/ySuHc24J4oV2Hxy7cKMXHLP3UutZuVqOWTZAzKjPiMqu1Ccn2MVwwqjyWmXPlfiVBCIU4CIDbrQWLswC7u9rCGnToFkzEzcP6QxPgnxOtM99iDJkGhscqhT4+6J20b8MYTa/GP2RJiMmekbec64AWDhr+t6d3m7F44xZazGKHCmuRzeRoO7+aw== 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=+scWIVR4jHo3y3nIzStTpCKFaaHWUnRMm0OP670WJO0=; b=AK7/sQgWpYQ4ikX5YzdxBUWGDazfFwOSf67JN+OOkl5g0EYF83RrgIwcCtqK9aAtDWu2musE5x+GzdcWCbDJjsHo5sJDxlAhcLMZkxfmFVnMI5aJxdeXVAkHDxWEr26x/9CSINmkW2xWFMD2ZhZEE3ICi7qn+vOTARsuNAEjFyM= 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 AM7PR04MB6871.eurprd04.prod.outlook.com (2603:10a6:20b:109::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4867.9; Sat, 8 Jan 2022 02:07:39 +0000 Received: from AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::a5b3:9e5:366:a3fc]) by AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::a5b3:9e5:366:a3fc%3]) with mapi id 15.20.4867.011; Sat, 8 Jan 2022 02:07:38 +0000 Message-ID: Subject: Re: [PATCH] drm/atomic: Check new_crtc_state->active to determine if CRTC needs disable in self refresh mode From: Liu Ying To: Alex Deucher Cc: Maling list - DRI developers , LKML , Rob Clark , David Airlie , Sean Paul , NXP Linux Team , Thomas Zimmermann Date: Sat, 08 Jan 2022 10:07:10 +0800 In-Reply-To: References: <20211230040626.646807-1-victor.liu@nxp.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.2 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: HK2PR0401CA0017.apcprd04.prod.outlook.com (2603:1096:202:2::27) 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: 330d50a9-f640-48f8-8bf3-08d9d24ba540 X-MS-TrafficTypeDiagnostic: AM7PR04MB6871:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1rKq59lnBM/WwazkOr5P9JGpO6e1gjuZ7TFbYsG0B1Py/xNV9QFUdneuLYIXocNCvtvBnTa+4uoZbTZbBMxGuNnK2xTcuY/TbzGgd5s17qFyo2GWA7uek6S67xLamcpRW2LhFvQ/4FscJMreR3EP9Nv+h7uWsnfvX5yRO6p+cWQk0E+AzEApJ3AcpQa0N0KV5/rWsgy6jik1WLSODR+DZnsXCpPqfdr3Ad1jtyhQvYl9EmdxS6zrC7esRfePNeDboK0P6MtsH0Aji4H6FV3PqqGTvRPxNHgpE1a3iBQLEC0Djvvvr6lIeQc/TdtSvoxxIFMqxe/+bg2f6u7mwq2sb8v8SK+O3Dh8p1XUdzXdYTbrsfNuAZJAYdQfTR4VL2p0x8UUdOzxOxIjA11oGXZEn25UJvZ8bmweDKt/YV1Inqh2Mx7HCjP3sKC6E/o+bkv+7Ggp8xCGVcyEgvyeLZuhGaIvazqyNU+cVYgDMOj+sTx6D/ZQrqgwKNr8ffRhJqKaRr+eIu3YeWFT775hKyFiQoj3STio8FZJ4aj9ub/fCBGCIyKPrQ6dIMifkmXXQ7NrjUspAvb8Bh9lpn2dKDomoCu+OJbrtYKX1+hp6ZAC2yCz8TfX6+uQlpwkssLo5YJjMeNCHrFgL5rIjo5XKJdivtcBSBUIbXhPxmdvR1T7Q90NsTcQKF6Act+wjmPHL0kPXlMS5ww+NB2Ux+qkVbxAsUyCH2z0FyMUFvRLg+oSHk4= 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:(4636009)(366004)(52116002)(5660300002)(316002)(186003)(38100700002)(38350700002)(6486002)(86362001)(26005)(2906002)(6512007)(508600001)(83380400001)(6916009)(8936002)(36756003)(53546011)(6506007)(8676002)(66946007)(66556008)(4326008)(66476007)(2616005)(6666004)(54906003)(99106002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?QXFIUzNQQ0VnOTlXcjJKT2o5cnVtYUR1a1VvbmRoTHBBb090WkFrWjgzYS92?= =?utf-8?B?d3dTdWVoRUpiTTdpaEcvMlBTSTJ6SEN5SFZMS0gzempld0FpVEN1RjVNM2Fn?= =?utf-8?B?TVJxK2pvblZ4S0lyVjJMbXh1Q2xCTy9zTktPbnQ4UWFqd2lnUlFwWEJJZ1Z2?= =?utf-8?B?UnpkZVd1RWNId2tuNWNEMzRrT1BvK3hBWXpob2NLQXhpMWNvTFRrc1RsSnE4?= =?utf-8?B?a1BicGEvc3F1YUJGbkEvZE9GM3pwV2F3THFGcTZaMmVrak1xOXNSQ3ZsWThV?= =?utf-8?B?MGJZUS9xQ2tY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FaSUpIMnY0RDFiMWhjejdv?= =?utf-8?B?NkF6bWRjbmxENzBMektqQWVWZzhMOVVmbGo4VlJOT2ZTOTBIVGJVWDMyeDNq?= =?utf-8?Q?Or3qLC4DHnj03Pz/Nhgyixk=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 330d50a9-f640-48f8-8bf3-08d9d24ba540 X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7046.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jan 2022 02:07:38.8205 (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: 4Rorh/o5098AzeKVsoUeCZp5cJCRKBO7CL+3OjFuPPJ2SRwT1LDIlrXRWeDDLTr9F6OfU5+I2VQ7cnrm5ajXmg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR04MB6871 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2022-01-07 at 14:53 -0500, Alex Deucher wrote: > On Wed, Dec 29, 2021 at 11:07 PM Liu Ying wrote: > > > > Actual hardware state of CRTC is controlled by the member 'active' > > in > > struct drm_crtc_state instead of the member 'enable', according to > > the > > kernel doc of the member 'enable'. In fact, the drm client modeset > > and atomic helpers are using the member 'active' to do the control. > > > > Referencing the member 'enable' of new_crtc_state, the function > > crtc_needs_disable() may fail to reflect if CRTC needs disable in > > self refresh mode, e.g., when the framebuffer emulation will be > > blanked > > through the client modeset helper with the next commit, the member > > 'enable' of new_crtc_state is still true while the member 'active' > > is > > false, hence the relevant potential encoder and bridges won't be > > disabled. > > > > So, let's check new_crtc_state->active to determine if CRTC needs > > disable > > in self refresh mode instead of new_crtc_state->enable. > > > > Fixes: 1452c25b0e60 ("drm: Add helpers to kick off self refresh > > mode in drivers") > > Cc: Sean Paul > > Cc: Rob Clark > > Cc: Maarten Lankhorst > > Cc: Maxime Ripard > > Cc: Thomas Zimmermann > > Cc: David Airlie > > Cc: Daniel Vetter > > Signed-off-by: Liu Ying > > Reviewed-by: Alex Deucher > > Do you need someone to push this for you? Yes, please. Thanks. Liu Ying > > Alex > > > --- > > drivers/gpu/drm/drm_atomic_helper.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/gpu/drm/drm_atomic_helper.c > > b/drivers/gpu/drm/drm_atomic_helper.c > > index a7a05e1e26bb..9603193d2fa1 100644 > > --- a/drivers/gpu/drm/drm_atomic_helper.c > > +++ b/drivers/gpu/drm/drm_atomic_helper.c > > @@ -1016,7 +1016,7 @@ crtc_needs_disable(struct drm_crtc_state > > *old_state, > > * it's in self refresh mode and needs to be fully > > disabled. > > */ > > return old_state->active || > > - (old_state->self_refresh_active && !new_state- > > >enable) || > > + (old_state->self_refresh_active && !new_state- > > >active) || > > new_state->self_refresh_active; > > } > > > > -- > > 2.25.1 > >