From patchwork Mon Oct 9 20:57:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 732112 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 89025CD6138 for ; Mon, 9 Oct 2023 20:57:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377975AbjJIU5e (ORCPT ); Mon, 9 Oct 2023 16:57:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41910 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378055AbjJIU5d (ORCPT ); Mon, 9 Oct 2023 16:57:33 -0400 Received: from mail-lj1-x22c.google.com (mail-lj1-x22c.google.com [IPv6:2a00:1450:4864:20::22c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 12942A3 for ; Mon, 9 Oct 2023 13:57:32 -0700 (PDT) Received: by mail-lj1-x22c.google.com with SMTP id 38308e7fff4ca-2c007d6159aso58954141fa.3 for ; Mon, 09 Oct 2023 13:57:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696885050; x=1697489850; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=A76BFNPnJ+6jsYihExtv8TvgroW23+3EsO63qGtaSNI=; b=vWAMmYRUE2xZMimF3ux50z2Sa2qEe7h5p/L4A9EKGDgxCg6P0EIkW66qBobvrmAABH 9LlsCAmu+fcp6G5tAXB9hO8qhS3sGXILmfa2fy3Zm84FoZU84bDTGiOb4Sauugw2AFim 5XCTbPZ4UiQ8sRizYIFfN3wsXAdnfbduI6Nj0Q6n4askrYldSK/UosESD6plsgg4JQf5 5ywC97/N7nlFVgC517jBleJOIpiEOXf6Lt5ho+keaoFHoK5woOvi2E1IBI+q0zJKWLVI CQ6llKoZEPjpk4GmzOjXfWhAus9dmguk1HFCcjZ+xQqjS9r9/V9nSmNYErQkkpv6n0ig grUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696885050; x=1697489850; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=A76BFNPnJ+6jsYihExtv8TvgroW23+3EsO63qGtaSNI=; b=Fqjefm4OR9GtHZsps+GJtfk1jJxTGN+rZgqiVRbTxFQUFnYwjT5tsC61d7MmqEt+59 FLR96rQtXuYdi0tqLY4FC74IkfxxBnUJS4k2LEnLeWZFkTC1ZbsfmIm/srWEC6L4czmB dHGuFaR1uyxMHBC6H4DplT4a5tZwRuD5kz2zyLJlonPo6cIPHPiIt+W+rHtyqNEp9mRy l+w7hRwdtpDJOnjAnVEUKKzCCLsTMtPKZC0qy36Yye4EKTFhkuAgX4UKl8pxtD1PsRIC pzRrWyVA7tCIwm+jcORLHpeYCV3jZIkbesfkURRGN/K0cnJwPoqomF1Gez4gwptsCZet +aBw== X-Gm-Message-State: AOJu0YyXYYZyjfapxU8FmLWRhNh0eVpcOCdc/2MF5Tt3UvK/pRorATcC Ho5380iiS2E7/zN9lRooedSItw== X-Google-Smtp-Source: AGHT+IF2F5SdPHGqRpF++yDaGef6VdS+zBqWRoYdzrdYV6qgV5UguFH7QQEEFEuwHRG+fVcJjNqhqw== X-Received: by 2002:a05:6512:108e:b0:502:9fce:b6da with SMTP id j14-20020a056512108e00b005029fceb6damr17282192lfg.21.1696885050016; Mon, 09 Oct 2023 13:57:30 -0700 (PDT) Received: from umbar.unikie.fi ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id f5-20020ac251a5000000b0050300e013f3sm1540844lfk.254.2023.10.09.13.57.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 13:57:29 -0700 (PDT) From: Dmitry Baryshkov To: Rob Clark , Sean Paul , Abhinav Kumar , Marijn Suijten Cc: Stephen Boyd , David Airlie , Daniel Vetter , Bjorn Andersson , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org Subject: [PATCH 1/5] drm/msm/dsi: do not store internal bridge pointer Date: Mon, 9 Oct 2023 23:57:23 +0300 Message-Id: <20231009205727.2781802-2-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231009205727.2781802-1-dmitry.baryshkov@linaro.org> References: <20231009205727.2781802-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Since the driver was switched to devm_drm_bridge_add(), there is no need anymore to store the created bridge instance in struct msm_dsi. Drop this field and pass data directly. Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar --- drivers/gpu/drm/msm/dsi/dsi.c | 8 +++++--- drivers/gpu/drm/msm/dsi/dsi.h | 7 ++----- drivers/gpu/drm/msm/dsi/dsi_manager.c | 19 ++++++++----------- 3 files changed, 15 insertions(+), 19 deletions(-) diff --git a/drivers/gpu/drm/msm/dsi/dsi.c b/drivers/gpu/drm/msm/dsi/dsi.c index 47f327e68471..c6d53cccb9ae 100644 --- a/drivers/gpu/drm/msm/dsi/dsi.c +++ b/drivers/gpu/drm/msm/dsi/dsi.c @@ -215,6 +215,7 @@ void __exit msm_dsi_unregister(void) int msm_dsi_modeset_init(struct msm_dsi *msm_dsi, struct drm_device *dev, struct drm_encoder *encoder) { + struct drm_bridge *bridge; int ret; msm_dsi->dev = dev; @@ -236,13 +237,14 @@ int msm_dsi_modeset_init(struct msm_dsi *msm_dsi, struct drm_device *dev, msm_dsi->encoder = encoder; - ret = msm_dsi_manager_bridge_init(msm_dsi); - if (ret) { + bridge = msm_dsi_manager_bridge_init(msm_dsi); + if (IS_ERR(bridge)) { + ret = PTR_ERR(bridge); DRM_DEV_ERROR(dev->dev, "failed to create dsi bridge: %d\n", ret); return ret; } - ret = msm_dsi_manager_ext_bridge_init(msm_dsi->id); + ret = msm_dsi_manager_ext_bridge_init(msm_dsi->id, bridge); if (ret) { DRM_DEV_ERROR(dev->dev, "failed to create dsi connector: %d\n", ret); diff --git a/drivers/gpu/drm/msm/dsi/dsi.h b/drivers/gpu/drm/msm/dsi/dsi.h index a01c326774a6..269975002b95 100644 --- a/drivers/gpu/drm/msm/dsi/dsi.h +++ b/drivers/gpu/drm/msm/dsi/dsi.h @@ -35,9 +35,6 @@ struct msm_dsi { struct drm_device *dev; struct platform_device *pdev; - /* internal dsi bridge attached to MDP interface */ - struct drm_bridge *bridge; - struct mipi_dsi_host *host; struct msm_dsi_phy *phy; @@ -56,8 +53,8 @@ struct msm_dsi { }; /* dsi manager */ -int msm_dsi_manager_bridge_init(struct msm_dsi *msm_dsi); -int msm_dsi_manager_ext_bridge_init(u8 id); +struct drm_bridge *msm_dsi_manager_bridge_init(struct msm_dsi *msm_dsi); +int msm_dsi_manager_ext_bridge_init(u8 id, struct drm_bridge *int_bridge); int msm_dsi_manager_cmd_xfer(int id, const struct mipi_dsi_msg *msg); bool msm_dsi_manager_cmd_xfer_trigger(int id, u32 dma_base, u32 len); int msm_dsi_manager_register(struct msm_dsi *msm_dsi); diff --git a/drivers/gpu/drm/msm/dsi/dsi_manager.c b/drivers/gpu/drm/msm/dsi/dsi_manager.c index 17aa19bb6510..59f4728fc772 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_manager.c +++ b/drivers/gpu/drm/msm/dsi/dsi_manager.c @@ -466,9 +466,9 @@ static const struct drm_bridge_funcs dsi_mgr_bridge_funcs = { }; /* initialize bridge */ -int msm_dsi_manager_bridge_init(struct msm_dsi *msm_dsi) +struct drm_bridge *msm_dsi_manager_bridge_init(struct msm_dsi *msm_dsi) { - struct drm_bridge *bridge = NULL; + struct drm_bridge *bridge; struct dsi_bridge *dsi_bridge; struct drm_encoder *encoder; int ret; @@ -476,7 +476,7 @@ int msm_dsi_manager_bridge_init(struct msm_dsi *msm_dsi) dsi_bridge = devm_kzalloc(msm_dsi->dev->dev, sizeof(*dsi_bridge), GFP_KERNEL); if (!dsi_bridge) - return -ENOMEM; + return ERR_PTR(-ENOMEM); dsi_bridge->id = msm_dsi->id; @@ -487,26 +487,23 @@ int msm_dsi_manager_bridge_init(struct msm_dsi *msm_dsi) ret = devm_drm_bridge_add(&msm_dsi->pdev->dev, bridge); if (ret) - return ret; + return ERR_PTR(ret); ret = drm_bridge_attach(encoder, bridge, NULL, 0); if (ret) - return ret; + return ERR_PTR(ret); - msm_dsi->bridge = bridge; - - return 0; + return bridge; } -int msm_dsi_manager_ext_bridge_init(u8 id) +int msm_dsi_manager_ext_bridge_init(u8 id, struct drm_bridge *int_bridge) { struct msm_dsi *msm_dsi = dsi_mgr_get_dsi(id); struct drm_device *dev = msm_dsi->dev; struct drm_encoder *encoder; - struct drm_bridge *int_bridge, *ext_bridge; + struct drm_bridge *ext_bridge; int ret; - int_bridge = msm_dsi->bridge; ext_bridge = devm_drm_of_get_bridge(&msm_dsi->pdev->dev, msm_dsi->pdev->dev.of_node, 1, 0); if (IS_ERR(ext_bridge)) From patchwork Mon Oct 9 20:57:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 731057 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6F5DFCD6139 for ; Mon, 9 Oct 2023 20:57:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378055AbjJIU5e (ORCPT ); Mon, 9 Oct 2023 16:57:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41922 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378034AbjJIU5e (ORCPT ); Mon, 9 Oct 2023 16:57:34 -0400 Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BFA7692 for ; Mon, 9 Oct 2023 13:57:32 -0700 (PDT) Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-504b84d59cbso6570219e87.3 for ; Mon, 09 Oct 2023 13:57:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696885051; x=1697489851; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=6mRCiNMZCeM+Ar6Xq8Rd6MAb4ZZFbkMJC2m2U/eGMOM=; b=Ok5TcXhu2jpwcjNPUSbHnjmlIJnwblJxMXFl8+oWScaVhUywPLTsjmoxx9O809l60g +ZvUdDqSlwaukdnuMlrSUfuHomnzec5jDUo5ddJIfWq0PI0SY64Ajfe/2RjJcn1zxqmz 9ySfdbR/aeJB0yWmW8GU+ArUcg68Xw6Xb0fxX66uhJFNEL3THXla1yLOKQMyasDLatn2 fp38G0seilD/oF/O6AxqHo0bTFNvNvKE0kt5tQdGEICPz2dcji2s5QIvK8MRBj+vaRoh QMXuN6a8j5e61+MtGv1wwXnYaUEJ1eNRiINyQcGA8fizQRYIksjtwv8ewwwQ+X+moKQs RpPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696885051; x=1697489851; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6mRCiNMZCeM+Ar6Xq8Rd6MAb4ZZFbkMJC2m2U/eGMOM=; b=ofwz6tECFFmUs9qqmPXv4xfW6/EgEPybTJvDZ08DNqsgH26HcJonBW9/OfuY5GCJfs n/t/TPoltkfOrOPdsWj1j2RhdeZVYArw5rQeeUoW1HQMqRz4/G9/bexss9ZhyfsW/sN+ 5ZlVkJo1V06WWb5wbQmGgUKJtTEBZ7ERB6QVFiGLM8hswrRYCpDCOZ84aLQ1k0Mj6O3g qCHHguynpwcBKvfZH2Kjj10a5ftO+uLFeoXblQuU282Ne2GE7j+MEJBunnIolQKg4aaq Md1HqJlXFiycmCh6TGG4Q+rpj0pvdS6y0haodvq9CUPJY2av1Igs/8Ox1vlc9IFC3MnN 9e8Q== X-Gm-Message-State: AOJu0Yy2s95bmYYjcHwdU0qwP8Epx1H/b43YEnA1Hnb/7B5yAkkYINXp S+W7SIVLlcgszjihm3ShD7IoFg== X-Google-Smtp-Source: AGHT+IFU7X41OGXzJD9SvazQZs/emXDkqZ6yVTu4T54nQhn3J7EF1X9dwl5ts7ONPF9ntJ0mSqjYQg== X-Received: by 2002:a05:6512:3993:b0:503:15a5:b368 with SMTP id j19-20020a056512399300b0050315a5b368mr14955585lfu.16.1696885050980; Mon, 09 Oct 2023 13:57:30 -0700 (PDT) Received: from umbar.unikie.fi ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id f5-20020ac251a5000000b0050300e013f3sm1540844lfk.254.2023.10.09.13.57.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 13:57:30 -0700 (PDT) From: Dmitry Baryshkov To: Rob Clark , Sean Paul , Abhinav Kumar , Marijn Suijten Cc: Stephen Boyd , David Airlie , Daniel Vetter , Bjorn Andersson , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org Subject: [PATCH 2/5] drm/msm/dsi: drop msm_dsi_device_connected() function Date: Mon, 9 Oct 2023 23:57:24 +0300 Message-Id: <20231009205727.2781802-3-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231009205727.2781802-1-dmitry.baryshkov@linaro.org> References: <20231009205727.2781802-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Since the commit 8f59ee9a570c ("drm/msm/dsi: Adjust probe order") the DSI hosts are not bound through the component framework if the DSI driver wasn't attached to the DSI device connected to this host. Afterwards, if there is no bridge (including the panel bridge) created for the DSI device then devm_drm_of_get_bridge() will return an error, also making msm_dsi_manager_ext_bridge_init() and thus DSI modesetting init fail. This way there can be no 'unconnected' MSM DSI bridges. Remove the msm_dsi_device_connected() function. Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar --- drivers/gpu/drm/msm/dsi/dsi.h | 6 ------ drivers/gpu/drm/msm/dsi/dsi_manager.c | 5 ----- 2 files changed, 11 deletions(-) diff --git a/drivers/gpu/drm/msm/dsi/dsi.h b/drivers/gpu/drm/msm/dsi/dsi.h index 269975002b95..b7edcb7b3ddc 100644 --- a/drivers/gpu/drm/msm/dsi/dsi.h +++ b/drivers/gpu/drm/msm/dsi/dsi.h @@ -61,12 +61,6 @@ int msm_dsi_manager_register(struct msm_dsi *msm_dsi); void msm_dsi_manager_unregister(struct msm_dsi *msm_dsi); void msm_dsi_manager_tpg_enable(void); -/* msm dsi */ -static inline bool msm_dsi_device_connected(struct msm_dsi *msm_dsi) -{ - return msm_dsi->external_bridge; -} - /* dsi host */ struct msm_dsi_host; int msm_dsi_host_xfer_prepare(struct mipi_dsi_host *host, diff --git a/drivers/gpu/drm/msm/dsi/dsi_manager.c b/drivers/gpu/drm/msm/dsi/dsi_manager.c index 59f4728fc772..af840a1e9fc0 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_manager.c +++ b/drivers/gpu/drm/msm/dsi/dsi_manager.c @@ -305,8 +305,6 @@ static void dsi_mgr_bridge_pre_enable(struct drm_bridge *bridge) int ret; DBG("id=%d", id); - if (!msm_dsi_device_connected(msm_dsi)) - return; /* Do nothing with the host if it is slave-DSI in case of bonded DSI */ if (is_bonded_dsi && !IS_MASTER_DSI_LINK(id)) @@ -364,9 +362,6 @@ static void dsi_mgr_bridge_post_disable(struct drm_bridge *bridge) DBG("id=%d", id); - if (!msm_dsi_device_connected(msm_dsi)) - return; - /* * Do nothing with the host if it is slave-DSI in case of bonded DSI. * It is safe to call dsi_mgr_phy_disable() here because a single PHY From patchwork Mon Oct 9 20:57:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 731056 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7BA86CD6137 for ; Mon, 9 Oct 2023 20:57:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378096AbjJIU5f (ORCPT ); Mon, 9 Oct 2023 16:57:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41930 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378034AbjJIU5f (ORCPT ); Mon, 9 Oct 2023 16:57:35 -0400 Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com [IPv6:2a00:1450:4864:20::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 64C4F9E for ; Mon, 9 Oct 2023 13:57:33 -0700 (PDT) Received: by mail-lf1-x133.google.com with SMTP id 2adb3069b0e04-50337b43ee6so6352948e87.3 for ; Mon, 09 Oct 2023 13:57:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696885051; x=1697489851; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=FsVPh0iTyvo+/vzHQV8VGhwEhSRLAhFjYHzI1LkCqoU=; b=HFTZkLWAG0j7MCCPF7n2h5NfpKTGI+dPq0710ueX77iX6QLojLpBI2ZEDGP1pQ2zd1 dTc+YWEBisVKnf/gBAdf2LtEtgYb1Yj/JtuN4tclQk44qM8hcOWZZ6QVYNLd9V2qcvT2 HikX1gT7AGOm/Lxf0tyXAclZEtgxXm6gV9sZe6pTHTbu0ZXeA6p4YD/ic0Ktc784lG2O U3kg9ikRFUp2yEFHZDc5mWZt/SkFw2+7+UjqgIeigaP9qleUfSrPOucnfLmfO1eVrnv4 S0vdue+LNJmxxRvPfgJ7rKMEqR0oggRpyxjgp+sh5GaaEnkbSSQbj+lrXpekC5mu2ZaD 23jA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696885051; x=1697489851; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FsVPh0iTyvo+/vzHQV8VGhwEhSRLAhFjYHzI1LkCqoU=; b=o6BOfHtmOW5IyfIqvr9CDE6OlHytyItPIUDSGPZQB1ncJdm0w6JEicArXNvm3D2HUp Odm3/rY9RUzsQjUwdHptNnsMoyrsQxmXdIhhovSjL7P0vgJShg+O5NFXgYmap11nLmtp y3o/spbPmpZz/4jOG7I55rUYqMDjqWtw7urbTS6OYnKKg1uvbHRVHagkIEYyDn8rgL9w 2fH0P3k72E0uH+An3nQz1snKxhNDmZjD3SfKGIokUDKkqE+A84h8xdOLwSV4UWcGAMi8 iGuTsblFioeAQN+F4g0z5DWmIVXRXiiVcs6H8KJ5FnhOvabXa+O67j/SM+2wCRLR4+H9 6bXA== X-Gm-Message-State: AOJu0YxusFM5rph90iA5aBtYEV8M8dX+r7qNFqyYwmlU4rtsVuJInVvw ElcpZL/7Eu2d4qPYUq1+v2k18A== X-Google-Smtp-Source: AGHT+IFJGy2KJmPdttBhioSDz9qzigsu77WQDa9aMgmNBJ9OPd2PNRDZd1XwmqmSd4bs014nxx5NOQ== X-Received: by 2002:a19:e010:0:b0:500:b74b:e53 with SMTP id x16-20020a19e010000000b00500b74b0e53mr12915898lfg.46.1696885051661; Mon, 09 Oct 2023 13:57:31 -0700 (PDT) Received: from umbar.unikie.fi ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id f5-20020ac251a5000000b0050300e013f3sm1540844lfk.254.2023.10.09.13.57.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 13:57:31 -0700 (PDT) From: Dmitry Baryshkov To: Rob Clark , Sean Paul , Abhinav Kumar , Marijn Suijten Cc: Stephen Boyd , David Airlie , Daniel Vetter , Bjorn Andersson , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org Subject: [PATCH 3/5] drm/msm/dsi: stop calling set_split_display Date: Mon, 9 Oct 2023 23:57:25 +0300 Message-Id: <20231009205727.2781802-4-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231009205727.2781802-1-dmitry.baryshkov@linaro.org> References: <20231009205727.2781802-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Since the commit 8b03ad30e314 ("drm/msm/dsi: Use one connector for dual DSI mode"), the second DSI host in the bonded pair will not be associated with the encoder and will not get the bridges, thus making condition in msm_dsi_manager_set_split_display() always false. Technically that change broke bonded DSI support in the MDP5 driver. But since nobody complained in the last 5.5 years, it seems that nobody cares enough. Drop the msm_dsi_manager_set_split_display() completely and stop calling the set_split_display() KMS callback. Also remove the msm_dsi::external_bridge field which was only used by the mentioned function. Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar --- drivers/gpu/drm/msm/dsi/dsi.h | 5 ---- drivers/gpu/drm/msm/dsi/dsi_manager.c | 35 --------------------------- 2 files changed, 40 deletions(-) diff --git a/drivers/gpu/drm/msm/dsi/dsi.h b/drivers/gpu/drm/msm/dsi/dsi.h index b7edcb7b3ddc..525c7ba22227 100644 --- a/drivers/gpu/drm/msm/dsi/dsi.h +++ b/drivers/gpu/drm/msm/dsi/dsi.h @@ -38,11 +38,6 @@ struct msm_dsi { struct mipi_dsi_host *host; struct msm_dsi_phy *phy; - /* - * external_bridge connected to dsi bridge output - */ - struct drm_bridge *external_bridge; - struct device *phy_dev; bool phy_enabled; diff --git a/drivers/gpu/drm/msm/dsi/dsi_manager.c b/drivers/gpu/drm/msm/dsi/dsi_manager.c index af840a1e9fc0..8eb73287dffb 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_manager.c +++ b/drivers/gpu/drm/msm/dsi/dsi_manager.c @@ -198,36 +198,6 @@ static int dsi_mgr_bridge_get_id(struct drm_bridge *bridge) return dsi_bridge->id; } -static void msm_dsi_manager_set_split_display(u8 id) -{ - struct msm_dsi *msm_dsi = dsi_mgr_get_dsi(id); - struct msm_dsi *other_dsi = dsi_mgr_get_other_dsi(id); - struct msm_drm_private *priv = msm_dsi->dev->dev_private; - struct msm_kms *kms = priv->kms; - struct msm_dsi *master_dsi, *slave_dsi; - - if (IS_BONDED_DSI() && !IS_MASTER_DSI_LINK(id)) { - master_dsi = other_dsi; - slave_dsi = msm_dsi; - } else { - master_dsi = msm_dsi; - slave_dsi = other_dsi; - } - - if (!msm_dsi->external_bridge || !IS_BONDED_DSI()) - return; - - /* - * Set split display info to kms once bonded DSI panel is connected to - * both hosts. - */ - if (other_dsi && other_dsi->external_bridge && kms->funcs->set_split_display) { - kms->funcs->set_split_display(kms, master_dsi->encoder, - slave_dsi->encoder, - msm_dsi_is_cmd_mode(msm_dsi)); - } -} - static int dsi_mgr_bridge_power_on(struct drm_bridge *bridge) { int id = dsi_mgr_bridge_get_id(bridge); @@ -504,8 +474,6 @@ int msm_dsi_manager_ext_bridge_init(u8 id, struct drm_bridge *int_bridge) if (IS_ERR(ext_bridge)) return PTR_ERR(ext_bridge); - msm_dsi->external_bridge = ext_bridge; - encoder = msm_dsi->encoder; /* @@ -538,9 +506,6 @@ int msm_dsi_manager_ext_bridge_init(u8 id, struct drm_bridge *int_bridge) return ret; } - /* The pipeline is ready, ping encoders if necessary */ - msm_dsi_manager_set_split_display(id); - return 0; } From patchwork Mon Oct 9 20:57:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 732111 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 584C8CD613A for ; Mon, 9 Oct 2023 20:57:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378034AbjJIU5g (ORCPT ); Mon, 9 Oct 2023 16:57:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40010 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378097AbjJIU5g (ORCPT ); Mon, 9 Oct 2023 16:57:36 -0400 Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 32725A3 for ; Mon, 9 Oct 2023 13:57:34 -0700 (PDT) Received: by mail-lf1-x136.google.com with SMTP id 2adb3069b0e04-50435ad51bbso5977361e87.2 for ; Mon, 09 Oct 2023 13:57:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696885052; x=1697489852; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=7cxLmiRyrS5kt0J5ZzxaEvq9+FAU6cjTlCuQBf1xxyA=; b=fbgfeB3JolgQkJuQ/AoQ1AZY72hdTk79+zw0gdv2o2sgRPyCpR5ml+X91zGwjqKTU6 QJIxy2GFJynGBoqErubIwOptE9SmRGekKgEf/mamsd5hFZan7HkV/caRGBLiomvJ30eb TjomayEiPdYY3M7YKkCaWUWUNAJ/jBuxYDGWAjxQhdG2OdXTxl69N9GluZHFS7UzOKCh HUxcy8xnsCgBGskLn3mxK0FAYdWKjONLaT2Dc4eeLCJtR2277nFPKCJhTjHU4E8YB/e3 /HPQ1waHf5SplzI0ZINzjpy55jblpjbZAWP5NqKR61Yea8Dm1iDB+5XGVRI6hlUNOQj4 aHaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696885052; x=1697489852; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7cxLmiRyrS5kt0J5ZzxaEvq9+FAU6cjTlCuQBf1xxyA=; b=pANj6qbRYtRMnFZuJDQCagJ7EfdRlJE+PKvXggp2g32jkiAX7hWQSR3LuvCeH2Dy8w 4jtYqpCHtlMzOEXnPKllGSWsp7YYHmV7ADgrHumCSXf1+B+7Z3xZgp/fnoglUG0VTnuv b3Xq83k4Ffg+LPEZ4cTRDj/8QQe8jCJ0nIjYCv7KWmMONI6T6aWBk2L/oMMnn4vfNcqx VREghwH5HIhNth1sMXq9IZDbCeF71R4GiY25Nkk2mrBaeMNkkpJydl5oR3woBXeo4N04 q4bC03TC6AlXlS9144upR27R98zlsFQeLrmJpKyKngBn9tZwIWa2GiFJK8VK50Chb1GS ydKg== X-Gm-Message-State: AOJu0Yx4xyij5SA89AbiMd6qL24U4FjtvBFNFiWZ9jiMOmuNwBdZvqpX jEkznDDSIjdTMBFhBBkGETA5DW+izxmwMkppd70= X-Google-Smtp-Source: AGHT+IFJ0l95lvmXQn6PFCYDow3HNy1sWNmEoh9lJjjaVhxV6tR3ePILoLD2bJjoLJgZj8uok8/bAA== X-Received: by 2002:a05:6512:3095:b0:503:2a53:7480 with SMTP id z21-20020a056512309500b005032a537480mr16398675lfd.49.1696885052428; Mon, 09 Oct 2023 13:57:32 -0700 (PDT) Received: from umbar.unikie.fi ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id f5-20020ac251a5000000b0050300e013f3sm1540844lfk.254.2023.10.09.13.57.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 13:57:31 -0700 (PDT) From: Dmitry Baryshkov To: Rob Clark , Sean Paul , Abhinav Kumar , Marijn Suijten Cc: Stephen Boyd , David Airlie , Daniel Vetter , Bjorn Andersson , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org Subject: [PATCH 4/5] drm/msm/dsi: remove msm_dsi::encoder Date: Mon, 9 Oct 2023 23:57:26 +0300 Message-Id: <20231009205727.2781802-5-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231009205727.2781802-1-dmitry.baryshkov@linaro.org> References: <20231009205727.2781802-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org There is no need anymore to stop the drm_encoder instance in struct msm_dsi. Remove corresponding field. Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar --- drivers/gpu/drm/msm/dsi/dsi.c | 4 +--- drivers/gpu/drm/msm/dsi/dsi.h | 6 ++---- drivers/gpu/drm/msm/dsi/dsi_manager.c | 8 +++----- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/msm/dsi/dsi.c b/drivers/gpu/drm/msm/dsi/dsi.c index c6d53cccb9ae..33c3437b09de 100644 --- a/drivers/gpu/drm/msm/dsi/dsi.c +++ b/drivers/gpu/drm/msm/dsi/dsi.c @@ -235,9 +235,7 @@ int msm_dsi_modeset_init(struct msm_dsi *msm_dsi, struct drm_device *dev, return 0; } - msm_dsi->encoder = encoder; - - bridge = msm_dsi_manager_bridge_init(msm_dsi); + bridge = msm_dsi_manager_bridge_init(msm_dsi, encoder); if (IS_ERR(bridge)) { ret = PTR_ERR(bridge); DRM_DEV_ERROR(dev->dev, "failed to create dsi bridge: %d\n", ret); diff --git a/drivers/gpu/drm/msm/dsi/dsi.h b/drivers/gpu/drm/msm/dsi/dsi.h index 525c7ba22227..d3380326d449 100644 --- a/drivers/gpu/drm/msm/dsi/dsi.h +++ b/drivers/gpu/drm/msm/dsi/dsi.h @@ -41,14 +41,12 @@ struct msm_dsi { struct device *phy_dev; bool phy_enabled; - /* the encoder we are hooked to (outside of dsi block) */ - struct drm_encoder *encoder; - int id; }; /* dsi manager */ -struct drm_bridge *msm_dsi_manager_bridge_init(struct msm_dsi *msm_dsi); +struct drm_bridge *msm_dsi_manager_bridge_init(struct msm_dsi *msm_dsi, + struct drm_encoder *encoder); int msm_dsi_manager_ext_bridge_init(u8 id, struct drm_bridge *int_bridge); int msm_dsi_manager_cmd_xfer(int id, const struct mipi_dsi_msg *msg); bool msm_dsi_manager_cmd_xfer_trigger(int id, u32 dma_base, u32 len); diff --git a/drivers/gpu/drm/msm/dsi/dsi_manager.c b/drivers/gpu/drm/msm/dsi/dsi_manager.c index 8eb73287dffb..101e79a6e281 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_manager.c +++ b/drivers/gpu/drm/msm/dsi/dsi_manager.c @@ -431,11 +431,11 @@ static const struct drm_bridge_funcs dsi_mgr_bridge_funcs = { }; /* initialize bridge */ -struct drm_bridge *msm_dsi_manager_bridge_init(struct msm_dsi *msm_dsi) +struct drm_bridge *msm_dsi_manager_bridge_init(struct msm_dsi *msm_dsi, + struct drm_encoder *encoder) { struct drm_bridge *bridge; struct dsi_bridge *dsi_bridge; - struct drm_encoder *encoder; int ret; dsi_bridge = devm_kzalloc(msm_dsi->dev->dev, @@ -445,8 +445,6 @@ struct drm_bridge *msm_dsi_manager_bridge_init(struct msm_dsi *msm_dsi) dsi_bridge->id = msm_dsi->id; - encoder = msm_dsi->encoder; - bridge = &dsi_bridge->base; bridge->funcs = &dsi_mgr_bridge_funcs; @@ -474,7 +472,7 @@ int msm_dsi_manager_ext_bridge_init(u8 id, struct drm_bridge *int_bridge) if (IS_ERR(ext_bridge)) return PTR_ERR(ext_bridge); - encoder = msm_dsi->encoder; + encoder = int_bridge->encoder; /* * Try first to create the bridge without it creating its own From patchwork Mon Oct 9 20:57:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 731055 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 321E0CD612F for ; Mon, 9 Oct 2023 20:57:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378102AbjJIU5i (ORCPT ); Mon, 9 Oct 2023 16:57:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40024 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378097AbjJIU5h (ORCPT ); Mon, 9 Oct 2023 16:57:37 -0400 Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 184F292 for ; Mon, 9 Oct 2023 13:57:35 -0700 (PDT) Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-5041bb9ce51so6240857e87.1 for ; Mon, 09 Oct 2023 13:57:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696885053; x=1697489853; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ArTNHECreYuQA115CCTpUIP9lX7NmDsLaxdoYp/EqZs=; b=VWqUM2KZd1ro0RcTCDIjWaF+e7XTJMFTIWuvdDAqtjeGitiN7QpYBzMq5bQR/aTr5a uMJdmCajpSGim467s2DHSiGfCCY184cbCsTR6LLjTxIjpJxP43Zpfn+89lFnrG0q3MgI ZJEieBTisL4XudIIXvDY8khSiA4jMVthpxS6piKeyqXqe9zc7ba7al6dwujy5WFlsZdP 9E1JxfQZCWuFZcUCBX89CxjT59Hr1jP9sjmvfTZN+GnAucLZPgoj8MZaBK2OE/bTMeAE AleFSpMzJTLX6nc2yd15rUf9Gbb8+Iz84de/tMeoXI2uoaHvPabXN3eLYKm6iILXTjGP 0Ilw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696885053; x=1697489853; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ArTNHECreYuQA115CCTpUIP9lX7NmDsLaxdoYp/EqZs=; b=jNnyZA3zkxRZOe1qA4GDRm7lPXgrO+Pnw2qYiE1NmRWtBe8NIn6U0hQsrxOTS9SbSP q+hyhamEb57/sqErViTL/CO80XUgAtKvujZqCVbZwDKn8Fkr94TGA46ePvQ0/EEH2jIr oe11/rB9lAZd3UQQN3pJGFb16uEgb4aEdKh0t2d209mVcqYPQi6uX+X4Ba8+8+PpFQ9+ fwp4F9qmwpdJBbIMHWvE/Ak2ZxEndug/uQMk25mcHelw00QR4khIRDDqbkEKAbxWXz6M k/TWn5lePOAN/gGvJ0R4Pi3cAmU4Oe4oHM7QhyS+MwrIli7GujiJQLgjTQSBJNCST/sE 3tlw== X-Gm-Message-State: AOJu0YzrSUsj3cGGRasbn/HWBLmn/zc3go289WgdALwZNOGfJXJNSwEW sVGjA/be7x7siLqZ4rNA1zTDTg== X-Google-Smtp-Source: AGHT+IFtjkuBxGl/3Nes/WDrdrp39PAnSs0zIGl0jOFF7dz7VMinE6ZC8w+igb8Uj57ZYYH5paVm0g== X-Received: by 2002:a19:f015:0:b0:503:3654:37bd with SMTP id p21-20020a19f015000000b00503365437bdmr12804812lfc.45.1696885053426; Mon, 09 Oct 2023 13:57:33 -0700 (PDT) Received: from umbar.unikie.fi ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id f5-20020ac251a5000000b0050300e013f3sm1540844lfk.254.2023.10.09.13.57.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 13:57:32 -0700 (PDT) From: Dmitry Baryshkov To: Rob Clark , Sean Paul , Abhinav Kumar , Marijn Suijten Cc: Stephen Boyd , David Airlie , Daniel Vetter , Bjorn Andersson , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org Subject: [PATCH 5/5] drm/msm/mdp5: drop split display support Date: Mon, 9 Oct 2023 23:57:27 +0300 Message-Id: <20231009205727.2781802-6-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231009205727.2781802-1-dmitry.baryshkov@linaro.org> References: <20231009205727.2781802-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org The MSM DSI driver has dropped support for calling mdp_kms_funcs::set_split_display() callback. Drop corresponding callback from the mdp5 driver together with the rest of the infrastructure. Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar --- .../gpu/drm/msm/disp/mdp5/mdp5_cmd_encoder.c | 42 ------------------- drivers/gpu/drm/msm/disp/mdp5/mdp5_encoder.c | 42 ------------------- drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c | 14 ------- drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.h | 9 ---- drivers/gpu/drm/msm/msm_kms.h | 4 -- 5 files changed, 111 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_cmd_encoder.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_cmd_encoder.c index a640af22eafc..e5662412db9b 100644 --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_cmd_encoder.c +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_cmd_encoder.c @@ -158,46 +158,4 @@ void mdp5_cmd_encoder_enable(struct drm_encoder *encoder) mdp5_cmd_enc->enabled = true; } - -int mdp5_cmd_encoder_set_split_display(struct drm_encoder *encoder, - struct drm_encoder *slave_encoder) -{ - struct mdp5_encoder *mdp5_cmd_enc = to_mdp5_encoder(encoder); - struct mdp5_kms *mdp5_kms; - struct device *dev; - int intf_num; - u32 data = 0; - - if (!encoder || !slave_encoder) - return -EINVAL; - - mdp5_kms = get_kms(encoder); - intf_num = mdp5_cmd_enc->intf->num; - - /* Switch slave encoder's trigger MUX, to use the master's - * start signal for the slave encoder - */ - if (intf_num == 1) - data |= MDP5_SPLIT_DPL_UPPER_INTF2_SW_TRG_MUX; - else if (intf_num == 2) - data |= MDP5_SPLIT_DPL_UPPER_INTF1_SW_TRG_MUX; - else - return -EINVAL; - - /* Smart Panel, Sync mode */ - data |= MDP5_SPLIT_DPL_UPPER_SMART_PANEL; - - dev = &mdp5_kms->pdev->dev; - - /* Make sure clocks are on when connectors calling this function. */ - pm_runtime_get_sync(dev); - mdp5_write(mdp5_kms, REG_MDP5_SPLIT_DPL_UPPER, data); - - mdp5_write(mdp5_kms, REG_MDP5_SPLIT_DPL_LOWER, - MDP5_SPLIT_DPL_LOWER_SMART_PANEL); - mdp5_write(mdp5_kms, REG_MDP5_SPLIT_DPL_EN, 1); - pm_runtime_put_sync(dev); - - return 0; -} #endif /* CONFIG_DRM_MSM_DSI */ diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_encoder.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_encoder.c index 79d67c495780..7c2092ca4040 100644 --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_encoder.c +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_encoder.c @@ -274,48 +274,6 @@ u32 mdp5_encoder_get_framecount(struct drm_encoder *encoder) return mdp5_read(mdp5_kms, REG_MDP5_INTF_FRAME_COUNT(intf)); } -int mdp5_vid_encoder_set_split_display(struct drm_encoder *encoder, - struct drm_encoder *slave_encoder) -{ - struct mdp5_encoder *mdp5_encoder = to_mdp5_encoder(encoder); - struct mdp5_encoder *mdp5_slave_enc = to_mdp5_encoder(slave_encoder); - struct mdp5_kms *mdp5_kms; - struct device *dev; - int intf_num; - u32 data = 0; - - if (!encoder || !slave_encoder) - return -EINVAL; - - mdp5_kms = get_kms(encoder); - intf_num = mdp5_encoder->intf->num; - - /* Switch slave encoder's TimingGen Sync mode, - * to use the master's enable signal for the slave encoder. - */ - if (intf_num == 1) - data |= MDP5_SPLIT_DPL_LOWER_INTF2_TG_SYNC; - else if (intf_num == 2) - data |= MDP5_SPLIT_DPL_LOWER_INTF1_TG_SYNC; - else - return -EINVAL; - - dev = &mdp5_kms->pdev->dev; - /* Make sure clocks are on when connectors calling this function. */ - pm_runtime_get_sync(dev); - - /* Dumb Panel, Sync mode */ - mdp5_write(mdp5_kms, REG_MDP5_SPLIT_DPL_UPPER, 0); - mdp5_write(mdp5_kms, REG_MDP5_SPLIT_DPL_LOWER, data); - mdp5_write(mdp5_kms, REG_MDP5_SPLIT_DPL_EN, 1); - - mdp5_ctl_pair(mdp5_encoder->ctl, mdp5_slave_enc->ctl, true); - - pm_runtime_put_sync(dev); - - return 0; -} - void mdp5_encoder_set_intf_mode(struct drm_encoder *encoder, bool cmd_mode) { struct mdp5_encoder *mdp5_encoder = to_mdp5_encoder(encoder); diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c index 11d9fc2c6bf5..22f2d2ec4a9c 100644 --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c @@ -190,19 +190,6 @@ static void mdp5_complete_commit(struct msm_kms *kms, unsigned crtc_mask) mdp5_smp_complete_commit(mdp5_kms->smp, &global_state->smp); } -static int mdp5_set_split_display(struct msm_kms *kms, - struct drm_encoder *encoder, - struct drm_encoder *slave_encoder, - bool is_cmd_mode) -{ - if (is_cmd_mode) - return mdp5_cmd_encoder_set_split_display(encoder, - slave_encoder); - else - return mdp5_vid_encoder_set_split_display(encoder, - slave_encoder); -} - static void mdp5_destroy(struct mdp5_kms *mdp5_kms); static void mdp5_kms_destroy(struct msm_kms *kms) @@ -275,7 +262,6 @@ static const struct mdp_kms_funcs kms_funcs = { .wait_flush = mdp5_wait_flush, .complete_commit = mdp5_complete_commit, .get_format = mdp_get_format, - .set_split_display = mdp5_set_split_display, .destroy = mdp5_kms_destroy, #ifdef CONFIG_DEBUG_FS .debugfs_init = mdp5_kms_debugfs_init, diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.h b/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.h index 29bf11f08601..ee68e9913f8c 100644 --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.h +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.h @@ -291,8 +291,6 @@ struct drm_crtc *mdp5_crtc_init(struct drm_device *dev, struct drm_encoder *mdp5_encoder_init(struct drm_device *dev, struct mdp5_interface *intf, struct mdp5_ctl *ctl); -int mdp5_vid_encoder_set_split_display(struct drm_encoder *encoder, - struct drm_encoder *slave_encoder); void mdp5_encoder_set_intf_mode(struct drm_encoder *encoder, bool cmd_mode); int mdp5_encoder_get_linecount(struct drm_encoder *encoder); u32 mdp5_encoder_get_framecount(struct drm_encoder *encoder); @@ -303,8 +301,6 @@ void mdp5_cmd_encoder_mode_set(struct drm_encoder *encoder, struct drm_display_mode *adjusted_mode); void mdp5_cmd_encoder_disable(struct drm_encoder *encoder); void mdp5_cmd_encoder_enable(struct drm_encoder *encoder); -int mdp5_cmd_encoder_set_split_display(struct drm_encoder *encoder, - struct drm_encoder *slave_encoder); #else static inline void mdp5_cmd_encoder_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode, @@ -317,11 +313,6 @@ static inline void mdp5_cmd_encoder_disable(struct drm_encoder *encoder) static inline void mdp5_cmd_encoder_enable(struct drm_encoder *encoder) { } -static inline int mdp5_cmd_encoder_set_split_display( - struct drm_encoder *encoder, struct drm_encoder *slave_encoder) -{ - return -EINVAL; -} #endif #endif /* __MDP5_KMS_H__ */ diff --git a/drivers/gpu/drm/msm/msm_kms.h b/drivers/gpu/drm/msm/msm_kms.h index 44aa435d68ce..0641f6111b93 100644 --- a/drivers/gpu/drm/msm/msm_kms.h +++ b/drivers/gpu/drm/msm/msm_kms.h @@ -105,10 +105,6 @@ struct msm_kms_funcs { /* misc: */ long (*round_pixclk)(struct msm_kms *kms, unsigned long rate, struct drm_encoder *encoder); - int (*set_split_display)(struct msm_kms *kms, - struct drm_encoder *encoder, - struct drm_encoder *slave_encoder, - bool is_cmd_mode); /* cleanup: */ void (*destroy)(struct msm_kms *kms);