From patchwork Fri Oct 31 22:54:24 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Longerbeam X-Patchwork-Id: 5207621 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 3B1DE9F318 for ; Fri, 31 Oct 2014 23:57:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 475AD20176 for ; Fri, 31 Oct 2014 23:57:17 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 57CD020120 for ; Fri, 31 Oct 2014 23:57:16 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 77F276E880; Fri, 31 Oct 2014 16:56:41 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pd0-f177.google.com (mail-pd0-f177.google.com [209.85.192.177]) by gabe.freedesktop.org (Postfix) with ESMTP id 60B736E84B for ; Fri, 31 Oct 2014 15:57:22 -0700 (PDT) Received: by mail-pd0-f177.google.com with SMTP id v10so8057310pde.36 for ; Fri, 31 Oct 2014 15:57:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=O/LxkF1mKQanjEdJKUzQp3V4XS7hui3heW+4K59mN+k=; b=h8Jb4aQJVYlQ7SV5YKoFCzf3wC/+9wHWUVKarpspMzhOimDbLON085dKj3xGBWwvyf Hz9ZLc2pW9cPbLa/m2h0onrdKEKbslGoO+8OEDerjfMBsKiEzvx9FVUUUh1nB7OW1WA3 cVCuUR6LGM7VRYQ7zuRvNUXLv9eJd3PPfXmW/SLcfLxoujF0w0k4O1Gq6gw08BsUTbQB EQqGcE3xy3GlC/80UacECpMW1ixs2CD4OuEgmIHRQakBmnVLza7FLWI6l7A/i/dD/4T1 J2sJZt4Y4/6dLnKfUD9fW65hYYsXFVbZP/9b62F0lYcqwAqiJovHVFqRQRyA0b7q8V7r E10w== X-Received: by 10.68.197.170 with SMTP id iv10mr27725130pbc.135.1414796242180; Fri, 31 Oct 2014 15:57:22 -0700 (PDT) Received: from mothership.mgc.mentorg.com (c-50-152-159-227.hsd1.ca.comcast.net. [50.152.159.227]) by mx.google.com with ESMTPSA id ev8sm10870656pdb.28.2014.10.31.15.57.21 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 31 Oct 2014 15:57:21 -0700 (PDT) From: Steve Longerbeam X-Google-Original-From: Steve Longerbeam To: dri-devel@lists.freedesktop.org Subject: [PATCH 41/72] imx-drm: imx-ldb: Add debug to connector/encoder entry points Date: Fri, 31 Oct 2014 15:54:24 -0700 Message-Id: <1414796095-10107-42-git-send-email-steve_longerbeam@mentor.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1414796095-10107-1-git-send-email-steve_longerbeam@mentor.com> References: <1414796095-10107-1-git-send-email-steve_longerbeam@mentor.com> X-Mailman-Approved-At: Fri, 31 Oct 2014 16:56:32 -0700 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add some debug macros for the important encoder and connector callbacks. Signed-off-by: Steve Longerbeam --- drivers/staging/imx-drm/imx-ldb.c | 36 +++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/drivers/staging/imx-drm/imx-ldb.c b/drivers/staging/imx-drm/imx-ldb.c index 4662e00..73ff379 100644 --- a/drivers/staging/imx-drm/imx-ldb.c +++ b/drivers/staging/imx-drm/imx-ldb.c @@ -85,6 +85,11 @@ struct imx_ldb { const struct bus_mux *lvds_mux; }; +#define imx_ldb_dbg(ch, fmt, args...) \ + dev_dbg((ch)->ldb->dev, "lvds%d: " fmt, (ch)->chno, ##args) +#define imx_ldb_entry_dbg(ch) \ + imx_ldb_dbg((ch), "%s\n", __func__) + static enum drm_connector_status imx_ldb_connector_detect( struct drm_connector *connector, bool force) { @@ -96,6 +101,8 @@ static int imx_ldb_connector_get_modes(struct drm_connector *connector) struct imx_ldb_channel *imx_ldb_ch = con_to_imx_ldb_ch(connector); int num_modes = 0; + imx_ldb_entry_dbg(imx_ldb_ch); + if (imx_ldb_ch->edid) { drm_mode_connector_update_edid_property(connector, imx_ldb_ch->edid); @@ -127,6 +134,9 @@ static struct drm_encoder *imx_ldb_connector_best_encoder( static void imx_ldb_encoder_dpms(struct drm_encoder *encoder, int mode) { + struct imx_ldb_channel *imx_ldb_ch = enc_to_imx_ldb_ch(encoder); + + imx_ldb_dbg(imx_ldb_ch, "%s: %s\n", __func__, mode ? "OFF" : "ON"); } static bool imx_ldb_encoder_mode_fixup(struct drm_encoder *encoder, @@ -139,22 +149,22 @@ static bool imx_ldb_encoder_mode_fixup(struct drm_encoder *encoder, static void imx_ldb_set_clock(struct imx_ldb *ldb, int mux, int chno, unsigned long serial_clk, unsigned long di_clk) { + struct imx_ldb_channel *imx_ldb_ch = &ldb->channel[chno]; int ret; - dev_dbg(ldb->dev, "%s: now: %ld want: %ld\n", __func__, - clk_get_rate(ldb->clk_pll[chno]), serial_clk); + imx_ldb_dbg(imx_ldb_ch, "%s: now: %ld want: %ld\n", __func__, + clk_get_rate(ldb->clk_pll[chno]), serial_clk); clk_set_rate(ldb->clk_pll[chno], serial_clk); - dev_dbg(ldb->dev, "%s after: %ld\n", __func__, - clk_get_rate(ldb->clk_pll[chno])); + imx_ldb_dbg(imx_ldb_ch, "%s after: %ld\n", __func__, + clk_get_rate(ldb->clk_pll[chno])); - dev_dbg(ldb->dev, "%s: now: %ld want: %ld\n", __func__, - clk_get_rate(ldb->clk[chno]), - (long int)di_clk); + imx_ldb_dbg(imx_ldb_ch, "%s: now: %ld want: %ld\n", __func__, + clk_get_rate(ldb->clk[chno]), (long int)di_clk); clk_set_rate(ldb->clk[chno], di_clk); - dev_dbg(ldb->dev, "%s after: %ld\n", __func__, - clk_get_rate(ldb->clk[chno])); + imx_ldb_dbg(imx_ldb_ch, "%s after: %ld\n", __func__, + clk_get_rate(ldb->clk[chno])); /* set display clock mux to LDB input clock */ ret = clk_set_parent(ldb->clk_sel[mux], ldb->clk[chno]); @@ -174,6 +184,8 @@ static void imx_ldb_encoder_prepare(struct drm_encoder *encoder) unsigned long di_clk = mode->clock * 1000; int mux = imx_drm_encoder_get_mux_id(imx_ldb_ch->child, encoder); + imx_ldb_entry_dbg(imx_ldb_ch); + if (ldb->ldb_ctrl & LDB_SPLIT_MODE_EN) { /* dual channel LVDS mode */ serial_clk = 3500UL * mode->clock; @@ -210,6 +222,8 @@ static void imx_ldb_encoder_commit(struct drm_encoder *encoder) int dual = ldb->ldb_ctrl & LDB_SPLIT_MODE_EN; int mux = imx_drm_encoder_get_mux_id(imx_ldb_ch->child, encoder); + imx_ldb_entry_dbg(imx_ldb_ch); + if (dual) { clk_prepare_enable(ldb->clk[0]); clk_prepare_enable(ldb->clk[1]); @@ -253,6 +267,8 @@ static void imx_ldb_encoder_mode_set(struct drm_encoder *encoder, struct imx_ldb *ldb = imx_ldb_ch->ldb; int dual = ldb->ldb_ctrl & LDB_SPLIT_MODE_EN; + imx_ldb_entry_dbg(imx_ldb_ch); + if (mode->clock > 170000) { dev_warn(ldb->dev, "%s: mode exceeds 170 MHz pixel clock\n", __func__); @@ -282,6 +298,8 @@ static void imx_ldb_encoder_disable(struct drm_encoder *encoder) struct imx_ldb_channel *imx_ldb_ch = enc_to_imx_ldb_ch(encoder); struct imx_ldb *ldb = imx_ldb_ch->ldb; + imx_ldb_entry_dbg(imx_ldb_ch); + /* * imx_ldb_encoder_disable is called by * drm_helper_disable_unused_functions without