From patchwork Mon Oct 9 19:37:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 115295 Delivered-To: patches@linaro.org Received: by 10.140.22.163 with SMTP id 32csp2921841qgn; Mon, 9 Oct 2017 12:37:54 -0700 (PDT) X-Received: by 10.98.98.66 with SMTP id w63mr11163409pfb.163.1507577874366; Mon, 09 Oct 2017 12:37:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507577874; cv=none; d=google.com; s=arc-20160816; b=vJIb+PGRmlqzhIqqttDHK9LxRM90RXmQIWyRepWBoSEWBoZZ/3Wee7tKjmQRFj7xZQ RQEnFa7dEH14NMvqiaHY1Hq6by1Xk0SFe0JOKv6z9d6pZt/d4yIr1PPB6i3zDjgDiyrd 8AzP4UMe35byZBT8CL4WBX8u307YAP/2EC9jpKQzlTYyMj4VtUYCkn641LUirAcu6lPx 0bKwq0+x51paD2LYbOZ5cVCHdwznNG1d78RPyzoW+AB5sFw6+TKEKG/+AoBszOV4287E 0diPK67j3GbJXVDG/J0RexuSCVyJmiWWXma7yr5eFv4wgAvHD6EsCCbo0U0K/UtjyqO7 feVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=lEe5N0NDUQGS/7YwSao5zd4Iix/yC3tXXgmf0uqjnMA=; b=EIDYQBkxBBvF6euso1U3GkJ94fLt0TMx33GK2wLr+JBNnmO2kvcTPeDjhovt6o+zx8 JlX2XZx7dVDZc4nMVk+wuPBGeUWGbeWgYk5g6/ZvR1/06ofYrDxvpWWFy/6ZbIk5PRnm aT4GCONyc45klW6i2cpXUEh+v205eB4r+DcCCbXW8DxOQOSgEfP5Yx3B82N/dimKW7NU 5EzyvowE5kOcQN7o46D26CaW8gk7SZxAlFEY0NlGZx1C/UF/C5+/mFQxN3DyTra+J5Sp Rph+eYHw8fAshHqFD2bWPa6yKTV63BYP9KoRPStBqIb5kPU23IkgZAjjuTxaSJ+JCzc+ 0H4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QTzNSd1s; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.41 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id e8sor799276pgt.312.2017.10.09.12.37.54 for (Google Transport Security); Mon, 09 Oct 2017 12:37:54 -0700 (PDT) Received-SPF: pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QTzNSd1s; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.41 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=lEe5N0NDUQGS/7YwSao5zd4Iix/yC3tXXgmf0uqjnMA=; b=QTzNSd1s8QK+gYhQNsvqmjNdA4AtaFlQByr+Nv10XXHgv35KHZ0HIhxqD7bP6Cwjto w79aY8BXeYSyGlJmhnRLHhIJLaZAB49y2ShliG0N2aJg+LXASYa7XhVpAMNzRHn7STMH J4VtqiyjPaF4Ygz5ahLzBRhaHZR1dcc0j0UKE= 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; bh=lEe5N0NDUQGS/7YwSao5zd4Iix/yC3tXXgmf0uqjnMA=; b=r+vCuxmcDQOvSIEn+MjYFkLSNBO75MF7zX8a7zUO28P1E9vq2JpcvGT81HEs+Oq1Kd O8cntCQzpYcmcZiSl2CARbZwm0aouIHFkqN0va0gds/OfCkAiJx9rbrDCTYe2Q2hfXJG bk8tEuybBOHpmImWnxsSVt82aMCn1jDWRMNKkI6dt3td2SIJB4u2aBCo4X4yrw2lZ3Wq hFv/L+eWEuv+rHbC6nzV1tr1zpLtadkhtSl425o9Np3ryvyw8bqHxtHyhnHWw5Mi5jA6 RQc7+EN9X13j3k57eI6NcCNOpok7h1E0H2vdVuxgyAG+wPHkKFzOA8Uw4enQYovusk+T Qk2A== X-Gm-Message-State: AMCzsaVEULpNZlWF/1HM0rE+KS08FysCVuGx0UIRPNTLci/OAOcfryWy vyrY8JFxBbYKCj/sZxVirHQKGqzQ X-Google-Smtp-Source: AOwi7QBgLR/6V/KBzHhUlu7F/Jz0V1qs+DxztVv8bNRgcoqwJ1jp6ucq2BYRrhoTh2F+GTPeTLgviA== X-Received: by 10.99.104.68 with SMTP id d65mr10283376pgc.340.1507577873892; Mon, 09 Oct 2017 12:37:53 -0700 (PDT) Return-Path: Received: from localhost.localdomain ([2601:1c2:1002:83f0:4e72:b9ff:fe99:466a]) by smtp.gmail.com with ESMTPSA id y27sm4828781pfi.107.2017.10.09.12.37.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 09 Oct 2017 12:37:52 -0700 (PDT) From: John Stultz To: Damien Dejean , Sahaj Sarup Cc: John Stultz Subject: [PATCH] HACK: DEBUG patch for sorting out valid modes w/ 4.9 Date: Mon, 9 Oct 2017 12:37:47 -0700 Message-Id: <1507577867-6968-1-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 2.7.4 We have a better solution upstream but for older kernels this can let folks figure out if a mode is valid or not. Signed-off-by: John Stultz --- drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 8 ++++---- drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c | 12 ++++++++++-- drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c | 3 +++ 3 files changed, 17 insertions(+), 6 deletions(-) -- 2.7.4 diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c index 3bd1ce7..d066342 100644 --- a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c +++ b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c @@ -642,7 +642,7 @@ static int adv7511_mode_valid(struct adv7511 *adv7511, /* * some work well modes which want to put in the front of the mode list. */ - DRM_DEBUG("Checking mode %ix%i@%i clock: %i...", + printk("JDB: Checking mode %ix%i@%i clock: %i...", mode->hdisplay, mode->vdisplay, drm_mode_vrefresh(mode), mode->clock); if ((mode->hdisplay == 1920 && mode->vdisplay == 1080 && mode->clock == 148500) || (mode->hdisplay == 1280 && mode->vdisplay == 800 && mode->clock == 83496) || @@ -652,11 +652,11 @@ static int adv7511_mode_valid(struct adv7511 *adv7511, (mode->hdisplay == 1024 && mode->vdisplay == 768 && mode->clock == 81833) || (mode->hdisplay == 800 && mode->vdisplay == 600 && mode->clock == 40000)) { mode->type |= DRM_MODE_TYPE_PREFERRED; - DRM_DEBUG("OK\n"); + printk("Whitelist OK\n"); return MODE_OK; } - DRM_DEBUG("BAD\n"); - return MODE_BAD; + printk("Witelist BAD (still reporting OK)\n"); + return MODE_OK; } static void adv7511_mode_set(struct adv7511 *adv7511, diff --git a/drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c b/drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c index 998452a..5963996 100644 --- a/drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c +++ b/drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c @@ -563,8 +563,16 @@ static void dsi_mipi_init(struct dw_dsi *dsi) /* dsi wake up */ writel(POWERUP, base + PWR_UP); - DRM_DEBUG_DRIVER("lanes=%d, pixel_clk=%d kHz, bytes_freq=%d kHz\n", - dsi->lanes, mode->clock, phy->lane_byte_clk_kHz); + printk("JDB: %s: lanes=%d, pixel_clk=%d kHz, req_kHz=%d kHz, bytes_freq=%d kHz\n", + __func__, dsi->lanes, mode->clock, dphy_req_kHz, phy->lane_byte_clk_kHz); + + printk("JDB: %s: %d/%d =?= %d/3 .... ", __func__, mode->clock, dsi->lanes, phy->lane_byte_clk_kHz); + if (mode->clock/dsi->lanes == phy->lane_byte_clk_kHz/3) + printk("JDB: MATCHED GOOD!\n"); + else + printk("JDB: DOES NOT MATCH, BAD!\n"); + + } static void dsi_encoder_disable(struct drm_encoder *encoder) diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c index 7e7a4d4..b371e4c 100644 --- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c +++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c @@ -193,6 +193,9 @@ static void ade_set_pix_clk(struct ade_hw_ctx *ctx, if (ret) DRM_ERROR("failed to set pixel clk %dHz (%d)\n", clk_Hz, ret); adj_mode->clock = clk_get_rate(ctx->ade_pix_clk) / 1000; + + printk("JDB: %s: %ix%i@%i requested clock: %ld, adjusted clock: %ld\n", __func__, mode->hdisplay, mode->vdisplay, drm_mode_vrefresh(mode), mode->clock, adj_mode->clock); + } static void ade_ldi_set_mode(struct ade_crtc *acrtc,