From patchwork Mon Mar 12 13:23:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sibi Sankar X-Patchwork-Id: 10276325 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 24DB760467 for ; Mon, 12 Mar 2018 13:24:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 16CD3287F3 for ; Mon, 12 Mar 2018 13:24:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0B43128847; Mon, 12 Mar 2018 13:24:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 89E19287DB for ; Mon, 12 Mar 2018 13:23:59 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 209E86E406; Mon, 12 Mar 2018 13:23:57 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from smtp.codeaurora.org (smtp.codeaurora.org [198.145.29.96]) by gabe.freedesktop.org (Postfix) with ESMTPS id C0E1E6E404; Mon, 12 Mar 2018 13:23:55 +0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1000) id A51ED60849; Mon, 12 Mar 2018 13:23:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1520861035; bh=hM1xi7qRGiS8+UONRthEdLxJZDtE7NC1hesgZgBIl5Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I6SU6jYhlxi2fqxAgq/WFwLH+QX9yKaur6HFg3qBopQ7JTh3lolrJnMZRZH8nDtra bQLUnUWL/8Wkxkz9Ox9VLejULrswmhPrdPemIiKOuQoWyms4wQsZ7w3c89AawAGq7m Ci6FyMxuRUYAjR7+QwL0vZngKDZer5E/kVY3KS6Y= Received: from blr-ubuntu-87.qualcomm.com (blr-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.18.19]) (using TLSv1.1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: sibis@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 2DE8660849; Mon, 12 Mar 2018 13:23:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1520861034; bh=hM1xi7qRGiS8+UONRthEdLxJZDtE7NC1hesgZgBIl5Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=g3sXF22A4E/xauhjxzIylgXBtqleqInIgyXuS/hR17Bz8V/Bu0G4reTbd7mmv31Zh 9Slrdk5s+DDCv+XLTDx82/GHXrFPRW7vdmu0EzFWOsQ5+sY/npGBrQhOj0XtDr7H99 NmLGBPU2ECrsl3oh88qJGioxysckE0Fzhk7EmZ2U= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 2DE8660849 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=sibis@codeaurora.org From: Sibi S To: architt@codeaurora.org, robdclark@gmail.com Subject: [PATCH 5/5] drm/msm/dsi: replace version checks for commmand broadcast Date: Mon, 12 Mar 2018 18:53:14 +0530 Message-Id: <1520860994-23334-6-git-send-email-sibis@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1520860994-23334-1-git-send-email-sibis@codeaurora.org> References: <1520860994-23334-1-git-send-email-sibis@codeaurora.org> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, Sibi S , dri-devel@lists.freedesktop.org MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Replace version checks for commmand broadcast with the helper functions bound to cfg_handler for DSI v6G 1.x and DSI 6G v2.0+ controllers Signed-off-by: Sibi S --- drivers/gpu/drm/msm/dsi/dsi_cfg.c | 6 ++++++ drivers/gpu/drm/msm/dsi/dsi_cfg.h | 2 ++ drivers/gpu/drm/msm/dsi/dsi_host.c | 16 +++------------- 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/msm/dsi/dsi_cfg.c b/drivers/gpu/drm/msm/dsi/dsi_cfg.c index dcdfb1b..6ec28d1 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_cfg.c +++ b/drivers/gpu/drm/msm/dsi/dsi_cfg.c @@ -145,6 +145,8 @@ .tx_buf_put = NULL, .dma_base_get = dsi_dma_base_get_v2, .calc_clk_rate = dsi_calc_clk_rate_v2, + .xfer = msm_dsi_manager_cmd_xfer, + .xfer_trigger = msm_dsi_manager_cmd_xfer_trigger, }; const static struct msm_dsi_host_cfg_ops msm_dsi_6g_host_ops = { @@ -156,6 +158,8 @@ .tx_buf_put = dsi_tx_buf_put_6g, .dma_base_get = dsi_dma_base_get_6g, .calc_clk_rate = dsi_calc_clk_rate_6g, + .xfer = msm_dsi_manager_cmd_xfer, + .xfer_trigger = msm_dsi_manager_cmd_xfer_trigger, }; const static struct msm_dsi_host_cfg_ops msm_dsi_6g_v2_host_ops = { @@ -167,6 +171,8 @@ .tx_buf_put = dsi_tx_buf_put_6g, .dma_base_get = dsi_dma_base_get_6g, .calc_clk_rate = dsi_calc_clk_rate_6g, + .xfer = msm_dsi_manager_cmd_xfer_6g_v2, + .xfer_trigger = msm_dsi_manager_cmd_xfer_trigger_6g_v2, }; static const struct msm_dsi_cfg_handler dsi_cfg_handlers[] = { diff --git a/drivers/gpu/drm/msm/dsi/dsi_cfg.h b/drivers/gpu/drm/msm/dsi/dsi_cfg.h index a795a06..145251e 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_cfg.h +++ b/drivers/gpu/drm/msm/dsi/dsi_cfg.h @@ -49,6 +49,8 @@ struct msm_dsi_host_cfg_ops { 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 (*xfer_trigger)(int id, u32 dma_base, u32 len); + int (*xfer)(int id, const struct mipi_dsi_msg *msg); }; 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 bd61cad..240ecb8 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_host.c +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c @@ -1251,13 +1251,8 @@ static int dsi_cmd_dma_tx(struct msm_dsi_host *msm_host, int len) reinit_completion(&msm_host->dma_comp); dsi_wait4video_eng_busy(msm_host); - if ((cfg_hnd->major == MSM_DSI_VER_MAJOR_6G) && - (cfg_hnd->minor < MSM_DSI_6G_VER_MINOR_V2_2_1)) - triggered = msm_dsi_manager_cmd_xfer_trigger(msm_host->id, - dma_base, len); - else - triggered = msm_dsi_manager_cmd_xfer_trigger_6g_v2( - msm_host->id, dma_base, len); + triggered = cfg_hnd->ops->xfer_trigger(msm_host->id, + dma_base, len); if (triggered) { ret = wait_for_completion_timeout(&msm_host->dma_comp, @@ -1615,12 +1610,7 @@ static ssize_t dsi_host_transfer(struct mipi_dsi_host *host, mutex_lock(&msm_host->cmd_mutex); - if (((cfg_hnd->major == MSM_DSI_VER_MAJOR_6G) && - (cfg_hnd->minor < MSM_DSI_6G_VER_MINOR_V2_2_1)) || - (cfg_hnd->major == MSM_DSI_VER_MAJOR_V2)) - ret = msm_dsi_manager_cmd_xfer(msm_host->id, msg); - else - ret = msm_dsi_manager_cmd_xfer_6g_v2(msm_host->id, msg); + ret = cfg_hnd->ops->xfer(msm_host->id, msg); mutex_unlock(&msm_host->cmd_mutex);