Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1872011ybv; Thu, 6 Feb 2020 11:19:51 -0800 (PST) X-Google-Smtp-Source: APXvYqy7Qafm2O/lepLRZ+Al0kp/8RStf34tr1uAb3BgVLwCcTmyzycylRIjhd5i2ZQfla5rVjdM X-Received: by 2002:a05:6808:7dd:: with SMTP id f29mr8239099oij.67.1581016790678; Thu, 06 Feb 2020 11:19:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581016790; cv=none; d=google.com; s=arc-20160816; b=SlFlUurK4jXG/ECY5TCimI7I2sSSJcqrhTmpL9Z6HKxKKZ3Y5wQBjK3zGQU5NazsAv 9C9sVc0on9IkYAxsAOaUaO13NiQ1/Atk5G5JkfNtTOK2CfXuhJi+C1TEmhYN7ZsNdFUv Kt5NkK72s85GZGPV1mChQjNhi4qEUgGt6W2wqB6xy8FvDi+UkEoMHWw0I+INf9lwKqPp Ry2p9YFIY+NADHAvtqEuqxTtvdVG7lFHXUBLdpoxklNOhtCYWZ34SOseKCgq+wBlKQuh UoyBSpFHQ/NCKh6Oimph+bXr6P4lA32hq9lLOhbDZC/7BGyx/uaujf8pmj3zY0RAci9I B00g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=6mFlT0Omv41nAtEpTgYWO4Xf2iU3uM7fX834ml+D12E=; b=hUY4218x38GP76Zalax/r4PqqsJ4gRSYSw1fEuiSPhqJYgmVzF46k8RSTAuEH4f7W8 WI0O1/rPTJ2f7/LXcONdV7GWWGIlP1D5QkfMC2ziGnbvYk2yV2FvDsjn+eNOdjwA7nYu 6fB8/bAQBpeMFp/Y9l0e6vkmZ7V06IWzqf0jPm0NYjVxA8JzIFrdPHyoG2CblhC77PSZ Zlf3XMhit8TxWadCSpdvkIjJHXDEhSnK9u7UPE4CJk4XVnAA866a0sJdKo7xmJXN6iV8 5SVYiS64EcZQIFF94yvpxaPLd4b29z7MQqNRCsSryxHWQP9aOz7fJAcEfDt/O+foyuOK qsjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=rci9PqEx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 194si2588245oii.2.2020.02.06.11.19.38; Thu, 06 Feb 2020 11:19:50 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=rci9PqEx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727916AbgBFTSm (ORCPT + 99 others); Thu, 6 Feb 2020 14:18:42 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:40818 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727703AbgBFTSl (ORCPT ); Thu, 6 Feb 2020 14:18:41 -0500 Received: by mail-wr1-f68.google.com with SMTP id t3so8560397wru.7 for ; Thu, 06 Feb 2020 11:18:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=6mFlT0Omv41nAtEpTgYWO4Xf2iU3uM7fX834ml+D12E=; b=rci9PqEx4hby5MvW1khg7iEKwuy1bfbD4iaH4uETQBur1Za15XCzVjeFY1VfdBhtw4 Sgm+lIqBzDWUcXws81WyInQc4DgofK0ajNixco/KiwkevvAVCOdtY5ZeQ6xfN/Ef6rVb GayBIdYOso2YrWls5jJXiF/U+8TKQSpE/sJZNy5HxzOqmim+LVfpuTuYr/kwh/7kYfdW Y3awX+mVUGcHmrjyQdCGHxtp6dtxRCX/efFt9Twi9ODg1shreYkTyHnQOaQ/ER9EN8Ut ptxJLeh9r0Gvc7WMEkLdB6fdxT1wUa0xnxOwgm+0Q4KtNxTa3y6OHyult0N4gOrTG7WX OpKQ== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=6mFlT0Omv41nAtEpTgYWO4Xf2iU3uM7fX834ml+D12E=; b=UiZrDc2onvn6RXZbJVDO83HGGrkaJUUqL/1laiN0j5ZKpEah0tJJvyPqCZLq1m7O+l yPaN3qQf6G3DySdf4SrOyT9Zc/BRa9+oCALLLx6JA36IiAVr+130J2ACiEMmq2M6iz6d nmZSqmYcXgmEimIdERTQmvgG2i6EEFyhdEpG8zx/81rn/uzkNx0TR+VcPSWtLrvuFy+B zd4Py4JvzWWIgeGgheCPndqfLnLizHPzHJdxK3DQwOFggcqANulvmxV1vcVvFDruw/3Q vtdPl5At8OWVyGa2lRt8za4+gymCyTP7Av/qlhQ7RQoCMmOwI/yyXGhDk/TXVZ3KGZlS hH3A== X-Gm-Message-State: APjAAAUTLc6IyHpIkJXVY4AiYNHgt6YtWOU/ctEeWxLRoIUuIMp1DBrc lSOicYkf5+zaOCwzG8smjarbRQ== X-Received: by 2002:adf:bc87:: with SMTP id g7mr5375779wrh.121.1581016718863; Thu, 06 Feb 2020 11:18:38 -0800 (PST) Received: from bender.baylibre.local ([2a01:e35:2ec0:82b0:7d33:17f7:8097:ecc7]) by smtp.gmail.com with ESMTPSA id m3sm272662wrs.53.2020.02.06.11.18.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Feb 2020 11:18:38 -0800 (PST) From: Neil Armstrong To: a.hajda@samsung.com, Laurent.pinchart@ideasonboard.com, jonas@kwiboo.se, jernej.skrabec@siol.net, boris.brezillon@collabora.com Cc: linux-amlogic@lists.infradead.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Neil Armstrong Subject: [PATCH v4 01/11] drm/bridge: dw-hdmi: set mtmdsclock for deep color Date: Thu, 6 Feb 2020 20:18:24 +0100 Message-Id: <20200206191834.6125-2-narmstrong@baylibre.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20200206191834.6125-1-narmstrong@baylibre.com> References: <20200206191834.6125-1-narmstrong@baylibre.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jonas Karlman Configure the correct mtmdsclock for deep colors to prepare support for 10, 12 & 16bit output. Signed-off-by: Jonas Karlman Signed-off-by: Neil Armstrong --- drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c index 67fca439bbfb..9e0927d22db6 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c @@ -1818,9 +1818,26 @@ static void hdmi_av_composer(struct dw_hdmi *hdmi, dev_dbg(hdmi->dev, "final pixclk = %d\n", vmode->mpixelclock); + if (!hdmi_bus_fmt_is_yuv422(hdmi->hdmi_data.enc_out_bus_format)) { + switch (hdmi_bus_fmt_color_depth( + hdmi->hdmi_data.enc_out_bus_format)) { + case 16: + vmode->mtmdsclock = (u64)vmode->mpixelclock * 2; + break; + case 12: + vmode->mtmdsclock = (u64)vmode->mpixelclock * 3 / 2; + break; + case 10: + vmode->mtmdsclock = (u64)vmode->mpixelclock * 5 / 4; + break; + } + } + if (hdmi_bus_fmt_is_yuv420(hdmi->hdmi_data.enc_out_bus_format)) vmode->mtmdsclock /= 2; + dev_dbg(hdmi->dev, "final tmdsclk = %d\n", vmode->mtmdsclock); + /* Set up HDMI_FC_INVIDCONF */ inv_val = (hdmi->hdmi_data.hdcp_enable || (dw_hdmi_support_scdc(hdmi) && -- 2.22.0