Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp6907114rwn; Tue, 13 Sep 2022 10:38:32 -0700 (PDT) X-Google-Smtp-Source: AA6agR53oHuB56+E5K4FPqdyEl9TKDlRIXfFJ2X5d8ZNd1tZRJLVnJJMuNauCr5Am692qFOiyU4+ X-Received: by 2002:a17:907:7f9e:b0:77f:c4c7:915e with SMTP id qk30-20020a1709077f9e00b0077fc4c7915emr4045418ejc.485.1663090711745; Tue, 13 Sep 2022 10:38:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663090711; cv=none; d=google.com; s=arc-20160816; b=AMM4lJCOKRHsSqwM/aKJGD0pyC+yeG2aHFTJWk/1/Wx//pbAMbl4Y++mXPbZ22tN07 Si9+u5UH9LL3CX1yaO/CGM2ziGf/zQdNDJV8KFHRv+xaIWoOz+AhKPjBWrCEonQrbCb+ EXrk7ZBf2dPcqzF3MBRDNdROqWmgpn7KPu8Jf7tHt+AYNce2M5VOsI/VlsL1VX2YAqYO 0jeeENEjzxNqcz5tZroit6EH63VZbuHAtuDQ7L7OtCjAoQfqq8TREeIhguwWKneOkzUQ 0DLNfz6UkuZORB8ZcSWialpajCk2zZzUg/4Vnm1NZwSROHTyoyYLaYp36Rvj8gsOnkJk F8zQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=Ogr/QPsfLlqyPywPveHgZK+CHgRo4MIzWIESAwaYdFY=; b=QX9VFdBSzslOMIXnJ3VnIo/p/J/Q9hMXNf4CE8W5P2+jTOSnkgb4YC/Wv27lDTjDOl jrCfuwO/xuSuX/RLR/ZazSDNkVNyH2YLu5LnboJ6n1pCbyEMKsBftuk4z5pqEXYuK3lM hI0Vvnu/98ZPkWsh87LzGO+e2z2w3xtepanavfRtBvGpWiC2xk7iLayTSGuNyt7fm0e+ W/yYK5q3jbK9Nf4Rn7bMYper4U4praBzar4eFgYlkOjmuvHZMRbIx93UavMl7oVhEFBK 4tM53omIoCd14176Slk1urV5vootLkJQX8pcjcmaBzLYR8g+2+yqlB7GXYR8kgjyC/S0 AQeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=LDfRKTt9; 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=quicinc.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cq13-20020a056402220d00b00445e286d000si7647215edb.365.2022.09.13.10.38.02; Tue, 13 Sep 2022 10:38:31 -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=@quicinc.com header.s=qcppdkim1 header.b=LDfRKTt9; 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=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232440AbiIMR1W (ORCPT + 99 others); Tue, 13 Sep 2022 13:27:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231878AbiIMR0j (ORCPT ); Tue, 13 Sep 2022 13:26:39 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A505C67C9B; Tue, 13 Sep 2022 09:14:55 -0700 (PDT) Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 28DDuY00032080; Tue, 13 Sep 2022 14:56:31 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=qcppdkim1; bh=Ogr/QPsfLlqyPywPveHgZK+CHgRo4MIzWIESAwaYdFY=; b=LDfRKTt9ilfPoCmgh55UthnppX1mJV3M+EivlG+quc/b3+vpnLNExhw/nSf6nUJ8qwz3 nrp/XfIwLmEX9HlLBh0X3hpi1FQn+QBRA8WB+sS5bClTduC7Y4F8MK6uMKLHu1tczEXV 5+HJYlV+KqrGHGbqIdAXixoz6ZxZLbnsbaWromKzj31qT0EM9yTDPoUd1BFUcGnVWA/x QgqqohMwAU9vRoarenOZqqcTHuKGHhxtSgSWZjSSnHH3CpRAGqLtWkSqE4mh7WiqJ5OL DZeUCnGRq89PZHqZ/RzM+TrH8XDys9cxtgs0oF9cZPryHuG1rT0hzpSWvWLiwoO2Yghl qg== Received: from apblrppmta01.qualcomm.com (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.18.19]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3jjm1wt6te-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 13 Sep 2022 14:56:31 +0000 Received: from pps.filterd (APBLRPPMTA01.qualcomm.com [127.0.0.1]) by APBLRPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTP id 28DEpQRM017875; Tue, 13 Sep 2022 14:51:27 GMT Received: from pps.reinject (localhost [127.0.0.1]) by APBLRPPMTA01.qualcomm.com (PPS) with ESMTPS id 3jh46m5drt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 13 Sep 2022 14:51:27 +0000 Received: from APBLRPPMTA01.qualcomm.com (APBLRPPMTA01.qualcomm.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 28DEpRa1017919; Tue, 13 Sep 2022 14:51:27 GMT Received: from vpolimer-linux.qualcomm.com (vpolimer-linux.qualcomm.com [10.204.67.235]) by APBLRPPMTA01.qualcomm.com (PPS) with ESMTP id 28DEpQxJ017896; Tue, 13 Sep 2022 14:51:27 +0000 Received: by vpolimer-linux.qualcomm.com (Postfix, from userid 463814) id C9CB54042; Tue, 13 Sep 2022 20:21:25 +0530 (IST) From: Vinod Polimera To: dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, devicetree@vger.kernel.org Cc: Vinod Polimera , linux-kernel@vger.kernel.org, robdclark@gmail.com, dianders@chromium.org, swboyd@chromium.org, quic_kalyant@quicinc.com, dmitry.baryshkov@linaro.org, quic_khsieh@quicinc.com, quic_vproddut@quicinc.com, quic_bjorande@quicinc.com, quic_aravindh@quicinc.com, quic_abhinavk@quicinc.com, quic_sbillaka@quicinc.com Subject: [PATCH v7 08/15] drm/bridge: add psr support for panel bridge callbacks Date: Tue, 13 Sep 2022 20:21:09 +0530 Message-Id: <1663080676-12936-9-git-send-email-quic_vpolimer@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1663080676-12936-1-git-send-email-quic_vpolimer@quicinc.com> References: <1663080676-12936-1-git-send-email-quic_vpolimer@quicinc.com> X-QCInternal: smtphost X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: JsQ3BalvzeJAUyVlmpgAy7wl5mRan7Sq X-Proofpoint-ORIG-GUID: JsQ3BalvzeJAUyVlmpgAy7wl5mRan7Sq X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-09-13_07,2022-09-13_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 phishscore=0 mlxlogscore=999 mlxscore=0 bulkscore=0 malwarescore=0 suspectscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2207270000 definitions=main-2209130068 X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE,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 This change will handle the psr entry exit cases in the panel bridge atomic callback functions. For example, the panel power should not turn off if the panel is entering psr. Signed-off-by: Sankeerth Billakanti Signed-off-by: Vinod Polimera --- drivers/gpu/drm/bridge/panel.c | 48 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/drivers/gpu/drm/bridge/panel.c b/drivers/gpu/drm/bridge/panel.c index 3558cbf..5e77e38 100644 --- a/drivers/gpu/drm/bridge/panel.c +++ b/drivers/gpu/drm/bridge/panel.c @@ -113,6 +113,18 @@ static void panel_bridge_atomic_pre_enable(struct drm_bridge *bridge, struct drm_bridge_state *old_bridge_state) { struct panel_bridge *panel_bridge = drm_bridge_to_panel_bridge(bridge); + struct drm_atomic_state *atomic_state = old_bridge_state->base.state; + struct drm_encoder *encoder = bridge->encoder; + struct drm_crtc *crtc; + struct drm_crtc_state *old_crtc_state; + + crtc = drm_atomic_get_new_crtc_for_encoder(atomic_state, encoder); + if (!crtc) + return; + + old_crtc_state = drm_atomic_get_old_crtc_state(atomic_state, crtc); + if (old_crtc_state && old_crtc_state->self_refresh_active) + return; drm_panel_prepare(panel_bridge->panel); } @@ -121,6 +133,18 @@ static void panel_bridge_atomic_enable(struct drm_bridge *bridge, struct drm_bridge_state *old_bridge_state) { struct panel_bridge *panel_bridge = drm_bridge_to_panel_bridge(bridge); + struct drm_atomic_state *atomic_state = old_bridge_state->base.state; + struct drm_encoder *encoder = bridge->encoder; + struct drm_crtc *crtc; + struct drm_crtc_state *old_crtc_state; + + crtc = drm_atomic_get_new_crtc_for_encoder(atomic_state, encoder); + if (!crtc) + return; + + old_crtc_state = drm_atomic_get_old_crtc_state(atomic_state, crtc); + if (old_crtc_state && old_crtc_state->self_refresh_active) + return; drm_panel_enable(panel_bridge->panel); } @@ -129,6 +153,18 @@ static void panel_bridge_atomic_disable(struct drm_bridge *bridge, struct drm_bridge_state *old_bridge_state) { struct panel_bridge *panel_bridge = drm_bridge_to_panel_bridge(bridge); + struct drm_atomic_state *atomic_state = old_bridge_state->base.state; + struct drm_encoder *encoder = bridge->encoder; + struct drm_crtc *crtc; + struct drm_crtc_state *new_crtc_state; + + crtc = drm_atomic_get_old_crtc_for_encoder(atomic_state, encoder); + if (!crtc) + return; + + new_crtc_state = drm_atomic_get_new_crtc_state(atomic_state, crtc); + if (new_crtc_state && new_crtc_state->self_refresh_active) + return; drm_panel_disable(panel_bridge->panel); } @@ -137,6 +173,18 @@ static void panel_bridge_atomic_post_disable(struct drm_bridge *bridge, struct drm_bridge_state *old_bridge_state) { struct panel_bridge *panel_bridge = drm_bridge_to_panel_bridge(bridge); + struct drm_atomic_state *atomic_state = old_bridge_state->base.state; + struct drm_encoder *encoder = bridge->encoder; + struct drm_crtc *crtc; + struct drm_crtc_state *new_crtc_state; + + crtc = drm_atomic_get_old_crtc_for_encoder(atomic_state, encoder); + if (!crtc) + return; + + new_crtc_state = drm_atomic_get_new_crtc_state(atomic_state, crtc); + if (new_crtc_state && new_crtc_state->self_refresh_active) + return; drm_panel_unprepare(panel_bridge->panel); } -- 2.7.4