Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp3671660rwi; Wed, 12 Oct 2022 05:26:34 -0700 (PDT) X-Google-Smtp-Source: AMsMyM77Rvx/RQUUOXazoA0y+kx58od3pPDCOsUfT5/I139xMg7bz0Lbko7IZmsrlU8sENdK4CAH X-Received: by 2002:a05:6402:90e:b0:443:ec4b:2b03 with SMTP id g14-20020a056402090e00b00443ec4b2b03mr26518473edz.71.1665577594618; Wed, 12 Oct 2022 05:26:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665577594; cv=none; d=google.com; s=arc-20160816; b=k4cRr6YGfb9k6FFtj1BCw3E2DCVGLYPn+eC6UfJnFrPzNGl1mthOX8KfKqEAMjhRlH 1sdClOarmuIS6cjDIlIHyQEmx2XLGxQ19xHW+lTGulGr3Kuwcl8fFuL6oWrewo+OZxEi 8rK012mcGVGQM0komuaDzNXRS5Ui32weK0Z4+Me4Po0CXmtPrIMptC092LBdJ3BVrBDK ohHlFbqXFW/kyuQwJlYWddPNJydIaAryk7UgarpwSlCtbZBMIpNqPyNR4qGm7ruDTLve 3ZBl1o/EACIEnyUoHrwNhAHX77TT1oFwsvsWwmiEKeTjVyzj5aE4NdiG2l6Bx78TZ/im JoOg== 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=RA1ipFEdhlLQbSALrHtsi1jAr2KcTAoVnz6bp7Dmpvo=; b=uIEImxI/DCsnoT7N7qDckFzkICyDFYhpw7kLef1wGbqBnS8tJJWogixRgj/IxKBg1k pMCtso2bSQpKsQrzugeFXz6M9NRKW0cckIvYYl/77545seUifqF+lIxdUUVeNEhwZ9vM t7ziW3LIFggvzuYKLmQKCYsIHzVYs3DCVb6wsOP3O3x4B7i8qj89AwtFlmibNzK4wv0v GSzqDWSoukXNiXTIo0JwX+I8If/rHlQanou7LcAEqJX6QyqW9hIq4b2SLG2d8quhFXSk 0O1/wA7TbBLAGM+3Z47JY3NH4hVBAU1fADO+KYoAW/Iz6XaOQ20gimgzr9nVVAMk603L BuIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=ZjvIVUz9; 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 u16-20020aa7d990000000b0045c26f0050esi6022584eds.238.2022.10.12.05.26.06; Wed, 12 Oct 2022 05:26:34 -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=ZjvIVUz9; 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 S229868AbiJLMDj (ORCPT + 99 others); Wed, 12 Oct 2022 08:03:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229590AbiJLMC4 (ORCPT ); Wed, 12 Oct 2022 08:02:56 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 419B1A7A9D; Wed, 12 Oct 2022 05:02: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 29C7xxo8009758; Wed, 12 Oct 2022 12:02:52 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=RA1ipFEdhlLQbSALrHtsi1jAr2KcTAoVnz6bp7Dmpvo=; b=ZjvIVUz9WMhRRqq4CKqbIaikWX1G83vxIfLYduc3YCDnzQrIm0RZm9T5V9s1V16byQxt 1zu1evnEgkG8GO6Xk0cpd2vNmwNAhYgDB9IDU6YmDpO8DEhSax+XVm1AwJkmmn/7/GVU JXDLrGMcEYvCn+RzNgIXrUN+jJHzddUvVfF46HHoP/LwGL2vKwtHEFK4iYn2jhIqgvFB jJ+SBpzwasWKDvzXHxJQ+Ypfmum98ZnVoUdEuhkJGhd9WOsICxSqViwTPo8YggV2sX3C 7YquJReGaCSNHv7qg7TVlxPlnijg9SVJLPGcojZe9T/sQOM0rcoaeGUFkdOYsEWzJA4s mQ== 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 3k5kar1n9t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 12 Oct 2022 12:02:52 +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 29CC2mtR026937; Wed, 12 Oct 2022 12:02:48 GMT Received: from pps.reinject (localhost [127.0.0.1]) by APBLRPPMTA02.qualcomm.com (PPS) with ESMTPS id 3k3jpu0t2f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 12 Oct 2022 12:02:48 +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 29CC2mg6026897; 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 29CC2mA4026870; Wed, 12 Oct 2022 12:02:48 +0000 Received: by vpolimer-linux.qualcomm.com (Postfix, from userid 463814) id CC7353EAB; 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: Sankeerth Billakanti , linux-kernel@vger.kernel.org, robdclark@gmail.com, dianders@chromium.org, quic_vpolimer@quicinc.com, 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 Subject: [PATCH v8 06/15] drm/msm/dp: disable self_refresh_aware after entering psr Date: Wed, 12 Oct 2022 17:32:30 +0530 Message-Id: <1665576159-3749-7-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-ORIG-GUID: IKs39UZb7NjAZKiWTRg4xseJzK310Lth X-Proofpoint-GUID: IKs39UZb7NjAZKiWTRg4xseJzK310Lth 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 spamscore=0 clxscore=1015 phishscore=0 suspectscore=0 adultscore=0 malwarescore=0 impostorscore=0 priorityscore=1501 mlxscore=0 bulkscore=0 lowpriorityscore=0 mlxlogscore=999 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 From: Sankeerth Billakanti Updated frames get queued if self_refresh_aware is set when the sink is in psr. To support bridge enable and avoid queuing of update frames, reset the self_refresh_aware state after entering psr. Signed-off-by: Sankeerth Billakanti Signed-off-by: Vinod Polimera --- drivers/gpu/drm/msm/dp/dp_drm.c | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/msm/dp/dp_drm.c b/drivers/gpu/drm/msm/dp/dp_drm.c index 3e8912b..818c105 100644 --- a/drivers/gpu/drm/msm/dp/dp_drm.c +++ b/drivers/gpu/drm/msm/dp/dp_drm.c @@ -100,6 +100,8 @@ static void edp_bridge_atomic_enable(struct drm_bridge *drm_bridge, struct drm_crtc_state *old_crtc_state; struct msm_dp_bridge *dp_bridge = to_dp_bridge(drm_bridge); struct msm_dp *dp = dp_bridge->dp_display; + struct drm_connector *connector; + struct drm_connector_state *conn_state = NULL; /* * Check the old state of the crtc to determine if the panel @@ -116,10 +118,22 @@ static void edp_bridge_atomic_enable(struct drm_bridge *drm_bridge, if (old_crtc_state && old_crtc_state->self_refresh_active) { dp_display_set_psr(dp, false); - return; + goto psr_aware; } dp_bridge_atomic_enable(drm_bridge, old_bridge_state); + +psr_aware: + connector = drm_atomic_get_new_connector_for_encoder(atomic_state, + drm_bridge->encoder); + if (connector) + conn_state = drm_atomic_get_new_connector_state(atomic_state, + connector); + + if (conn_state) { + conn_state->self_refresh_aware = dp->psr_supported; + } + } static void edp_bridge_atomic_disable(struct drm_bridge *drm_bridge, @@ -130,6 +144,14 @@ static void edp_bridge_atomic_disable(struct drm_bridge *drm_bridge, struct drm_crtc_state *new_crtc_state = NULL, *old_crtc_state = NULL; struct msm_dp_bridge *dp_bridge = to_dp_bridge(drm_bridge); struct msm_dp *dp = dp_bridge->dp_display; + struct drm_connector *connector; + struct drm_connector_state *conn_state = NULL; + + connector = drm_atomic_get_old_connector_for_encoder(atomic_state, + drm_bridge->encoder); + if (connector) + conn_state = drm_atomic_get_new_connector_state(atomic_state, + connector); crtc = drm_atomic_get_old_crtc_for_encoder(atomic_state, drm_bridge->encoder); @@ -156,6 +178,9 @@ static void edp_bridge_atomic_disable(struct drm_bridge *drm_bridge, * when display disable occurs while the sink is in psr state. */ if (new_crtc_state->self_refresh_active) { + if (conn_state) + conn_state->self_refresh_aware = false; + dp_display_set_psr(dp, true); return; } else if (old_crtc_state->self_refresh_active) { -- 2.7.4