From patchwork Fri Jul 9 23:50:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 471925 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E76F9C07E99 for ; Fri, 9 Jul 2021 23:50:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CE791613C2 for ; Fri, 9 Jul 2021 23:50:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230428AbhGIXxO (ORCPT ); Fri, 9 Jul 2021 19:53:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45122 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229854AbhGIXxN (ORCPT ); Fri, 9 Jul 2021 19:53:13 -0400 Received: from mail-lj1-x236.google.com (mail-lj1-x236.google.com [IPv6:2a00:1450:4864:20::236]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BB993C0613DD for ; Fri, 9 Jul 2021 16:50:28 -0700 (PDT) Received: by mail-lj1-x236.google.com with SMTP id q184so10141036ljq.0 for ; Fri, 09 Jul 2021 16:50:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=TzUyhCi0R9uqdugmQmGJSfrz95P/95y35wz07MzJkZY=; b=b9Jmhplj6Aq7waENEpcluhQUWgVrVB3Ibkkv6VeW5ZqBL6KBzDj5jmUCrKuUD0b8FY tqabC6bGlHDNa/cBd1k5ZB4tsc/mIUSK+jShNNpwjs55xA284CwYUQcqK6olSOmxxd9/ IiNpz/1TRfQn5ta3Q0SWjXsNgQLgmex/w+NHXN9PRjLDVh3DnNG/Hg+BNgicftpJvazo 0ZASTXAyk4txPQfnjaVbQFTf+XSW6PQX6wSxb6tt5exuNN2sH4higQxrCUcXrk8C5Q+5 Vv2mXWjeN90gJqmnWVW+qq9tA3Ey55+R1zdwlGuqY8dumrQAsn0rk5tPnA8GvqAQs0C0 loTA== 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=TzUyhCi0R9uqdugmQmGJSfrz95P/95y35wz07MzJkZY=; b=FAZ7z3Nttua9w/mJhIS4QI6qRGUjoTkyDWZS63aKMtf7ZIt4+ySFnpMzbcQRSOkvK7 bkqE9byQMRx0vDQ7e/NigUK0mhnNVp3Jbjmj15LQR64vxsAUnOIQKprAeqJ9lUM/V3Le SH2VAFGArTRjH4a7XELnKT5vBQD4ELt+Ymhf6tVaIYrAGnKef+S4sYtP19f/HZ20Bcbn PqMn+otocnSPu/WiIUL8r+ZwvaV9G1Lyvzh3QUYTtOvUXUi62wTJNWR0U2dC0VYqeRfx jZZZhY2tjFf66rmVt3/qKEMmQa+1jZhoqDMkNYgRTC2F0oGUOp5d/6auLZ7UXuhAbd5k cbrQ== X-Gm-Message-State: AOAM530beamK91H0uj7jC1irGy7+7OU1abi5VAt12m3B8Wg5QOPUsW28 5ZzYOjcD0b5213mwe1gYGdH1ew== X-Google-Smtp-Source: ABdhPJzYDeJkpX86xRIGj+NQR2ZS/mCDMDQ1yWjAnJzw17IK3hkFm/kAU4CWUZyZ+PmcQHHDLNhhEQ== X-Received: by 2002:a2e:9c19:: with SMTP id s25mr32152198lji.478.1625874626801; Fri, 09 Jul 2021 16:50:26 -0700 (PDT) Received: from eriador.lan ([37.153.55.125]) by smtp.gmail.com with ESMTPSA id v10sm718964ljp.20.2021.07.09.16.50.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Jul 2021 16:50:26 -0700 (PDT) From: Dmitry Baryshkov To: Bjorn Andersson , Rob Clark , Sean Paul , Abhinav Kumar Cc: Jonathan Marek , Stephen Boyd , David Airlie , Daniel Vetter , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org Subject: [PATCH v2 1/7] drm/msm/dsi: rename dual DSI to bonded DSI Date: Sat, 10 Jul 2021 02:50:18 +0300 Message-Id: <20210709235024.1077888-2-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210709235024.1077888-1-dmitry.baryshkov@linaro.org> References: <20210709235024.1077888-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org We are preparing to support two independent DSI hosts in the DSI/DPU code. To remove possible confusion (as both configurations can be referenced as dual DSI) let's rename old "dual DSI" (two DSI hosts driving single device, with clocks being locked) to "bonded DSI". Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar --- drivers/gpu/drm/msm/dsi/dsi.h | 8 ++-- drivers/gpu/drm/msm/dsi/dsi_cfg.h | 2 +- drivers/gpu/drm/msm/dsi/dsi_host.c | 30 ++++++------ drivers/gpu/drm/msm/dsi/dsi_manager.c | 69 +++++++++++++-------------- 4 files changed, 54 insertions(+), 55 deletions(-) diff --git a/drivers/gpu/drm/msm/dsi/dsi.h b/drivers/gpu/drm/msm/dsi/dsi.h index 9b8e9b07eced..856a532850c0 100644 --- a/drivers/gpu/drm/msm/dsi/dsi.h +++ b/drivers/gpu/drm/msm/dsi/dsi.h @@ -109,7 +109,7 @@ int msm_dsi_host_enable(struct mipi_dsi_host *host); int msm_dsi_host_disable(struct mipi_dsi_host *host); int msm_dsi_host_power_on(struct mipi_dsi_host *host, struct msm_dsi_phy_shared_timings *phy_shared_timings, - bool is_dual_dsi); + bool is_bonded_dsi); int msm_dsi_host_power_off(struct mipi_dsi_host *host); int msm_dsi_host_set_display_mode(struct mipi_dsi_host *host, const struct drm_display_mode *mode); @@ -123,7 +123,7 @@ int msm_dsi_host_set_src_pll(struct mipi_dsi_host *host, void msm_dsi_host_reset_phy(struct mipi_dsi_host *host); void msm_dsi_host_get_phy_clk_req(struct mipi_dsi_host *host, struct msm_dsi_phy_clk_request *clk_req, - bool is_dual_dsi); + bool is_bonded_dsi); void msm_dsi_host_destroy(struct mipi_dsi_host *host); int msm_dsi_host_modeset_init(struct mipi_dsi_host *host, struct drm_device *dev); @@ -145,8 +145,8 @@ int dsi_dma_base_get_6g(struct msm_dsi_host *msm_host, uint64_t *iova); int dsi_dma_base_get_v2(struct msm_dsi_host *msm_host, uint64_t *iova); int dsi_clk_init_v2(struct msm_dsi_host *msm_host); int dsi_clk_init_6g_v2(struct msm_dsi_host *msm_host); -int dsi_calc_clk_rate_v2(struct msm_dsi_host *msm_host, bool is_dual_dsi); -int dsi_calc_clk_rate_6g(struct msm_dsi_host *msm_host, bool is_dual_dsi); +int dsi_calc_clk_rate_v2(struct msm_dsi_host *msm_host, bool is_bonded_dsi); +int dsi_calc_clk_rate_6g(struct msm_dsi_host *msm_host, bool is_bonded_dsi); void msm_dsi_host_snapshot(struct msm_disp_state *disp_state, struct mipi_dsi_host *host); /* dsi phy */ struct msm_dsi_phy; diff --git a/drivers/gpu/drm/msm/dsi/dsi_cfg.h b/drivers/gpu/drm/msm/dsi/dsi_cfg.h index ade9b609c7d9..2bce00d5a9fc 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_cfg.h +++ b/drivers/gpu/drm/msm/dsi/dsi_cfg.h @@ -47,7 +47,7 @@ struct msm_dsi_host_cfg_ops { void* (*tx_buf_get)(struct msm_dsi_host *msm_host); void (*tx_buf_put)(struct msm_dsi_host *msm_host); int (*dma_base_get)(struct msm_dsi_host *msm_host, uint64_t *iova); - int (*calc_clk_rate)(struct msm_dsi_host *msm_host, bool is_dual_dsi); + int (*calc_clk_rate)(struct msm_dsi_host *msm_host, bool is_bonded_dsi); }; struct msm_dsi_cfg_handler { diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c index ed504fe5074f..eb988faddbbf 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_host.c +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c @@ -679,7 +679,7 @@ void dsi_link_clk_disable_v2(struct msm_dsi_host *msm_host) clk_disable_unprepare(msm_host->byte_clk); } -static u32 dsi_get_pclk_rate(struct msm_dsi_host *msm_host, bool is_dual_dsi) +static u32 dsi_get_pclk_rate(struct msm_dsi_host *msm_host, bool is_bonded_dsi) { struct drm_display_mode *mode = msm_host->mode; u32 pclk_rate; @@ -692,17 +692,17 @@ static u32 dsi_get_pclk_rate(struct msm_dsi_host *msm_host, bool is_dual_dsi) * the clock rates have to be split between the two dsi controllers. * Adjust the byte and pixel clock rates for each dsi host accordingly. */ - if (is_dual_dsi) + if (is_bonded_dsi) pclk_rate /= 2; return pclk_rate; } -static void dsi_calc_pclk(struct msm_dsi_host *msm_host, bool is_dual_dsi) +static void dsi_calc_pclk(struct msm_dsi_host *msm_host, bool is_bonded_dsi) { u8 lanes = msm_host->lanes; u32 bpp = dsi_get_bpp(msm_host->format); - u32 pclk_rate = dsi_get_pclk_rate(msm_host, is_dual_dsi); + u32 pclk_rate = dsi_get_pclk_rate(msm_host, is_bonded_dsi); u64 pclk_bpp = (u64)pclk_rate * bpp; if (lanes == 0) { @@ -720,28 +720,28 @@ static void dsi_calc_pclk(struct msm_dsi_host *msm_host, bool is_dual_dsi) } -int dsi_calc_clk_rate_6g(struct msm_dsi_host *msm_host, bool is_dual_dsi) +int dsi_calc_clk_rate_6g(struct msm_dsi_host *msm_host, bool is_bonded_dsi) { if (!msm_host->mode) { pr_err("%s: mode not set\n", __func__); return -EINVAL; } - dsi_calc_pclk(msm_host, is_dual_dsi); + dsi_calc_pclk(msm_host, is_bonded_dsi); msm_host->esc_clk_rate = clk_get_rate(msm_host->esc_clk); return 0; } -int dsi_calc_clk_rate_v2(struct msm_dsi_host *msm_host, bool is_dual_dsi) +int dsi_calc_clk_rate_v2(struct msm_dsi_host *msm_host, bool is_bonded_dsi) { u32 bpp = dsi_get_bpp(msm_host->format); u64 pclk_bpp; unsigned int esc_mhz, esc_div; unsigned long byte_mhz; - dsi_calc_pclk(msm_host, is_dual_dsi); + dsi_calc_pclk(msm_host, is_bonded_dsi); - pclk_bpp = (u64)dsi_get_pclk_rate(msm_host, is_dual_dsi) * bpp; + pclk_bpp = (u64)dsi_get_pclk_rate(msm_host, is_bonded_dsi) * bpp; do_div(pclk_bpp, 8); msm_host->src_clk_rate = pclk_bpp; @@ -938,7 +938,7 @@ static void dsi_ctrl_config(struct msm_dsi_host *msm_host, bool enable, dsi_write(msm_host, REG_DSI_CTRL, data); } -static void dsi_timing_setup(struct msm_dsi_host *msm_host, bool is_dual_dsi) +static void dsi_timing_setup(struct msm_dsi_host *msm_host, bool is_bonded_dsi) { struct drm_display_mode *mode = msm_host->mode; u32 hs_start = 0, vs_start = 0; /* take sync start as 0 */ @@ -962,7 +962,7 @@ static void dsi_timing_setup(struct msm_dsi_host *msm_host, bool is_dual_dsi) * timings have to be split between the two dsi controllers. * Adjust the DSI host timing values accordingly. */ - if (is_dual_dsi) { + if (is_bonded_dsi) { h_total /= 2; hs_end /= 2; ha_start /= 2; @@ -2285,13 +2285,13 @@ void msm_dsi_host_reset_phy(struct mipi_dsi_host *host) void msm_dsi_host_get_phy_clk_req(struct mipi_dsi_host *host, struct msm_dsi_phy_clk_request *clk_req, - bool is_dual_dsi) + bool is_bonded_dsi) { struct msm_dsi_host *msm_host = to_msm_dsi_host(host); const struct msm_dsi_cfg_handler *cfg_hnd = msm_host->cfg_hnd; int ret; - ret = cfg_hnd->ops->calc_clk_rate(msm_host, is_dual_dsi); + ret = cfg_hnd->ops->calc_clk_rate(msm_host, is_bonded_dsi); if (ret) { pr_err("%s: unable to calc clk rate, %d\n", __func__, ret); return; @@ -2354,7 +2354,7 @@ static void msm_dsi_sfpb_config(struct msm_dsi_host *msm_host, bool enable) int msm_dsi_host_power_on(struct mipi_dsi_host *host, struct msm_dsi_phy_shared_timings *phy_shared_timings, - bool is_dual_dsi) + bool is_bonded_dsi) { struct msm_dsi_host *msm_host = to_msm_dsi_host(host); const struct msm_dsi_cfg_handler *cfg_hnd = msm_host->cfg_hnd; @@ -2392,7 +2392,7 @@ int msm_dsi_host_power_on(struct mipi_dsi_host *host, goto fail_disable_clk; } - dsi_timing_setup(msm_host, is_dual_dsi); + dsi_timing_setup(msm_host, is_bonded_dsi); dsi_sw_reset(msm_host); dsi_ctrl_config(msm_host, true, phy_shared_timings); diff --git a/drivers/gpu/drm/msm/dsi/dsi_manager.c b/drivers/gpu/drm/msm/dsi/dsi_manager.c index 4ebfedc4a9ac..1173663c6d5d 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_manager.c +++ b/drivers/gpu/drm/msm/dsi/dsi_manager.c @@ -21,14 +21,14 @@ struct msm_dsi_manager { struct msm_dsi *dsi[DSI_MAX]; - bool is_dual_dsi; + bool is_bonded_dsi; bool is_sync_needed; int master_dsi_link_id; }; static struct msm_dsi_manager msm_dsim_glb; -#define IS_DUAL_DSI() (msm_dsim_glb.is_dual_dsi) +#define IS_BONDED_DSI() (msm_dsim_glb.is_bonded_dsi) #define IS_SYNC_NEEDED() (msm_dsim_glb.is_sync_needed) #define IS_MASTER_DSI_LINK(id) (msm_dsim_glb.master_dsi_link_id == id) @@ -42,18 +42,17 @@ static inline struct msm_dsi *dsi_mgr_get_other_dsi(int id) return msm_dsim_glb.dsi[(id + 1) % DSI_MAX]; } -static int dsi_mgr_parse_dual_dsi(struct device_node *np, int id) +static int dsi_mgr_parse_of(struct device_node *np, int id) { struct msm_dsi_manager *msm_dsim = &msm_dsim_glb; /* We assume 2 dsi nodes have the same information of dual-dsi and * sync-mode, and only one node specifies master in case of dual mode. */ - if (!msm_dsim->is_dual_dsi) - msm_dsim->is_dual_dsi = of_property_read_bool( - np, "qcom,dual-dsi-mode"); + if (!msm_dsim->is_bonded_dsi) + msm_dsim->is_bonded_dsi = of_property_read_bool(np, "qcom,dual-dsi-mode"); - if (msm_dsim->is_dual_dsi) { + if (msm_dsim->is_bonded_dsi) { if (of_property_read_bool(np, "qcom,master-dsi")) msm_dsim->master_dsi_link_id = id; if (!msm_dsim->is_sync_needed) @@ -72,7 +71,7 @@ static int dsi_mgr_setup_components(int id) struct msm_dsi *clk_slave_dsi = dsi_mgr_get_dsi(DSI_CLOCK_SLAVE); int ret; - if (!IS_DUAL_DSI()) { + if (!IS_BONDED_DSI()) { ret = msm_dsi_host_register(msm_dsi->host, true); if (ret) return ret; @@ -119,9 +118,9 @@ static int enable_phy(struct msm_dsi *msm_dsi, { struct msm_dsi_phy_clk_request clk_req; int ret; - bool is_dual_dsi = IS_DUAL_DSI(); + bool is_bonded_dsi = IS_BONDED_DSI(); - msm_dsi_host_get_phy_clk_req(msm_dsi->host, &clk_req, is_dual_dsi); + msm_dsi_host_get_phy_clk_req(msm_dsi->host, &clk_req, is_bonded_dsi); ret = msm_dsi_phy_enable(msm_dsi->phy, &clk_req); msm_dsi_phy_get_shared_timings(msm_dsi->phy, shared_timings); @@ -143,7 +142,7 @@ dsi_mgr_phy_enable(int id, * will silently reset those PHY1 registers. Therefore we need to reset * and enable both PHYs before any PLL clock operation. */ - if (IS_DUAL_DSI() && mdsi && sdsi) { + if (IS_BONDED_DSI() && mdsi && sdsi) { if (!mdsi->phy_enabled && !sdsi->phy_enabled) { msm_dsi_host_reset_phy(mdsi->host); msm_dsi_host_reset_phy(sdsi->host); @@ -182,7 +181,7 @@ static void dsi_mgr_phy_disable(int id) * first controller only when the second controller is disabled. */ msm_dsi->phy_enabled = false; - if (IS_DUAL_DSI() && mdsi && sdsi) { + if (IS_BONDED_DSI() && mdsi && sdsi) { if (!mdsi->phy_enabled && !sdsi->phy_enabled) { msm_dsi_phy_disable(sdsi->phy); msm_dsi_phy_disable(mdsi->phy); @@ -244,7 +243,7 @@ static int msm_dsi_manager_panel_init(struct drm_connector *conn, u8 id) struct msm_dsi *master_dsi, *slave_dsi; struct drm_panel *panel; - if (IS_DUAL_DSI() && !IS_MASTER_DSI_LINK(id)) { + if (IS_BONDED_DSI() && !IS_MASTER_DSI_LINK(id)) { master_dsi = other_dsi; slave_dsi = msm_dsi; } else { @@ -264,7 +263,7 @@ static int msm_dsi_manager_panel_init(struct drm_connector *conn, u8 id) return PTR_ERR(panel); } - if (!panel || !IS_DUAL_DSI()) + if (!panel || !IS_BONDED_DSI()) goto out; drm_object_attach_property(&conn->base, @@ -366,7 +365,7 @@ static void dsi_mgr_bridge_pre_enable(struct drm_bridge *bridge) struct mipi_dsi_host *host = msm_dsi->host; struct drm_panel *panel = msm_dsi->panel; struct msm_dsi_phy_shared_timings phy_shared_timings[DSI_MAX]; - bool is_dual_dsi = IS_DUAL_DSI(); + bool is_bonded_dsi = IS_BONDED_DSI(); int ret; DBG("id=%d", id); @@ -374,22 +373,22 @@ static void dsi_mgr_bridge_pre_enable(struct drm_bridge *bridge) return; /* Do nothing with the host if it is slave-DSI in case of dual DSI */ - if (is_dual_dsi && !IS_MASTER_DSI_LINK(id)) + if (is_bonded_dsi && !IS_MASTER_DSI_LINK(id)) return; ret = dsi_mgr_phy_enable(id, phy_shared_timings); if (ret) goto phy_en_fail; - ret = msm_dsi_host_power_on(host, &phy_shared_timings[id], is_dual_dsi); + ret = msm_dsi_host_power_on(host, &phy_shared_timings[id], is_bonded_dsi); if (ret) { pr_err("%s: power on host %d failed, %d\n", __func__, id, ret); goto host_on_fail; } - if (is_dual_dsi && msm_dsi1) { + if (is_bonded_dsi && msm_dsi1) { ret = msm_dsi_host_power_on(msm_dsi1->host, - &phy_shared_timings[DSI_1], is_dual_dsi); + &phy_shared_timings[DSI_1], is_bonded_dsi); if (ret) { pr_err("%s: power on host1 failed, %d\n", __func__, ret); @@ -415,7 +414,7 @@ static void dsi_mgr_bridge_pre_enable(struct drm_bridge *bridge) goto host_en_fail; } - if (is_dual_dsi && msm_dsi1) { + if (is_bonded_dsi && msm_dsi1) { ret = msm_dsi_host_enable(msm_dsi1->host); if (ret) { pr_err("%s: enable host1 failed, %d\n", __func__, ret); @@ -431,7 +430,7 @@ static void dsi_mgr_bridge_pre_enable(struct drm_bridge *bridge) if (panel) drm_panel_unprepare(panel); panel_prep_fail: - if (is_dual_dsi && msm_dsi1) + if (is_bonded_dsi && msm_dsi1) msm_dsi_host_power_off(msm_dsi1->host); host1_on_fail: msm_dsi_host_power_off(host); @@ -446,7 +445,7 @@ static void dsi_mgr_bridge_enable(struct drm_bridge *bridge) int id = dsi_mgr_bridge_get_id(bridge); struct msm_dsi *msm_dsi = dsi_mgr_get_dsi(id); struct drm_panel *panel = msm_dsi->panel; - bool is_dual_dsi = IS_DUAL_DSI(); + bool is_bonded_dsi = IS_BONDED_DSI(); int ret; DBG("id=%d", id); @@ -454,7 +453,7 @@ static void dsi_mgr_bridge_enable(struct drm_bridge *bridge) return; /* Do nothing with the host if it is slave-DSI in case of dual DSI */ - if (is_dual_dsi && !IS_MASTER_DSI_LINK(id)) + if (is_bonded_dsi && !IS_MASTER_DSI_LINK(id)) return; if (panel) { @@ -471,7 +470,7 @@ static void dsi_mgr_bridge_disable(struct drm_bridge *bridge) int id = dsi_mgr_bridge_get_id(bridge); struct msm_dsi *msm_dsi = dsi_mgr_get_dsi(id); struct drm_panel *panel = msm_dsi->panel; - bool is_dual_dsi = IS_DUAL_DSI(); + bool is_bonded_dsi = IS_BONDED_DSI(); int ret; DBG("id=%d", id); @@ -479,7 +478,7 @@ static void dsi_mgr_bridge_disable(struct drm_bridge *bridge) return; /* Do nothing with the host if it is slave-DSI in case of dual DSI */ - if (is_dual_dsi && !IS_MASTER_DSI_LINK(id)) + if (is_bonded_dsi && !IS_MASTER_DSI_LINK(id)) return; if (panel) { @@ -497,7 +496,7 @@ static void dsi_mgr_bridge_post_disable(struct drm_bridge *bridge) struct msm_dsi *msm_dsi1 = dsi_mgr_get_dsi(DSI_1); struct mipi_dsi_host *host = msm_dsi->host; struct drm_panel *panel = msm_dsi->panel; - bool is_dual_dsi = IS_DUAL_DSI(); + bool is_bonded_dsi = IS_BONDED_DSI(); int ret; DBG("id=%d", id); @@ -510,14 +509,14 @@ static void dsi_mgr_bridge_post_disable(struct drm_bridge *bridge) * It is safe to call dsi_mgr_phy_disable() here because a single PHY * won't be diabled until both PHYs request disable. */ - if (is_dual_dsi && !IS_MASTER_DSI_LINK(id)) + if (is_bonded_dsi && !IS_MASTER_DSI_LINK(id)) goto disable_phy; ret = msm_dsi_host_disable(host); if (ret) pr_err("%s: host %d disable failed, %d\n", __func__, id, ret); - if (is_dual_dsi && msm_dsi1) { + if (is_bonded_dsi && msm_dsi1) { ret = msm_dsi_host_disable(msm_dsi1->host); if (ret) pr_err("%s: host1 disable failed, %d\n", __func__, ret); @@ -537,7 +536,7 @@ static void dsi_mgr_bridge_post_disable(struct drm_bridge *bridge) if (ret) pr_err("%s: host %d power off failed,%d\n", __func__, id, ret); - if (is_dual_dsi && msm_dsi1) { + if (is_bonded_dsi && msm_dsi1) { ret = msm_dsi_host_power_off(msm_dsi1->host); if (ret) pr_err("%s: host1 power off failed, %d\n", @@ -556,15 +555,15 @@ static void dsi_mgr_bridge_mode_set(struct drm_bridge *bridge, struct msm_dsi *msm_dsi = dsi_mgr_get_dsi(id); struct msm_dsi *other_dsi = dsi_mgr_get_other_dsi(id); struct mipi_dsi_host *host = msm_dsi->host; - bool is_dual_dsi = IS_DUAL_DSI(); + bool is_bonded_dsi = IS_BONDED_DSI(); DBG("set mode: " DRM_MODE_FMT, DRM_MODE_ARG(mode)); - if (is_dual_dsi && !IS_MASTER_DSI_LINK(id)) + if (is_bonded_dsi && !IS_MASTER_DSI_LINK(id)) return; msm_dsi_host_set_display_mode(host, adjusted_mode); - if (is_dual_dsi && other_dsi) + if (is_bonded_dsi && other_dsi) msm_dsi_host_set_display_mode(other_dsi->host, adjusted_mode); } @@ -640,7 +639,7 @@ struct drm_connector *msm_dsi_manager_connector_init(u8 id) bool msm_dsi_manager_validate_current_config(u8 id) { - bool is_dual_dsi = IS_DUAL_DSI(); + bool is_bonded_dsi = IS_BONDED_DSI(); /* * For dual DSI, we only have one drm panel. For this @@ -648,7 +647,7 @@ bool msm_dsi_manager_validate_current_config(u8 id) * Skip bridge/connector initialisation if it is * slave-DSI for dual DSI configuration. */ - if (is_dual_dsi && !IS_MASTER_DSI_LINK(id)) { + if (is_bonded_dsi && !IS_MASTER_DSI_LINK(id)) { DBG("Skip bridge registration for slave DSI->id: %d\n", id); return false; } @@ -809,7 +808,7 @@ int msm_dsi_manager_register(struct msm_dsi *msm_dsi) msm_dsim->dsi[id] = msm_dsi; - ret = dsi_mgr_parse_dual_dsi(msm_dsi->pdev->dev.of_node, id); + ret = dsi_mgr_parse_of(msm_dsi->pdev->dev.of_node, id); if (ret) { pr_err("%s: failed to parse dual DSI info\n", __func__); goto fail; From patchwork Fri Jul 9 23:50:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 471996 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp763603jao; Fri, 9 Jul 2021 16:50:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJywIGSiWuLxxu2mwxH43HLEA3wFRJ4DwsurycxoBzW3x03pVqSB2Xm513H6sz4qm1UnGnSd X-Received: by 2002:a5e:980c:: with SMTP id s12mr26104301ioj.128.1625874633965; Fri, 09 Jul 2021 16:50:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625874633; cv=none; d=google.com; s=arc-20160816; b=xQS6YD/ydTTSBnuHIuVqnXl5uf41L/vZRiJOvWcz3bFG2prxkGmiguoElL7uNzIO8P aU0CNV/xkVCFl7rbZbUIhh3XKjgq0YDGRy8ITIebzNpD9Q9M7EBhBQluFnb7wISa2cD0 JDYcwd3QThZ2u5G1p851nivIKe7cJ4+0sFLflzX8OGd4wEp1cEIPIj1mvd2hvwm1Yiib GnKWygfk2zCwdSuF2UMg9m9mFuYI/Ohgxhct9Z/aId6wg11HnfcJ9gJgVwqv//BE9EeD giJPC0eYSwqxD+RB6/PRq7L/MAe0v3WAZNeaua5/GawmAGneCErQFVt8wEoVK4J5SSWL OxrQ== 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=IDjFBmgKDqg9nqXkFulzVe09hEu6HLAuDIHiVBMT/Zw=; b=EP00k7bsv4+rcRSCQ4YGGDQdywFy5CTkElFBCn128e4XNErU1gKR4afl95hJaN3gFa rZVN7u3oe75USISYO2ym5RahkMrG+Y4dDxFC+H9O9vcDG14jAz74ooLI3/U9JL13TjID nEz3NWnoxw1VZSU0p5NRJm+5yjblm6Fv4/5Pv+4e4iqkhMLvNz9UEDL5dHHHNMY0RkU9 Ob8e+L7oO2k3dV4gG2UoehLT9syO8yf9aIBnr2yH1A7hbMTpGOTZYVUZ0+Ve1FxKjdZ0 tbcPxgbdaMvjT8gjBD7VvjU41EmKNBttNwPptj8YNhvNCQaO84HqDXql3/M3CDG86WYq D6Hg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fx1W89N9; 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 b42si7594388jav.96.2021.07.09.16.50.33; Fri, 09 Jul 2021 16:50:33 -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=fx1W89N9; 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 S230429AbhGIXxP (ORCPT + 17 others); Fri, 9 Jul 2021 19:53:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45124 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229854AbhGIXxO (ORCPT ); Fri, 9 Jul 2021 19:53:14 -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 5F78DC0613E5 for ; Fri, 9 Jul 2021 16:50:29 -0700 (PDT) Received: by mail-lf1-x136.google.com with SMTP id c28so25996782lfp.11 for ; Fri, 09 Jul 2021 16:50:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=IDjFBmgKDqg9nqXkFulzVe09hEu6HLAuDIHiVBMT/Zw=; b=fx1W89N9tfeOGVGzyI7fjpFthGMZ0mUGAwPNKEgjOd9HKewi/a0JqoUlWireolh57L CtQcGvsE1GS8jSe+NkpVzTXNFNJIJZRfe2ixQcNRVOK87RTC/Cr4qCqKu+xB5Cqz0Tm5 D5afe1VqxCNL9ouOh0YTbKk/M9yAgxTXSM7oFdVvoUtwh/1DxKoxJRAIJ3U8f9bm73Oz 0n983xcpEpD/lwpcC6cHysSyLjnGo4MI7SbAfpzXowsDJvw9j+5UG6Im2opeHHVcT/gC 0xxR5yZULE+4fPvp7jtguEXI3Sjm9qwh50XWja3Tr2yvWR6Sq+ZXHJ4OyJ6Y4RipGmgM nl8A== 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=IDjFBmgKDqg9nqXkFulzVe09hEu6HLAuDIHiVBMT/Zw=; b=s3vMhInZ/pCwITACjl+r8G70cIHjBi4yX5n4oumU46f0eHj3eZRbyDOdvt2vnnl+3/ c5/9T0Uf45zSCAQWS6cfqBWFDWq+hP0cnlg17oaFKgTryqpgD/fC6p8aVk/YSMoMog4Z W1tg6EvIt+yMo6VRGbvr84Nr1JnW21/6o/cG1ClI+30qK/6ZOAqRACN9oTOGQ8bGWsWn mnn9hRjLJDSCdfCZ75L4cQcGEPcONuSJRK40ZGiUyEUuNhE1Iqd7tPyUOS83PxyX2PRb j0FkQoBXb5z23KfmuEElshi9waPKkGF3ZfNlJd2krpkeYwPDz7CreXHeYN2BBvNtCUyK S+sA== X-Gm-Message-State: AOAM531JU3Ey/BButKMdYFqhuE8PChdDFH6pWPjfK5UDBtw5Lwv0Mlck F7k05AbvfiXuUTtFGkPrz2Grdg== X-Received: by 2002:a05:6512:2034:: with SMTP id s20mr26866973lfs.259.1625874627694; Fri, 09 Jul 2021 16:50:27 -0700 (PDT) Received: from eriador.lan ([37.153.55.125]) by smtp.gmail.com with ESMTPSA id v10sm718964ljp.20.2021.07.09.16.50.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Jul 2021 16:50:27 -0700 (PDT) From: Dmitry Baryshkov To: Bjorn Andersson , Rob Clark , Sean Paul , Abhinav Kumar Cc: Jonathan Marek , Stephen Boyd , David Airlie , Daniel Vetter , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org Subject: [PATCH v2 2/7] drm/msm/dsi: add two helper functions Date: Sat, 10 Jul 2021 02:50:19 +0300 Message-Id: <20210709235024.1077888-3-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210709235024.1077888-1-dmitry.baryshkov@linaro.org> References: <20210709235024.1077888-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Add two helper functions to be used by display drivers for setting up encoders. Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar --- drivers/gpu/drm/msm/dsi/dsi.c | 7 +++++++ drivers/gpu/drm/msm/dsi/dsi_manager.c | 14 ++++++-------- drivers/gpu/drm/msm/msm_drv.h | 12 ++++++++++-- 3 files changed, 23 insertions(+), 10 deletions(-) -- 2.30.2 diff --git a/drivers/gpu/drm/msm/dsi/dsi.c b/drivers/gpu/drm/msm/dsi/dsi.c index 75afc12a7b25..5201d7eb0490 100644 --- a/drivers/gpu/drm/msm/dsi/dsi.c +++ b/drivers/gpu/drm/msm/dsi/dsi.c @@ -13,6 +13,13 @@ struct drm_encoder *msm_dsi_get_encoder(struct msm_dsi *msm_dsi) return msm_dsi->encoder; } +bool msm_dsi_is_cmd_mode(struct msm_dsi *msm_dsi) +{ + unsigned long host_flags = msm_dsi_host_get_mode_flags(msm_dsi->host); + + return !(host_flags & MIPI_DSI_MODE_VIDEO); +} + static int dsi_get_phy(struct msm_dsi *msm_dsi) { struct platform_device *pdev = msm_dsi->pdev; diff --git a/drivers/gpu/drm/msm/dsi/dsi_manager.c b/drivers/gpu/drm/msm/dsi/dsi_manager.c index 1173663c6d5d..a81105633d3c 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_manager.c +++ b/drivers/gpu/drm/msm/dsi/dsi_manager.c @@ -216,12 +216,6 @@ static int dsi_mgr_bridge_get_id(struct drm_bridge *bridge) return dsi_bridge->id; } -static bool dsi_mgr_is_cmd_mode(struct msm_dsi *msm_dsi) -{ - unsigned long host_flags = msm_dsi_host_get_mode_flags(msm_dsi->host); - return !(host_flags & MIPI_DSI_MODE_VIDEO); -} - void msm_dsi_manager_setup_encoder(int id) { struct msm_dsi *msm_dsi = dsi_mgr_get_dsi(id); @@ -231,7 +225,7 @@ void msm_dsi_manager_setup_encoder(int id) if (encoder && kms->funcs->set_encoder_mode) kms->funcs->set_encoder_mode(kms, encoder, - dsi_mgr_is_cmd_mode(msm_dsi)); + msm_dsi_is_cmd_mode(msm_dsi)); } static int msm_dsi_manager_panel_init(struct drm_connector *conn, u8 id) @@ -276,7 +270,7 @@ static int msm_dsi_manager_panel_init(struct drm_connector *conn, u8 id) if (other_dsi && other_dsi->panel && kms->funcs->set_split_display) { kms->funcs->set_split_display(kms, master_dsi->encoder, slave_dsi->encoder, - dsi_mgr_is_cmd_mode(msm_dsi)); + msm_dsi_is_cmd_mode(msm_dsi)); } out: @@ -839,3 +833,7 @@ void msm_dsi_manager_unregister(struct msm_dsi *msm_dsi) msm_dsim->dsi[msm_dsi->id] = NULL; } +bool msm_dsi_is_bonded_dsi(struct msm_dsi *msm_dsi) +{ + return IS_BONDED_DSI(); +} diff --git a/drivers/gpu/drm/msm/msm_drv.h b/drivers/gpu/drm/msm/msm_drv.h index 1a48a709ffb3..e0528dfd965e 100644 --- a/drivers/gpu/drm/msm/msm_drv.h +++ b/drivers/gpu/drm/msm/msm_drv.h @@ -350,7 +350,8 @@ void __exit msm_dsi_unregister(void); int msm_dsi_modeset_init(struct msm_dsi *msm_dsi, struct drm_device *dev, struct drm_encoder *encoder); void msm_dsi_snapshot(struct msm_disp_state *disp_state, struct msm_dsi *msm_dsi); - +bool msm_dsi_is_cmd_mode(struct msm_dsi *msm_dsi); +bool msm_dsi_is_bonded_dsi(struct msm_dsi *msm_dsi); #else static inline void __init msm_dsi_register(void) { @@ -367,7 +368,14 @@ static inline int msm_dsi_modeset_init(struct msm_dsi *msm_dsi, static inline void msm_dsi_snapshot(struct msm_disp_state *disp_state, struct msm_dsi *msm_dsi) { } - +static inline bool msm_dsi_is_cmd_mode(struct msm_dsi *msm_dsi) +{ + return false; +} +static bool msm_dsi_is_bonded_dsi(struct msm_dsi *msm_dsi) +{ + return false; +} #endif #ifdef CONFIG_DRM_MSM_DP From patchwork Fri Jul 9 23:50:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 472007 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp763609jao; Fri, 9 Jul 2021 16:50:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzhPor00gFqSEl2qKDS/aqH2kMfyp5St3B1PdCk8SrW2ksBGVE02B3/lcR/KVwMr1TFAtIf X-Received: by 2002:a6b:5b01:: with SMTP id v1mr27595546ioh.132.1625874634280; Fri, 09 Jul 2021 16:50:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625874634; cv=none; d=google.com; s=arc-20160816; b=TuqhIAwv1b0xzUc57aqU7GNkKFrQ4yZfLaWxMG/hLfSd9yKz6gdxkwmBPOz0mWWLsV jouBGHVmj4PT9j2HwpEA74R3wC52DGtaBpq0b906pOoN1V13afw9SYUzkfIY0n9zEu4/ HLMCP1z44CcIHOaASKX+KBNbdN5cQcUPbF42g3SV6vd5A1bI2iAZnqGjzii9CVHyVCO/ IauLb8JVjTzT3/UZD/hoFQvnKuc3Sh7J5GztbKfN+/WPAlfY6y0fjjvisxOWek2fnUET Lo1j141jkDr/yezbSiCPHWlgnHQI46GMxwg5scFCPYXJIP1snnqTWwBWRYEjEkm8y0nk clZA== 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=0+4Cu6PpzsSGmEoMmg7oFjwuZKsB+y3Zq1/8dnbS9Eg=; b=KWVsRDHA8tgbHRGTN6HFY3nZCBg9q+A8j9EMYinmwHaFYTo9sz6Jj41I3riDXtKHgL Q19R9Vi5KfaiN7TW4VIFHSoQ4QA7oO+u5y6swEBKgNAqmZJkChjqWaNHU3DyVahtwjK1 3bMqR/wp7h7uG5vKo/H5JLxTBSJrMEtPYTNnW/uunfOQ2LKGzJRfWqO881ya0DV5IMy6 4pd2f3+iKhFPCJUe2GmYuRwxhbUi5nNgXUaTDvhxpwNlbYjlqn2OHeRkBCGRYP44wEQx BECZDmZyw6JG/CFyjw9DcSsyrfDp15qwha8kmzFUHCdnREehuJDFQBZ0TrBFlhA4vUDx PpBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PUbb4ncj; 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 b42si7594388jav.96.2021.07.09.16.50.34; Fri, 09 Jul 2021 16:50:34 -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=PUbb4ncj; 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 S230442AbhGIXxP (ORCPT + 17 others); Fri, 9 Jul 2021 19:53:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45130 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229854AbhGIXxP (ORCPT ); Fri, 9 Jul 2021 19:53:15 -0400 Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 30E21C0613DD for ; Fri, 9 Jul 2021 16:50:30 -0700 (PDT) Received: by mail-lf1-x12d.google.com with SMTP id a18so26463066lfs.10 for ; Fri, 09 Jul 2021 16:50:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=0+4Cu6PpzsSGmEoMmg7oFjwuZKsB+y3Zq1/8dnbS9Eg=; b=PUbb4ncjimj+tNRRMOspNNOZ9YfYYJHsvZjQOnWRU8cIpi1t0/N7rhq4+jlvM9Q8j5 YR8st668gT+FywX6if4wMQJdDscB8NiNIuMQiPyhBfeYAIeeWfzp2uGraUoel5LZwzJR BGt1OxCdVLPEfwWxAbJMJSZjZkd+PwZjUqQiEyq8/01b1BineqLhbuclY9ybCnvL6Pdo 73mVU0+TFn5WMQLUbFBalAl0fy1SrRyTAHGsbx5/xIvGWL7GUoFHlfx6E+/Ph6zh9ypx fej8lfyzYMT6J0o4zNgSm8xcrnkaHwEq9f+HWAAzUJBdjurpHxVFCTXx2RJPekl2tjFd ukwg== 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=0+4Cu6PpzsSGmEoMmg7oFjwuZKsB+y3Zq1/8dnbS9Eg=; b=EsppQ9MasyO5OQxvhVgHDDmeRJegEBNseQ2KlmMhM88YGCIK3T7b8/PZ3pxbzufVHP xb8V9M66k80FkuOyUVg8iDR/R/qllHTAhgWIa1NJCD9Y+2obDgqFRGM46Q104d1N9OH9 BmItAGCaz7olpels/tpysMXnJ5UXsioZMtO8NU1xPqF+C9/AJKuC3M99/mQUECeXpdX1 Jd0APIyhXj1iaw0AStT2Cg13bjE8dr7l5NWe8jCjoASEbwlAhqzFaQXy/i6fwaW+rsQ9 aN5/gb7ysWAr1OtxusFLPYWpXvNQXWD+7DPcf40bFTzF8nclBTlJzlsJ9k5NeTEkt4RS 3shQ== X-Gm-Message-State: AOAM532UPR72Jk9Opvpu0PsP4qMk9ZQh/2HFOoLfHVnbMfhIkG8Mrk6j 9+eQoNgiaa+E/MZ8Qyg6I6YZFA== X-Received: by 2002:a19:7dc2:: with SMTP id y185mr29817788lfc.249.1625874628528; Fri, 09 Jul 2021 16:50:28 -0700 (PDT) Received: from eriador.lan ([37.153.55.125]) by smtp.gmail.com with ESMTPSA id v10sm718964ljp.20.2021.07.09.16.50.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Jul 2021 16:50:28 -0700 (PDT) From: Dmitry Baryshkov To: Bjorn Andersson , Rob Clark , Sean Paul , Abhinav Kumar Cc: Jonathan Marek , Stephen Boyd , David Airlie , Daniel Vetter , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org Subject: [PATCH v2 3/7] drm/msm/dpu: support setting up two independent DSI connectors Date: Sat, 10 Jul 2021 02:50:20 +0300 Message-Id: <20210709235024.1077888-4-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210709235024.1077888-1-dmitry.baryshkov@linaro.org> References: <20210709235024.1077888-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Move setting up encoders from set_encoder_mode to _dpu_kms_initialize_dsi() / _dpu_kms_initialize_displayport(). This allows us to support not only "single DSI" and "bonded DSI" but also "two independent DSI" configurations. In future this would also help adding support for multiple DP connectors. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 130 ++++++++++++++---------- 1 file changed, 79 insertions(+), 51 deletions(-) -- 2.30.2 diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c index 1d3a4f395e74..e14eb8f94cd7 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c @@ -466,17 +466,16 @@ static void dpu_kms_wait_flush(struct msm_kms *kms, unsigned crtc_mask) dpu_kms_wait_for_commit_done(kms, crtc); } -static int _dpu_kms_initialize_dsi(struct drm_device *dev, - struct msm_drm_private *priv, - struct dpu_kms *dpu_kms) +static int _dpu_kms_initialize_dsi_encoder(struct drm_device *dev, + struct msm_drm_private *priv, + struct dpu_kms *dpu_kms, + int dsi_id, int dsi_id1) { + struct msm_dsi *dsi = priv->dsi[dsi_id]; struct drm_encoder *encoder = NULL; - int i, rc = 0; - - if (!(priv->dsi[0] || priv->dsi[1])) - return rc; + struct msm_display_info info; + int rc = 0; - /*TODO: Support two independent DSI connectors */ encoder = dpu_encoder_init(dev, DRM_MODE_ENCODER_DSI); if (IS_ERR(encoder)) { DPU_ERROR("encoder init failed for dsi display\n"); @@ -485,19 +484,74 @@ static int _dpu_kms_initialize_dsi(struct drm_device *dev, priv->encoders[priv->num_encoders++] = encoder; - for (i = 0; i < ARRAY_SIZE(priv->dsi); i++) { - if (!priv->dsi[i]) - continue; + rc = msm_dsi_modeset_init(dsi, dev, encoder); + if (rc) { + DPU_ERROR("modeset_init failed for dsi[%d], rc = %d\n", + dsi_id, rc); + return rc; + } + + memset(&info, 0, sizeof(info)); + info.intf_type = encoder->encoder_type; + info.capabilities = msm_dsi_is_cmd_mode(dsi) ? + MSM_DISPLAY_CAP_CMD_MODE : + MSM_DISPLAY_CAP_VID_MODE; + info.h_tile_instance[info.num_of_h_tiles++] = dsi_id; - rc = msm_dsi_modeset_init(priv->dsi[i], dev, encoder); + /* For the bonded DSI setup we have second DSI host */ + if (dsi_id1 >= 0) { + struct msm_dsi *dsi1 = priv->dsi[dsi_id1]; + + rc = msm_dsi_modeset_init(dsi1, dev, encoder); if (rc) { DPU_ERROR("modeset_init failed for dsi[%d], rc = %d\n", - i, rc); - break; + dsi_id1, rc); + return rc; } + + info.h_tile_instance[info.num_of_h_tiles++] = dsi_id1; } - return rc; + 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; +} + +static int _dpu_kms_initialize_dsi(struct drm_device *dev, + struct msm_drm_private *priv, + struct dpu_kms *dpu_kms) +{ + int i, rc = 0; + + if (!(priv->dsi[0] || priv->dsi[1])) + return rc; + + /* + * We support following confiurations: + * - Single DSI host (dsi0 or dsi1) + * - Two independent DSI hosts + * - Bonded DSI0 and DSI1 hosts + * + * TODO: Support swapping DSI0 and DSI1 in the bonded setup. + */ + if (priv->dsi[0] && priv->dsi[1] && msm_dsi_is_bonded_dsi(priv->dsi[0])) + return _dpu_kms_initialize_dsi_encoder(dev, priv, dpu_kms, 0, 1); + + for (i = 0; i < ARRAY_SIZE(priv->dsi); i++) { + if (!priv->dsi[i]) + continue; + + rc = _dpu_kms_initialize_dsi_encoder(dev, priv, dpu_kms, i, -1); + if (rc) + return rc; + } + + return 0; } static int _dpu_kms_initialize_displayport(struct drm_device *dev, @@ -505,6 +559,7 @@ static int _dpu_kms_initialize_displayport(struct drm_device *dev, struct dpu_kms *dpu_kms) { struct drm_encoder *encoder = NULL; + struct msm_display_info info; int rc = 0; if (!priv->dp) @@ -516,6 +571,7 @@ static int _dpu_kms_initialize_displayport(struct drm_device *dev, 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); @@ -524,6 +580,14 @@ static int _dpu_kms_initialize_displayport(struct drm_device *dev, } 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; } @@ -726,41 +790,6 @@ static void dpu_kms_destroy(struct msm_kms *kms) msm_kms_destroy(&dpu_kms->base); } -static void _dpu_kms_set_encoder_mode(struct msm_kms *kms, - struct drm_encoder *encoder, - bool cmd_mode) -{ - struct msm_display_info info; - struct msm_drm_private *priv = encoder->dev->dev_private; - int i, rc = 0; - - memset(&info, 0, sizeof(info)); - - info.intf_type = encoder->encoder_type; - info.capabilities = cmd_mode ? MSM_DISPLAY_CAP_CMD_MODE : - MSM_DISPLAY_CAP_VID_MODE; - - switch (info.intf_type) { - case DRM_MODE_ENCODER_DSI: - /* TODO: No support for DSI swap */ - for (i = 0; i < ARRAY_SIZE(priv->dsi); i++) { - if (priv->dsi[i]) { - info.h_tile_instance[info.num_of_h_tiles] = i; - info.num_of_h_tiles++; - } - } - break; - case DRM_MODE_ENCODER_TMDS: - info.num_of_h_tiles = 1; - break; - } - - rc = dpu_encoder_setup(encoder->dev, encoder, &info); - if (rc) - DPU_ERROR("failed to setup DPU encoder %d: rc:%d\n", - encoder->base.id, rc); -} - static irqreturn_t dpu_irq(struct msm_kms *kms) { struct dpu_kms *dpu_kms = to_dpu_kms(kms); @@ -863,7 +892,6 @@ static const struct msm_kms_funcs kms_funcs = { .get_format = dpu_get_msm_format, .round_pixclk = dpu_kms_round_pixclk, .destroy = dpu_kms_destroy, - .set_encoder_mode = _dpu_kms_set_encoder_mode, .snapshot = dpu_kms_mdp_snapshot, #ifdef CONFIG_DEBUG_FS .debugfs_init = dpu_kms_debugfs_init, From patchwork Fri Jul 9 23:50:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 471924 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DFA1FC07E9E for ; Fri, 9 Jul 2021 23:50:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C759A613C2 for ; Fri, 9 Jul 2021 23:50:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231286AbhGIXxQ (ORCPT ); Fri, 9 Jul 2021 19:53:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45136 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231244AbhGIXxP (ORCPT ); Fri, 9 Jul 2021 19:53:15 -0400 Received: from mail-lj1-x229.google.com (mail-lj1-x229.google.com [IPv6:2a00:1450:4864:20::229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 61A72C0613DD for ; Fri, 9 Jul 2021 16:50:31 -0700 (PDT) Received: by mail-lj1-x229.google.com with SMTP id r16so10645456ljk.9 for ; Fri, 09 Jul 2021 16:50:31 -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=hoN8ubV+NL8AcGXwOuvZXUIKfTF5XnABfb0Z79GoR78=; b=quuDsEutRmMltKHkzhv5sPpAdPqn4r1fYbFOA3X8HG+gBIMHvtMqSUvYPVZR/XJByT b7nw1SQYCSSkHxCST9c2DOvxrLJ6LiXiVTCs/HrMu264W5Jim8QydZVxnDvA80vBakJB 1g7iXrvijk6YPyt/lPjOPJB5IvjGi7froKOD8JWkJx17qvmIoH0gav7HBl3PHUdoGeg8 Us6g7ofAMVvAVota10aZ8gsI2K20C/dBEVVJQxGtJ4tbhg0mE8qCLeVMxzL7fidB5au9 b34mHmAbguT+O6tqLK8kTEu7J+5d00HS81pa6LNdSeIVvyR6AE9r2YdXCc7aOfgk0nUd YrPw== 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=hoN8ubV+NL8AcGXwOuvZXUIKfTF5XnABfb0Z79GoR78=; b=p91MDSCmoBF8CjWt+7i8Hd2HM6F6OsgCA56HvflVJ0HryGv+Qtx0+v5Z+TN988a+hh APoM7vYv/4GuDfYatB+SFW6BKCAOCbwKR2zCVKm4R5tdI4hgGxR3KhsnKWSHcNOw3yhA uTAvBp2IQZO6vMCNJfyQafjv9W6SpO0EpxCRfFyOq/dWLBonAvFbMG3KChadP6fJsUNK p5b15tt2zNFcJ7PPe07APMH9njw3HeJb6wYUD/P7UYt/UH+Cndmv7az/CRLoGG51Sgny TNaeNX2WE1JWPWLFTvRwB7fLkMFkil7uPzl/ewJhSHa7sE++YSK8uv5Q6bAwa8mn4atA 0FkA== X-Gm-Message-State: AOAM532zznBfdQNSlPW7OOuMgrHkesQENEQxGhNuttj63+PlAHDlQXIR Cj142mY/Xsf2vsRA6EOHWh2DWg== X-Google-Smtp-Source: ABdhPJxkZo+rx9Fi2loI4UVnBbE2VZH7ldG6qdDneK0XQ7YnW9JmijHNHoFrFogWWttshz3NCmzRqg== X-Received: by 2002:a2e:8614:: with SMTP id a20mr21090696lji.31.1625874629371; Fri, 09 Jul 2021 16:50:29 -0700 (PDT) Received: from eriador.lan ([37.153.55.125]) by smtp.gmail.com with ESMTPSA id v10sm718964ljp.20.2021.07.09.16.50.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Jul 2021 16:50:28 -0700 (PDT) From: Dmitry Baryshkov To: Bjorn Andersson , Rob Clark , Sean Paul , Abhinav Kumar Cc: Jonathan Marek , Stephen Boyd , David Airlie , Daniel Vetter , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org Subject: [PATCH v2 4/7] drm/msm/mdp5: move mdp5_encoder_set_intf_mode after msm_dsi_modeset_init Date: Sat, 10 Jul 2021 02:50:21 +0300 Message-Id: <20210709235024.1077888-5-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210709235024.1077888-1-dmitry.baryshkov@linaro.org> References: <20210709235024.1077888-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Move a call to mdp5_encoder_set_intf_mode() after msm_dsi_modeset_init(), removing set_encoder_mode callback. Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar --- drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c index 15aed45022bc..b3b42672b2d4 100644 --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c @@ -209,13 +209,6 @@ static int mdp5_set_split_display(struct msm_kms *kms, slave_encoder); } -static void mdp5_set_encoder_mode(struct msm_kms *kms, - struct drm_encoder *encoder, - bool cmd_mode) -{ - mdp5_encoder_set_intf_mode(encoder, cmd_mode); -} - static void mdp5_kms_destroy(struct msm_kms *kms) { struct mdp5_kms *mdp5_kms = to_mdp5_kms(to_mdp_kms(kms)); @@ -287,7 +280,6 @@ static const struct mdp_kms_funcs kms_funcs = { .get_format = mdp_get_format, .round_pixclk = mdp5_round_pixclk, .set_split_display = mdp5_set_split_display, - .set_encoder_mode = mdp5_set_encoder_mode, .destroy = mdp5_kms_destroy, #ifdef CONFIG_DEBUG_FS .debugfs_init = mdp5_kms_debugfs_init, @@ -448,6 +440,9 @@ static int modeset_init_intf(struct mdp5_kms *mdp5_kms, } ret = msm_dsi_modeset_init(priv->dsi[dsi_id], dev, encoder); + if (!ret) + mdp5_encoder_set_intf_mode(encoder, msm_dsi_is_cmd_mode(priv->dsi[dsi_id])); + break; } default: From patchwork Fri Jul 9 23:50:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 471923 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D615EC07E99 for ; Fri, 9 Jul 2021 23:50:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BDC00613C8 for ; Fri, 9 Jul 2021 23:50:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231244AbhGIXxQ (ORCPT ); Fri, 9 Jul 2021 19:53:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45138 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229854AbhGIXxP (ORCPT ); Fri, 9 Jul 2021 19:53:15 -0400 Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD109C0613E5 for ; Fri, 9 Jul 2021 16:50:31 -0700 (PDT) Received: by mail-lf1-x12c.google.com with SMTP id q18so26546125lfc.7 for ; Fri, 09 Jul 2021 16:50:31 -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=TR8ndGweFJ1zlT+mXoJoL5P2xKgyplXAag8kXZdug0c=; b=PIUKaE5ue2Sn7b+1bTo40616rgAAHVpNo3GCi92/h57cImN34xz3/QdWsNYnVsBlql VVPQbezVXdsIioe5uUPYhmW9UTmQ+unmfXPxN+GQ+VaPJgrJydYj0GyM1Oq68EcSrpIs citjJBPuCUUytxCDHBVPAs1j1gz/aA6vZG//W7OUNMPZyVYqizhPHufUl7nGsGF6Zhfe 2iGGFq3H8oX91kGDTNSO8xD6bzFHp6SjFwGAncUwGuBlpXhwMTCQL+bQ2WOjIG2pBEg3 4QF8EA14l04luXwZ0xDvfHueAPdkGdhixL+l0hadkMVg5zb6iWLiZ5rrT8+Un1xX+Zqw Wm+g== 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=TR8ndGweFJ1zlT+mXoJoL5P2xKgyplXAag8kXZdug0c=; b=pjmsGVNm/A+I5DP8mZ6pI2rLlEi2wLsrtCXuSYPSnQu93RY5O0x+nvybaOaWzTtxsK ora1ppPww/sH24PxuYDTDqyUxnrkUSTW9MTDKCwz9GbYBXNtCzbue0f7osGV+lY0vEVF Y4tqn4HSaEwPhALs1zOQxT4j6NWeRLiRlUmyzc3RNRPxuq/br4KwWzAd951em467EmJt CTKc3pSwAHkDM6WM+r8mPhLl8iTBCRpgZROG4LkewWhmEZqGOqZqHPMEmBOu+JMukXGy 8b9dVROMbS/Ln4y9VL3AgXj/UQrzDgI31nnNKlFLX0vtowYlyycAeRvgu7912wiGTO5e niSA== X-Gm-Message-State: AOAM530rv9Mht7v1lRU2Tt0bYkMvVn0axEYbvkQegtDsKgDVEVwjz/0T zU7yX2E0Exdr8sTrA3Smarf/HA== X-Google-Smtp-Source: ABdhPJxMyoUwsBZ83rVWTMY8hgakNpqW7Cdx0IP8Zq5KW+sntfIMw8Y2r+2tN3dpnqR85DuTY5E3aA== X-Received: by 2002:a05:6512:1511:: with SMTP id bq17mr31109194lfb.341.1625874630114; Fri, 09 Jul 2021 16:50:30 -0700 (PDT) Received: from eriador.lan ([37.153.55.125]) by smtp.gmail.com with ESMTPSA id v10sm718964ljp.20.2021.07.09.16.50.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Jul 2021 16:50:29 -0700 (PDT) From: Dmitry Baryshkov To: Bjorn Andersson , Rob Clark , Sean Paul , Abhinav Kumar Cc: Jonathan Marek , Stephen Boyd , David Airlie , Daniel Vetter , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org Subject: [PATCH v2 5/7] drm/msm/dp: stop calling set_encoder_mode callback Date: Sat, 10 Jul 2021 02:50:22 +0300 Message-Id: <20210709235024.1077888-6-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210709235024.1077888-1-dmitry.baryshkov@linaro.org> References: <20210709235024.1077888-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org None of the display drivers now implement set_encoder_mode callback. Stop calling it from the modeset init code. Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar --- drivers/gpu/drm/msm/dp/dp_display.c | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c index 051c1be1de7e..70b319a8fe83 100644 --- a/drivers/gpu/drm/msm/dp/dp_display.c +++ b/drivers/gpu/drm/msm/dp/dp_display.c @@ -102,8 +102,6 @@ struct dp_display_private { struct dp_display_mode dp_mode; struct msm_dp dp_display; - bool encoder_mode_set; - /* wait for audio signaling */ struct completion audio_comp; @@ -283,20 +281,6 @@ static void dp_display_send_hpd_event(struct msm_dp *dp_display) } -static void dp_display_set_encoder_mode(struct dp_display_private *dp) -{ - struct msm_drm_private *priv = dp->dp_display.drm_dev->dev_private; - struct msm_kms *kms = priv->kms; - - if (!dp->encoder_mode_set && dp->dp_display.encoder && - kms->funcs->set_encoder_mode) { - kms->funcs->set_encoder_mode(kms, - dp->dp_display.encoder, false); - - dp->encoder_mode_set = true; - } -} - static int dp_display_send_hpd_notification(struct dp_display_private *dp, bool hpd) { @@ -369,8 +353,6 @@ static void dp_display_host_init(struct dp_display_private *dp, int reset) if (dp->usbpd->orientation == ORIENTATION_CC2) flip = true; - dp_display_set_encoder_mode(dp); - dp_power_init(dp->power, flip); dp_ctrl_host_init(dp->ctrl, flip, reset); dp_aux_init(dp->aux); From patchwork Fri Jul 9 23:50:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 472026 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp763619jao; Fri, 9 Jul 2021 16:50:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzpFmLdnbDPK1VwbiJprLJDGRgERr1UfbdOOHYpkuxrx5a1QHAi9NA+9vEzkcJQdrHIKTKJ X-Received: by 2002:a05:6602:10e:: with SMTP id s14mr30944220iot.52.1625874635287; Fri, 09 Jul 2021 16:50:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625874635; cv=none; d=google.com; s=arc-20160816; b=OpyKsRWsArJDI59fe6Fj7XB7dS3nPCd9P0oAxGeENy0M+awiyWknWIfsfwjfnRxvw2 9xcDoVrRiAaCFdACbBpAmIRscCNUa+wExtAKvGu4+FBASr1AsPQL2MXTsJZBo1Xn+Duh 6QhGKAdYz2NPp3p+ULo0gUanZsmoTivOFER5ke9UFXSnBzf6kWm+Xd6bbUs8i3FBEc8+ DdVjoft517j2Fh+44ebaRjUbYQHujroXQCnqFI4+QaljRfUc0QGo2wQ53vemTP1xM9kH aL9UBQlOU26+Q7dIOqdvSCgiZ6cdhM7W3vFeIZjHCJeAWrWI7Hn1vUbIlyIQ3z8sCpNt SjfQ== 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=49a8wW7cPE/UYu/CgVMiIaLLCRNVbynlrKg04A+ZvZk=; b=GhFRhsygBdeeUPDSvjrodj5WlLhJOlTi8P7zmAbipVadUoQVaIUdKZq28JiJUSXXBK DDdCZA5rd9HuYUmjWxBPQ5Ov5xvsIed1xblg3Dm+hnXUAqVZiJWyXdpS0njnUTHf5yW7 blhVG4n3FQAsKdkmSTpwpQBwKP7djQOY6XoCB6Gw+HP3oAb1mSt/DM0O///Vj1tPEdYb znzBBiFxeqxJoI5LldzsESK27Y+JODYZ69+JCeMO3CUhGrEzrHMtaSe8qgKOT9Pqw/ne +0Pyun/7mK8H3uS0J7R5Y+W+YYI3gG8Ei6L6SWm5fOUOBPR44mMCZlmvJqEFHCcy6TLZ duNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dZNwrSFc; 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 b42si7594388jav.96.2021.07.09.16.50.35; Fri, 09 Jul 2021 16:50: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=dZNwrSFc; 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 S231324AbhGIXxR (ORCPT + 17 others); Fri, 9 Jul 2021 19:53:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229854AbhGIXxR (ORCPT ); Fri, 9 Jul 2021 19:53:17 -0400 Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com [IPv6:2a00:1450:4864:20::12e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B4B5C0613DD for ; Fri, 9 Jul 2021 16:50:32 -0700 (PDT) Received: by mail-lf1-x12e.google.com with SMTP id q18so26546166lfc.7 for ; Fri, 09 Jul 2021 16:50:32 -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=49a8wW7cPE/UYu/CgVMiIaLLCRNVbynlrKg04A+ZvZk=; b=dZNwrSFcgexHfE1MFXEJp08UR0ysnSEomH8R8ENvmtD7Q9xTSSe7AtMRiXNSjnjlxh TqZnGMMRF80DqX9TWTh1LD0zHhFPgi9FI+zb9Ck1H2OLTqyOPCsLSaHAZWBaLJKYP97C 4xS7wktgCqO5ioEPJCRZs2Hmez7HxKmxZXqiYGNhMELzFArooD/FXYb770Q2k3+of8eZ xcyHOaHxTtOyYILTeoxqS22mEspjcKN5HUkZfwrnJqapm8YUmCMw7JtqAOkPy5XV/6xh 56arP3EoQkp7GG4wh+vcRJvEYpByxKfO1Epb1w1/hCo92p2hTDdOK1dswkhreeFokBLW 342Q== 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=49a8wW7cPE/UYu/CgVMiIaLLCRNVbynlrKg04A+ZvZk=; b=XmF0DgzdqF0+Gt648XgLzZKs/u/gLGvanrCtuDmT+3rUG0mWhesMPmtBNt5ig3yw90 TqTB9QThGU7gatERX1h6vpfLscOflYToQgIr7/x49Lga+NZEQjvF3g/jzBPddIcPESya xCjkKVrE1Hr0xFD7MV8599hx8FGnLvlg4qVdZz30/AQku6er7LaB5XsFyb6V/bLl0/hu yxFbtvQPItsYragwsSZCKogDKPOvPHwTcHicf2hg52Ev7firAMJqT1qqIEVK82h5Fisp 59xlDcgDTba7rYub7KyZv1O0KIsbNzoh4V2MfwkzhoCk9kIIf/9qFxCj6/adElRn2dAk +qCg== X-Gm-Message-State: AOAM5319M+qK9tgqwxwyT3lnek6e+ULiGeMT0cJRbxrtmJ1ok9Zmwboc 4UaOKTjN4A+UatBzk/KVf2Z9iA== X-Received: by 2002:ac2:4345:: with SMTP id o5mr30107129lfl.599.1625874630890; Fri, 09 Jul 2021 16:50:30 -0700 (PDT) Received: from eriador.lan ([37.153.55.125]) by smtp.gmail.com with ESMTPSA id v10sm718964ljp.20.2021.07.09.16.50.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Jul 2021 16:50:30 -0700 (PDT) From: Dmitry Baryshkov To: Bjorn Andersson , Rob Clark , Sean Paul , Abhinav Kumar Cc: Jonathan Marek , Stephen Boyd , David Airlie , Daniel Vetter , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org Subject: [PATCH v2 6/7] drm/msm/dsi: stop calling set_encoder_mode callback Date: Sat, 10 Jul 2021 02:50:23 +0300 Message-Id: <20210709235024.1077888-7-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210709235024.1077888-1-dmitry.baryshkov@linaro.org> References: <20210709235024.1077888-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org None of the display drivers now implement set_encoder_mode callback. Stop calling it from the modeset init code. Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar --- drivers/gpu/drm/msm/dsi/dsi.c | 2 -- drivers/gpu/drm/msm/dsi/dsi.h | 1 - drivers/gpu/drm/msm/dsi/dsi_manager.c | 12 ------------ 3 files changed, 15 deletions(-) -- 2.30.2 diff --git a/drivers/gpu/drm/msm/dsi/dsi.c b/drivers/gpu/drm/msm/dsi/dsi.c index 5201d7eb0490..77c8dba297d8 100644 --- a/drivers/gpu/drm/msm/dsi/dsi.c +++ b/drivers/gpu/drm/msm/dsi/dsi.c @@ -251,8 +251,6 @@ int msm_dsi_modeset_init(struct msm_dsi *msm_dsi, struct drm_device *dev, goto fail; } - msm_dsi_manager_setup_encoder(msm_dsi->id); - priv->bridges[priv->num_bridges++] = msm_dsi->bridge; priv->connectors[priv->num_connectors++] = msm_dsi->connector; diff --git a/drivers/gpu/drm/msm/dsi/dsi.h b/drivers/gpu/drm/msm/dsi/dsi.h index 856a532850c0..e0c3c4409377 100644 --- a/drivers/gpu/drm/msm/dsi/dsi.h +++ b/drivers/gpu/drm/msm/dsi/dsi.h @@ -80,7 +80,6 @@ struct drm_connector *msm_dsi_manager_connector_init(u8 id); struct drm_connector *msm_dsi_manager_ext_bridge_init(u8 id); 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); -void msm_dsi_manager_setup_encoder(int id); int msm_dsi_manager_register(struct msm_dsi *msm_dsi); void msm_dsi_manager_unregister(struct msm_dsi *msm_dsi); bool msm_dsi_manager_validate_current_config(u8 id); diff --git a/drivers/gpu/drm/msm/dsi/dsi_manager.c b/drivers/gpu/drm/msm/dsi/dsi_manager.c index a81105633d3c..e7f4e1d8978a 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_manager.c +++ b/drivers/gpu/drm/msm/dsi/dsi_manager.c @@ -216,18 +216,6 @@ static int dsi_mgr_bridge_get_id(struct drm_bridge *bridge) return dsi_bridge->id; } -void msm_dsi_manager_setup_encoder(int id) -{ - struct msm_dsi *msm_dsi = dsi_mgr_get_dsi(id); - struct msm_drm_private *priv = msm_dsi->dev->dev_private; - struct msm_kms *kms = priv->kms; - struct drm_encoder *encoder = msm_dsi_get_encoder(msm_dsi); - - if (encoder && kms->funcs->set_encoder_mode) - kms->funcs->set_encoder_mode(kms, encoder, - msm_dsi_is_cmd_mode(msm_dsi)); -} - static int msm_dsi_manager_panel_init(struct drm_connector *conn, u8 id) { struct msm_drm_private *priv = conn->dev->dev_private; From patchwork Fri Jul 9 23:50:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 471922 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 37392C07E9E for ; Fri, 9 Jul 2021 23:50:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1B26D613C8 for ; Fri, 9 Jul 2021 23:50:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231325AbhGIXxS (ORCPT ); Fri, 9 Jul 2021 19:53:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45148 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229854AbhGIXxS (ORCPT ); Fri, 9 Jul 2021 19:53:18 -0400 Received: from mail-lj1-x22b.google.com (mail-lj1-x22b.google.com [IPv6:2a00:1450:4864:20::22b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B862C0613E5 for ; Fri, 9 Jul 2021 16:50:33 -0700 (PDT) Received: by mail-lj1-x22b.google.com with SMTP id z9so10639435ljm.2 for ; Fri, 09 Jul 2021 16:50:33 -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=XvCGkdShjzVXwoehYqCYEiIRtFRTu+7v5aX+Z4YnzDM=; b=pGXH7SAhltogfutLQ/zeZfz62JPmTkJ/1LApDK/tGH5I+dfu/VPri77jJFsBx6qljU ohFqHJf6nt6ZnSz59BxmXeKf/nb5F4GqEBVWvMPo5TZXe/VvH8VoIp5pck+9/yZXAsIk Kkm2sSChJ/N6c7XQxBd4hoqYSPxCnOFx05VbddU7oSHQmNiWQUMIWBUPKZJG/TyYAYRK BOh9UwUXgwSVouoRKTy3HSNj+FEU7TLBI3Ak+qzOuqes8bApRxMADc20X3sRbZh2now8 mokMI9kuz5B+371uu1CxuDigrcXbgVDUpSOrFYqxtrBj+ojUq9FTklfqZ+2sPzPRMWdb QRWQ== 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=XvCGkdShjzVXwoehYqCYEiIRtFRTu+7v5aX+Z4YnzDM=; b=PKzUSHESJ/3C34oVqssILr3Wa8yPfnFeZdJbAotoXb0dUQx5G0MfJr5WUVxII+4pBd 78kuEyFU8wtVe1l4S6s2YS/jRfSbDhN9O6gbq236OSJq24VjMJyCqR5/p5txnXP+dQ1m Zgtj9fVw1Hgf9zBMmvs27JS+JzV/p5LGOCaHXoigA9kbZvVI24b/c4niA8bwHARo2/3A RYUKeguVq1wUUg1HUYd43Y/TeaMdPy04kyH06MfUrFXzJ3VJ5D51dAVgJ/wAH9/hM2lI 4zFhSfxBdPrbXb0j4nSh6rNhXHeBzbKwDm5xgAsRjC4++tMbjT+CSeiY3hd9endSt4eX 9oJg== X-Gm-Message-State: AOAM531m47libqts0+aZDc3aCbo2/ul3ZwDMOpyu2z1IkiAbZ5VOXu0w puzSSPs99Fl8ns9xfsBJa2mIxw== X-Google-Smtp-Source: ABdhPJySk4bNYi9lDVMKK3/g4W2wWjseacmtJPphy6Gp3sXceQXGIOfFkILwTY3/QUcvU0Q+24r+yA== X-Received: by 2002:a2e:2e09:: with SMTP id u9mr5443219lju.322.1625874631652; Fri, 09 Jul 2021 16:50:31 -0700 (PDT) Received: from eriador.lan ([37.153.55.125]) by smtp.gmail.com with ESMTPSA id v10sm718964ljp.20.2021.07.09.16.50.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Jul 2021 16:50:31 -0700 (PDT) From: Dmitry Baryshkov To: Bjorn Andersson , Rob Clark , Sean Paul , Abhinav Kumar Cc: Jonathan Marek , Stephen Boyd , David Airlie , Daniel Vetter , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org Subject: [PATCH v2 7/7] drm/msm/kms: drop set_encoder_mode callback Date: Sat, 10 Jul 2021 02:50:24 +0300 Message-Id: <20210709235024.1077888-8-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210709235024.1077888-1-dmitry.baryshkov@linaro.org> References: <20210709235024.1077888-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org set_encoder_mode callback is completely unused now. Drop it from msm_kms_func(). Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar --- drivers/gpu/drm/msm/msm_kms.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/gpu/drm/msm/msm_kms.h b/drivers/gpu/drm/msm/msm_kms.h index 086a2d59b8c8..9484e8b62630 100644 --- a/drivers/gpu/drm/msm/msm_kms.h +++ b/drivers/gpu/drm/msm/msm_kms.h @@ -117,9 +117,6 @@ struct msm_kms_funcs { struct drm_encoder *encoder, struct drm_encoder *slave_encoder, bool is_cmd_mode); - void (*set_encoder_mode)(struct msm_kms *kms, - struct drm_encoder *encoder, - bool cmd_mode); /* cleanup: */ void (*destroy)(struct msm_kms *kms);