From patchwork Fri Nov 30 13:42:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 10706351 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 05BA017D5 for ; Fri, 30 Nov 2018 13:43:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E73B430091 for ; Fri, 30 Nov 2018 13:43:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DB0C230098; Fri, 30 Nov 2018 13:43:22 +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,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 56D4D30091 for ; Fri, 30 Nov 2018 13:43:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=ZMHezFKl7xm1owQL6vnG4EwsKCSXYvMUgN8IUVadY3o=; b=J2Gh8BJABZ6iC1 D2tw4wkGIrU8R31Sz2KTbh3DQWzt7qnHYQmbULD6967yOc6m2N65MfSF0aYB8W3zbFuYU/oN2cJtq 4gUSDywWhqeAatCwTzrJqJ9U2VXDvP9iWb5TRz4q1cz2Jek/40oTg6QZxe3nHhyCwib3qLlaOkmuI X/gp+0KXWmle5icZq5I5QZXSHC3f6LBuMfLK1JEd0de6e7lHhnmbZRYi2QsiWXBWMEvnV6kuhcF1K ab5l1BH0xYfZ1rgvVGmLaIk2DW2CiOPXRZdzIDsadx/KkMZxvIxrpLUPzluDn7+MivkRj2pwYd9yq 9z8q/d84Qd3hyMoLuFhg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gSj4j-0003As-Et; Fri, 30 Nov 2018 13:43:21 +0000 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gSj4e-0002yC-Qm for linux-amlogic@lists.infradead.org; Fri, 30 Nov 2018 13:43:19 +0000 Received: by mail-wr1-x443.google.com with SMTP id 96so5365018wrb.2 for ; Fri, 30 Nov 2018 05:43:06 -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:mime-version :content-transfer-encoding; bh=oZJV/qsmAM5gZtjG0Mt+AwQrzLC1ULCsrCDHyIkNEK0=; b=yyumK4eIzVxLOIl1BjBOR4aNypcEk3oAeO7W7a42QcgR+nz+Jy8H8WDgOtzMacSSr9 bAKEJ/+GmmpSLewZpvOr1Xb5NvD2ER5mLDOG/dH8fEmKe2+fiIv9gvTfRUSjkEGz4XSI 9YZtjIhbs5p6Nq5VhA7l+UDqgTMOEMC2HDy8+XDOJyhQ/8QBKGkImpWWPWTZe1jXDgwg g5jQbinkLEk+v2UBG96hFQEw5AWLaV+TTlw8FxJhr/H+U6gCBVHYZDOZPMit9gfXpPnw y6dV3zDMI7MIpgnT63M2BIc2DzZRCDZWvHS2SX/0MnooM6TtXXZ3+ULSkeWznoMi0EIZ c8Cg== 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=oZJV/qsmAM5gZtjG0Mt+AwQrzLC1ULCsrCDHyIkNEK0=; b=hRvjUBQoSmPGKFVzA+V9yKiN4W2nZUTXfqY3AqOgLod1OfjKgH6H/PpN5R86Yrj7C6 2EjdmyaD4WvrBMQRAMw9I14+rBlUerjEvRyH/HBnxhPamlsR3eLnayJn3MlSGDCBHc60 qAYT+tR9cxBk2U11HSo3iat6VqyWOkF0d35jRi0QQn4BNlk9FfiqMkI7RujFb9np9I+6 1LmBFyu8drCfgiOEIoLMK9xiRTVk4hl2Q19Id8GDNah3vNyj4uBnK023UGa8kYo4UbqG t1T8jO8rYkdxkrCjcCmv8wJfk4wUtjmlvoIW3AYshopdSj4pDpIL/6TmyKgoAzm6ylRX TSPQ== X-Gm-Message-State: AA+aEWYIsyfSeUvGshmeU/xAfWo2FD7+2P0QSHUyyV2MsQImvB/i3aGH 6GVdjm/qAzxkk6/EggBfENEeTg== X-Google-Smtp-Source: AFSGD/WnusZXZmSbQwaQjTPVj8I5aEuPKjTtBDATCHPVA02O75C9vDKod9nE2a8O+5QLzPvBKjKqmw== X-Received: by 2002:adf:e608:: with SMTP id p8mr5030095wrm.166.1543585384677; Fri, 30 Nov 2018 05:43:04 -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 125sm6864898wml.35.2018.11.30.05.43.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 30 Nov 2018 05:43:03 -0800 (PST) From: Neil Armstrong To: architt@codeaurora.org, 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 RFC v2 0/8] drm/meson: Add support for HDMI2.0 4k60 Date: Fri, 30 Nov 2018 14:42:53 +0100 Message-Id: <20181130134301.17963-1-narmstrong@baylibre.com> X-Mailer: git-send-email 2.19.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181130_054316_937560_2DCE96B6 X-CRM114-Status: GOOD ( 15.66 ) X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: 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 Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org 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 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/ 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 | 129 ++++++++++++--- 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, 375 insertions(+), 66 deletions(-)