From patchwork Wed May 5 08:16:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sankeerth Billakanti X-Patchwork-Id: 12239339 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 73B1AC433ED for ; Wed, 5 May 2021 08:34:37 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D99BE6112F for ; Wed, 5 May 2021 08:34:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D99BE6112F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2CEE16E0A5; Wed, 5 May 2021 08:34:36 +0000 (UTC) Received: from alexa-out.qualcomm.com (alexa-out.qualcomm.com [129.46.98.28]) by gabe.freedesktop.org (Postfix) with ESMTPS id 36ED76E0E9; Wed, 5 May 2021 08:23:26 +0000 (UTC) Received: from ironmsg08-lv.qualcomm.com ([10.47.202.152]) by alexa-out.qualcomm.com with ESMTP; 05 May 2021 01:17:23 -0700 X-QCInternal: smtphost Received: from ironmsg01-blr.qualcomm.com ([10.86.208.130]) by ironmsg08-lv.qualcomm.com with ESMTP/TLS/AES256-SHA; 05 May 2021 01:17:22 -0700 X-QCInternal: smtphost Received: from sbillaka-linux.qualcomm.com ([10.204.66.13]) by ironmsg01-blr.qualcomm.com with ESMTP; 05 May 2021 13:46:58 +0530 Received: by sbillaka-linux.qualcomm.com (Postfix, from userid 2305739) id 84F6F21D5B; Wed, 5 May 2021 13:46:57 +0530 (IST) From: Sankeerth Billakanti To: dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH v1 3/3] drm/msm/disp/dpu1: add support for edp encoder Date: Wed, 5 May 2021 13:46:19 +0530 Message-Id: <1620202579-19066-4-git-send-email-sbillaka@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1620202579-19066-1-git-send-email-sbillaka@codeaurora.org> References: <1620202579-19066-1-git-send-email-sbillaka@codeaurora.org> X-Mailman-Approved-At: Wed, 05 May 2021 08:34:34 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mkrishn@codeaurora.org, dianders@chromium.org, abhinavk@codeaurora.org, swboyd@chromium.org, khsieh@codeaurora.org, seanpaul@chromium.org, kalyan_t@codeaurora.org, Sankeerth Billakanti MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This change will enable dpu encoder support for the native eDP interface on next generation snapdragon platforms. Signed-off-by: Sankeerth Billakanti --- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 7 +++++- drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 33 +++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c index 8d94205..9f5185bb 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c @@ -2075,7 +2075,12 @@ static int dpu_encoder_setup_display(struct dpu_encoder_virt *dpu_enc, intf_type = INTF_DSI; break; case DRM_MODE_ENCODER_TMDS: - intf_type = INTF_DP; + if (disp_info->capabilities & MSM_DISPLAY_CAP_CMD_MODE) { + intf_type = INTF_EDP; + /* PSR CMD mode not supported */ + disp_info->capabilities = MSM_DISPLAY_CAP_VID_MODE; + } else + intf_type = INTF_DP; break; } diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c index 88e9cc3..ecd7dc8 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c @@ -499,6 +499,33 @@ static int _dpu_kms_initialize_dsi(struct drm_device *dev, return rc; } +static int _dpu_kms_initialize_edp(struct drm_device *dev, + struct msm_drm_private *priv, + struct dpu_kms *dpu_kms) +{ + struct drm_encoder *encoder = NULL; + int rc = 0; + + if (!priv->edp) + return rc; + + encoder = dpu_encoder_init(dev, DRM_MODE_ENCODER_TMDS); + if (IS_ERR(encoder)) { + DPU_ERROR("encoder init failed for eDP display\n"); + return PTR_ERR(encoder); + } + + rc = msm_edp_modeset_init(priv->edp, dev, encoder); + if (rc) { + DPU_ERROR("modeset_init failed for eDP, rc = %d\n", rc); + drm_encoder_cleanup(encoder); + return rc; + } + + priv->encoders[priv->num_encoders++] = encoder; + return rc; +} + static int _dpu_kms_initialize_displayport(struct drm_device *dev, struct msm_drm_private *priv, struct dpu_kms *dpu_kms) @@ -546,6 +573,12 @@ static int _dpu_kms_setup_displays(struct drm_device *dev, return rc; } + rc = _dpu_kms_initialize_edp(dev, priv, dpu_kms); + if (rc) { + DPU_ERROR("initialize_eDP failed, rc = %d\n", rc); + return rc; + } + rc = _dpu_kms_initialize_displayport(dev, priv, dpu_kms); if (rc) { DPU_ERROR("initialize_DP failed, rc = %d\n", rc);