Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3939023pxb; Tue, 2 Nov 2021 00:52:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyNGKwl4HNX44nAvoKzX/huCvvGxBJRLC0vMS1RKBlP7ONcxm9Y9Oj4xaWLgZ3BhXWF0Z+H X-Received: by 2002:a17:906:9756:: with SMTP id o22mr25586214ejy.438.1635839552464; Tue, 02 Nov 2021 00:52:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635839552; cv=none; d=google.com; s=arc-20160816; b=1KYLuI3w594M2ltTg6smn0xUA1EU4ne86XtRgLZtdEk6YrnS18+lou1WleO9m6eNET vMRazbW4h/214Gx31eO0dzasnGhIbhOIgUn8Zrdx24ahDuRu5K2GEI1XpeSqraY3VKG9 brZuGx+/2PFhzdrQDAOvrysjaj8b4wDJRrIHqWIFD/kMh61fADEfLjHjasbMFsObitYr hDrxninJiNIU3CL3gWDF3/LRFW/iB0dfU1Tup4AupXfsYsJ611Pca9WcPw0ZCQXKlBE/ fQ4+uDGA+pbpJpal7TPPk1AcksLsN5fZ5RWj1jX2ML5hRdrPlD5DtNm4vc2IAV9QI3aS gkIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=XbITvdzhfLjyb4CX1ZOFhT1UhZy0Ds5/2mi6MtUV/uo=; b=1IuyTocdpvh8GaGSkSo7J9sLHS0s6JyS+s1jJIuFtcr7npujcKHZ6qoxNBczy/nHDI M8EP0K98YrsO5ZPfSNXoNbhFbxnG/aocPYI5u9H+e+67wCOZdaFuoNxfvnZIF4KyloGN HtXmS/NV4yIn8CiXnUn2QszgNF0kGCCDgfkH04cXBaYqFofhBm0V2WOD9lx6w3KKfX15 Xp+GNMR4q8qZjb2D81E5l4bAtyekU5gtQ5+j/mXrsAlFF5V3Ag5J8QUK9dnqL87Q5ESc LpCAUmK+l5DKDT7lYLrmw49mzYAJzTXPzDfD9G+N5CZm6TuOp2txnMv580K7onDKzdfZ APsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=QWWjNg1J; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y6si26469544edp.593.2021.11.02.00.52.09; Tue, 02 Nov 2021 00:52:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=QWWjNg1J; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S230005AbhKBHwS (ORCPT + 99 others); Tue, 2 Nov 2021 03:52:18 -0400 Received: from alexa-out-sd-02.qualcomm.com ([199.106.114.39]:22864 "EHLO alexa-out-sd-02.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231303AbhKBHwR (ORCPT ); Tue, 2 Nov 2021 03:52:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1635839383; x=1667375383; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=XbITvdzhfLjyb4CX1ZOFhT1UhZy0Ds5/2mi6MtUV/uo=; b=QWWjNg1J7XEvQn/95n5ozp8hqYVplkOL3nnb7WtlsINWB0QeVrckl1lo g9l950PryXurhOBZLUwKhftUGNRjDhh6gjTP+wzZRpokr2pf+1GWyZ1tg c4CatmGkGsD+TUf07o68XUI7/XqdS/ArmjWpNmpWe9XOk1rQ0JKgxghhi w=; Received: from unknown (HELO ironmsg03-sd.qualcomm.com) ([10.53.140.143]) by alexa-out-sd-02.qualcomm.com with ESMTP; 02 Nov 2021 00:49:43 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg03-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Nov 2021 00:49:42 -0700 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.922.7; Tue, 2 Nov 2021 00:49:42 -0700 Received: from sbillaka-linux.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.922.7; Tue, 2 Nov 2021 00:49:38 -0700 From: Sankeerth Billakanti To: , , , CC: Sankeerth Billakanti , , , , , , , , Subject: [PATCH v4 5/5] drm/msm/dp: Enable ASSR for supported DP sinks Date: Tue, 2 Nov 2021 13:18:45 +0530 Message-ID: <1635839325-401-6-git-send-email-quic_sbillaka@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1635839325-401-1-git-send-email-quic_sbillaka@quicinc.com> References: <1635839325-401-1-git-send-email-quic_sbillaka@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The eDP sink on sc7280 supports ASSR and dp driver will enable ASSR in the source hardware. The driver needs to enable the ASSR field in the DPCD configuration register to avoid screen corruption. This change will enable ASSR if supported in the sink device. Signed-off-by: Sankeerth Billakanti Reviewed-by: Stephen Boyd --- drivers/gpu/drm/msm/dp/dp_ctrl.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/msm/dp/dp_ctrl.c b/drivers/gpu/drm/msm/dp/dp_ctrl.c index a40e798..c724cb0 100644 --- a/drivers/gpu/drm/msm/dp/dp_ctrl.c +++ b/drivers/gpu/drm/msm/dp/dp_ctrl.c @@ -119,13 +119,13 @@ void dp_ctrl_push_idle(struct dp_ctrl *dp_ctrl) static void dp_ctrl_config_ctrl(struct dp_ctrl_private *ctrl) { u32 config = 0, tbd; - u8 *dpcd = ctrl->panel->dpcd; + const u8 *dpcd = ctrl->panel->dpcd; /* Default-> LSCLK DIV: 1/4 LCLK */ config |= (2 << DP_CONFIGURATION_CTRL_LSCLK_DIV_SHIFT); /* Scrambler reset enable */ - if (dpcd[DP_EDP_CONFIGURATION_CAP] & DP_ALTERNATE_SCRAMBLER_RESET_CAP) + if (drm_dp_alternate_scrambler_reset_cap(dpcd)) config |= DP_CONFIGURATION_CTRL_ASSR; tbd = dp_link_get_test_bits_depth(ctrl->link, @@ -1231,6 +1231,7 @@ static int dp_ctrl_link_train(struct dp_ctrl_private *ctrl, const u8 *dpcd = ctrl->panel->dpcd; u8 encoding = DP_SET_ANSI_8B10B; u8 ssc; + u8 assr; struct dp_link_info link_info = {0}; dp_ctrl_config_ctrl(ctrl); @@ -1249,6 +1250,12 @@ static int dp_ctrl_link_train(struct dp_ctrl_private *ctrl, drm_dp_dpcd_write(ctrl->aux, DP_MAIN_LINK_CHANNEL_CODING_SET, &encoding, 1); + if (drm_dp_alternate_scrambler_reset_cap(dpcd)) { + assr = DP_ALTERNATE_SCRAMBLER_RESET_ENABLE; + drm_dp_dpcd_write(ctrl->aux, DP_EDP_CONFIGURATION_SET, + &assr, 1); + } + ret = dp_ctrl_link_train_1(ctrl, training_step); if (ret) { DRM_ERROR("link training #1 failed. ret=%d\n", ret); -- 2.7.4