From patchwork Sun Jul 25 04:24:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 485654 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp2705242jao; Sat, 24 Jul 2021 21:26:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxMUF2bF9QZvvZPFB7NreX7IyfNsHd611Q7ppXdMHw/kCZjxQZTWP4EU1jKdrmqez3dw2jL X-Received: by 2002:a6b:6f11:: with SMTP id k17mr9633816ioc.114.1627187191975; Sat, 24 Jul 2021 21:26:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627187191; cv=none; d=google.com; s=arc-20160816; b=07rwVbL+ef8niNdQFCRxg+Qa2iRr8WLHRcxSsheTHo7IRexuUivf3jPnNyx8hz3+XX lujqoAi2N3UgFwZbExw/5vS4+mKDS6TIlEl9CTzT1bzYdG71+Wi0MLyJhWdGi7o5+dtB yZDAJcAo0SgisqA3HtidAZpUKZwPpGQSY9f2c6yNdhydKoboWz68v/WBcHrklOZFld49 vajw0T6IQVqKnz1CqRymHQXCRF4YnVNQvtBKkdUKJtnx/hfcTaMyqTvKzrI9SLRiBgFr sxV4pw1v+DpYmb2KZw7GOiRzYu4cKTkMSwl/KWehZH187/4Y2vBeLHx0qT5r2GsfVX8w 1SlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=mzd8UHtqK6B4nMMOJ0K4TjMQTf4XfrHnm9DLV7Ce3NQ=; b=w1pX5sxNJKduY7cGMYM5C7q93x8nXbNlMnCaI897CneKF3fluCU9O2jZTs4j6xL1vL B0XG4rpd8mwuSWDJ7rXGC/UU64P9rx4L//vTnmCYBo/00MWHbqKuTh6KPlAJgdxg5C1v ns/FMO2JfaF+xONfnClM10gfLJGAoM8c9M1PUBNwQSt7tXsM8RLBqDwY7e/qXO1rnTX1 bgyvaGmebFOwnCVCyIJWsoUJmoUAkSoaEYhdNykjU+k8SzGhF21dqGI6U9cSZjH2NOQS a0XNcLaGq3R0060UdUXxa3HhUneNUZaLxudgCNN/6UEOHh9p3BT2yUD4xRE8zfyVU86U BoeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pXmTqUzR; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q41si36302239jav.74.2021.07.24.21.26.31; Sat, 24 Jul 2021 21:26:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-arm-msm-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=@linaro.org header.s=google header.b=pXmTqUzR; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230350AbhGYDp6 (ORCPT + 17 others); Sat, 24 Jul 2021 23:45:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57170 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230303AbhGYDpz (ORCPT ); Sat, 24 Jul 2021 23:45:55 -0400 Received: from mail-oi1-x231.google.com (mail-oi1-x231.google.com [IPv6:2607:f8b0:4864:20::231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 51B21C061764 for ; Sat, 24 Jul 2021 21:26:25 -0700 (PDT) Received: by mail-oi1-x231.google.com with SMTP id t128so6934024oig.1 for ; Sat, 24 Jul 2021 21:26:25 -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=mzd8UHtqK6B4nMMOJ0K4TjMQTf4XfrHnm9DLV7Ce3NQ=; b=pXmTqUzRebdCDYGNG6+TYM2T+HxPVGKaSR5yWGfEdomAVgqzmDFkhEp/tUextNIZNd riHfDapWf2PtZcGsJ2rRHIfW2tGT5ljh0WgIXen2dJyimdCh1djcRxQqhzXFJh2tu2X/ HteEGoX9vEHUR7H2mSA/DEj/nHJucUX97BfiC1KQ3W4aRHfgh+wB/H65UuMwshBNa03s 2S61Rbw5ZS/+ZmllLlP7OAogGSFzjlmQuTj+LKwJcbtN0U5ssdXmQoHwzxKuaegZWJm3 bocJAn0BHbHbdiajDtjB8IVb+D+zJfC2PAgW45IllNcusyrwpcPy2zP7+nspcc2SPQYc sEgQ== 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=mzd8UHtqK6B4nMMOJ0K4TjMQTf4XfrHnm9DLV7Ce3NQ=; b=e+WcZmoXPeYaN1Mq4UiMKGIC+qSOjQg5AuqVq/gzLmO7XZuOK1vZqHMzJ6AKLp2Ifq sEPKxvIeR5UCpVq+kg9jItTZV19OIGiZe+Dl3jEBicj8O9D1P8dp5+FTZ5NHzNi8QSav NL3/iZg6snqL5f30DaiwE31fJSkrzqZAKN3m/KiUTHo7VtcrZo06wifL7QNLGsTRC1Ly TkNrqErUNpj9c1zbo2fQkivwTqGgT2o4gVGv+fyD/VjjxXzOC6g5k7RRaYakJ8DxsGFd ZtCACc4XuMuoY7HR1BcWAB8lIfuyo0/AQeRgR6lTxBEaFWH4UHIRrMqHxZ6AB4MOsv5J LBhw== X-Gm-Message-State: AOAM530AcSIhNvLDfhKlqPFc9Zt1LUksftiTFdin5x3S4lgqlPAI6+tP DEAXGYSWdC/V32INT/aHe3CWsg== X-Received: by 2002:aca:3194:: with SMTP id x142mr7095396oix.93.1627187184676; Sat, 24 Jul 2021 21:26:24 -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.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Jul 2021 21:26:24 -0700 (PDT) From: Bjorn Andersson To: Rob Clark , Sean Paul , David Airlie , Daniel Vetter , Abhinav Kumar , Dmitry Baryshkov , Kalyan Thota , Kuogee Hsieh Cc: Rob Herring , Stephen Boyd , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/5] drm/msm/dp: Remove global g_dp_display variable Date: Sat, 24 Jul 2021 21:24:31 -0700 Message-Id: <20210725042436.3967173-2-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 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org As the Qualcomm DisplayPort driver only supports a single instance of the driver the commonly used struct dp_display is kept in a global variable. As we introduce additional instances this obviously doesn't work. Replace this with a combination of existing references to adjacent objects and drvdata. Signed-off-by: Bjorn Andersson --- drivers/gpu/drm/msm/dp/dp_display.c | 78 ++++++++++++++--------------- 1 file changed, 37 insertions(+), 41 deletions(-) -- 2.29.2 diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c index 70b319a8fe83..8696b36d30e4 100644 --- a/drivers/gpu/drm/msm/dp/dp_display.c +++ b/drivers/gpu/drm/msm/dp/dp_display.c @@ -27,7 +27,6 @@ #include "dp_audio.h" #include "dp_debug.h" -static struct msm_dp *g_dp_display; #define HPD_STRING_SIZE 30 enum { @@ -122,6 +121,13 @@ static const struct of_device_id dp_dt_match[] = { {} }; +static struct dp_display_private *dev_to_dp_display_private(struct device *dev) +{ + struct msm_dp *dp = dev_get_drvdata(dev); + + return container_of(dp, struct dp_display_private, dp_display); +} + static int dp_add_event(struct dp_display_private *dp_priv, u32 event, u32 data, u32 delay) { @@ -198,14 +204,16 @@ static int dp_display_bind(struct device *dev, struct device *master, void *data) { int rc = 0; - struct dp_display_private *dp; + struct dp_display_private *dp = dev_to_dp_display_private(dev); struct drm_device *drm; struct msm_drm_private *priv; drm = dev_get_drvdata(master); - dp = container_of(g_dp_display, - struct dp_display_private, dp_display); + if (!dp) { + DRM_ERROR("DP driver bind failed. Invalid driver data\n"); + return -EINVAL; + } dp->dp_display.drm_dev = drm; priv = drm->dev_private; @@ -240,12 +248,14 @@ static int dp_display_bind(struct device *dev, struct device *master, static void dp_display_unbind(struct device *dev, struct device *master, void *data) { - struct dp_display_private *dp; + struct dp_display_private *dp = dev_to_dp_display_private(dev); struct drm_device *drm = dev_get_drvdata(master); struct msm_drm_private *priv = drm->dev_private; - dp = container_of(g_dp_display, - struct dp_display_private, dp_display); + if (!dp) { + DRM_ERROR("Invalid DP driver data\n"); + return; + } dp_power_client_deinit(dp->power); dp_aux_unregister(dp->aux); @@ -376,17 +386,14 @@ static void dp_display_host_deinit(struct dp_display_private *dp) static int dp_display_usbpd_configure_cb(struct device *dev) { int rc = 0; - struct dp_display_private *dp; + struct dp_display_private *dp = dev_to_dp_display_private(dev); - if (!dev) { - DRM_ERROR("invalid dev\n"); - rc = -EINVAL; + if (!dp) { + DRM_ERROR("no driver data found\n"); + rc = -ENODEV; goto end; } - dp = container_of(g_dp_display, - struct dp_display_private, dp_display); - dp_display_host_init(dp, false); rc = dp_display_process_hpd_high(dp); @@ -397,17 +404,14 @@ static int dp_display_usbpd_configure_cb(struct device *dev) static int dp_display_usbpd_disconnect_cb(struct device *dev) { int rc = 0; - struct dp_display_private *dp; + struct dp_display_private *dp = dev_to_dp_display_private(dev); - if (!dev) { - DRM_ERROR("invalid dev\n"); - rc = -EINVAL; + if (!dp) { + DRM_ERROR("no driver data found\n"); + rc = -ENODEV; return rc; } - dp = container_of(g_dp_display, - struct dp_display_private, dp_display); - dp_add_event(dp, EV_USER_NOTIFICATION, false, 0); return rc; @@ -466,15 +470,15 @@ static int dp_display_usbpd_attention_cb(struct device *dev) { int rc = 0; u32 sink_request; - struct dp_display_private *dp; + struct dp_display_private *dp = dev_to_dp_display_private(dev); + struct dp_usbpd *hpd; - if (!dev) { - DRM_ERROR("invalid dev\n"); - return -EINVAL; + if (!dp) { + DRM_ERROR("no driver data found\n"); + return -ENODEV; } - dp = container_of(g_dp_display, - struct dp_display_private, dp_display); + hpd = dp->usbpd; /* check for any test request issued by sink */ rc = dp_link_process_request(dp->link); @@ -638,7 +642,7 @@ static int dp_hpd_unplug_handle(struct dp_display_private *dp, u32 data) dp_add_event(dp, EV_DISCONNECT_PENDING_TIMEOUT, 0, DP_TIMEOUT_5_SECOND); /* signal the disconnect event early to ensure proper teardown */ - dp_display_handle_plugged_change(g_dp_display, false); + dp_display_handle_plugged_change(&dp->dp_display, false); /* enable HDP plug interrupt to prepare for next plugin */ dp_catalog_hpd_config_intr(dp->catalog, DP_DP_HPD_PLUG_INT_MASK, true); @@ -832,9 +836,7 @@ static int dp_display_prepare(struct msm_dp *dp) static int dp_display_enable(struct dp_display_private *dp, u32 data) { int rc = 0; - struct msm_dp *dp_display; - - dp_display = g_dp_display; + struct msm_dp *dp_display = &dp->dp_display; if (dp_display->power_on) { DRM_DEBUG_DP("Link already setup, return\n"); @@ -869,9 +871,7 @@ static int dp_display_post_enable(struct msm_dp *dp_display) static int dp_display_disable(struct dp_display_private *dp, u32 data) { - struct msm_dp *dp_display; - - dp_display = g_dp_display; + struct msm_dp *dp_display = &dp->dp_display; if (!dp_display->power_on) return 0; @@ -1229,14 +1229,13 @@ static int dp_display_probe(struct platform_device *pdev) } mutex_init(&dp->event_mutex); - g_dp_display = &dp->dp_display; /* Store DP audio handle inside DP display */ - g_dp_display->dp_audio = dp->audio; + dp->dp_display.dp_audio = dp->audio; init_completion(&dp->audio_comp); - platform_set_drvdata(pdev, g_dp_display); + platform_set_drvdata(pdev, &dp->dp_display); rc = component_add(&pdev->dev, &dp_display_comp_ops); if (rc) { @@ -1249,10 +1248,7 @@ static int dp_display_probe(struct platform_device *pdev) static int dp_display_remove(struct platform_device *pdev) { - struct dp_display_private *dp; - - dp = container_of(g_dp_display, - struct dp_display_private, dp_display); + struct dp_display_private *dp = platform_get_drvdata(pdev); dp_display_deinit_sub_modules(dp); 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: 485677 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=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, 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 4AAF7C432BE for ; Sun, 25 Jul 2021 04:26:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2F79260E77 for ; Sun, 25 Jul 2021 04:26:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230405AbhGYDqJ (ORCPT ); Sat, 24 Jul 2021 23:46:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57180 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230325AbhGYDp4 (ORCPT ); Sat, 24 Jul 2021 23:45:56 -0400 Received: from mail-ot1-x329.google.com (mail-ot1-x329.google.com [IPv6:2607:f8b0:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4513FC06175F for ; Sat, 24 Jul 2021 21:26:26 -0700 (PDT) Received: by mail-ot1-x329.google.com with SMTP id 48-20020a9d0bb30000b02904cd671b911bso6498366oth.1 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=aBFCcX2+9lCQaEYQ6Mi687654b7ayF5dQ1mk5VT/7BC01+vLtwuyvcJfM/BFzr3l54 qw8cjDrXykKxfbjhet08T7O6tBKC4EHDh3oXoDhChJ91ZgOFJXgSmoEfzTIeq26MpvAQ KZn5bHZG3y9XxXKO+sbIVBmXaD3MImz5I7En69HIVDrg5JiqN2DetsX5Semy2FgpyEDl jQG26hQUKPto5qIixV0DKwPcZuE3gkn4kLdzPmcGaCkolekLgH2t73TkwKrkIVHFMhuv O4UCuJ2fMWEOktfx8xchYfcro2A/16Pa8a3+hM7R9q2H6A53Br7rCPplWDEYKPu1PFLB AUEg== X-Gm-Message-State: AOAM532vcnwznk7aux5SllZrT6+shyjywdP6J2zbvCyOPq/ssKeYeR38 uNbSIY+e3JjANS5XsCXxrJ2y1A== X-Google-Smtp-Source: ABdhPJyeN1G9YfFLpWScjFsEnbMYVbrcJYDddgLmpUj1BYLkBpR0btwUuyuvVdz0UhFCbA8QVx3HoA== 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 Cc: Rob Herring , Stephen Boyd , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org 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 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org 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 Reviewed-by: Stephen Boyd --- 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(-) 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: 485919 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=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, 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 A9843C4338F for ; Sun, 25 Jul 2021 04:26:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8ADF460F38 for ; Sun, 25 Jul 2021 04:26:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230210AbhGYDqJ (ORCPT ); Sat, 24 Jul 2021 23:46:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57184 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230328AbhGYDp4 (ORCPT ); Sat, 24 Jul 2021 23:45:56 -0400 Received: from mail-oi1-x233.google.com (mail-oi1-x233.google.com [IPv6:2607:f8b0:4864:20::233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 39ADCC061760 for ; Sat, 24 Jul 2021 21:26:27 -0700 (PDT) Received: by mail-oi1-x233.google.com with SMTP id t128so6934058oig.1 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=ewTQ/6dS+2Od2KgJIe1jmAlJRWi7KnZCKbKBjfYSW7AJoqstM8ix9AX/11UBtEhexC C5f5s1SQ/TbHaZgP52HebuAkOv+8aMVbHZazwmnHdG8yg3OLldZ5XTooxJ7oX4OSwGrw cwPq4mDT+dKL7+zj4z1LvPhEYbOojRdt7VQrDmPHZb4wuE0XUHnTRLZdn9h7OBMMmXYl P1ycHQ9/5SpQFvejd5WBBDZnN1xZN0Kchej5DqQ7/ISTjMOdSAa55u2noctIJdu6vMZL DP4e6HmQ3HGdZB8BVbApYIkhQTlXMsv92SMTq0fesntUx2nYq8YgsvzimnAmun9HUkhW 9Hnw== X-Gm-Message-State: AOAM532ci55f5RjrrQHPCEO/amCOeUKyLEesEFWLVpmkK/SjDD3l0YEK 3odLO3P8BXQ/7tW+R0hv5R9DLg== X-Google-Smtp-Source: ABdhPJwHP7CViU9ZbsfEzVt3ZOe/bA1EiXOM06Uh4N4ZwOYpM/QXB82FGl+mGaNYBP+efVkXdiPihw== 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 Cc: Rob Herring , Stephen Boyd , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org 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 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org 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(-) 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:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 485659 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp2705367jao; Sat, 24 Jul 2021 21:26:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzVjt9qb2Y7ejZHynUxjtQImEYjzfgyr0azAJ/t5pmE977KSlTp7MubeJ6PDWwKqUWcW9Jh X-Received: by 2002:a92:ac14:: with SMTP id r20mr9044341ilh.241.1627187206008; Sat, 24 Jul 2021 21:26:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627187206; cv=none; d=google.com; s=arc-20160816; b=QXJGX2MEcBLzqfmWJ93ZCJb2Om1tRhIDQw8P4qUQXmOtdPnxQHmaGtg2WngPrSKfZx +iT2VkY4KtDyKaDnvhbrJgzycb5T9ix0FRK/0vpz5bv5M3W+k9zwfCEc8eAbMxzsW/NN mZSTMKPxjqBd8uMXe5eGxTLYp6bjtq1X2ndXFrgjnY/5rISOU+asE/wXR8O6D/0K8QEV saNWUclUKPZwa76lGqWBCSL25Rg5xzODeAIJBdO9cnxR8HOmVGFhmiy0asOf7zYOsEnR d6dxe52iyKtYYlEUximHpdulMUpOb7/ecgjFe51/QLQWDxQEloRihNx66MtcuGLnJ0aJ qB2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=2lr0HLKbGMfhvgQzbBYGum6ThIOLWrTxgc/XRrqS7TI=; b=Mdgl0Xk8nfRWQl5s9uG0XhX3rB8JKqDxJlBKkb/SUuNe9215QJ9gIlO32qR6kd3BQn HJ/pUsJrG4MuAP25zYneubvN47YO9/iE3nz4BUjssIBeLlLsp8gOfaGrJV/gzmK3zLKr cM78ABts+DENmrlclC2kI86IZOkBViL4d3gUacEY8P16LlraRQE1PeKwyQ3yNE9coP4+ 1e59OCEmQkWp3owZ4iOqb4VIU8YszbKmL5KbIKQok/VK3EBqDw8DoAAqwcY3xMGVVXyC W+UxE4ANQDpXHXBIItuT4RNiKX0LQRH7my7xm12GtLz7RDj/wnlhH2ZYG+5wcoyZU0J0 alMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GP51RnXy; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i8si20141257ilr.7.2021.07.24.21.26.45; Sat, 24 Jul 2021 21:26:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-arm-msm-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=@linaro.org header.s=google header.b=GP51RnXy; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230327AbhGYDqK (ORCPT + 17 others); Sat, 24 Jul 2021 23:46:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230355AbhGYDp6 (ORCPT ); Sat, 24 Jul 2021 23:45:58 -0400 Received: from mail-oi1-x232.google.com (mail-oi1-x232.google.com [IPv6:2607:f8b0:4864:20::232]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58B3DC0613CF for ; Sat, 24 Jul 2021 21:26:28 -0700 (PDT) Received: by mail-oi1-x232.google.com with SMTP id l126so6920457oib.2 for ; Sat, 24 Jul 2021 21:26:28 -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=GP51RnXyV5DlsFpI2ZiBhXt9xZvi1sS6LzIRJewIMWMadsHwvMzlslCOM8ygyMv0EF Cv94UffGrQGwyIc3hwmqoGkM5X6BWL4qurb/sSc3cXSrWYKNX8Wb48HE8AJ2t7pT38O9 4LE9U4XGDNtz93pkHz36mMH3CAa1UV8GlJuk6Mt77LoGwfENEnxSVTOaKjwACI8lwfuw NzZc3YsXHJZ/ZlwyLas8qIFb/MVmd2yj98fonX8pnphzcrpUeQCvi0067+vSN+WPqVG3 zuerbA8JLUQXGBq7BOXd8gEtBk3gy0kNOw/evOJ3Sm9AjUFPWeaULHYo5gwfxKwMF8y3 B70A== 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=fgTNA9w9uOSGT7OWuZpGK05pc8GldnDmBwdSvVSOsfzMPJzIPoPpxzrPgKIUHTvCBE bBfYMysaP0RXFhTVMWKdwm4k0KhqzmOcc5La7zJl4JLnKyOFs14WCx5lbHR9jJTuMzTt eifbL53UsPl9aVQnkmptTWiL01BBLzmmBbfqiJUxNs/GIi583B/IMq8lGNH+szsMMSR4 r0VOQFxTy7tvlA3CN/da4Cq/NMHKU2xT7v4xgNWJzSl5ZLvn6+jLWtTDecP4KmJ+iHqx feFR8SrHUjQuZfh12R/1ztZ8344Ap2g+A68yBP3hHg4sqPtWd13DTwT3YvjU4EI1OTNs wfsw== X-Gm-Message-State: AOAM532yXYJtKbYbpY+LVpS+IC+pUnGCn7h9tooQ6KlnvAfncNAhDu8W ql7ohBOc3YTmviElWsHgkVq5vg== X-Received: by 2002:aca:d505:: with SMTP id m5mr11011056oig.5.1627187187735; Sat, 24 Jul 2021 21:26:27 -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.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Jul 2021 21:26:27 -0700 (PDT) From: Bjorn Andersson To: Rob Clark , Sean Paul , David Airlie , Daniel Vetter , Abhinav Kumar , Dmitry Baryshkov , Kalyan Thota , Kuogee Hsieh Cc: Rob Herring , Stephen Boyd , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/4] drm/msm/dp: Add sc8180x DP controllers Date: Sat, 24 Jul 2021 21:24:34 -0700 Message-Id: <20210725042436.3967173-5-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 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org 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 }, {} }; 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: 485675 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=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, 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 8F8E4C432BE for ; Sun, 25 Jul 2021 04:26:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6EB9560BD3 for ; Sun, 25 Jul 2021 04:26:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230393AbhGYDqM (ORCPT ); Sat, 24 Jul 2021 23:46:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57244 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230389AbhGYDqI (ORCPT ); Sat, 24 Jul 2021 23:46:08 -0400 Received: from mail-ot1-x334.google.com (mail-ot1-x334.google.com [IPv6:2607:f8b0:4864:20::334]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C371C061799 for ; Sat, 24 Jul 2021 21:26:30 -0700 (PDT) Received: by mail-ot1-x334.google.com with SMTP id h63-20020a9d14450000b02904ce97efee36so6435704oth.7 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=ikNnLaoR+DhDh/djkPb6MzEy8oGYndOChpc37WMxPafNDqG2EiSxc2tHaPB/4x9mDx COH0ysNUmCbFNpE1BOeG/vF2DyaajkKZy6Z9hlzXso9g+XiWCuV1LDV8uqtVXh+PFVRz /JGAjyLvxzj9jodBDILd6cjE6ntJRK2GITgQ+hW2WQCIxkBo2fr3L83utbXv98Pc3ia7 VKUNPNgiiKasxUzVtUGMaqAc+V0yq60X5TpRfoBc9ytO7Wy/MoKuM1b7lFuPHnaSZ45u qPQwoUwr4tctAFsXqRLjhX7K4ThgylDTcrpgtIr94cyj1tB+qmwpkwKd78TkAh11EX8L ZUUg== X-Gm-Message-State: AOAM533oY4UC3ktWTUJvx4IztdfD6Mqww8zTkA4n8ujn6vm+9saSKGOg 6CPiJWzgszvB5pBTNYyMOzN25A== X-Google-Smtp-Source: ABdhPJwzlSIVW2aW5cAHty03J7MuoqU0oXzGi7uz1brYzycm4HpPSCcTzEv7utPTS/ArSjZlgLegPw== 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 Cc: Rob Herring , Stephen Boyd , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org 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 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org 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(+) 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 }, {} };