Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp86634iof; Sun, 5 Jun 2022 21:57:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwO/Cp7OqBDk/jng1igmSv7S2AarrLsM45YHGq3nBGMrX6Z/wg8lrjFET+YvEPPPUcVPz7D X-Received: by 2002:a17:903:24f:b0:15c:e3b8:a640 with SMTP id j15-20020a170903024f00b0015ce3b8a640mr22428916plh.5.1654491445056; Sun, 05 Jun 2022 21:57:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654491445; cv=none; d=google.com; s=arc-20160816; b=uxZBAGoI/Xs5E6zoZbjm7JaRe2CqwmCd9fXedr4Dzob29brjUHX3mqSZ3Q8Du5BFQp cpnb548Md6IspOCCTo8KEJON2WYqMhLi/mwZecaJeQKtqsETbj0miEBHERT2rLOpUOgE OJ1KrPlyIxVT+pFE2rPSw2kwMsZgKGj1+BUQuJ7UF/Ouzvnys0/yHVgiUmXeqNMi9TeD taq3qlGPiY6TAmgGV5EQCoKuIFpg9mZUPRGIFnmBka4wT3uckW87PUtwHKTk1YhC2kWW S5eUHXsjlAJ/3l3+75Z3LrE635VRRyypTDJpz/7FCnOEAMEEUg2NuN8lD1C7/EQhy3/E yHAQ== 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 :message-id:date:subject:to:from:dkim-signature; bh=7RCLFoGqMwTmWEP7WwIcV4ALshtLZtePe1d/3kYJpfU=; b=Ew0aNXUNW5TO4GGXN9Z0uuyDhlCOThR7HbbtkAHnWGHyg5O3LRVLVu38EXNoL3WYWg +yh0DOG2Tg1vQ1JdCGRPXvmspSa2TfFvJtKN94uqn2CD7GLKQ5/Oeab0k+D1k0NvVRVP 5y0AKi/aNogPWcJ2FI2u4U3RQwevQHb4Nwa4KorKxmgG8rVQegndbR7njKycZNO0c+zf Ahh71yvff56JW48yvirBW5DJLaa8Nw0+axTqDcQlQT7y/oSAwNPMlf+6FhnFmR66uMbU ulezDAre97QHw1WIPCXaetLMv+eUw/gMTIZ0Kkic0VyO7tuWaeEPdHibz1+wMHnAta1V ETPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b="KrC/+YrE"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foss.st.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id c2-20020a630d02000000b003c60d889162si19340672pgl.244.2022.06.05.21.57.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jun 2022 21:57:25 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b="KrC/+YrE"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foss.st.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D5B05703FF; Sun, 5 Jun 2022 21:10:31 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245456AbiFCPV7 (ORCPT + 99 others); Fri, 3 Jun 2022 11:21:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56820 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230514AbiFCPV6 (ORCPT ); Fri, 3 Jun 2022 11:21:58 -0400 Received: from mx07-00178001.pphosted.com (mx07-00178001.pphosted.com [185.132.182.106]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C24345F5A for ; Fri, 3 Jun 2022 08:21:56 -0700 (PDT) Received: from pps.filterd (m0288072.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 253FFQEC017973; Fri, 3 Jun 2022 17:21:25 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=from : to : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=selector1; bh=7RCLFoGqMwTmWEP7WwIcV4ALshtLZtePe1d/3kYJpfU=; b=KrC/+YrEsWQe42iiuS+l4zU073QLJc54Ep69vmPu+ecGLUdIsLhBJy44BsCf1DMn5x4/ AGyWyWEV7MqqXiJswP/VHYVd8X7jWkKanR9NFJ0l4FcCnfOCwh7OGH9cPzbXQ7XDE9Tg VB4KgVEvGl5I05OtTLR3UVsNYicuoX3QVjWkw9TkaNULE+wWMsVEQXMa5L7r/kqb/8iH sis7944pWyd32hcWbhx6fLJOP3mq+s6AIrm/J5YrhEQiz5NEeYQR9AsUvP8wq3P6TJ3K U0J7khybIeMsZ5LybP4qDrK1aIzXXpla4qkEpnnjNv1MiCSqrfbKrDotz3KF4wi8PyWL sA== Received: from beta.dmz-ap.st.com (beta.dmz-ap.st.com [138.198.100.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 3gbc2w747p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 03 Jun 2022 17:21:25 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id AAE4540128; Fri, 3 Jun 2022 15:42:54 +0200 (CEST) Received: from Webmail-eu.st.com (shfdag1node1.st.com [10.75.129.69]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id F34E3226FAA; Fri, 3 Jun 2022 15:42:03 +0200 (CEST) Received: from localhost (10.75.127.51) by SHFDAG1NODE1.st.com (10.75.129.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2308.20; Fri, 3 Jun 2022 15:42:03 +0200 From: Yannick Fertre To: Yannick Fertre , Philippe Cornu , Raphael Gallais-Pou , David Airlie , Daniel Vetter , Maxime Coquelin , Alexandre Torgue , , , , Subject: [PATCH] drm/stm: ltdc: disable all layers before crtc shutdown Date: Fri, 3 Jun 2022 15:41:51 +0200 Message-ID: <20220603134151.591997-1-yannick.fertre@foss.st.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.75.127.51] X-ClientProxiedBy: SFHDAG2NODE3.st.com (10.75.127.6) To SHFDAG1NODE1.st.com (10.75.129.69) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.874,Hydra:6.0.517,FMLib:17.11.64.514 definitions=2022-06-03_05,2022-06-03_01,2022-02-23_01 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 All plans must be disabled before the CRTC shutdown helping the crtc to restart from a clean situation (without unwanted planes already enable). Signed-off-by: Yannick Fertre --- drivers/gpu/drm/stm/ltdc.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/drm/stm/ltdc.c b/drivers/gpu/drm/stm/ltdc.c index 6bd45df8f5a7..eeefc3260c07 100644 --- a/drivers/gpu/drm/stm/ltdc.c +++ b/drivers/gpu/drm/stm/ltdc.c @@ -787,11 +787,17 @@ static void ltdc_crtc_atomic_disable(struct drm_crtc *crtc, { struct ltdc_device *ldev = crtc_to_ltdc(crtc); struct drm_device *ddev = crtc->dev; + int layer_index = 0; DRM_DEBUG_DRIVER("\n"); drm_crtc_vblank_off(crtc); + /* Disable all layers */ + for (layer_index = 0; layer_index < ldev->caps.nb_layers; layer_index++) + regmap_write_bits(ldev->regmap, LTDC_L1CR + layer_index * LAY_OFS, + LXCR_CLUTEN | LXCR_LEN, 0); + /* disable IRQ */ regmap_clear_bits(ldev->regmap, LTDC_IER, IER_RRIE | IER_FUIE | IER_TERRIE); -- 2.25.1