From patchwork Tue Dec 15 10:45:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 11974431 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=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,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 1A4D9C2BB9A for ; Tue, 15 Dec 2020 10:47:58 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B6F672222A for ; Tue, 15 Dec 2020 10:47:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B6F672222A Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=ti.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1F3436E1ED; Tue, 15 Dec 2020 10:47:38 +0000 (UTC) Received: from fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142]) by gabe.freedesktop.org (Postfix) with ESMTPS id 01C1C6E1BD for ; Tue, 15 Dec 2020 10:47:23 +0000 (UTC) Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 0BFAlN5W123905 for ; Tue, 15 Dec 2020 04:47:23 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1608029243; bh=brqGUoek86JvLx/0fWso334f6rIEGQEoDjeHYaQ/f4M=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=kYBPTthQjBnP6WX6ya1btnVbM/f+agFZjf5rYKgx8W2uokC9bMlpf9BDMNypiAkCG xIhUC1hlmUf+Fhfv9vyfvqf4T5ndutMuDBNH7vG+ZNjFHIWPABZ5rK6R6EHO3fQZig 44dxvdJ3ekrk5uQPSGnzZXzLf/RhHFDHXcjeEJcU= Received: from DFLE100.ent.ti.com (dfle100.ent.ti.com [10.64.6.21]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 0BFAlNrw000404 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Tue, 15 Dec 2020 04:47:23 -0600 Received: from DFLE106.ent.ti.com (10.64.6.27) by DFLE100.ent.ti.com (10.64.6.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3; Tue, 15 Dec 2020 04:47:23 -0600 Received: from fllv0040.itg.ti.com (10.64.41.20) by DFLE106.ent.ti.com (10.64.6.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3 via Frontend Transport; Tue, 15 Dec 2020 04:47:23 -0600 Received: from deskari.lan (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id 0BFAkwa9046467; Tue, 15 Dec 2020 04:47:22 -0600 From: Tomi Valkeinen To: Subject: [PATCH v6 23/84] drm/omap: dsi: lp/hs switching support for transfer() Date: Tue, 15 Dec 2020 12:45:56 +0200 Message-ID: <20201215104657.802264-24-tomi.valkeinen@ti.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201215104657.802264-1-tomi.valkeinen@ti.com> References: <20201215104657.802264-1-tomi.valkeinen@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: tomi.valkeinen@ti.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Sebastian Reichel Integrate low-power / high-speed bus switching into transfer function and drop the omapdrm specific enable_hs() callback. Signed-off-by: Sebastian Reichel Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart --- drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c | 6 +++--- drivers/gpu/drm/omapdrm/dss/dsi.c | 9 +++++++-- drivers/gpu/drm/omapdrm/dss/omapdss.h | 2 -- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c index 8534d0633e37..6a32a0402fa3 100644 --- a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c +++ b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c @@ -269,7 +269,7 @@ static int dsicm_exit_ulps(struct panel_drv_data *ddata) return 0; src->ops->enable(src); - src->ops->dsi.enable_hs(src, ddata->dsi->channel, true); + ddata->dsi->mode_flags &= ~MIPI_DSI_MODE_LPM; r = _dsicm_enable_te(ddata, true); if (r) { @@ -573,7 +573,7 @@ static int dsicm_power_on(struct panel_drv_data *ddata) dsicm_hw_reset(ddata); - src->ops->dsi.enable_hs(src, ddata->dsi->channel, false); + ddata->dsi->mode_flags |= MIPI_DSI_MODE_LPM; r = dsicm_sleep_out(ddata); if (r) @@ -616,7 +616,7 @@ static int dsicm_power_on(struct panel_drv_data *ddata) ddata->intro_printed = true; } - src->ops->dsi.enable_hs(src, ddata->dsi->channel, true); + ddata->dsi->mode_flags &= ~MIPI_DSI_MODE_LPM; return 0; err: diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c b/drivers/gpu/drm/omapdrm/dss/dsi.c index bf7bee0b9334..501784137708 100644 --- a/drivers/gpu/drm/omapdrm/dss/dsi.c +++ b/drivers/gpu/drm/omapdrm/dss/dsi.c @@ -329,6 +329,7 @@ struct dsi_data { int irq; bool is_enabled; + bool in_lp_mode; struct clk *dss_clk; struct regmap *syscon; @@ -2433,6 +2434,8 @@ static void dsi_vc_enable_hs(struct omap_dss_device *dssdev, int channel, /* start the DDR clock by sending a NULL packet */ if (dsi->vm_timings.ddr_clk_always_on && enable) dsi_vc_send_null(dsi, channel); + + dsi->in_lp_mode = !enable; } static void dsi_vc_flush_long_data(struct dsi_data *dsi, int channel) @@ -4690,6 +4693,10 @@ static ssize_t omap_dsi_host_transfer(struct mipi_dsi_host *host, struct dsi_data *dsi = host_to_omap(host); struct omap_dss_device *dssdev = &dsi->output; + if (!!(msg->flags & MIPI_DSI_MSG_USE_LPM) != dsi->in_lp_mode) + dsi_vc_enable_hs(dssdev, msg->channel, + !(msg->flags & MIPI_DSI_MSG_USE_LPM)); + switch (msg->type) { case MIPI_DSI_GENERIC_SHORT_WRITE_0_PARAM: case MIPI_DSI_GENERIC_SHORT_WRITE_1_PARAM: @@ -4750,8 +4757,6 @@ static const struct omap_dss_device_ops dsi_ops = { .disable = dsi_display_disable, - .enable_hs = dsi_vc_enable_hs, - .set_config = dsi_set_config, .enable_video_output = dsi_enable_video_output, diff --git a/drivers/gpu/drm/omapdrm/dss/omapdss.h b/drivers/gpu/drm/omapdrm/dss/omapdss.h index b02a75d55133..b020e8e57e0e 100644 --- a/drivers/gpu/drm/omapdrm/dss/omapdss.h +++ b/drivers/gpu/drm/omapdrm/dss/omapdss.h @@ -288,8 +288,6 @@ struct omapdss_dsi_ops { int (*set_config)(struct omap_dss_device *dssdev, const struct omap_dss_dsi_config *cfg); - void (*enable_hs)(struct omap_dss_device *dssdev, int channel, - bool enable); int (*enable_te)(struct omap_dss_device *dssdev, bool enable); int (*update)(struct omap_dss_device *dssdev, int channel,