From patchwork Fri Oct 1 18:00:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 515107 Delivered-To: patch@linaro.org Received: by 2002:a02:606e:0:0:0:0:0 with SMTP id d46csp1032608jaf; Fri, 1 Oct 2021 10:59:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxAgZvfKpDC6Lyg7VmjzRa/gtXDQwIOScl6Eza7kIUAkLHVzUgOoXTRqCVIC7y4o0CaEHZi X-Received: by 2002:a17:902:7d95:b0:13d:a304:1b55 with SMTP id a21-20020a1709027d9500b0013da3041b55mr10702353plm.51.1633111155986; Fri, 01 Oct 2021 10:59:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633111155; cv=none; d=google.com; s=arc-20160816; b=OGwdDAGia7SCMIRbRuH8FWF9mbh8kLPEaBa2PPunU2nseASUo9AGBdmqE/eAueFZrC 3SWXZ1fyDvMsgMwZ3SiC+YZd2jGRUYtAkJd2Vg15tAZg/aNkuIctbjNubkd2jdPWOd6Z FWoQCfVBJyS4vyiky0ZyH/y1i2PhPcFTD2OFAkLWK8gEOgTP7EvU/BtKS+v528Gvu64X YOGCJ/fE89H7hoEjW4kypLklhFNIDPwSIU1hAFiSeH0L2O7/KtLAVuk5DCaj7/I61iTl o3Z0B/a8RPyajsSBaTWRMELIQ9m+cy7cWf92wEYt/zsfbPQ59c6K7nC2WW5vCErP1x/M 5evw== 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=BbrY9L8oGXBnlpXMCaFxKXALnanmzcN5gb67Scae2JI=; b=tKIwA0XNavM64vWDOmztNKQ+wF4Ih38kxw71ZSz5mcj3fdKJ2Ea2Gdq1BVJ3kLVZmx XyFpOYVKCHSVMnCpEE73voxe463TkM1nC99+/31aGF/HVACbmcaTux8bMyXXxkK2kRPi Qn8B4jfjL4BU4p8qQZrLcyuGAqlpxT5vVxWOXm3Lxpj7d/kk4JAapP1UVyc3nI10xkQV bp0U+xj6b6UHoJRuZxP1yvVRRFXWdhQJ+2SpCB0h80doZqNe0IjMDF2wyXXlhuQOYeGa jguGiLZm/d/GlNoc3NSQojmf7xh+WYKTCI0sixSbdyA1St16MN+mOZkjlstSFpBWmECK z3cQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tG4AUnHh; 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 t4si9751881pgv.226.2021.10.01.10.59.15; Fri, 01 Oct 2021 10:59:15 -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=tG4AUnHh; 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 S1355624AbhJASA6 (ORCPT + 17 others); Fri, 1 Oct 2021 14:00:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47048 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355617AbhJASA5 (ORCPT ); Fri, 1 Oct 2021 14:00:57 -0400 Received: from mail-oi1-x22d.google.com (mail-oi1-x22d.google.com [IPv6:2607:f8b0:4864:20::22d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C3CDC06177D for ; Fri, 1 Oct 2021 10:59:13 -0700 (PDT) Received: by mail-oi1-x22d.google.com with SMTP id t189so12416184oie.7 for ; Fri, 01 Oct 2021 10:59:13 -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=BbrY9L8oGXBnlpXMCaFxKXALnanmzcN5gb67Scae2JI=; b=tG4AUnHhWbICDpcgAPy8kXFPyz3XtOwtAKO93KC4cz47LVczDoFExu8GRqd1uOiOfh vshJs5v8PZNWlzHzglV0ZvKO9wvgsOtcn7G4AtTzrYFqN+yoaRlAuwc383Q4+FAPDd20 rp2n0m3x29PYVV25cfHjKAAslz8ZNe84PhttDZFfsU8TN7NUjlqYBXCx2tafsbwOtLZa cqVHgYN+Ym4Vmk5Kyy3mnXsSnbO9X27axECY65kKb4NsYzEjdMXHROGl864m/Lj87uYp xGAhtiTgLLp+Vwee/Rzi3heWwCNS9uVwLlqsnuY9qmPxIAB9eYtXkN3IzZ3V3HmSqU8q Qw/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=BbrY9L8oGXBnlpXMCaFxKXALnanmzcN5gb67Scae2JI=; b=mHf8+aKLirawq6OWZipwAyCp16zF2iB8ZqmhnYambydOdxXER8QZWPcXm8dRhjtdMy Ont0eLJ9p36Nh8dspABVtIsh3iO4J4mkD6yrfF/Y5HNQpHnklQvBfRvgsHqH6cnni65j ROnunbPyGaBKqr7mAe9JSvxYgDdCG63ov8A2c4qib+sO1NstFOtO1XSNDmuhh8QHsbkY vQHcSOvzp24wAWmHnlQuSa48I6app5E4wP3swWtgjhq0YxlvNaYEyU2zRFet/p6GvS7C db//5LeduxOXuyfmDSwMpED1opzq1Hnya27QWrck2cPvRrBzn0ByHl1M+u9dzHa4G85e 5JYQ== X-Gm-Message-State: AOAM533rYRRNmAPEvg3yVbwInyh8+Dm0BLIPT3SakYnuAFndKPZv6fWn +AXbw9b2d2jigqfqS1qMDMxO4Q== X-Received: by 2002:a54:408f:: with SMTP id i15mr4781658oii.17.1633111152717; Fri, 01 Oct 2021 10:59:12 -0700 (PDT) Received: from localhost.localdomain ([2600:1700:a0:3dc8:205:1bff:fec0:b9b3]) by smtp.gmail.com with ESMTPSA id w2sm1284798oof.23.2021.10.01.10.59.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Oct 2021 10:59:12 -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 v3 1/5] drm/msm/dp: Remove global g_dp_display variable Date: Fri, 1 Oct 2021 11:00:54 -0700 Message-Id: <20211001180058.1021913-2-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20211001180058.1021913-1-bjorn.andersson@linaro.org> References: <20211001180058.1021913-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. Reviewed-by: Stephen Boyd Signed-off-by: Bjorn Andersson --- Changes since v2: - None drivers/gpu/drm/msm/dp/dp_display.c | 80 ++++++++--------------------- 1 file changed, 21 insertions(+), 59 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 fbe4c2cd52a3..5d3ee5ef07c2 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 { @@ -121,6 +120,13 @@ static const struct of_device_id dp_dt_match[] = { {} }; +static struct dp_display_private *dev_get_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) { @@ -197,15 +203,12 @@ static int dp_display_bind(struct device *dev, struct device *master, void *data) { int rc = 0; - struct dp_display_private *dp; - struct drm_device *drm; + struct dp_display_private *dp = dev_get_dp_display_private(dev); struct msm_drm_private *priv; + struct drm_device *drm; drm = dev_get_drvdata(master); - dp = container_of(g_dp_display, - struct dp_display_private, dp_display); - dp->dp_display.drm_dev = drm; priv = drm->dev_private; priv->dp = &(dp->dp_display); @@ -240,13 +243,10 @@ 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_get_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); - dp_power_client_deinit(dp->power); dp_aux_unregister(dp->aux); priv->dp = NULL; @@ -379,38 +379,17 @@ 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; - - if (!dev) { - DRM_ERROR("invalid dev\n"); - rc = -EINVAL; - goto end; - } - - dp = container_of(g_dp_display, - struct dp_display_private, dp_display); + struct dp_display_private *dp = dev_get_dp_display_private(dev); dp_display_host_init(dp, false); - rc = dp_display_process_hpd_high(dp); -end: - return rc; + return dp_display_process_hpd_high(dp); } static int dp_display_usbpd_disconnect_cb(struct device *dev) { int rc = 0; - struct dp_display_private *dp; - - if (!dev) { - DRM_ERROR("invalid dev\n"); - rc = -EINVAL; - return rc; - } - - dp = container_of(g_dp_display, - struct dp_display_private, dp_display); + struct dp_display_private *dp = dev_get_dp_display_private(dev); dp_add_event(dp, EV_USER_NOTIFICATION, false, 0); @@ -472,15 +451,7 @@ static int dp_display_usbpd_attention_cb(struct device *dev) { int rc = 0; u32 sink_request; - struct dp_display_private *dp; - - if (!dev) { - DRM_ERROR("invalid dev\n"); - return -EINVAL; - } - - dp = container_of(g_dp_display, - struct dp_display_private, dp_display); + struct dp_display_private *dp = dev_get_dp_display_private(dev); /* check for any test request issued by sink */ rc = dp_link_process_request(dp->link); @@ -647,7 +618,7 @@ static int dp_hpd_unplug_handle(struct dp_display_private *dp, u32 data) DRM_DEBUG_DP("hpd_state=%d\n", state); /* 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); @@ -842,9 +813,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; DRM_DEBUG_DP("sink_count=%d\n", dp->link->sink_count); if (dp_display->power_on) { @@ -880,9 +849,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; @@ -1237,14 +1204,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) { @@ -1257,10 +1223,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 = dev_get_dp_display_private(&pdev->dev); dp_display_deinit_sub_modules(dp); @@ -1315,8 +1278,7 @@ static int dp_pm_resume(struct device *dev) else dp->dp_display.is_connected = false; - dp_display_handle_plugged_change(g_dp_display, - dp->dp_display.is_connected); + dp_display_handle_plugged_change(dp_display, dp->dp_display.is_connected); DRM_DEBUG_DP("After, sink_count=%d is_connected=%d core_inited=%d power_on=%d\n", dp->link->sink_count, dp->dp_display.is_connected, From patchwork Fri Oct 1 18:00:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 515108 Delivered-To: patch@linaro.org Received: by 2002:a02:606e:0:0:0:0:0 with SMTP id d46csp1032622jaf; Fri, 1 Oct 2021 10:59:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzFAGwksQnf2zLXzTDzGR5ZzlKRFzn4/6cx+Ww05PViTlhvcJtfnXlbN2pYJjVt4Bd9dXf6 X-Received: by 2002:a62:1ac3:0:b0:44b:b424:b49c with SMTP id a186-20020a621ac3000000b0044bb424b49cmr11428787pfa.86.1633111156924; Fri, 01 Oct 2021 10:59:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633111156; cv=none; d=google.com; s=arc-20160816; b=YN9mFg3otbjpCoVCeEUuTgYMnk5xIjQgKjAoH58RS9oIrPcbBOYZpa6MEqpUmuIDrL wuelvvcSqJVRm8RiL63XEzzswn8C6dzMlSLIEUimcwNyxqEmhsGV981jpf7BJY6YTBa5 14zrjbIyk/obJ1uevDJcOz3m34dR+giEDbTbim4om9CvzpqkCol6LDIZaWv9iATLmBE7 Gdeyom/IyMZiLpsRnRUSNtaJxrPxQkjE3INhG0Tp2v201Ca8NfzCUiVmuhB8AwECz2TW ivejrLi+3aXvFw//ei5P4ICEKs8gcMg3tuEX+GqvjEG8862RMH7ntQCFuuZj9OwICk03 vCfA== 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=8jGVwsV27e5G+2lgCCsaslyi5w/V/6kg5N6xFIrsoZg=; b=hk4uKqopHCdSjhvk9whZbZpt7h6NIMqgvMpYABvK+m2E3CiKrptLJ6nvsOn6skxkSi i954Gd03KdnQmA1QdPeai114zfTe7oa9kVpdsg+0ov553WawrsDaykngP5+v/gPvkDK0 hA+61V7Pw88WA/SLyPn9v54+GwT+BTWuAHQSTK1qcZTYHb34I1tIOwVeIfjSiD9hXRFH SOOFRGPSr2RLatJMXi/AaxEaf/WYV/47szeUliFGPY6KNTluitpfZSd+4Yx74+CyiYL9 5sFjGs4KoYsLkMUoh9a5EoJxSGOYzi5IYPiAwuntRX204qEBcYew30yBrbD35XYCnzbA d5SA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EGIbdefG; 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 t4si9751881pgv.226.2021.10.01.10.59.16; Fri, 01 Oct 2021 10:59:16 -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=EGIbdefG; 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 S1355628AbhJASA7 (ORCPT + 17 others); Fri, 1 Oct 2021 14:00:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47050 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355623AbhJASA6 (ORCPT ); Fri, 1 Oct 2021 14:00:58 -0400 Received: from mail-ot1-x32f.google.com (mail-ot1-x32f.google.com [IPv6:2607:f8b0:4864:20::32f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3DA02C061775 for ; Fri, 1 Oct 2021 10:59:14 -0700 (PDT) Received: by mail-ot1-x32f.google.com with SMTP id c6-20020a9d2786000000b005471981d559so12496603otb.5 for ; Fri, 01 Oct 2021 10:59:14 -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=8jGVwsV27e5G+2lgCCsaslyi5w/V/6kg5N6xFIrsoZg=; b=EGIbdefGp4R9Z0HnjM6MGC0UpiG4tF1EKpC4OqzbWkcivAcehDVDzyiD6CwF8R7ILO wM6zuTB2newHK89Yjbyc6yfOAjvNPNFU1YXv+kg0ypGs7lP2MTac381HDm+Ik+DIwbus /IOdqC98zTAnHuvysnLXfmSSoTdoZ9/WnwmFgAQacECw+CSokldVnQPcP+uYDdzET+Wp 2pBZLrfBZoiIghbt7m+gvS4oDmyseoProA4ZDqAl24xAh54Wdcvc5oorlFrGC0oOXs5s 3Ff7xmOfbuU4fIStkRZctlnT6+CRpm1jlw+OcuZ1p1A4qIz/5izfb/OOMq2JQhigIZZX YG8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=8jGVwsV27e5G+2lgCCsaslyi5w/V/6kg5N6xFIrsoZg=; b=2RQPcmaODMz1b3Jct7hfnIdHOB1XeRmZqe6Bo5QlF7pm9roYX3+9CMgbQMjqRmVJqK 8M9vyj7PWOAm6pwU8PddIbFQ87G/R6FJxFTi34zhZ+MTj+1rIDQEaItbjwyIu0TCc6qb kRB30Bj1QqHaetpcKuCrtMM6rlerWC2uzsV2ALOWsVYFEJuuW6vdj/7J0qYGmRwr+fzW /r4gvC1r3kQv9dkG4+nDAG6N8GM8O6EjjGEZY4maPJjfAtXlDrrjv8o7iAyGqqd3ca6t fc7p+YHlEtaAF+3c7kjimXOBwYy/C2X73HxQcOARUlolBmLzIunvsNQWMKdPuhWd6eZu 5Ftw== X-Gm-Message-State: AOAM532DwHkLUxslA4K1XunPS59TUbhmmsWT8IKWZB1HS7KnJqyXmb7R BaamuSNmu0S4VcXtdhac/+zkSA== X-Received: by 2002:a9d:7f89:: with SMTP id t9mr11495008otp.143.1633111153600; Fri, 01 Oct 2021 10:59:13 -0700 (PDT) Received: from localhost.localdomain ([2600:1700:a0:3dc8:205:1bff:fec0:b9b3]) by smtp.gmail.com with ESMTPSA id w2sm1284798oof.23.2021.10.01.10.59.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Oct 2021 10:59:13 -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 v3 2/5] drm/msm/dp: Modify prototype of encoder based API Date: Fri, 1 Oct 2021 11:00:55 -0700 Message-Id: <20211001180058.1021913-3-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20211001180058.1021913-1-bjorn.andersson@linaro.org> References: <20211001180058.1021913-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. Store a reference to the struct msm_dp associated with each dpu_encoder_virt to allow the particular instance to be associate with the encoder in the following patch. Reviewed-by: Stephen Boyd Signed-off-by: Bjorn Andersson --- Changes since v2: - None drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 23 ++++++++++++--------- 1 file changed, 13 insertions(+), 10 deletions(-) -- 2.29.2 Reviewed-by: Abhinav Kumar diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c index 0e9d3fa1544b..b7f33da2799c 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c @@ -168,6 +168,7 @@ enum dpu_enc_rc_states { * @vsync_event_work: worker to handle vsync event for autorefresh * @topology: topology of the display * @idle_timeout: idle timeout duration in milliseconds + * @dp: msm_dp pointer, for DP encoders */ struct dpu_encoder_virt { struct drm_encoder base; @@ -206,6 +207,8 @@ struct dpu_encoder_virt { struct msm_display_topology topology; u32 idle_timeout; + + struct msm_dp *dp; }; #define to_dpu_encoder_virt(x) container_of(x, struct dpu_encoder_virt, base) @@ -1000,8 +1003,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(dpu_enc->dp, drm_enc, mode, adj_mode); list_for_each_entry(conn_iter, connector_list, head) if (conn_iter->encoder == drm_enc) @@ -1182,9 +1185,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(dpu_enc->dp, drm_enc); if (ret) { DPU_ERROR_ENC(dpu_enc, "dp display enable failed: %d\n", ret); @@ -1224,8 +1226,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(dpu_enc->dp, drm_enc)) DPU_ERROR_ENC(dpu_enc, "dp display push idle failed\n"); } @@ -1253,8 +1255,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(dpu_enc->dp, drm_enc)) DPU_ERROR_ENC(dpu_enc, "dp display disable failed\n"); } @@ -2170,7 +2172,8 @@ int dpu_encoder_setup(struct drm_device *dev, struct drm_encoder *enc, timer_setup(&dpu_enc->vsync_event_timer, dpu_encoder_vsync_event_handler, 0); - + else if (disp_info->intf_type == DRM_MODE_ENCODER_TMDS) + dpu_enc->dp = priv->dp; INIT_DELAYED_WORK(&dpu_enc->delayed_off_work, dpu_encoder_off_work); From patchwork Fri Oct 1 18:00:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 515109 Delivered-To: patch@linaro.org Received: by 2002:a02:606e:0:0:0:0:0 with SMTP id d46csp1032646jaf; Fri, 1 Oct 2021 10:59:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzYA+nc1bhuUMWm4hzzh+ZDrFULL9NnkBFT2vZrwM4nBpT7EnrcDLt8YQGbCgjPj5XYLkA1 X-Received: by 2002:a17:90a:3d49:: with SMTP id o9mr4803356pjf.187.1633111158456; Fri, 01 Oct 2021 10:59:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633111158; cv=none; d=google.com; s=arc-20160816; b=mmhiPUyNVxLdFxxWAyumZwDYFilPEWnMDKuIYsDKZ6q1E7WB6meuR3c9KbXAaa6Tjz 7KJcHDIZLreadxkUiz+U9I1nTe8s0vp+ekaZaPyjdLQEWye4yrmWTcBsWv6fU4doKpKs Qt/iVp1YxhbSIr9WfIXzOwPY+0jktjRwZiOzVMqk66arAbO7LAB4IIDzBhMT43Zthm3k pKwN4Fr9yRvq0OguhTKq3+DZX1Lsb7O0RRl48cUQVG62DWZoEtKtlcZb69ukff5f/yXC PMuuuWeqVdFpsQJEbhgZrH5Ij+ZpHqC4Gee9ajTnPy0uFspsMW7z0APcyXP3Z3hVrOyb SX4g== 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=3QrQtMQo75wB67lbK50DoBtO/nNO7fO+JFiUoQTDZoI=; b=0U6t2rHOKzeGYD6zpT84DGyzPHWWPXxE+nr2yEYGm8gWTRckLmbhF+5h3aFxJSMUrV sIO5cZCroYD/KSP+qHtPF1EfQsY4QspWNnSXZ643VzLUTlItFUrQElz/uBCKw0KVU13o h6pyB1zdiqywpYTJKfPwmC5lVFo/igytu8tfj9UXQorjeE6WikV0AD/z//grq0KZUERF 0Tjft982Luc18TYsMiQ0UM+UwOQM+r4TZPNMFyf1JJ+QZt2ce4cdESYkxjwMnq5xxQXl TEAbEgFT+rNPN2T2wJXP0FJ3MsRbntgBJRwVze2eufNB/wL2KcOeLXj0tXid1DFaREq6 2BwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FlDcjY1u; 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 x191si6008352pgd.605.2021.10.01.10.59.18; Fri, 01 Oct 2021 10:59:18 -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=FlDcjY1u; 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 S1355634AbhJASBB (ORCPT + 17 others); Fri, 1 Oct 2021 14:01:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47064 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355632AbhJASA7 (ORCPT ); Fri, 1 Oct 2021 14:00:59 -0400 Received: from mail-oi1-x230.google.com (mail-oi1-x230.google.com [IPv6:2607:f8b0:4864:20::230]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 55B21C06177D for ; Fri, 1 Oct 2021 10:59:15 -0700 (PDT) Received: by mail-oi1-x230.google.com with SMTP id y201so12421510oie.3 for ; Fri, 01 Oct 2021 10:59:15 -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=3QrQtMQo75wB67lbK50DoBtO/nNO7fO+JFiUoQTDZoI=; b=FlDcjY1usTvRYbavhtkjkcDtmRQzJbhqffgSi7z+8wu0x/bbN4NTfwoNiz/97YkawL a3UzO9qC7tPESUPybviFuq/lIGbksw4kJiE4tJtFVGwbMhufukuw19QBneloJr/ZIgCq X9U3x+0j28n86wpRr5NQJ1DUQz4zUomAZvgTnEVC7Yu/kZpKj1WcIdNa9ljr8WKn4N6u jj8VEn0aPD40qPMjqXJTlaRg93aBZ+WlRM5bfss4AGXczyWVXHN0rLS+0DgLsIl04uNl VcqibrDitnmNEw6Xr4BwQsKI9MHNIsjlteIUgqYwQPfQW+UQuz/G+OzdOUsCXmXJDNMH PJNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3QrQtMQo75wB67lbK50DoBtO/nNO7fO+JFiUoQTDZoI=; b=CUzwo42serAZGzNQJJXJpB4SeUaDYJOXDZL50g1S9r8uQFDzI3DTYvcqP5DSWcsdBO cTmNLVs7wCXP6JJreFbcm7B5ekuzdJlltHSRJAoN73KKHEQTKEpTg36VTnDew3qB2ZyS 2/dR3LiwZBYlacKmlRdoqQWo0ed9BbtL4ueIv2RqBK1hHwkUctPOZrO5hE8k5Z+Xg2jC wKO5iS90ou3wFVMpvjaPKVVp6T7d1bvJG2jEBNgux1scbgIhcPwuFPancEmyONUyNTkh IaPk40RYVdAGu1xU8WGAPgsvGGiiZB6jVDv8VdM8wK2V/gS/YX1JL24ULHe1bLU4xMQ6 otbw== X-Gm-Message-State: AOAM531Jpem8gUZ30E5ek5kBf3oExpmZxd3/ZPdQ/9rbUtw2HoA0KuP3 vrJ9PyfkB2wRHun/MU/X/T8kxA== X-Received: by 2002:aca:c641:: with SMTP id w62mr4676227oif.102.1633111154633; Fri, 01 Oct 2021 10:59:14 -0700 (PDT) Received: from localhost.localdomain ([2600:1700:a0:3dc8:205:1bff:fec0:b9b3]) by smtp.gmail.com with ESMTPSA id w2sm1284798oof.23.2021.10.01.10.59.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Oct 2021 10:59:14 -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 v3 3/5] drm/msm/dp: Support up to 3 DP controllers Date: Fri, 1 Oct 2021 11:00:56 -0700 Message-Id: <20211001180058.1021913-4-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20211001180058.1021913-1-bjorn.andersson@linaro.org> References: <20211001180058.1021913-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 associating each struct msm_dp with the struct dpu_encoder_virt. 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 --- Changes since v2: - Added MSM_DRM_DP_COUNT to link the two 3s - Moved NULL check for msm_dp_debugfs_init() to the call site - Made struct dp_display_private->id unsigned I also implemented added connector_type to each of the DP instances and propagated this to dp_drm_connector_init() but later dropped this again per Doug's suggestion that we'll base this on the presence/absence of a associated drm bridge or panel. drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 2 +- drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 66 +++++++++++-------- .../gpu/drm/msm/disp/msm_disp_snapshot_util.c | 8 ++- drivers/gpu/drm/msm/dp/dp_display.c | 44 ++++++++++++- drivers/gpu/drm/msm/msm_drv.h | 4 +- 5 files changed, 90 insertions(+), 34 deletions(-) -- 2.29.2 Reviewed-by: Stephen Boyd diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c index b7f33da2799c..9cd9539a1504 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c @@ -2173,7 +2173,7 @@ int dpu_encoder_setup(struct drm_device *dev, struct drm_encoder *enc, dpu_encoder_vsync_event_handler, 0); else if (disp_info->intf_type == DRM_MODE_ENCODER_TMDS) - dpu_enc->dp = priv->dp; + dpu_enc->dp = priv->dp[disp_info->h_tile_instance[0]]; INIT_DELAYED_WORK(&dpu_enc->delayed_off_work, dpu_encoder_off_work); diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c index f655adbc2421..875b07e7183d 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,10 @@ 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++) { + if (priv->dp[i]) + msm_dp_debugfs_init(priv->dp[i], minor); + } return dpu_core_perf_debugfs_init(dpu_kms, entry); } @@ -544,35 +547,42 @@ static int _dpu_kms_initialize_displayport(struct drm_device *dev, { struct drm_encoder *encoder = NULL; struct msm_display_info info; - int rc = 0; + int rc; + 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.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.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; + } + } + + return 0; } /** @@ -792,6 +802,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 +811,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 5d3ee5ef07c2..ff3477474c5d 100644 --- a/drivers/gpu/drm/msm/dp/dp_display.c +++ b/drivers/gpu/drm/msm/dp/dp_display.c @@ -78,6 +78,8 @@ struct dp_display_private { char *name; int irq; + unsigned int id; + /* state variables */ bool core_initialized; bool hpd_irq_on; @@ -115,8 +117,18 @@ struct dp_display_private { struct dp_audio *audio; }; +struct msm_dp_config { + phys_addr_t io_start[MSM_DRM_DP_COUNT]; + size_t num_descs; +}; + +static const struct msm_dp_config sc7180_dp_cfg = { + .io_start = { 0x0ae90000 }, + .num_descs = 1, +}; + static const struct of_device_id dp_dt_match[] = { - {.compatible = "qcom,sc7180-dp"}, + { .compatible = "qcom,sc7180-dp", .data = &sc7180_dp_cfg }, {} }; @@ -211,7 +223,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) { @@ -249,7 +261,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 = { @@ -1180,10 +1192,31 @@ int dp_display_request_irq(struct msm_dp *dp_display) return 0; } +static int dp_display_find_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_descs; 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; struct dp_display_private *dp; + int id; if (!pdev || !pdev->dev.of_node) { DRM_ERROR("pdev not found\n"); @@ -1194,8 +1227,13 @@ static int dp_display_probe(struct platform_device *pdev) if (!dp) return -ENOMEM; + id = dp_display_find_id(pdev); + if (id < 0) + return id; + dp->pdev = pdev; dp->name = "drm_dp"; + dp->id = id; rc = dp_init_sub_modules(dp); if (rc) { diff --git a/drivers/gpu/drm/msm/msm_drv.h b/drivers/gpu/drm/msm/msm_drv.h index 8b005d1ac899..b20a6dd221f7 100644 --- a/drivers/gpu/drm/msm/msm_drv.h +++ b/drivers/gpu/drm/msm/msm_drv.h @@ -135,6 +135,8 @@ struct msm_drm_thread { struct kthread_worker *worker; }; +#define MSM_DRM_DP_COUNT 3 + struct msm_drm_private { struct drm_device *dev; @@ -161,7 +163,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[MSM_DRM_DP_COUNT]; /* when we have more than one 'msm_gpu' these need to be an array: */ struct msm_gpu *gpu; From patchwork Fri Oct 1 18:00:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 515110 Delivered-To: patch@linaro.org Received: by 2002:a02:606e:0:0:0:0:0 with SMTP id d46csp1032659jaf; Fri, 1 Oct 2021 10:59:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxuRrJfx7jKMYrEtLTk5yBsK2fxCeMu27ZOObebKAFvLsZXas6v8Mr4hjM2gtv9x/er0M59 X-Received: by 2002:a17:90a:b105:: with SMTP id z5mr20764914pjq.64.1633111159513; Fri, 01 Oct 2021 10:59:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633111159; cv=none; d=google.com; s=arc-20160816; b=VEh/JFaqR5fXFwXwEjcUgLSP9MEZ/XgdloaH2DOAXzg20wjknw8nE2j7XAzo9VoyoX iVmtF/8yayzAQHg/2YZQwLldiAxqxhnM2Sw4XrHx8oJFaHEmsqMy+GykP2fvXXnw0+Tk QYDaCsvyHMEa3bcPnvovzndNns3859enJAAbbJwp2UNRb/yJpxCZ6YUD+cAge+vKpseG MXYNnVuwgDkcARt0gPwVVZ9DeRWQyFN5Rd2Z0goU+R5+GdLRSOf6muK66pe0O6znenGs WdDgMJZHwKa+PC2EkcX+V8pV47GlOHYeVMCpOsgf0M3vnb2MeRTLhZbA6hITdw3YFVxo 0NXQ== 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=nF6LW47fQKO3rk11qFL799VxY9yECSKjA1fHehWHHiY=; b=oe7B4WUFJBGEyKXHCWAbRFZMOErGnj8zEa23hyU23uQ/iOhwWWqlvnHFwSr2DJczvW pfEcqVbL3GGdy6KzPdwEFipcLSuebGrWQPipA8DYedQXiejRNULp45bxzH0W/aK3fK8k JApsutN+Ez3x5GGlg1VIEukqTnNZI/B8o1JP4Q6XOnND5FxdebJjwXnp6VPcPf2R05hU RB7qMyZQP1I0UAN3+AWGo1VHKosyJHqH7RlaFILYRe6xJ41cuQCWE3yUGIFp908J7xrx 2YU0uUQ50LgX1IIY5JqPFkqEbWn4E9w7JXKoIr6TNryzFOQY4MuMxPTe0hiGyLXakz3P rtnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LfElaVRa; 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 x191si6008352pgd.605.2021.10.01.10.59.19; Fri, 01 Oct 2021 10:59:19 -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=LfElaVRa; 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 S1355651AbhJASBC (ORCPT + 17 others); Fri, 1 Oct 2021 14:01:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47070 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355638AbhJASBA (ORCPT ); Fri, 1 Oct 2021 14:01:00 -0400 Received: from mail-oi1-x22d.google.com (mail-oi1-x22d.google.com [IPv6:2607:f8b0:4864:20::22d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 28A17C061775 for ; Fri, 1 Oct 2021 10:59:16 -0700 (PDT) Received: by mail-oi1-x22d.google.com with SMTP id s24so12398031oij.8 for ; Fri, 01 Oct 2021 10:59:16 -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=nF6LW47fQKO3rk11qFL799VxY9yECSKjA1fHehWHHiY=; b=LfElaVRac/rd1pa8a5fX1rNze9VGWsDJnTwe0/38y7mY4Ift6Rv2p0/0MJRGrWKadO RI16GHNleNanYFQYIHBEVPz73wL0xknC6WgdjoR4Pmg8/yz9k5qNLI29iRn1mYCLqizx zmMzb4CpQ4D2Wcw4Yiraci0rPMYVNKkHVvF3RjUBElh9eCZcYZWa7uP9v31fcHe/6OwN 0jeNLY4UahYzbGIeIJG22QvYF53997PNq8/+Ci/autUvIIHlJvDcnMy2Dz1yf1t/0Y4V 9hrvQgfBCYp8j8YqkD5lUOS88Me/dIra4WhaQN0cIpGtpyTBCNnh6L5JGZRNRYahdRgF zMQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=nF6LW47fQKO3rk11qFL799VxY9yECSKjA1fHehWHHiY=; b=qQ0hZvlgjjpuxjyTiv5Gph+2xNffoFQ0M1lkgSg4afuJQvYvC+B2BOoG/vGcdSRsZG Zmb25s5U2MEvjAj4Eli2AfGk5XcwDh9FLZvyXbnNu5XpqxKuxDkNR7Jf+azI1tGcoYnH XYOaUrBPvWvHRdzrf2fR5rXWYRhL/YXejIBbUzbYJjjlHnqNVOhIjIWvotXDsYa1XPYG sUUCpUDK26XrCCNsJYZlPE5jA5pgGc+QNTRUo63FT//mTgFZ9fy8scZyYN5kv+kL6BP2 5JX4w/H5x/IULvj82tTNBfWaPURr1HV72UIj+W4uC/e4x0B4MALGLomJmG3qDs/o5Bmp Yjxw== X-Gm-Message-State: AOAM533pbAHKXPKj+Gg/Wwy/qTSlqTxqcTdWw2aG0V1HxurPIgdGD885 v5kUD9p0tpM93BlgfCCiA8zs+/VogZrFmw== X-Received: by 2002:a05:6808:b25:: with SMTP id t5mr4965587oij.58.1633111155560; Fri, 01 Oct 2021 10:59:15 -0700 (PDT) Received: from localhost.localdomain ([2600:1700:a0:3dc8:205:1bff:fec0:b9b3]) by smtp.gmail.com with ESMTPSA id w2sm1284798oof.23.2021.10.01.10.59.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Oct 2021 10:59:15 -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 v3 4/5] dt-bindings: msm/dp: Add SC8180x compatibles Date: Fri, 1 Oct 2021 11:00:57 -0700 Message-Id: <20211001180058.1021913-5-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20211001180058.1021913-1-bjorn.andersson@linaro.org> References: <20211001180058.1021913-1-bjorn.andersson@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org The Qualcomm SC8180x has 2 DP controllers and 1 eDP controller, add compatibles for these to the msm/dp binding. Reviewed-by: Stephen Boyd Signed-off-by: Bjorn Andersson --- Changes since v2: - None .../devicetree/bindings/display/msm/dp-controller.yaml | 2 ++ 1 file changed, 2 insertions(+) -- 2.29.2 Reviewed-by: Abhinav Kumar diff --git a/Documentation/devicetree/bindings/display/msm/dp-controller.yaml b/Documentation/devicetree/bindings/display/msm/dp-controller.yaml index 6bb424c21340..63e585f48789 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 Fri Oct 1 18:00:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 515111 Delivered-To: patch@linaro.org Received: by 2002:a02:606e:0:0:0:0:0 with SMTP id d46csp1032750jaf; Fri, 1 Oct 2021 10:59:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxtGE43j4NT+BnPuf1DyFZ4qfRmQuzwif3XHHx6oRYvFEf+rCoIg4i2io0GywoQP4z8GBD/ X-Received: by 2002:a17:90a:b105:: with SMTP id z5mr20765415pjq.64.1633111165707; Fri, 01 Oct 2021 10:59:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633111165; cv=none; d=google.com; s=arc-20160816; b=Xfx6DjscmlKJapC03/e83V0WemK8w2P3Mbhm12v4/AMWElJY/zJrabGI05wDK1MKtn VjQCQrbWzaa78VH9+3nPggMcdummoR3CXMeVF/+ow7LyiwEwyz+F5mMEviG192xquuKS 2R0CYGwiamI8um4/U29UAsgTWIsOv7w8efI5RHEPasyHtvOOS3EsLgE+jRtmpSGBuKXx 0hyxSke0QYfUtUx70jxj+h5irHb/xXyoMYrpEZZMZ3+SkTSDIZKlul5iEqGHsaQpYQi6 2mO+wgaIgyfE3XM2IE3QetskN10+TQP/cR32rQw1sPllxoapyDjFqKauLu6dk8s7QDUm bbcg== 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=JI+sywciYnZbmZEgEJHRDL/J7+jew9UCDT1hip8NvrU=; b=Ag6omhOd09l9eNFtN3Bk9vIvPrv6Jbnr7P8zN93kvifXoepDkqhOnVQ6AhrxiX65BG FYS4W9shv+8K7tV14RXc50TrB9zHYPzBBH/ohI/AFoia6T7Bd8thRSJK4U0GgJnKSyUp 5cQy5M9uqcf8HgbJhAQzeAeneOy7Ewb9tis8+dmCnGc8Rw0T3yeLyg6rrZUgZBG7S4La FFxOFYA//8/wTNt72AHMKex9CQy8NBzyG66xQHJkJ/ZrpIfgvHP5x6LtYTG3rRJ3B+Mb P+QhG8aLhW1ioSyvGpUpcXHGvFu40ckKt1atOsrIw+R7LCYyXytOOiUaCDPQX5actTmK 4GOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FyoEbdW2; 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 x191si6008352pgd.605.2021.10.01.10.59.25; Fri, 01 Oct 2021 10:59:25 -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=FyoEbdW2; 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 S1355695AbhJASBI (ORCPT + 17 others); Fri, 1 Oct 2021 14:01:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47076 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355640AbhJASBB (ORCPT ); Fri, 1 Oct 2021 14:01:01 -0400 Received: from mail-oi1-x229.google.com (mail-oi1-x229.google.com [IPv6:2607:f8b0:4864:20::229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E49FC061775 for ; Fri, 1 Oct 2021 10:59:17 -0700 (PDT) Received: by mail-oi1-x229.google.com with SMTP id v10so12370887oic.12 for ; Fri, 01 Oct 2021 10:59:17 -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=JI+sywciYnZbmZEgEJHRDL/J7+jew9UCDT1hip8NvrU=; b=FyoEbdW2FqsPcEhkuzRiqeAZHw3KxbHbOcE66Ei50UA+S5jXlr/d7sRdoPXj0zrPM/ 76r6rt7i+ccdj+mTerjrunN45spBenJDBib2hBvA6rhfnWpjHqmkNK5z5wJgO+jXn4p0 h8raVVABtgEso+pTjYoll7GzjNoJgFGPIE/Q/rcwKVRadh1jHI48y9214q0FbwcNp5WJ M0pg+/b8khuqIFspFtwtwhAfa+JcRwQ+TBmb6BrtuIUOUSEYZ1bb5ZiQFC4p5TnMblcg zSxLtACQTor8eVznN8PPWSFJWfAADp52R487S2riQYeeqU7BpyvBkm9YvYD7Txy3HbMS Q8+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=JI+sywciYnZbmZEgEJHRDL/J7+jew9UCDT1hip8NvrU=; b=aAgon0vLJlCCLCqlzeQQPbkcv2GZHUTOBkJwRQSmxE8KTh4h5w9pMe7tOl91LWqXr9 EqPjDne0GRv3zwA8ye1XGkRqGqBOP0r4qcB1Rk43Mg1iaplzjhPcTu6yfKjsjqRKQDOu jprPzqTgtsnwaQS71S8WZq0oUJMIIaLViSLWgMSWDPQ0jadoRGg8OHO3a6gEHj++lW4u KxEwGORz5aqFlTt5nz1NLd4Eg21DIYauHDAIGhuLV9lWOZ8GLdspollc+EYFtL4Qkt4H ZKhSrZqKsL4t5ZPo7/xfwWW7saVyyGq3x9zNtUN6YAAeb3rX4SDBqS8YGhReUTNHx+hY ET+Q== X-Gm-Message-State: AOAM531KI9FwV6Bwc0qWu4czI6nF0SCMQmEOtAyOhpZ1lv/hMj5l7CkP 1x+aAzENWnvc8FKOxmfAYQh+4A== X-Received: by 2002:aca:f189:: with SMTP id p131mr4906839oih.128.1633111156385; Fri, 01 Oct 2021 10:59:16 -0700 (PDT) Received: from localhost.localdomain ([2600:1700:a0:3dc8:205:1bff:fec0:b9b3]) by smtp.gmail.com with ESMTPSA id w2sm1284798oof.23.2021.10.01.10.59.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Oct 2021 10:59:16 -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 v3 5/5] drm/msm/dp: Add sc8180x DP controllers Date: Fri, 1 Oct 2021 11:00:58 -0700 Message-Id: <20211001180058.1021913-6-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20211001180058.1021913-1-bjorn.andersson@linaro.org> References: <20211001180058.1021913-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. Reviewed-by: Stephen Boyd Signed-off-by: Bjorn Andersson --- Changes since v2: - None drivers/gpu/drm/msm/dp/dp_display.c | 7 +++++++ 1 file changed, 7 insertions(+) -- 2.29.2 Reviewed-by: Abhinav Kumar diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c index ff3477474c5d..56a79aeffed4 100644 --- a/drivers/gpu/drm/msm/dp/dp_display.c +++ b/drivers/gpu/drm/msm/dp/dp_display.c @@ -127,8 +127,15 @@ static const struct msm_dp_config sc7180_dp_cfg = { .num_descs = 1, }; +static const struct msm_dp_config sc8180x_dp_cfg = { + .io_start = { 0xae90000, 0xae98000, 0xae9a000 }, + .num_descs = 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_dp_cfg }, {} };