From patchwork Wed Aug 25 23:42:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 502323 Delivered-To: patch@linaro.org Received: by 2002:a17:906:f0cd:0:0:0:0 with SMTP id dk13csp721583ejb; Wed, 25 Aug 2021 16:41:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw2v8OsImhjwBwf2B7rYC3PUzt2XtfV/72J4CR8cQt1DVnaSPHYr2hQKmbGeeSWLczVzHwC X-Received: by 2002:a6b:e50e:: with SMTP id y14mr781107ioc.54.1629934887734; Wed, 25 Aug 2021 16:41:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629934887; cv=none; d=google.com; s=arc-20160816; b=QLSsjC7BdTqzr+D2+RMI0iXsi00s4XgkOgxwuXyWRDnAzWGYP/CI6x8US0I3yX4m5o Cx+vC4gKipopU+v/7TufxRw8+u8yToZOCXPYuRtjTEju2CiFtBx6o/shhT+SZyOMf7m9 oepsRDdhXBCZetpOvMmCy8uqaQAhtVlYbVfSt/HIjINmO0BUmjGc67RYnkyyADJ7+nLy l8ngiasA6ePK5+I/5BMnnQuvvlv8Ksu4ehV2CkYmkagTD5G1On9W44KBDdxtxNaaR7bw fyO2d/PYmWleY0moHEwUf8kBI5VvhCR+SCO+OgJ0r6bMxJDpjNpKugR0kT/CoCeg596L vCAA== 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=lZrU8U8P0CV677Vco2xQXxNWbS5uRSsKifcZEcankpE=; b=I1w6z8QujhwWsF6M/HTN7ZEW3tFDdgVQ8fX+SNvZL/5yJco6WdOj1lBaz1e0u7QYJ8 LC48hPFDw/iDx54gHPjpZ0hdTCnWgguerT30vHCoh9jE5giPb14uiHzQRDAyqZtf/2dj nJv/RBNPS6Jd7yZkb/+FFRDfpr5QWCX7fRnovSKmU0z3wsRY1/l8BvzNfT011mm6RRtk 2NxENLfoHiFN5EnSeXU1yyu8veHw50ns1Shh1ZgjYEbKhuyeIC+gRYVWshNrAjNqsB/D GNIvQBiV2ndwMLoEDibDNjc5kqB0D1Uk+hw4EkqsucaVNhObS3a+yWXI/HOQN6Mf4wEq uI7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ao5ckATz; 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 l6si1082234ios.26.2021.08.25.16.41.27; Wed, 25 Aug 2021 16:41:27 -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=ao5ckATz; 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 S233924AbhHYXmK (ORCPT + 16 others); Wed, 25 Aug 2021 19:42:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55224 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233891AbhHYXmI (ORCPT ); Wed, 25 Aug 2021 19:42:08 -0400 Received: from mail-oi1-x22a.google.com (mail-oi1-x22a.google.com [IPv6:2607:f8b0:4864:20::22a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8D26EC0613C1 for ; Wed, 25 Aug 2021 16:41:22 -0700 (PDT) Received: by mail-oi1-x22a.google.com with SMTP id h133so1783356oib.7 for ; Wed, 25 Aug 2021 16:41:22 -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=lZrU8U8P0CV677Vco2xQXxNWbS5uRSsKifcZEcankpE=; b=ao5ckATzqUpbA0sw5SPgi0ZBcaV8pPxbpc6QSyXBEiDJiT5S3xLybVTBnAHeLRW+ZO P8TtNkFJqIx88hybf+wqW0FVRAtUH7U+0Tn4+VtNOPRx788eRYnP8Zos4oQewzbFn3zG v9z5Q0gpdEATHb0n6rjboqgXfkIq3WjFkrv+35pSgKUBD8i6S0BVtRvdOwoGYNbknEIG Q+cyNnD1dPmuqnmQR1adXsou0o/ho93b2PEzgV+uZ/hIPdW4xxYxDegIRWLA5H/Ihw4x UM+UEUpaWYLNvigGLxY1whNbiie50MkIOtXnko+rrgFQQ/BIhM2o424BSPi9p47dL4rO /Ddw== 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=lZrU8U8P0CV677Vco2xQXxNWbS5uRSsKifcZEcankpE=; b=iq2ecccWdEngzrmCTzlHijqFJvCC6arEF/X12CuzxFtEBgW2jS4QlbgDxf9DWtDuUu c8SrEc6KoblMqfI8gUFUESNTSFj2JA/sz8k9HZ+qWkOgpEoPsDHAIywUS8xdLmwYKOzz Yb/eRZBpaB6PLoIzp0aRpZqyvsP546LAuVfOWszsqm4qKlRwlymEDXurqqiLcooKgqGR DwmeE8qCagWuF4peMoK7eqbUiYn+i8YwdJ6PQREU6OSQwv1yQtAp1dBaQQcqPdjihwAI DZJ3ZYz1zr+v3KW7X0fEz8DLbY7eIIDy6l6dLvKMz621zC1dby37+NX/pXxHLpF8MSpH JdOw== X-Gm-Message-State: AOAM531rfV7ZSOE/LhD1mXEomSIjItcZU7LLjnS+XN+X/0c6DS80xK0U squ7piISPZ/+rIMWll1PbCLfzQ== X-Received: by 2002:aca:d06:: with SMTP id 6mr381891oin.105.1629934881947; Wed, 25 Aug 2021 16:41:21 -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 g10sm267136oof.37.2021.08.25.16.41.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Aug 2021 16:41:21 -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 v2 1/5] drm/msm/dp: Remove global g_dp_display variable Date: Wed, 25 Aug 2021 16:42:29 -0700 Message-Id: <20210825234233.1721068-2-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210825234233.1721068-1-bjorn.andersson@linaro.org> References: <20210825234233.1721068-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 --- Changes since v1: - Renamed dev_get_dp_display_private() - Drop incorrect checks for !container_of() - Dropped the checks for !NULL checks of dev in the USB api - Use right accessor in dp_display_remove() 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 13a3cf692562..2c7de43f655a 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", From patchwork Wed Aug 25 23:42:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 502324 Delivered-To: patch@linaro.org Received: by 2002:a17:906:f0cd:0:0:0:0 with SMTP id dk13csp721593ejb; Wed, 25 Aug 2021 16:41:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyHCGBjd2OrqFOkA/RyQvGSDC2+Nn0TW8Wv8ZJV2gE4cOBfFNeFFs4/+PW2W0DAL5vMFrWA X-Received: by 2002:a05:6638:1905:: with SMTP id p5mr865356jal.25.1629934889350; Wed, 25 Aug 2021 16:41:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629934889; cv=none; d=google.com; s=arc-20160816; b=Bto9EmqqH3Rn1D7BwdVZ0nLgYGUuQYzZtRK/mR1CIK29DO15lFzhzg5Wf/HSFhI1YL 7siP3uPEfGFQ4dY1FToTn1rgfuWksuLvtTkQc88HVLtGDZRqvx/E/68AZZUOfpN1lUrL uqbDTKAgIDziBXAM07ZiDEDXqy7TLy3Lfd7rW+G8IEKgkZwd/LvU6XvO6xI2/ObI2GWX Pn8YpmWUndjqah4ShLVOObDcATrXSIg0r7A0ybUZ3RlMvoDlizM4CsdIh3xL8tTvFVtf /IHYXXQ9rEaDZy/Dpbn6lMhnIk+6P6z3JmbYoJbv517GlKmNh7FuOmRVxQvON5Q6G8Ft EoDw== 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=/SUT6/CPQy4VuzfV2PpQSsF1DEYegx2l+83mHNGP6WQ=; b=ilJwGD8yKAVwMjgqpFntYRsjIr5/HlEmNFg39O3tPOnQx83EAWrWw2EP2PISylrXsF ejp+/3OA0gAKlEG6rKsqm0Ehg2xVjXZ+1g2LOUwdz2GoSp3Srz+yJ1z2216g/eK0OiAR xu77SMDDY4o1yRGeU+WM04h4FvGo067GoUJ/93ZjzQ+4HaSURPXGfkgew0jLhuJDonxw El/dnC+AwDNZ9wfn+YqsW/1e2ve8qQXwTBjCS3dDZ9h7nusjkV0dtMmQcxkpJvCwxLHp YD0CedBCOX0PN6Lj1LBz0VOmwdhVH50NIozZ+D9MP4AiwhA5htpHPy6+R8glYQqdkrLL dJQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aBNo6IWt; 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 l6si1082234ios.26.2021.08.25.16.41.29; Wed, 25 Aug 2021 16:41:29 -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=aBNo6IWt; 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 S234101AbhHYXmM (ORCPT + 16 others); Wed, 25 Aug 2021 19:42:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55232 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233730AbhHYXmK (ORCPT ); Wed, 25 Aug 2021 19:42:10 -0400 Received: from mail-oi1-x22c.google.com (mail-oi1-x22c.google.com [IPv6:2607:f8b0:4864:20::22c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F5CBC0613C1 for ; Wed, 25 Aug 2021 16:41:23 -0700 (PDT) Received: by mail-oi1-x22c.google.com with SMTP id p2so2112196oif.1 for ; Wed, 25 Aug 2021 16:41:23 -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=/SUT6/CPQy4VuzfV2PpQSsF1DEYegx2l+83mHNGP6WQ=; b=aBNo6IWtJzImXbC1euEfhI81ak1ju0dMOsBX7Z7MsXlS1oGV7yhvpcNp/7KrArcVkI FjClKe19BQvluGfgAg+7Jt0gX2jzTDxOuwAIhSNkPP6cpxmv33Z9t0H9XnCTAkjWoZAz OeYtUxQ/WWxXaHt7OF8RkHWv6vAsYToBWjn+wXgLglFm5apCOE0nLoROvK26p2gcHj5l jZDMH107p5YMVNFyHTVdr76B5/QbIpq/PhVCcBQMgzLVOFN311NDYDvR9Es1i96HZjM5 NkyRS2N1tSego9wrDW7VFt4gx6N38aoSSMV8AethWs2UdKENGqCR2hCyxQ8JvGLASJJ1 qPNQ== 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=/SUT6/CPQy4VuzfV2PpQSsF1DEYegx2l+83mHNGP6WQ=; b=BiJs3PqDQyGNbo33mZLI4oY1pUoBJ2zCzKYLS4L1YCVvBQ4zoeyhINOluaOBKCnjfc yPGzefgOT0jJulgWfzUloXPxamQ+zO14Pg/Qx+p6GMPhLGR9cfXPNUg+bLnIXG7bEKUN WQlUe2gAmTXi0QZYBi7PtBKcqbcXmYwfCx+YZgdCRfRlMrVdByVKOnJnuyYkRVMh7ix0 mV3Tcx5mCez57oQrveak97y2cVqSxzvTvYohwmIsUtyTyVO3TdkMnD6FUTsUO/KS/y2f 6YtyvcgRD8G01Uw3n6WUktWZQQ3l5br+wdip+u1YLWzW7jUTN4XMt8gBrtx14yeqvSYm nsfw== X-Gm-Message-State: AOAM531nBPuJ5hiUdJ/EKrM9Al2vNiYvAY4h5X/h8wutYfobQyH68cGc SLjJ92mefBzSbIXxSRbEgsMSFg== X-Received: by 2002:a05:6808:1d3:: with SMTP id x19mr365072oic.137.1629934882911; Wed, 25 Aug 2021 16:41:22 -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 g10sm267136oof.37.2021.08.25.16.41.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Aug 2021 16:41:22 -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 v2 2/5] drm/msm/dp: Modify prototype of encoder based API Date: Wed, 25 Aug 2021 16:42:30 -0700 Message-Id: <20210825234233.1721068-3-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210825234233.1721068-1-bjorn.andersson@linaro.org> References: <20210825234233.1721068-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. Signed-off-by: Bjorn Andersson --- Changes since v1: - Store msm_dp reference in dpu_encoder_virt instead of carrying a list of them and searching repeatedly drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 23 ++++++++++++--------- 1 file changed, 13 insertions(+), 10 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 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 Wed Aug 25 23:42: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: 502325 Delivered-To: patch@linaro.org Received: by 2002:a17:906:f0cd:0:0:0:0 with SMTP id dk13csp721595ejb; Wed, 25 Aug 2021 16:41:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzn9zbpobuDdD08SNasLA0aY0jW+Dn/6GoAD0Nggx61cXBjeMfsJPG/181fRhcFBPQvKv6S X-Received: by 2002:a02:70d4:: with SMTP id f203mr843984jac.35.1629934889675; Wed, 25 Aug 2021 16:41:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629934889; cv=none; d=google.com; s=arc-20160816; b=KTWexj3RTiLKy5hri1p7Pan4O1bY4SXbrK7MMVmFMU31+YrKE3JBQIG3Zhg8AhzqHl 1AdX1zNNnpiwtmCjmSr8m5JrUt+A9C814tOrs0IHB7CvNbuXw6J/k1QR5fdYdJbf2sa8 4AjuiUz2r1uUV9XQ5GJuYha/K2RCIXScVBI8PagAPui3vXP2ZfBd1w+94TSLOJbUjOP8 faTK92H0/wV+aFcAcCJdcGyW2oz9nxiUbH6yHktyqieOC9tBmH5iCXQ73GjVris1jNkf DoTCskQXK6Kzmp7vtv32gWogQfFBs6xaQuBY0LvSfYQkxuQ/6FNWzx+ldl6oJbAIr5SY N7Zg== 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=UyiBHZU0sJ+AAUPSROiGijhdbK/4CnMcUZShDuulJlc=; b=x4UZXII/GwHbk1kZ1i/Ng8x/L/Dqq56hHxvXctgwXIjmPnwj4ViI3uTpire0k2L8sL cyJRdjNrMhbA/1SLFKrfiCfgEkrr8VsF8IWimC8349cxQ3Lg0RnWdyULh5kpRAzs/jfv hsfD66u8KZ/nJpttjGNtLqBKdK/o7rY+yUP7bPQu+MdGh2Y4OSditieif2dQh4/av6fk QLMxD3xKTjb5LYk31dr6on27oNLPK5v2hzjMGYDbapR4mfYO4W9EOZHChIVwLkQjrQc6 nPsR/zKMby48ecGI3GVTM/5LLnu7XiywF9zNmqKqVCTtZJ3SROBqfciy3X9gQeiMiPIn WaiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mHC5WMLL; 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 l6si1082234ios.26.2021.08.25.16.41.29; Wed, 25 Aug 2021 16:41:29 -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=mHC5WMLL; 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 S234319AbhHYXmN (ORCPT + 16 others); Wed, 25 Aug 2021 19:42:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234022AbhHYXmK (ORCPT ); Wed, 25 Aug 2021 19:42:10 -0400 Received: from mail-oi1-x22e.google.com (mail-oi1-x22e.google.com [IPv6:2607:f8b0:4864:20::22e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B093C0613C1 for ; Wed, 25 Aug 2021 16:41:24 -0700 (PDT) Received: by mail-oi1-x22e.google.com with SMTP id o185so1734703oih.13 for ; Wed, 25 Aug 2021 16:41:24 -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=UyiBHZU0sJ+AAUPSROiGijhdbK/4CnMcUZShDuulJlc=; b=mHC5WMLLLkd3vHYZGgKzLtt5Ar+vY3WNkp1XwZ3DWIpEJ+uz9ARYQcmjMx2s3XIZe6 NKemOyP78VsEmt5EipS7yINKx3n9s42e9i/uan3dIAnwv6HX6ea8Ym+SePpPM7oD81IG AxK37JaADJ+/8ttgRDtRq7QJGXDAy5rL9nRBoUKTCGJvkUlOhx8Qqgdj598/3Derx5K6 2pqdJH1dlB8cRII+RDD1PrMURe1aXRtW9UVSl8ur6S77gkiFzbKgmEaGUZtsL9povck2 w8KqnzdHf4hZvfknXiy9AB9RbT3YoY/jkVXVlYAv6r+XUU4Db5O6dQagVZOAslWk3Xj6 zTCA== 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=UyiBHZU0sJ+AAUPSROiGijhdbK/4CnMcUZShDuulJlc=; b=hd6tshSrAngHi1QIQolmElXrkHD2K7yb7dglwleoChRr90jsSF8c6MkGZ95iFhWDRY 14c4JKcBDUqk77ibpjZy32OS69zIIhhOw2RnhysBYBe2Rd8v0tmr6V0y2s919t/RfIl0 gHeQshTNZRE0MuFmi0Hij9p5xZn30ZhPA3Hn8idvq+X7Ll1RNbZiCVWNxq89OCimdhUD 1uW5WWZo09+PRIGvAIZkM7myC6Srp4jcvypBCuKW276NiXlgWpI899jEDee2QChYX80h UuXwoK3HK1oGGBZDsxa5/9KNE3OhBHYBYbG42HLJobeprILivUEkjAfaiaPCMTadZqZP 62kA== X-Gm-Message-State: AOAM5332UGh19MNyDxJAXE1J9+4zYsDfkObapQ29ixN20Ep8VL7DVeT+ 3ABcWIMX5oP62YFjfZMDSkurMg== X-Received: by 2002:a05:6808:10c8:: with SMTP id s8mr422586ois.6.1629934883884; Wed, 25 Aug 2021 16:41:23 -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 g10sm267136oof.37.2021.08.25.16.41.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Aug 2021 16:41:23 -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 v2 3/5] drm/msm/dp: Support up to 3 DP controllers Date: Wed, 25 Aug 2021 16:42:31 -0700 Message-Id: <20210825234233.1721068-4-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210825234233.1721068-1-bjorn.andersson@linaro.org> References: <20210825234233.1721068-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 v1: - Update dpu_encoder_setup() to store the reference to the msm_dp in our dpu_enc drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 2 +- 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 | 51 ++++++++++++++-- drivers/gpu/drm/msm/msm_drv.h | 2 +- 5 files changed, 90 insertions(+), 33 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..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 2c7de43f655a..4a6132c18e57 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; + int id; + /* state variables */ bool core_initialized; bool hpd_irq_on; @@ -115,8 +117,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 }, {} }; @@ -211,7 +224,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) { @@ -233,8 +246,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; @@ -249,7 +265,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,6 +1196,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; @@ -1194,6 +1230,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"; @@ -1388,6 +1428,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; diff --git a/drivers/gpu/drm/msm/msm_drv.h b/drivers/gpu/drm/msm/msm_drv.h index 8b005d1ac899..2e84dc30e12e 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 Wed Aug 25 23:42: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: 502326 Delivered-To: patch@linaro.org Received: by 2002:a17:906:f0cd:0:0:0:0 with SMTP id dk13csp721651ejb; Wed, 25 Aug 2021 16:41:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz4VbxyAei6wVsi0DnedoP6iEiFpup6uz9ayDdodhLqfD7ojftOFxBSJMvHQxQr/BCAlj7S X-Received: by 2002:a92:290f:: with SMTP id l15mr596814ilg.290.1629934895206; Wed, 25 Aug 2021 16:41:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629934895; cv=none; d=google.com; s=arc-20160816; b=09fdfU3n14C3e0DMBrjCigRIKMoUsc9/ySl0hHmsWfw5bCUHyfJr4njgQvj5wlzATL yMXPcRRiblOoPo9IKcwInDfHsuBnwX4ft2H/xGyAbvP5xpSvUrzC2+4Eg9JD4xVCTpWC 9UW0mdY652U+zkCHuyXvynnqMsy/aQHnwXftGp1K0ki5VUi6etfyMnR/oA/NEWAfKi+m nZnMCowV/qiYbSmqQXx+QAorEpq3XhUCqDKNi5lAjwlkhi/wIj1d+xfjZzJk7qPthEuq Ldhb7+IcI6qi0Eo6JAmHe4kXO5qcR9fjbwp+Y/gNOaq7O1B8tlTDZI/dfEnOgc1a6vwW rU5w== 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=4Qbn6rk6sj87tSTKdnnYPYuRTniKiqOezdw+dFrRZCg=; b=uL2Bbl41/OWIAUgth/uw0qZSNoGr3MQUjXvLzvh5g39+WgvBiFn7eLPuXtpWSEwDCc Iv57eJwlat0VORtg+MlKJOVU91D+22QNxGR95BnKglY76XganDt6M4wi3U8h2M88XxoU TiNJRPpSviV0xXfS1kKrWfm9ftv7CT62vk2iQEgPjj9Y+kVikhLjzEN8rrzTKTI0Wdj8 KyxgKsN3DQDmKdyz3KRpWEn+y5b4yHz54exDTTtqCCpgN8ynA3I4U/YfcPmkXBEfxQ/E 0iya239EREaRHKMjTNNgtgziwlBtzOMrRihb0UKOx5Ly4Tygp+z9m55b7N+zoPEaB0o/ sFPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Vm4G3uft; 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 l6si1082234ios.26.2021.08.25.16.41.35; Wed, 25 Aug 2021 16:41:35 -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=Vm4G3uft; 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 S234931AbhHYXmT (ORCPT + 16 others); Wed, 25 Aug 2021 19:42:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234153AbhHYXmM (ORCPT ); Wed, 25 Aug 2021 19:42:12 -0400 Received: from mail-oi1-x22e.google.com (mail-oi1-x22e.google.com [IPv6:2607:f8b0:4864:20::22e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D880C06179A for ; Wed, 25 Aug 2021 16:41:25 -0700 (PDT) Received: by mail-oi1-x22e.google.com with SMTP id h133so1783512oib.7 for ; Wed, 25 Aug 2021 16:41: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=4Qbn6rk6sj87tSTKdnnYPYuRTniKiqOezdw+dFrRZCg=; b=Vm4G3uftCW/T6dCqbkA7vokLZMlA9pX5RbXLwF33YGHY9/epjZ2UZRq5k7X3sXH2RQ 4+j+0+P2XLOlMPSqqzjNNRFMB/sIERKlX72b+Eeou62AjSWYpl4HwXsgkShSu/ocFCP0 +fTSaHJTwWznLYOaQMKHxMmyAQobljjla/3hbvDh73lP2ApfNpf5ph3Ie/ucWtBwQ2S0 NbkVeJQAvKsCUMKHe1xLa8liMwqfwWgkzF68oUGavZjOxTIfdwFnnqEC1VggZpcwu56V 1feLQBw5xIKHNORbnU9/8AMfk3UdSZUHrO+707Wz1k9Vp00gj+Wf+qCj312VNn0EXzzh BmZg== 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=4Qbn6rk6sj87tSTKdnnYPYuRTniKiqOezdw+dFrRZCg=; b=pP0SMV1ye68z76y7khFEQIpXT/dBA5kQ20q0u5Wk5rUFk1jqWomkFuY7sz8UPkrqdg n73O2d4sMgQhPxH9In766D68Weu8dIy1pO4hY0xVIbhwiIDk9II4lvHf+pOCazdI9Iq1 k6eAQ07M1383CGFewHxSOnYs8Ia5fu+et3w5D3+lwaTS9uQsHkQsOh/8KiveTPS/rVMa Nl1+L7IMzwYgDlwenOUUChL0iu8TBRRrbQZViDV+D8VIl6EEDjreBGjksEKW4I6Zm1/u qZpAXuGZ0hgLWWll2g2FU10rm979cXWWAkI2E86MBKEuqn69gpv1lZvoAgXuseBxplxx 3xXw== X-Gm-Message-State: AOAM530c7hi5MkEB6ho79XJUWz2AjefI/ucXDsgv0FXlHgOElUgFd2vZ U64t/S6hQMS2PKaKiPoi5UwT+Q== X-Received: by 2002:a05:6808:2ca:: with SMTP id a10mr427499oid.44.1629934884855; Wed, 25 Aug 2021 16:41: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 g10sm267136oof.37.2021.08.25.16.41.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Aug 2021 16:41: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 v2 4/5] dt-bindings: msm/dp: Add SC8180x compatibles Date: Wed, 25 Aug 2021 16:42:32 -0700 Message-Id: <20210825234233.1721068-5-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210825234233.1721068-1-bjorn.andersson@linaro.org> References: <20210825234233.1721068-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 v1: - Picked up Stephen's R-b .../devicetree/bindings/display/msm/dp-controller.yaml | 2 ++ 1 file changed, 2 insertions(+) -- 2.29.2 diff --git a/Documentation/devicetree/bindings/display/msm/dp-controller.yaml b/Documentation/devicetree/bindings/display/msm/dp-controller.yaml index f915dc080cbc..b36d74c1da7c 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 Wed Aug 25 23:42: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: 502327 Delivered-To: patch@linaro.org Received: by 2002:a17:906:f0cd:0:0:0:0 with SMTP id dk13csp721658ejb; Wed, 25 Aug 2021 16:41:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxDlnKbYcQ5kqjo92zjSh/aB3cwz0DXNz7fa9BEylcNwcXl7a0c+Kac0aOMdXs1EVyer8tS X-Received: by 2002:a92:d282:: with SMTP id p2mr552938ilp.259.1629934896138; Wed, 25 Aug 2021 16:41:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629934896; cv=none; d=google.com; s=arc-20160816; b=wCnjAAQ8iF0FybgrzhDbIZ7h0T6G8zrEM26p4K4OT8GFKhfuPY3Y9E2uXde+zQv+2f sgk0doXV5rx51yHYXT3UOwTBSkhdUCBVqGpgk2RIme8c5Ua7jpiLvQJhlZ+XbKHMJAvY dz7BOau/zMH5o3mYmt3VgTxXV7QhnWMVjI95NpoJlVBPcXO918m3mhyunMyvUWeVKl67 /9LFKRNdG3279+toFNc4qlVhFwC8IsQE5gHpUhvSesb7zWWBMKjlm1z7KyU61axIK9TR VCAQl/E+4ZY4muWcAN3nfgEUd0TBofVF8jIRHwunPHK4Jng9zpTWaGnGOoHFhcL1of8D z5XA== 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=zmkhJZgxUoBYEWfmUUPtlawWDiOOQTnvHmBTREcB0I8=; b=sTQjmMRqm7k9yiPRIaY1e3W9G/PlvzgiofA6usAxFtjI7ioPRn4tOluWSgs+UpZqnX fBksoZvP9vqVdgqSlfzRkHiUA8A/V6/9/bu+HJq1jlcDnRWGgMh+4UW3y1MbzO3YujfN t4ibAivX3GzlxkROx5te52gye1kgY+09uZ9H4kXN07kBR4NReyxEP5C49IGerRCZc1M0 JMG7wZlKgkLNTbw1Sf5tDtaSTKIOIbddTH7YzAqToHjcTklQTv13e1el3yDiJfQ6xVzB 7GeteUBzKRXa5Qemgg1bO/NYp6BzyqMChrQnWJAo3U20Oy3ycLyXzl5vDnG9rnA2KiLT VMWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JyWNsF0F; 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 l6si1082234ios.26.2021.08.25.16.41.35; Wed, 25 Aug 2021 16:41:36 -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=JyWNsF0F; 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 S235078AbhHYXmU (ORCPT + 16 others); Wed, 25 Aug 2021 19:42:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55258 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234178AbhHYXmM (ORCPT ); Wed, 25 Aug 2021 19:42:12 -0400 Received: from mail-oi1-x22f.google.com (mail-oi1-x22f.google.com [IPv6:2607:f8b0:4864:20::22f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 625F2C0617AD for ; Wed, 25 Aug 2021 16:41:26 -0700 (PDT) Received: by mail-oi1-x22f.google.com with SMTP id p2so2112335oif.1 for ; Wed, 25 Aug 2021 16:41: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=zmkhJZgxUoBYEWfmUUPtlawWDiOOQTnvHmBTREcB0I8=; b=JyWNsF0Fao+n3iA7RF4tPiWMJ8n2MZ2mYJoFDYpVaqi9ikZqme6UoCEL5AL6XWV8+b 7j87fGb8hvJLvdo6yIJZGnmE8E4AXI+nFHBd1vgw/ziftZGciRFPiNm6JyxoKk4XqR8R WZf76jy/wYt9SI4BubN6PAu11atHjFJc6O5BLQ/wS52aA2uWAtwaI3YInYvWOgACsamN lerEgJOmm6aVh2+Wsj1TQGiWtR6jEXRCBgn32lvkpTeYUci5pjr1cWJmIX6WHVJjzKoz j9cQiPlS9DuiiKiFzshN54SQEfYOJxDMmAKpOJLwvJXhgE/NrZVmiItvzv6iUdhqFKc8 RcTg== 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=zmkhJZgxUoBYEWfmUUPtlawWDiOOQTnvHmBTREcB0I8=; b=gFytx59TNiWA7C3FEqdrkMXdfDNb5CfEwCexhnuUhKPS8cFTxdilQCwyPxpo3WttQx HS7FGFqkQAdjm9NFQzzptNHxXVixmN4SO05RODWYiHx6dr837z3xEpNEStfvtpaL39rH jY3Apzhgjc7N2BQCMmfiCVhLv2dIRlqrh3cvkf+Hq6MUdK9VsS4O6q7zwuXsQTHWrfqw eMDFTFQRvqxqPjxq3yVj7Gg/GoOUKQmW+zpg93VBEysNybIDWwBw3Hy6NOXRaGzHd5s8 lbEMw104wSD98k/F8+meXPLtEIVpfbU3jnBe7MskyfBKZi+Rqbj2+n3nQtcCnuB+qoxE UIPw== X-Gm-Message-State: AOAM530P7npHndgOdtjzrlWrIvE+n1CBXWsFNUernsKkap6bcf5xALjC FYROz5FpL/Z6/4f0XfCwyDOluQ== X-Received: by 2002:a05:6808:95:: with SMTP id s21mr418519oic.80.1629934885805; Wed, 25 Aug 2021 16:41: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 g10sm267136oof.37.2021.08.25.16.41.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Aug 2021 16:41: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 v2 5/5] drm/msm/dp: Add sc8180x DP controllers Date: Wed, 25 Aug 2021 16:42:33 -0700 Message-Id: <20210825234233.1721068-6-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210825234233.1721068-1-bjorn.andersson@linaro.org> References: <20210825234233.1721068-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. Signed-off-by: Bjorn Andersson --- Changes since v1: - Squashed DP and eDP data, as there's no reason to keep them separate today drivers/gpu/drm/msm/dp/dp_display.c | 7 +++++++ 1 file changed, 7 insertions(+) -- 2.29.2 Reviewed-by: Stephen Boyd diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c index 4a6132c18e57..c1307230dc47 100644 --- a/drivers/gpu/drm/msm/dp/dp_display.c +++ b/drivers/gpu/drm/msm/dp/dp_display.c @@ -128,8 +128,15 @@ 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, 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_dp_cfg }, {} };