From patchwork Tue Jan 15 12:33:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 10764407 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 8F3B091E for ; Tue, 15 Jan 2019 12:33:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7E7552B7C4 for ; Tue, 15 Jan 2019 12:33:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 724592B803; Tue, 15 Jan 2019 12:33:25 +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 E2E7F2B7C4 for ; Tue, 15 Jan 2019 12:33:24 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 496086E68B; Tue, 15 Jan 2019 12:33:23 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5447F6E68B for ; Tue, 15 Jan 2019 12:33:21 +0000 (UTC) Received: by mail-wm1-x341.google.com with SMTP id n190so3129897wmd.0 for ; Tue, 15 Jan 2019 04:33:21 -0800 (PST) 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:mime-version :content-transfer-encoding; bh=OnmW3I3aEOcM2Y+7WXt4KDIp2EOVSptX4pBq7/8Df+o=; b=NemiQdxKXgBUKzY9KGtixSa+JkUe4UAKimQy94gDZrstVd9HyeN3vvzUYJSIkGbFgs lp3E36BFsBWBUCV/lXga8PaF0SMbSsVLBJTBzbpqGx+ANLFP5GJNh2/FGfItJsMue1ri JeIEEIpHKg2ZqIrMiDEf1YEp1b3uWRto/K/sleS17w0XdYnTiZbK0A8gIu0gc+A5WLsh cW+TzRFUW/R+0iaaYdSyPsGTndkqyufmYtC2t99wPp6FiOduQUfYVHuhNS6lHSzyiskj ECeZtVE/2p/Aor3WzbHZl7YvAGyQZBDgriyZnTOl4ZO/YTMKcDLrgm9FjKqlvbCF5og/ vKgw== X-Gm-Message-State: AJcUukcFG0EC0Se8IgcCtjFiJo+4SWZWJhLG/9pRnOtNJBXBJ9CJY0s2 tyV+lPfO3lbHoTKKjdABcgucqw== X-Google-Smtp-Source: ALg8bN4JQ2jEGUeUu2Z6Tlisa1zjk3iTHIYjpA6uu4+OeEo6P4OMbzX1XyoQkWD9Jl52Pn73gUuLRw== X-Received: by 2002:a7b:c951:: with SMTP id i17mr3410360wml.70.1547555599796; Tue, 15 Jan 2019 04:33:19 -0800 (PST) Received: from bender.baylibre.local (lmontsouris-657-1-212-31.w90-63.abo.wanadoo.fr. [90.63.244.31]) by smtp.gmail.com with ESMTPSA id x15sm75658842wrs.27.2019.01.15.04.33.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 15 Jan 2019 04:33:19 -0800 (PST) From: Neil Armstrong To: a.hajda@samsung.com, Laurent.pinchart@ideasonboard.com, Philipp Zabel , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , maxime.ripard@bootlin.com Subject: [PATCH 0/8] drm/meson: Add support for HDMI2.0 4k60 Date: Tue, 15 Jan 2019 13:33:07 +0100 Message-Id: <20190115123315.11069-1-narmstrong@baylibre.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 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: linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Neil Armstrong Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP This patchset aims to add support for the following HDMI2.0 4k60 modes: - 594Mhz TMDS frequency needing TMDS Scramling and 1/40 rate for RGB/YUV4:4:4 - 297MHz TMDS frequency with YUV4:2:0 encoding The first mode uses the SCDC helpers introduced by intel to : - discover where the monitor support SCDC - setup the SCDC parameters This is implemented in the dw-hdmi bridge driver by handling scrambling support during the bridge setup and by exporting an helper for the PHY setup to setup the SCDC configuration for the 1/40 TMDS rate. This code will only be active if the encoder support a TMDS rate > 340MHz. This patch could eventually break support on different SoC when connected on a 4k60 monitor with SCDC : - i.MX correctly discards pixel clocks > 216MHz - R-CAR discards discards pixel clocks > 297MHz since [1] - Rockchip discards invalid pixel clocks not in the rockchip_mpll_cfg table - sun8i correctly discards pixel clocks > 297MHz on a83t - sun8i discards discards pixel clocks > 594Mhz on h6, which is already broken First patch should fix support for Allwinner H6. The second mode is implemented by added the missing 4:2:0 bypass handling in the dw-hdmi bridge driver and adding a "mtmdsclock" separating the pixel clock from the tmds clock in the mode setup phase. We also enable support for these modes in the connector only if the platform glue code explicits the support. Only the meson DRM dw_hdmi glue allows ycbcr420 modes, so no breakage is expected here. The remaining patches adds support for : - 1/40 TMDS rate aka DIV40 in the dw-hdmi meson PHY setup - 4:2:0 output and clock setup The dw-hdmi support re-uses the support done by Rockchip engineers on the Linux 4.4 BSP kernel. These modes has been validated using a MuxLab HDMI Signal Analyser in addition to different UHD TVs supporting full 4k60 or the 4:2:0 variant. Changes since RFC v2 at [3]: - Collected tested-by and reviewed-by tags - Changed if condition in "add HDMI div40 TMDS mode" - Updated "Add YUV420 output support" with the same if condition Changes since RFC v1 at [2]: - Fix all comments from Laurent : - Add define for HDMI 1.4 max tmds clock and SCDC supported version - Call dw_hdmi_set_high_tmds_clock_ratio() in dw_hdmi_phy_enable_powerdown() to unbreak Allwinner H6 - Pass in_t(u8, bytes, SCDC_MIN_SOURCE_VERSION) as SCDC version - Finally add comments for SCDC and Scrambling process [1] https://patchwork.freedesktop.org/patch/263616/ [2] https://patchwork.freedesktop.org/series/52950/#rev1 [3] https://patchwork.freedesktop.org/series/52950/#rev2 Neil Armstrong (7): drm/bridge: dw-hdmi: Add SCDC and TMDS Scrambling support drm/meson: add HDMI div40 TMDS mode drm/meson: add support for HDMI2.0 2160p modes drm/bridge: dw-hdmi: add support for YUV420 output drm/bridge: dw-hdmi: allow ycbcr420 modes for >= 0x200a drm/meson: Add YUV420 output support drm/meson: Output in YUV444 if sink supports it Zheng Yang (1): drm/bridge: dw-hdmi: support dynamically get input/out color info drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 182 +++++++++++++++++++--- drivers/gpu/drm/bridge/synopsys/dw-hdmi.h | 1 + drivers/gpu/drm/meson/meson_dw_hdmi.c | 128 ++++++++++++--- drivers/gpu/drm/meson/meson_vclk.c | 93 ++++++++--- drivers/gpu/drm/meson/meson_vclk.h | 7 +- drivers/gpu/drm/meson/meson_venc.c | 8 +- drivers/gpu/drm/meson/meson_venc.h | 11 ++ drivers/gpu/drm/meson/meson_venc_cvbs.c | 3 +- include/drm/bridge/dw_hdmi.h | 7 + 9 files changed, 374 insertions(+), 66 deletions(-)