Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp3673388rwi; Wed, 12 Oct 2022 05:28:03 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6LnQDYXNVchbQx4wcobKG58RZpAtRFY1vl6ETanCRL3wPZRQYymXe2bjorx2GS/EKjCf3C X-Received: by 2002:a17:90a:d48a:b0:20a:f65b:143c with SMTP id s10-20020a17090ad48a00b0020af65b143cmr4824949pju.199.1665577673052; Wed, 12 Oct 2022 05:27:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665577673; cv=none; d=google.com; s=arc-20160816; b=RjsEXyrMwaJtIrv/DVAmgckonAG+n8E6bwaCI3Q5CKAH9kK/mq9YvCSy9+EtyiHNM2 QtGCOqenEA7y+s3/9FWbz/yKLDn+7Jv0rb6H0JAM+NsOKnd0TatuV5RU7smxTZ/s6OVw tZCNO15mYZitlM0oEdCNX1sL5lJnE7Okc3X4zNj/8x2+SrdIVMe6bOBLK8eyXkEdmbSO 6yVqTZMtHqu5zoKMXUB2e0YWpvmM6lgLwOPAkh/8dU7kXJQJttlwEkWuoWXLQq+CVrsG cD4g/q8iXNueJZKFctDsM4PIQlc8YAKMtVuFo4mAzVuzG0hNuOkQ4GCe+1EJycgLx+uL kUaA== 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=UceIkCBvwg9U8E7QWCkcqupknUzPDTiSlkybj92UA3YNDwLa4aW6H1GN9VILCv8yME cJUHJr3w5tGNJOPaWjOgNXeNEpPRomJSe6nVQxb6Jah/czz/uKhsvqKoLOEdEmmGSsrc FBwiyrK3fxIA4O0XKibJue5rWby6sEpM0mu7PAjo8nfJMrL6tjy1WiXVbPcp4UPSlUkB 6pLArxs9MOGwGf2uoPung/oqAquqx/0p3DnIn+MeHzxQMSKb7Nho51IzocO8hcmVK+0d eZymYbWs8LlNEUOeFAbAsuUW0NrD9J0o4ylzP3MnEx3YuSvuF36XyUqyuHq+cxGroRsc 2B/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=G+zwwCZi; 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 a7-20020a62bd07000000b00551e64c3942si16576584pff.311.2022.10.12.05.27.41; Wed, 12 Oct 2022 05:27:53 -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=G+zwwCZi; 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 S229833AbiJLMEA (ORCPT + 99 others); Wed, 12 Oct 2022 08:04:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51560 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229629AbiJLMC6 (ORCPT ); Wed, 12 Oct 2022 08:02:58 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 386C2A3441; Wed, 12 Oct 2022 05:02:56 -0700 (PDT) Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 29C7xxuW003623; Wed, 12 Oct 2022 12:02:53 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=G+zwwCZicpdEEYBpmHODCun9Izhn8MsZ/egV76+U4wXnLHpocoll+DIR0Ze2O+O/hjc0 OtNz1zBGXnF5ugBJuKNRRYQvu5L693fAMc+28/O4JsnyOvxo7bZFFWI1usehJeHUqnNd 2Bd1YmF28CPRCnAt0C3z7BWm0qot0/lGii3OvlzBBSMtTSs/bdtwPLA27SbzURIpERtl YCvmDbqmQG5Zz4kSKw035nMSip7snmVoHizt6qESxMO3/ywOCifmICBnl27majO4SH6y PbRYjcxFdZUyR6/S3FvQfbbU+h81RBjcfLTM/m3VMj885KvT+At/RqAmWDw7R+3kJ8Bv sg== Received: from apblrppmta02.qualcomm.com (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.18.19]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3k5eg4a9xp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 12 Oct 2022 12:02:53 +0000 Received: from pps.filterd (APBLRPPMTA02.qualcomm.com [127.0.0.1]) by APBLRPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTP id 29CC2lAa026863; Wed, 12 Oct 2022 12:02:50 GMT Received: from pps.reinject (localhost [127.0.0.1]) by APBLRPPMTA02.qualcomm.com (PPS) with ESMTPS id 3k3jpu0t2n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 12 Oct 2022 12:02:50 +0000 Received: from APBLRPPMTA02.qualcomm.com (APBLRPPMTA02.qualcomm.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 29CC2mN1026904; Wed, 12 Oct 2022 12:02:48 GMT Received: from vpolimer-linux.qualcomm.com (vpolimer-linux.qualcomm.com [10.204.67.235]) by APBLRPPMTA02.qualcomm.com (PPS) with ESMTP id 29CC2mTP026873; Wed, 12 Oct 2022 12:02:48 +0000 Received: by vpolimer-linux.qualcomm.com (Postfix, from userid 463814) id 09A653EEF; Wed, 12 Oct 2022 17:32:46 +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 v8 08/15] drm/bridge: add psr support for panel bridge callbacks Date: Wed, 12 Oct 2022 17:32:32 +0530 Message-Id: <1665576159-3749-9-git-send-email-quic_vpolimer@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1665576159-3749-1-git-send-email-quic_vpolimer@quicinc.com> References: <1665576159-3749-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: jrHYDiWFQyduTE0tgf1VB0t7K6VDN6Ha X-Proofpoint-ORIG-GUID: jrHYDiWFQyduTE0tgf1VB0t7K6VDN6Ha X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-10-12_06,2022-10-12_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=981 mlxscore=0 suspectscore=0 bulkscore=0 phishscore=0 malwarescore=0 clxscore=1015 impostorscore=0 priorityscore=1501 spamscore=0 lowpriorityscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210120079 X-Spam-Status: No, score=-2.4 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 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