From patchwork Sun Jul 25 04:24:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 485655 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp2705257jao; Sat, 24 Jul 2021 21:26:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzZmKgOF73bHgjUiPKz3LngCz3rFpKDGo5hJ+345ALOWcjWpeZOgmgNvgNf/rSweDryjpX1 X-Received: by 2002:a17:90a:17a1:: with SMTP id q30mr11224899pja.190.1627187193332; Sat, 24 Jul 2021 21:26:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627187193; cv=none; d=google.com; s=arc-20160816; b=PjxApqy2sP60LHmGMbYeckd+xC2VazEivDJTQe/ok/Y7uOOuZ0DCnEX+MH3k9NbxAS 4TIyi56Su+i89n12mBrnjwK1YktkgrBasxPtZmS6vT0OxhhItS3cLkNNb6oIkJno5si8 GYegQ9Y4bqBqeY9kDnUTF2xSYOow3NRWFenpwX00WuVSg5//sgJbO9moqmjJ0N3hp5n+ j3u8QXsWWvwMGBYqUnP0aJKMzj93tBJr/tdYXmXUpX7IdpTCm8Aa9XU0NJrkVLq2YVwv F1H2Y6SdYXmTxgMJnP4XTbXhpqqMSSJrQZMO7Ds/xczuV61rHNyoCR34Z/fYHYJ7sz72 OSNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature:delivered-to; bh=kLIpHKwFlMuHXbvXnn7lcDZQY67Dtyth80Io278/rNM=; b=rTl3CvBvtqD8evCso6aQ0qkoAhqMOzrfNb6HliItSrsMdw0izfH0UXaOtVi9Nrf/Y4 MtjNi6L2eu1pyOngfcbAU5jOvl/r10kQHREY9VRe+nZIAIK0cflCsJ6L+nlcTqnYRIUx 9Jxn31vznT9GqVTg4+gxCM0pFLFAe+695RTe9nhuIj6ybAcpP4O4xXiEaCCeQoDb0qJF HjhJrIG6TMMGWwm2u7zghLQV1mBqVX6b3RR72XEMSyQ+6HQYr+FfBw/0X7ONb2YSetyH cgOvxmAf0awS3x4bpjmp0VMEjT0BwFrODwTDXaFo5JKQRK0CmLUd/Xpgi7BVpIwJpUM/ +2zA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Y5Ai3brq; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [2610:10:20:722:a800:ff:fe36:1795]) by mx.google.com with ESMTPS id t19si16085833ply.14.2021.07.24.21.26.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Jul 2021 21:26:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) client-ip=2610:10:20:722:a800:ff:fe36:1795; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Y5Ai3brq; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2269F737FB; Sun, 25 Jul 2021 04:26:29 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-ot1-x32d.google.com (mail-ot1-x32d.google.com [IPv6:2607:f8b0:4864:20::32d]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5204273049 for ; Sun, 25 Jul 2021 04:26:26 +0000 (UTC) Received: by mail-ot1-x32d.google.com with SMTP id c2-20020a0568303482b029048bcf4c6bd9so5076272otu.8 for ; Sat, 24 Jul 2021 21:26:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=kLIpHKwFlMuHXbvXnn7lcDZQY67Dtyth80Io278/rNM=; b=Y5Ai3brq2K5DR9ucCChonXVGTYduqDK3BdwGhM+jz9Ia7mWW/pfsXoLJlGBGub9YMj 597wrEKirFSD62Uilrms59MVw4H1IEdmgSKKDlBEsnQy9tQssrIZ/E06F550Co+vWe43 80trfKhcDXDxpZgCUfS2fJaIVmfDTrZafaByjJ5siMB2vTXDpehT77Pi6sKqeQuyBYZ3 poLBWGeYRrHvYSp5qnGIaHDqLUUbjS/TRukyigXGtnaQo4VJ3Okp2Fxqja1y/KZptR+S Xtn2wPZI4D1aqfjk+7Gbpd4LdEw8j8eN/Calx78ZIw3U6yC7HwfviI/nHqC/pPTSifj4 fhZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=kLIpHKwFlMuHXbvXnn7lcDZQY67Dtyth80Io278/rNM=; b=eGZkw133VlDMj14TxQUo/ua1GRiI+IN0b1+WELm4ahbphWjh6osftOtZmJrZUub3S+ HfoYYF+x6q6TS3RW33Uy1oVGTlv4SQRRtyI1foPZ7AsfDSr7x1S5IhP8DU8OzhSJ5M5X +agxy+dAAqvZv9gEwLk9j1WDNbk9+yBg1UZS+1gF3jBQgmUTfjqWJDJpmPBVhBYXUSYs bssag5Vo9kgWcmiJGjtPod1DliNzWsh2NZDdaOLr/6qY3cn3C6ERfaro/6ilNcvUEYcX EZx8/b2tN3UkIbZ41YDi4DJZNqj1CiyWBDh//CoXQIhC1iKmI6TUVSBsiHBtXnCiOucX ll4A== X-Gm-Message-State: AOAM5311U1I6jy63vKctU2Xlwc3NYFDUBtUtWjbOl2wuCM9P4P6VPVy0 FTAtePqBiuYe65osR4h5h80dow== X-Received: by 2002:a9d:39e3:: with SMTP id y90mr8228160otb.257.1627187185599; Sat, 24 Jul 2021 21:26:25 -0700 (PDT) Received: from localhost.localdomain (104-57-184-186.lightspeed.austtx.sbcglobal.net. [104.57.184.186]) by smtp.gmail.com with ESMTPSA id t144sm6986200oih.57.2021.07.24.21.26.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Jul 2021 21:26:25 -0700 (PDT) From: Bjorn Andersson To: Rob Clark , Sean Paul , David Airlie , Daniel Vetter , Abhinav Kumar , Dmitry Baryshkov , Kalyan Thota , Kuogee Hsieh Subject: [PATCH 2/5] drm/msm/dp: Modify prototype of encoder based API Date: Sat, 24 Jul 2021 21:24:32 -0700 Message-Id: <20210725042436.3967173-3-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210725042436.3967173-1-bjorn.andersson@linaro.org> References: <20210725042436.3967173-1-bjorn.andersson@linaro.org> MIME-Version: 1.0 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: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Stephen Boyd , Rob Herring , freedreno@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Functions in the DisplayPort code that relates to individual instances (encoders) are passed both the struct msm_dp and the struct drm_encoder. But in a situation where multiple DP instances would exist this means that the caller need to resolve which struct msm_dp relates to the struct drm_encoder at hand. The information for doing this lookup is available inside the DP driver, so update the API to take the struct msm_drm_private and the struct drm_encoder and have the DP code figure out which struct msm_dp the operation relates to. Signed-off-by: Bjorn Andersson --- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 17 +++++---- drivers/gpu/drm/msm/dp/dp_display.c | 38 +++++++++++++++++---- drivers/gpu/drm/msm/msm_drv.h | 31 +++++++++-------- 3 files changed, 56 insertions(+), 30 deletions(-) -- 2.29.2 diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c index 1c04b7cce43e..0d64ef0819af 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c @@ -1002,8 +1002,8 @@ static void dpu_encoder_virt_mode_set(struct drm_encoder *drm_enc, trace_dpu_enc_mode_set(DRMID(drm_enc)); - if (drm_enc->encoder_type == DRM_MODE_ENCODER_TMDS && priv->dp) - msm_dp_display_mode_set(priv->dp, drm_enc, mode, adj_mode); + if (drm_enc->encoder_type == DRM_MODE_ENCODER_TMDS) + msm_dp_display_mode_set(priv, drm_enc, mode, adj_mode); list_for_each_entry(conn_iter, connector_list, head) if (conn_iter->encoder == drm_enc) @@ -1184,9 +1184,8 @@ static void dpu_encoder_virt_enable(struct drm_encoder *drm_enc) _dpu_encoder_virt_enable_helper(drm_enc); - if (drm_enc->encoder_type == DRM_MODE_ENCODER_TMDS && priv->dp) { - ret = msm_dp_display_enable(priv->dp, - drm_enc); + if (drm_enc->encoder_type == DRM_MODE_ENCODER_TMDS) { + ret = msm_dp_display_enable(priv, drm_enc); if (ret) { DPU_ERROR_ENC(dpu_enc, "dp display enable failed: %d\n", ret); @@ -1226,8 +1225,8 @@ static void dpu_encoder_virt_disable(struct drm_encoder *drm_enc) /* wait for idle */ dpu_encoder_wait_for_event(drm_enc, MSM_ENC_TX_COMPLETE); - if (drm_enc->encoder_type == DRM_MODE_ENCODER_TMDS && priv->dp) { - if (msm_dp_display_pre_disable(priv->dp, drm_enc)) + if (drm_enc->encoder_type == DRM_MODE_ENCODER_TMDS) { + if (msm_dp_display_pre_disable(priv, drm_enc)) DPU_ERROR_ENC(dpu_enc, "dp display push idle failed\n"); } @@ -1255,8 +1254,8 @@ static void dpu_encoder_virt_disable(struct drm_encoder *drm_enc) DPU_DEBUG_ENC(dpu_enc, "encoder disabled\n"); - if (drm_enc->encoder_type == DRM_MODE_ENCODER_TMDS && priv->dp) { - if (msm_dp_display_disable(priv->dp, drm_enc)) + if (drm_enc->encoder_type == DRM_MODE_ENCODER_TMDS) { + if (msm_dp_display_disable(priv, drm_enc)) DPU_ERROR_ENC(dpu_enc, "dp display disable failed\n"); } diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c index 8696b36d30e4..59ffd6c8f41f 100644 --- a/drivers/gpu/drm/msm/dp/dp_display.c +++ b/drivers/gpu/drm/msm/dp/dp_display.c @@ -1432,12 +1432,25 @@ int msm_dp_modeset_init(struct msm_dp *dp_display, struct drm_device *dev, return 0; } -int msm_dp_display_enable(struct msm_dp *dp, struct drm_encoder *encoder) +static struct msm_dp *msm_dp_from_drm_encoder(struct msm_drm_private *priv, + struct drm_encoder *encoder) +{ + if (priv->dp && priv->dp->encoder == encoder) + return priv->dp; + + return NULL; +} + +int msm_dp_display_enable(struct msm_drm_private *priv, struct drm_encoder *encoder) { int rc = 0; struct dp_display_private *dp_display; + struct msm_dp *dp = msm_dp_from_drm_encoder(priv, encoder); u32 state; + if (!dp) + return -EINVAL; + dp_display = container_of(dp, struct dp_display_private, dp_display); if (!dp_display->dp_mode.drm_mode.clock) { DRM_ERROR("invalid params\n"); @@ -1489,9 +1502,13 @@ int msm_dp_display_enable(struct msm_dp *dp, struct drm_encoder *encoder) return rc; } -int msm_dp_display_pre_disable(struct msm_dp *dp, struct drm_encoder *encoder) +int msm_dp_display_pre_disable(struct msm_drm_private *priv, struct drm_encoder *encoder) { struct dp_display_private *dp_display; + struct msm_dp *dp = msm_dp_from_drm_encoder(priv, encoder); + + if (!dp) + return 0; dp_display = container_of(dp, struct dp_display_private, dp_display); @@ -1500,11 +1517,15 @@ int msm_dp_display_pre_disable(struct msm_dp *dp, struct drm_encoder *encoder) return 0; } -int msm_dp_display_disable(struct msm_dp *dp, struct drm_encoder *encoder) +int msm_dp_display_disable(struct msm_drm_private *priv, struct drm_encoder *encoder) { int rc = 0; u32 state; struct dp_display_private *dp_display; + struct msm_dp *dp = msm_dp_from_drm_encoder(priv, encoder); + + if (!dp) + return 0; dp_display = container_of(dp, struct dp_display_private, dp_display); @@ -1531,11 +1552,16 @@ int msm_dp_display_disable(struct msm_dp *dp, struct drm_encoder *encoder) return rc; } -void msm_dp_display_mode_set(struct msm_dp *dp, struct drm_encoder *encoder, - struct drm_display_mode *mode, - struct drm_display_mode *adjusted_mode) +void msm_dp_display_mode_set(struct msm_drm_private *priv, + struct drm_encoder *encoder, + struct drm_display_mode *mode, + struct drm_display_mode *adjusted_mode) { struct dp_display_private *dp_display; + struct msm_dp *dp = msm_dp_from_drm_encoder(priv, encoder); + + if (!dp) + return; dp_display = container_of(dp, struct dp_display_private, dp_display); diff --git a/drivers/gpu/drm/msm/msm_drv.h b/drivers/gpu/drm/msm/msm_drv.h index 9bfd37855969..e9232032b266 100644 --- a/drivers/gpu/drm/msm/msm_drv.h +++ b/drivers/gpu/drm/msm/msm_drv.h @@ -388,12 +388,13 @@ int __init msm_dp_register(void); void __exit msm_dp_unregister(void); int msm_dp_modeset_init(struct msm_dp *dp_display, struct drm_device *dev, struct drm_encoder *encoder); -int msm_dp_display_enable(struct msm_dp *dp, struct drm_encoder *encoder); -int msm_dp_display_disable(struct msm_dp *dp, struct drm_encoder *encoder); -int msm_dp_display_pre_disable(struct msm_dp *dp, struct drm_encoder *encoder); -void msm_dp_display_mode_set(struct msm_dp *dp, struct drm_encoder *encoder, - struct drm_display_mode *mode, - struct drm_display_mode *adjusted_mode); +int msm_dp_display_enable(struct msm_drm_private *priv, struct drm_encoder *encoder); +int msm_dp_display_disable(struct msm_drm_private *priv, struct drm_encoder *encoder); +int msm_dp_display_pre_disable(struct msm_drm_private *priv, struct drm_encoder *encoder); +void msm_dp_display_mode_set(struct msm_drm_private *priv, + struct drm_encoder *encoder, + struct drm_display_mode *mode, + struct drm_display_mode *adjusted_mode); void msm_dp_irq_postinstall(struct msm_dp *dp_display); void msm_dp_snapshot(struct msm_disp_state *disp_state, struct msm_dp *dp_display); @@ -413,25 +414,25 @@ static inline int msm_dp_modeset_init(struct msm_dp *dp_display, { return -EINVAL; } -static inline int msm_dp_display_enable(struct msm_dp *dp, +static inline int msm_dp_display_enable(struct msm_drm_private *priv, struct drm_encoder *encoder) { return -EINVAL; } -static inline int msm_dp_display_disable(struct msm_dp *dp, - struct drm_encoder *encoder) +static inline int msm_dp_display_disable(struct msm_drm_private *priv, + struct drm_encoder *encoder) { return -EINVAL; } -static inline int msm_dp_display_pre_disable(struct msm_dp *dp, - struct drm_encoder *encoder) +static inline int msm_dp_display_pre_disable(struct msm_drm_private *priv, + struct drm_encoder *encoder) { return -EINVAL; } -static inline void msm_dp_display_mode_set(struct msm_dp *dp, - struct drm_encoder *encoder, - struct drm_display_mode *mode, - struct drm_display_mode *adjusted_mode) +static inline void msm_dp_display_mode_set(struct msm_drm_private *priv, + struct drm_encoder *encoder, + struct drm_display_mode *mode, + struct drm_display_mode *adjusted_mode) { } From patchwork Sun Jul 25 04:24:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 485656 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp2705279jao; Sat, 24 Jul 2021 21:26:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzpt9HSKO05P8W8Tw9AVY0DpmltYFK/n/zCfRGIVGOzi6y44YAT51FyGzUkDENO20/AE5Rv X-Received: by 2002:aa7:8886:0:b029:32a:7290:ba42 with SMTP id z6-20020aa788860000b029032a7290ba42mr11857369pfe.65.1627187195915; Sat, 24 Jul 2021 21:26:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627187195; cv=none; d=google.com; s=arc-20160816; b=OG/kKsx+oqs5rjb6DhacygBk8M7YGvzg/Luau8phQXPElVCaXGDSw0yGBPgvl8B5wD il107yqgZ4WGqKgEThIiQIPWMJv5NQp9m3tUTYCIZzhB/xEJZzicibq1DWcBSlEP3+0o 48K9cIjbCoArTF5Rffs4H+/3WQBrqB3Y/VhaBIhs8wJyDumRQWrntpIAVNYC78AtX5dW u6tEXV29bjLKp9+/J9HRSb8xIttI3qdwNKA34Sq4w1tm4pfXMGjxNQclTKLX0E/UXGyU V/ix6dhoJ7DMQChOVqS/xdrNUHSTNyCmQrsZVqE82dVG1xLwuWUfcELFPgitldapUYyC /ctA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature:delivered-to; bh=LmXuEYSYhB+2/Ibl9NiegecKtnpW+IZkNn1yz7Dmy3A=; b=N0A0bSSjuY9YlT1ejFdXV4i8d+hEIB9swPKaEKeoyekvIGidqy1v7CTnuU0LJ4aLHL ucytt7Yfk0evuWXm4BRuq3ZaFj2bxebY7AD9FzP5QkH81oEtPJrP56iqbayUJw5b8umI wuDQQCuiFaba0XIKChx1EUaosXFWw1yjsCCbQ4aq2BadNlk8Dvr+zADZaKVkm9TfZmDN OP6CqUgOFbyvOZBGAFiEz1T0wnmF1zP7UNSgsTBbIromvMPEuIPFDTnoRlddDOsQwp3O UoLBk8NG9aG01BX6T9OVw7l+5SM0HiQguwkrpKVNiIHsTCaXgb7KIAlyfMqtBwgJ+zrc iVbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=WFc6LLpY; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id y14si26558592plh.40.2021.07.24.21.26.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Jul 2021 21:26:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=WFc6LLpY; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B055F737FC; Sun, 25 Jul 2021 04:26:29 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-oi1-x232.google.com (mail-oi1-x232.google.com [IPv6:2607:f8b0:4864:20::232]) by gabe.freedesktop.org (Postfix) with ESMTPS id 448FB737F8 for ; Sun, 25 Jul 2021 04:26:27 +0000 (UTC) Received: by mail-oi1-x232.google.com with SMTP id q6so6872065oiw.7 for ; Sat, 24 Jul 2021 21:26:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=LmXuEYSYhB+2/Ibl9NiegecKtnpW+IZkNn1yz7Dmy3A=; b=WFc6LLpY1ukT6Pa7wvCPiVNKrsYkSCByoIim/wNuwB3QlvEkvIJ7wOTt1Ttrt+A8Ij 1dxI1uTGgiqXFwedHnwxl+tF+S0I/s5iC+ikJa4bPJPH0JzbjlU4hvKX/e5UBsPHeZ2V 9WlBmVGKcXQDeRMxH58VkuyQ4FIjRY/y3oxv9em1syMxq7H0Azr+MHmEWj4iwklxWJhk NrYcQzbr5qlzHqmzvw9qn4QqP/g/vlxzwPytLD6K3ql6g7HL2KbwgEGNcUQbAH4XXM9d O2fYSymglFoRmatM/IByBRoJ6KggUhAXmTdyQElYGpIuPUF+7FeyksaDD0isy7wp7n/b 2hlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=LmXuEYSYhB+2/Ibl9NiegecKtnpW+IZkNn1yz7Dmy3A=; b=YP8Lyz+UujLbN/P/2RHxSsAX5Am6JW+sCKbf1DRpkb+m3lMBhFBOP06RGdtvJFBInu TCzGfpt4By344g0qV+3/7cZw78wZAOChshaTtEUghv+gUc0CPVxbGN8lUv/9v8nwVXvD aJV6TUQQfMiVQx4yLHV/h1fwTs58HHZpBMNAvIUOlYbpjWGq0M1AsSIk6A3bBBVbnfGL my/88n7ttLNBRsvEtbjrN2q3LBflrvBSksVMfnnMIjhBE/gz5aQ5uqDGbtNm9Zsy/tkr WxhtbuKQiV9vDTl8hLlUAXl84BOHz3oOWUbVGmfPlyR74aN6o6j09b020MmtUlq2zSUL V08Q== X-Gm-Message-State: AOAM5328AfOl6PKlqFDYALa3dvBhUQJEffX08upL7uShJehYFmO1DHWN T9VJxT5WaHeJjbLu/ts3TlBJvw== X-Received: by 2002:aca:c0c3:: with SMTP id q186mr2020961oif.39.1627187186596; Sat, 24 Jul 2021 21:26:26 -0700 (PDT) Received: from localhost.localdomain (104-57-184-186.lightspeed.austtx.sbcglobal.net. [104.57.184.186]) by smtp.gmail.com with ESMTPSA id t144sm6986200oih.57.2021.07.24.21.26.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Jul 2021 21:26:26 -0700 (PDT) From: Bjorn Andersson To: Rob Clark , Sean Paul , David Airlie , Daniel Vetter , Abhinav Kumar , Dmitry Baryshkov , Kalyan Thota , Kuogee Hsieh Subject: [PATCH 3/5] drm/msm/dp: Support up to 3 DP controllers Date: Sat, 24 Jul 2021 21:24:33 -0700 Message-Id: <20210725042436.3967173-4-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210725042436.3967173-1-bjorn.andersson@linaro.org> References: <20210725042436.3967173-1-bjorn.andersson@linaro.org> MIME-Version: 1.0 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: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Stephen Boyd , Rob Herring , freedreno@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Based on the removal of the g_dp_display and the movement of the priv->dp lookup into the DP code it's now possible to have multiple DP instances. In line with the other controllers in the MSM driver, introduce a per-compatible list of base addresses which is used to resolve the "instance id" for the given DP controller. This instance id is used as index in the priv->dp[] array. Then extend the initialization code to initialize struct drm_encoder for each of the registered priv->dp[] and update the logic for finding a struct msm_dp from a struct drm_encoder. Lastly, bump the number of struct msm_dp instances carries by priv->dp to 3, the currently known maximum number of controllers found in a Qualcomm SoC. Signed-off-by: Bjorn Andersson --- drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 60 +++++++++++-------- .../gpu/drm/msm/disp/msm_disp_snapshot_util.c | 8 ++- drivers/gpu/drm/msm/dp/dp_display.c | 59 ++++++++++++++++-- drivers/gpu/drm/msm/msm_drv.h | 2 +- 4 files changed, 95 insertions(+), 34 deletions(-) -- 2.29.2 diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c index f655adbc2421..a793cc8a007e 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c @@ -188,6 +188,7 @@ static int dpu_kms_debugfs_init(struct msm_kms *kms, struct drm_minor *minor) struct dentry *entry; struct drm_device *dev; struct msm_drm_private *priv; + int i; if (!p) return -EINVAL; @@ -203,8 +204,8 @@ static int dpu_kms_debugfs_init(struct msm_kms *kms, struct drm_minor *minor) dpu_debugfs_vbif_init(dpu_kms, entry); dpu_debugfs_core_irq_init(dpu_kms, entry); - if (priv->dp) - msm_dp_debugfs_init(priv->dp, minor); + for (i = 0; i < ARRAY_SIZE(priv->dp); i++) + msm_dp_debugfs_init(priv->dp[i], minor); return dpu_core_perf_debugfs_init(dpu_kms, entry); } @@ -545,33 +546,40 @@ static int _dpu_kms_initialize_displayport(struct drm_device *dev, struct drm_encoder *encoder = NULL; struct msm_display_info info; int rc = 0; + int i; - if (!priv->dp) - return rc; + for (i = 0; i < ARRAY_SIZE(priv->dp); i++) { + if (!priv->dp[i]) + continue; - encoder = dpu_encoder_init(dev, DRM_MODE_ENCODER_TMDS); - if (IS_ERR(encoder)) { - DPU_ERROR("encoder init failed for dsi display\n"); - return PTR_ERR(encoder); - } + encoder = dpu_encoder_init(dev, DRM_MODE_ENCODER_TMDS); + if (IS_ERR(encoder)) { + DPU_ERROR("encoder init failed for dsi display\n"); + return PTR_ERR(encoder); + } - memset(&info, 0, sizeof(info)); - rc = msm_dp_modeset_init(priv->dp, dev, encoder); - if (rc) { - DPU_ERROR("modeset_init failed for DP, rc = %d\n", rc); - drm_encoder_cleanup(encoder); - return rc; - } + memset(&info, 0, sizeof(info)); + rc = msm_dp_modeset_init(priv->dp[i], dev, encoder); + if (rc) { + DPU_ERROR("modeset_init failed for DP, rc = %d\n", rc); + drm_encoder_cleanup(encoder); + return rc; + } - priv->encoders[priv->num_encoders++] = encoder; + priv->encoders[priv->num_encoders++] = encoder; + + info.num_of_h_tiles = 1; + info.h_tile_instance[0] = i; + info.capabilities = MSM_DISPLAY_CAP_VID_MODE; + info.intf_type = encoder->encoder_type; + rc = dpu_encoder_setup(dev, encoder, &info); + if (rc) { + DPU_ERROR("failed to setup DPU encoder %d: rc:%d\n", + encoder->base.id, rc); + return rc; + } + } - info.num_of_h_tiles = 1; - info.capabilities = MSM_DISPLAY_CAP_VID_MODE; - info.intf_type = encoder->encoder_type; - rc = dpu_encoder_setup(dev, encoder, &info); - if (rc) - DPU_ERROR("failed to setup DPU encoder %d: rc:%d\n", - encoder->base.id, rc); return rc; } @@ -792,6 +800,7 @@ static int dpu_irq_postinstall(struct msm_kms *kms) { struct msm_drm_private *priv; struct dpu_kms *dpu_kms = to_dpu_kms(kms); + int i; if (!dpu_kms || !dpu_kms->dev) return -EINVAL; @@ -800,7 +809,8 @@ static int dpu_irq_postinstall(struct msm_kms *kms) if (!priv) return -EINVAL; - msm_dp_irq_postinstall(priv->dp); + for (i = 0; i < ARRAY_SIZE(priv->dp); i++) + msm_dp_irq_postinstall(priv->dp[i]); return 0; } diff --git a/drivers/gpu/drm/msm/disp/msm_disp_snapshot_util.c b/drivers/gpu/drm/msm/disp/msm_disp_snapshot_util.c index cabe15190ec1..2e1acb1bc390 100644 --- a/drivers/gpu/drm/msm/disp/msm_disp_snapshot_util.c +++ b/drivers/gpu/drm/msm/disp/msm_disp_snapshot_util.c @@ -126,8 +126,12 @@ void msm_disp_snapshot_capture_state(struct msm_disp_state *disp_state) priv = drm_dev->dev_private; kms = priv->kms; - if (priv->dp) - msm_dp_snapshot(disp_state, priv->dp); + for (i = 0; i < ARRAY_SIZE(priv->dp); i++) { + if (!priv->dp[i]) + continue; + + msm_dp_snapshot(disp_state, priv->dp[i]); + } for (i = 0; i < ARRAY_SIZE(priv->dsi); i++) { if (!priv->dsi[i]) diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c index 59ffd6c8f41f..92b7646a1bb7 100644 --- a/drivers/gpu/drm/msm/dp/dp_display.c +++ b/drivers/gpu/drm/msm/dp/dp_display.c @@ -79,6 +79,8 @@ struct dp_display_private { char *name; int irq; + int id; + /* state variables */ bool core_initialized; bool hpd_irq_on; @@ -116,8 +118,19 @@ struct dp_display_private { struct dp_audio *audio; }; + +struct msm_dp_config { + phys_addr_t io_start[3]; + size_t num_dp; +}; + +static const struct msm_dp_config sc7180_dp_cfg = { + .io_start = { 0x0ae90000 }, + .num_dp = 1, +}; + static const struct of_device_id dp_dt_match[] = { - {.compatible = "qcom,sc7180-dp"}, + { .compatible = "qcom,sc7180-dp", .data = &sc7180_dp_cfg }, {} }; @@ -217,7 +230,7 @@ static int dp_display_bind(struct device *dev, struct device *master, dp->dp_display.drm_dev = drm; priv = drm->dev_private; - priv->dp = &(dp->dp_display); + priv->dp[dp->id] = &(dp->dp_display); rc = dp->parser->parse(dp->parser); if (rc) { @@ -238,8 +251,11 @@ static int dp_display_bind(struct device *dev, struct device *master, } rc = dp_register_audio_driver(dev, dp->audio); - if (rc) + if (rc) { DRM_ERROR("Audio registration Dp failed\n"); + goto end; + } + end: return rc; @@ -259,7 +275,7 @@ static void dp_display_unbind(struct device *dev, struct device *master, dp_power_client_deinit(dp->power); dp_aux_unregister(dp->aux); - priv->dp = NULL; + priv->dp[dp->id] = NULL; } static const struct component_ops dp_display_comp_ops = { @@ -1205,6 +1221,26 @@ int dp_display_request_irq(struct msm_dp *dp_display) return 0; } +static int dp_display_get_id(struct platform_device *pdev) +{ + const struct msm_dp_config *cfg = of_device_get_match_data(&pdev->dev); + struct resource *res; + int i; + + + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + if (!res) + return -EINVAL; + + for (i = 0; i < cfg->num_dp; i++) { + if (cfg->io_start[i] == res->start) + return i; + } + + dev_err(&pdev->dev, "unknown displayport instance\n"); + return -EINVAL; +} + static int dp_display_probe(struct platform_device *pdev) { int rc = 0; @@ -1219,6 +1255,10 @@ static int dp_display_probe(struct platform_device *pdev) if (!dp) return -ENOMEM; + dp->id = dp_display_get_id(pdev); + if (dp->id < 0) + return -EINVAL; + dp->pdev = pdev; dp->name = "drm_dp"; @@ -1386,6 +1426,9 @@ void msm_dp_debugfs_init(struct msm_dp *dp_display, struct drm_minor *minor) struct device *dev; int rc; + if (!dp_display) + return; + dp = container_of(dp_display, struct dp_display_private, dp_display); dev = &dp->pdev->dev; @@ -1435,8 +1478,12 @@ int msm_dp_modeset_init(struct msm_dp *dp_display, struct drm_device *dev, static struct msm_dp *msm_dp_from_drm_encoder(struct msm_drm_private *priv, struct drm_encoder *encoder) { - if (priv->dp && priv->dp->encoder == encoder) - return priv->dp; + int i; + + for (i = 0; i < ARRAY_SIZE(priv->dp); i++) { + if (priv->dp[i] && priv->dp[i]->encoder == encoder) + return priv->dp[i]; + } return NULL; } diff --git a/drivers/gpu/drm/msm/msm_drv.h b/drivers/gpu/drm/msm/msm_drv.h index e9232032b266..62d54ef6c2c4 100644 --- a/drivers/gpu/drm/msm/msm_drv.h +++ b/drivers/gpu/drm/msm/msm_drv.h @@ -161,7 +161,7 @@ struct msm_drm_private { /* DSI is shared by mdp4 and mdp5 */ struct msm_dsi *dsi[2]; - struct msm_dp *dp; + struct msm_dp *dp[3]; /* when we have more than one 'msm_gpu' these need to be an array: */ struct msm_gpu *gpu; From patchwork Sun Jul 25 04:24:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 485657 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp2705334jao; Sat, 24 Jul 2021 21:26:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw+oMXZvrlzLxgzutgQo92MipiGdaysTLZrqmsR5U4sLIxfHvICEaMyeLZHtNY0GzyC3vsu X-Received: by 2002:a17:902:7611:b029:12b:e55e:6ee8 with SMTP id k17-20020a1709027611b029012be55e6ee8mr5909182pll.4.1627187201863; Sat, 24 Jul 2021 21:26:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627187201; cv=none; d=google.com; s=arc-20160816; b=EgsCWqaOVLN+J3E9efi1KK3kCcSntjRl/nRfZ2tpFHNHqvcGOT9ht7cnrQ4rWtX/Pb vH7d1uFHMn/ok5Q6tXsjilb+35eWNM09S5H0A3XeN7L8yZJ522lq+KGS8G5giSeBJYsG N13cb/1D3BagM/TlCfzMqDqIJbhuoVounLm29UYyD+BF8X1s1UHE4bSiVEN4VIkkFx+s oc2g6ESAMsmPa997UTu65sFLk/2GPMK5GdpOam6BLiCsM7d0z7sgufAefziCgwsOfYfs UvOkjq2/wE/4ejbIMLNJ1VCAFb1Yco44iQThzOTADUlbnbjmyg99CfzmnFdl6CsZIWLN E4/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature:delivered-to; bh=kU1VfKV/KwidsxyPTuvcQ9ilMU6Cwx8iFZjshNBHlrk=; b=xLqGNmkbZwEDlryPD4Hg3ua4OrDN6Y6ojdvohdjlO5rUPpCguCsYf0jLeOl75LvQQ6 dYuLthghDnGSCBB2Vxy9iuXD2haiQeyF2bw8p7AmZ5SlQ8mOIUIhE/8OSdn/EVgP3I1g 8h1sOeICJBRIg2MqoAF5Io5x47y429GngMwZTgmjiV/0lVQZ1T+unj7+zsPS+kB2kklu lFOoj0JnxUaH74VdStN7PEREiyLDo3wtLYQcfEJfr/iVu2ZAioAL1269X69b5V5lWYbG iXkUuzUlaEGgqjqlaBmK5my31Pi7A8xi7mCKJ4hNDWSgUx5zOYBhLYNJu0e+nRUgM/j+ OjAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=TRygaLb1; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id d19si105982pfq.334.2021.07.24.21.26.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Jul 2021 21:26:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=TRygaLb1; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6ADAA73801; Sun, 25 Jul 2021 04:26:38 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-oi1-x236.google.com (mail-oi1-x236.google.com [IPv6:2607:f8b0:4864:20::236]) by gabe.freedesktop.org (Postfix) with ESMTPS id 54696737FC for ; Sun, 25 Jul 2021 04:26:29 +0000 (UTC) Received: by mail-oi1-x236.google.com with SMTP id a19so6886899oiw.6 for ; Sat, 24 Jul 2021 21:26:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=kU1VfKV/KwidsxyPTuvcQ9ilMU6Cwx8iFZjshNBHlrk=; b=TRygaLb1d2m9eOGCp6xYaANeKW0tOnOoZgQUGxgLOoMYwf+qIpEE8Rpp9HKxSQ2lfI tWdu7DdwKwVM5s04IZr/iL8VuBBoAjCHxHzHAflBHRPHf3KtBpmDN5JgZeMRC+nkyrff FkM+Q0dRk2WI3LnGnTmu4VMb2ug+ib3gcQw44sLHlMn3aqwNt9dFlKB1j+/Y9+bNE42V HmfGNgOQvpx+AC06SYnxWW6FqPEi7Ffg8EsoUNKpyMMbga3Pu4TlP/RpE6RQbcVSWGgM RRYovJ0OkjLyEtB4VzulN3ZfQsEFvwBTk4jYxS5qDX3NNf/UsBagGyHU0X6m9CAbEyab BEJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=kU1VfKV/KwidsxyPTuvcQ9ilMU6Cwx8iFZjshNBHlrk=; b=G9iva+Te++Z//GyOYuVVriFMgGiRIgTMX35TzQadmt3owGuAfc+sDGesjd57AOBNVv Y1hybW6xkg4m9MtCYgRw/INPtujRq4i0RFUnLJh58MqvXETgYo2v6N24apyRsyJy4sTe ARfEG9KwLGr6R8T9/9HzPgwjH+dUi2ictN3IbIl4Vgr+JvpaggvjZT9pZGnIxKqyoyQT pbnSQpCNGUu0LG+WuSt7NMwgy8ZyR71p5coFzVCKs0qclHw3t+146wh5JRujQ5GWUI6h EOvT/Ow7lEOdmLBsU3vzrAN03MgXvuyG45o/a8I6/9sD7qwzyoOViNkWT83Nc0u0cuIr 6rOQ== X-Gm-Message-State: AOAM53354Ox2no7f95bwi6V1XpT4gA67vj+ufHL8WB4zHTqFKzqvtGYw Ln21qmczQXO9SGUlewkRQ4ySnQ== X-Received: by 2002:a05:6808:2089:: with SMTP id s9mr7702063oiw.156.1627187188672; Sat, 24 Jul 2021 21:26:28 -0700 (PDT) Received: from localhost.localdomain (104-57-184-186.lightspeed.austtx.sbcglobal.net. [104.57.184.186]) by smtp.gmail.com with ESMTPSA id t144sm6986200oih.57.2021.07.24.21.26.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Jul 2021 21:26:28 -0700 (PDT) From: Bjorn Andersson To: Rob Clark , Sean Paul , David Airlie , Daniel Vetter , Abhinav Kumar , Dmitry Baryshkov , Kalyan Thota , Kuogee Hsieh Subject: [PATCH 4/5] dt-bindings: msm/dp: Add SC8180x compatibles Date: Sat, 24 Jul 2021 21:24:35 -0700 Message-Id: <20210725042436.3967173-6-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210725042436.3967173-1-bjorn.andersson@linaro.org> References: <20210725042436.3967173-1-bjorn.andersson@linaro.org> MIME-Version: 1.0 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: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Stephen Boyd , Rob Herring , freedreno@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The Qualcomm SC8180x has 2 DP controllers and 1 eDP controller, add compatibles for these to the msm/dp binding. Signed-off-by: Bjorn Andersson --- .../devicetree/bindings/display/msm/dp-controller.yaml | 2 ++ 1 file changed, 2 insertions(+) -- 2.29.2 Reviewed-by: Stephen Boyd diff --git a/Documentation/devicetree/bindings/display/msm/dp-controller.yaml b/Documentation/devicetree/bindings/display/msm/dp-controller.yaml index a6e41be038fc..c6056e0b0845 100644 --- a/Documentation/devicetree/bindings/display/msm/dp-controller.yaml +++ b/Documentation/devicetree/bindings/display/msm/dp-controller.yaml @@ -17,6 +17,8 @@ properties: compatible: enum: - qcom,sc7180-dp + - qcom,sc8180x-dp + - qcom,sc8180x-edp reg: items: From patchwork Sun Jul 25 04:24:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 485658 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp2705337jao; Sat, 24 Jul 2021 21:26:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyGbXtUhTALCwb2t5wFOHROuC6UI+PqgRFfSeYSPDGtjN/iMYKV45BsUOOoWca7D/TNSrn7 X-Received: by 2002:a17:902:f2c1:b029:12a:e27f:7366 with SMTP id h1-20020a170902f2c1b029012ae27f7366mr9860935plc.22.1627187202583; Sat, 24 Jul 2021 21:26:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627187202; cv=none; d=google.com; s=arc-20160816; b=RdWLXshO3BwhM3AXNXHnsPOybgU5+ia5G5HiGVeevL3yn8R8MeyFN3L0a/Hh88xzDO n0iC3/fK1tAGNq3L3ZNrT3kTm7ltkQMxsbl11p6ctetKZ4UtA/XF7MmJakPeBxJzySnF mgPC0MP1HKpk5C/1NcMs6ynT4bK5GBHvI0RxzKpEDV1uoiadcfv64+Wv3uBK3LqGgYHE 6FuPzs1AT9jbKW/SHxalXg2rp/LDp2fmAHiP8emXII4gMeDIGV6/lRhmdYd0PBPpM5to 9IlBPngKOlRMXdCRpowRT6uE0rQKBA29lVF14kX3mexp0vNGMz/eb/1df+4GFMYPcksK KjoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature:delivered-to; bh=2lr0HLKbGMfhvgQzbBYGum6ThIOLWrTxgc/XRrqS7TI=; b=S8oz3+DZQIPuS8dDYMGji3DuObvCTizfMbE/e3EpbPcUN/ayyIK0jsRp+ph9HQZ6RD iO98Vc+viuhTZIh5ktK6fDfgCrFlsuQrbKdz5sy4La3/Z4e1Rt6cQaiNNWlFMWLH4+Fh BUgWE0j5BzCS7c1wjNSeD2ySNq410ykGh1/WQ/E5BMM21d5WOIfAWEkDcFhlU/dY5usw e7gYuRoCzaQ2aY5TV7QSLTtZRpXJlp0yRL6uACETv5waOf6zHJDak8vJ4LYMAdxJhmn9 P5QvKEPwRZKTEZrfRtpGut1VWaOS5QKFVOVvg+JUKZGGdNDCCUPZz02qZrGl1VB/LXjs NoAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=T4ZvBinI; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [2610:10:20:722:a800:ff:fe36:1795]) by mx.google.com with ESMTPS id n10si39096515plp.13.2021.07.24.21.26.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Jul 2021 21:26:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) client-ip=2610:10:20:722:a800:ff:fe36:1795; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=T4ZvBinI; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E9B5F73802; Sun, 25 Jul 2021 04:26:38 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-ot1-x334.google.com (mail-ot1-x334.google.com [IPv6:2607:f8b0:4864:20::334]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5C218737FE for ; Sun, 25 Jul 2021 04:26:30 +0000 (UTC) Received: by mail-ot1-x334.google.com with SMTP id i39-20020a9d17270000b02904cf73f54f4bso4593716ota.2 for ; Sat, 24 Jul 2021 21:26:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2lr0HLKbGMfhvgQzbBYGum6ThIOLWrTxgc/XRrqS7TI=; b=T4ZvBinIYvzQj0wWKnaURygYFC2E8hXmRZ1ZtD4KlsPvtaZ0cFoZfK0iRpA8KWTzLF CIbCxifoBvbYOZVB97EkjwgnLgzyC+SwnJKlzG0JDrqag/Ri8ZAO1YgIe0MInyV0rBBQ AgO5NCpTP1bTaBjQUienFQi8F9Tdqt9Zqoup4M7jy/4tNtdQ4x6dZw2ZGjcmVGdm2gzU ZAEx8G3ft3CUzTeoUHLzsJZEcqxrcD2Fa5M4Ia8Pz2QS8D3I1Bwm3U6M1t/TrbtLEMZ9 2V2i+KpfabqUX5eh9vinXE8LjV//GvsaLvmISWVyFnpalEri1aC4/JXOD5nAVQQRr3Q8 JqJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=2lr0HLKbGMfhvgQzbBYGum6ThIOLWrTxgc/XRrqS7TI=; b=jF1kVad5/v7t+Hx1vNsLscvE6BtMo38mROl1v0nA8XqxCw/IPpYKXYg3I3JdigCNpi AO0sC1yU8ES4jgFkRQMwDfRJ9xpOcHdm663RLgnV6bCoAscfheCblpomW2DXTNL3AU5U kVliC2fu8vWDBOYvv1DujpH3Aaei26qsgKfdC02mKMbliT9HhLsMtYRfKyjjUmdiLT35 3Ljw+nmNINJdjAz7aKrtunJ39WMtrKRFsIwxIKzCAUaiuoZdMuUAkvdx3h2pTLDYqGof 3nxdQ3TJGrFADY69CPcaSa9u+LweBcCl63GTZcmFQG3XV/TCLlVVbKp3578JsqSYlNkQ b7GA== X-Gm-Message-State: AOAM530V6RXw+HHlnV0CsjAJW8aWMiWBBD1qCGW5uSyaKTrpLxK1ji85 Xm/fCBUa1dVRBs41Heu7qdQBPg== X-Received: by 2002:a9d:27a4:: with SMTP id c33mr8032327otb.281.1627187189689; Sat, 24 Jul 2021 21:26:29 -0700 (PDT) Received: from localhost.localdomain (104-57-184-186.lightspeed.austtx.sbcglobal.net. [104.57.184.186]) by smtp.gmail.com with ESMTPSA id t144sm6986200oih.57.2021.07.24.21.26.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Jul 2021 21:26:29 -0700 (PDT) From: Bjorn Andersson To: Rob Clark , Sean Paul , David Airlie , Daniel Vetter , Abhinav Kumar , Dmitry Baryshkov , Kalyan Thota , Kuogee Hsieh Subject: [PATCH 5/5] drm/msm/dp: Add sc8180x DP controllers Date: Sat, 24 Jul 2021 21:24:36 -0700 Message-Id: <20210725042436.3967173-7-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210725042436.3967173-1-bjorn.andersson@linaro.org> References: <20210725042436.3967173-1-bjorn.andersson@linaro.org> MIME-Version: 1.0 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: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Stephen Boyd , Rob Herring , freedreno@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The sc8180x has 2 DP and 1 eDP controllers, add support for these to the DP driver. Link: https://lore.kernel.org/linux-arm-msm/20210511042043.592802-5-bjorn.andersson@linaro.org/ Signed-off-by: Bjorn Andersson --- drivers/gpu/drm/msm/dp/dp_display.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) -- 2.29.2 diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c index 92b7646a1bb7..c26805cfcdd1 100644 --- a/drivers/gpu/drm/msm/dp/dp_display.c +++ b/drivers/gpu/drm/msm/dp/dp_display.c @@ -129,8 +129,20 @@ static const struct msm_dp_config sc7180_dp_cfg = { .num_dp = 1, }; +static const struct msm_dp_config sc8180x_dp_cfg = { + .io_start = { 0xae90000, 0xae98000, 0 }, + .num_dp = 3, +}; + +static const struct msm_dp_config sc8180x_edp_cfg = { + .io_start = { 0, 0, 0xae9a000 }, + .num_dp = 3, +}; + static const struct of_device_id dp_dt_match[] = { { .compatible = "qcom,sc7180-dp", .data = &sc7180_dp_cfg }, + { .compatible = "qcom,sc8180x-dp", .data = &sc8180x_dp_cfg }, + { .compatible = "qcom,sc8180x-edp", .data = &sc8180x_edp_cfg }, {} };