From patchwork Fri Jul 19 15:59:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Noralf_Tr=C3=B8nnes?= X-Patchwork-Id: 11050285 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 11D6A13BD for ; Fri, 19 Jul 2019 15:59:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 00869288BF for ; Fri, 19 Jul 2019 15:59:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E8FAE288C4; Fri, 19 Jul 2019 15:59:51 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED 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 7F013288BF for ; Fri, 19 Jul 2019 15:59:51 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8B08F6E853; Fri, 19 Jul 2019 15:59:48 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from smtp.domeneshop.no (smtp.domeneshop.no [IPv6:2a01:5b40:0:3005::1]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1353D6E851 for ; Fri, 19 Jul 2019 15:59:39 +0000 (UTC) Received: from 211.81-166-168.customer.lyse.net ([81.166.168.211]:55144 helo=localhost.localdomain) by smtp.domeneshop.no with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.84_2) (envelope-from ) id 1hoVIH-0001bQ-3N; Fri, 19 Jul 2019 17:59:37 +0200 From: =?utf-8?q?Noralf_Tr=C3=B8nnes?= To: dri-devel@lists.freedesktop.org Subject: [PATCH v2 04/11] drm/tinydrm: Remove spi debug buffer dumping Date: Fri, 19 Jul 2019 17:59:09 +0200 Message-Id: <20190719155916.62465-5-noralf@tronnes.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190719155916.62465-1-noralf@tronnes.org> References: <20190719155916.62465-1-noralf@tronnes.org> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tronnes.org; s=ds201810; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=jcFyK+CemsX184RDJ30wSwdO3yfafNlKfahsbOi7U+o=; b=KLFsUJ3abkFD3JfRv6NXEvVckBs7VR4BznR+vyQgARovWstZYo77ZKSKZ4xOrFIUnU8kI5PdgcPjWqbY6KrM1COc5crZs238/q3aJAkwXeTRsDkAx6LTbV/JgYoL3l7vf+B4tJKIaaUbVg32WKeVwiAP4v4dZehft5j23uqEx3eLBIfQIAB+i7vlqCDFYE+XNgoIEVH+nCnA5WOCquFFLTpngphRDYp5z9NQ3yYpyuanKKzL2ggkZODo645QsO1QckLVJe1Y20TM8ymgJS90Y0InAtY2+LvI1Q3NpfcJU0i/23FTSKkfFfU3YPSvjbzecYi6UkWsN3wK+Cj2ckkZMg==; 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: sam@ravnborg.org, david@lechnology.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP The SPI event tracing can dump the buffer now so no need for this. Remove the debug print from tinydrm_spi_transfer() since this info can be gleaned from the trace event. Reviewed-by: Sam Ravnborg Signed-off-by: Noralf Trønnes --- .../gpu/drm/tinydrm/core/tinydrm-helpers.c | 40 ------------------- drivers/gpu/drm/tinydrm/mipi-dbi.c | 6 --- include/drm/tinydrm/tinydrm-helpers.h | 25 ------------ 3 files changed, 71 deletions(-) diff --git a/drivers/gpu/drm/tinydrm/core/tinydrm-helpers.c b/drivers/gpu/drm/tinydrm/core/tinydrm-helpers.c index aeb49cefed25..272616a246cd 100644 --- a/drivers/gpu/drm/tinydrm/core/tinydrm-helpers.c +++ b/drivers/gpu/drm/tinydrm/core/tinydrm-helpers.c @@ -53,41 +53,6 @@ size_t tinydrm_spi_max_transfer_size(struct spi_device *spi, size_t max_len) } EXPORT_SYMBOL(tinydrm_spi_max_transfer_size); -static void -tinydrm_dbg_spi_print(struct spi_device *spi, struct spi_transfer *tr, - const void *buf, int idx, bool tx) -{ - u32 speed_hz = tr->speed_hz ? tr->speed_hz : spi->max_speed_hz; - char linebuf[3 * 32]; - - hex_dump_to_buffer(buf, tr->len, 16, - DIV_ROUND_UP(tr->bits_per_word, 8), - linebuf, sizeof(linebuf), false); - - printk(KERN_DEBUG - " tr(%i): speed=%u%s, bpw=%i, len=%u, %s_buf=[%s%s]\n", idx, - speed_hz > 1000000 ? speed_hz / 1000000 : speed_hz / 1000, - speed_hz > 1000000 ? "MHz" : "kHz", tr->bits_per_word, tr->len, - tx ? "tx" : "rx", linebuf, tr->len > 16 ? " ..." : ""); -} - -/* called through tinydrm_dbg_spi_message() */ -void _tinydrm_dbg_spi_message(struct spi_device *spi, struct spi_message *m) -{ - struct spi_transfer *tmp; - int i = 0; - - list_for_each_entry(tmp, &m->transfers, transfer_list) { - - if (tmp->tx_buf) - tinydrm_dbg_spi_print(spi, tmp, tmp->tx_buf, i, true); - if (tmp->rx_buf) - tinydrm_dbg_spi_print(spi, tmp, tmp->rx_buf, i, false); - i++; - } -} -EXPORT_SYMBOL(_tinydrm_dbg_spi_message); - /** * tinydrm_spi_transfer - SPI transfer helper * @spi: SPI device @@ -125,10 +90,6 @@ int tinydrm_spi_transfer(struct spi_device *spi, u32 speed_hz, max_chunk = tinydrm_spi_max_transfer_size(spi, 0); - if (drm_debug & DRM_UT_DRIVER) - pr_debug("[drm:%s] bpw=%u, max_chunk=%zu, transfers:\n", - __func__, bpw, max_chunk); - if (bpw == 16 && !spi_is_bpw_supported(spi, 16)) { tr.bits_per_word = 8; if (tinydrm_machine_little_endian()) { @@ -162,7 +123,6 @@ int tinydrm_spi_transfer(struct spi_device *spi, u32 speed_hz, buf += chunk; len -= chunk; - tinydrm_dbg_spi_message(spi, &m); ret = spi_sync(spi, &m); if (ret) return ret; diff --git a/drivers/gpu/drm/tinydrm/mipi-dbi.c b/drivers/gpu/drm/tinydrm/mipi-dbi.c index b6c46453e904..99509d16b037 100644 --- a/drivers/gpu/drm/tinydrm/mipi-dbi.c +++ b/drivers/gpu/drm/tinydrm/mipi-dbi.c @@ -679,8 +679,6 @@ static int mipi_dbi_spi1e_transfer(struct mipi_dbi *mipi, int dc, dst[8] = *src; tr.len = 9; - tinydrm_dbg_spi_message(spi, &m); - return spi_sync(spi, &m); } @@ -758,7 +756,6 @@ static int mipi_dbi_spi1e_transfer(struct mipi_dbi *mipi, int dc, tr.len = chunk + added; - tinydrm_dbg_spi_message(spi, &m); ret = spi_sync(spi, &m); if (ret) return ret; @@ -822,7 +819,6 @@ static int mipi_dbi_spi1_transfer(struct mipi_dbi *mipi, int dc, tr.len = chunk; len -= chunk; - tinydrm_dbg_spi_message(spi, &m); ret = spi_sync(spi, &m); if (ret) return ret; @@ -898,8 +894,6 @@ static int mipi_dbi_typec3_command_read(struct mipi_dbi *mipi, u8 *cmd, if (ret) goto err_free; - tinydrm_dbg_spi_message(spi, &m); - if (tr[1].len == len) { memcpy(data, buf, len); } else { diff --git a/include/drm/tinydrm/tinydrm-helpers.h b/include/drm/tinydrm/tinydrm-helpers.h index 146bc383297c..dca75de3a359 100644 --- a/include/drm/tinydrm/tinydrm-helpers.h +++ b/include/drm/tinydrm/tinydrm-helpers.h @@ -14,7 +14,6 @@ struct drm_rect; struct drm_simple_display_pipe; struct drm_simple_display_pipe_funcs; struct spi_transfer; -struct spi_message; struct spi_device; struct device; @@ -46,29 +45,5 @@ size_t tinydrm_spi_max_transfer_size(struct spi_device *spi, size_t max_len); int tinydrm_spi_transfer(struct spi_device *spi, u32 speed_hz, struct spi_transfer *header, u8 bpw, const void *buf, size_t len); -void _tinydrm_dbg_spi_message(struct spi_device *spi, struct spi_message *m); - -#ifdef DEBUG -/** - * tinydrm_dbg_spi_message - Dump SPI message - * @spi: SPI device - * @m: SPI message - * - * Dumps info about the transfers in a SPI message including buffer content. - * DEBUG has to be defined for this function to be enabled alongside setting - * the DRM_UT_DRIVER bit of &drm_debug. - */ -static inline void tinydrm_dbg_spi_message(struct spi_device *spi, - struct spi_message *m) -{ - if (drm_debug & DRM_UT_DRIVER) - _tinydrm_dbg_spi_message(spi, m); -} -#else -static inline void tinydrm_dbg_spi_message(struct spi_device *spi, - struct spi_message *m) -{ -} -#endif /* DEBUG */ #endif /* __LINUX_TINYDRM_HELPERS_H */