From patchwork Tue Jan 17 12:31:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 9520671 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8CCA160244 for ; Tue, 17 Jan 2017 12:31:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 676EF28522 for ; Tue, 17 Jan 2017 12:31:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5C1FA2853C; Tue, 17 Jan 2017 12:31:58 +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=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID 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 1EDA228522 for ; Tue, 17 Jan 2017 12:31:58 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2ADF86E678; Tue, 17 Jan 2017 12:31:57 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-x22c.google.com (mail-wm0-x22c.google.com [IPv6:2a00:1450:400c:c09::22c]) by gabe.freedesktop.org (Postfix) with ESMTPS id D41186E676 for ; Tue, 17 Jan 2017 12:31:52 +0000 (UTC) Received: by mail-wm0-x22c.google.com with SMTP id c206so220459069wme.0 for ; Tue, 17 Jan 2017 04:31:52 -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; bh=zbWNtV8v1SZv6AYWwun3lIXiQgAXgBrvKwWjTRMyHW4=; b=YO7iwaxJ9ei1C00B8dp6KUF2oIGIGn/nrFUUhthgBNBs8MBnfQdhvCIZvUezxun4Sn ZtqOd/aCDxtHV+NQfAX7cDhZuIvYG6Fro+GnArU/oxrVFaSTE6zZ2WPj7/DyBqItxJP0 H6IqutityWANTqeSG74/ITVdmhc8n2PwX+6z3kJq1QkNR+J7q8fb4jr4neVY11jC/4TW FL6iXP7J859Vcn0U20nq+UNNWoT/w438PFAVnGpRS6/X5FF7lxXzdaNpY9yHV1s5mLZg AKo+UeWDGNll1OnpYHaR8SlhWCwO/eSYV/mmtEKMFG3x0r5pjHtHT2PG2A5dTZSQjUjc CW/w== 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; bh=zbWNtV8v1SZv6AYWwun3lIXiQgAXgBrvKwWjTRMyHW4=; b=qMKMfmMQEdJpxyy5NBuDnNUDn4IXRPlX7JhAq/MBHi/L8RRSu4Auma2AEFiHpYjWKa CSxc8r4Lkpq6PpagJm1n24RagZ7TYZuwWRLc21cnVGNaXzoDAZsHJwJcpwiXy6ec4vzr YY7fKWDMQicQJ5OIAvxjU6Q7vhQ/H62ZIrPNIGiyyPFETWYBrST6SiCEWNGHHxCJHQuf hjKQAGnFVdgWh1GPriOSeeEiDbgO3w64acgxfdP1H/wjCTJDj9doUhR7zd9+EQOIpMQh 97PWNSj2GQZkNuHxsEX7ZKDNVh3hA6Zl4F4ir7oSq8HgketKigbMDAlI+f/EbgapmA3G 11VA== X-Gm-Message-State: AIkVDXKEI4CQvZU9Cwbm88YS0m56SWj72GJpu+xxVZ1wnmGrc9XzwnCh5Hf0x3jTVWEFC0Wd X-Received: by 10.28.40.67 with SMTP id o64mr15065076wmo.40.1484656311445; Tue, 17 Jan 2017 04:31:51 -0800 (PST) Received: from localhost.localdomain (home.amouriers.starnux.net. [82.228.250.61]) by smtp.gmail.com with ESMTPSA id l74sm36678858wmg.2.2017.01.17.04.31.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 Jan 2017 04:31:50 -0800 (PST) From: Neil Armstrong To: dri-devel@lists.freedesktop.org, laurent.pinchart+renesas@ideasonboard.com Subject: [RFC/RFT PATCH 4/4] drm/bridge: dw-hdmi: Take input format from plat_data Date: Tue, 17 Jan 2017 13:31:34 +0100 Message-Id: <1484656294-6140-5-git-send-email-narmstrong@baylibre.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1484656294-6140-1-git-send-email-narmstrong@baylibre.com> References: <1484656294-6140-1-git-send-email-narmstrong@baylibre.com> Cc: Jose.Abreu@synopsys.com, linux-amlogic@lists.infradead.org, kieran.bingham@ideasonboard.com, linux-kernel@vger.kernel.org, Neil Armstrong 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-Virus-Scanned: ClamAV using ClamSMTP Some display pipelines can only provide non-RBG input pixels to the HDMI TX Controller, this patch takes the pixel format from the plat_data if provided. Signed-off-by: Neil Armstrong --- drivers/gpu/drm/bridge/dw-hdmi.c | 7 +++++-- include/drm/bridge/dw_hdmi.h | 9 +++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/bridge/dw-hdmi.c b/drivers/gpu/drm/bridge/dw-hdmi.c index 8a6a183..fa4147c 100644 --- a/drivers/gpu/drm/bridge/dw-hdmi.c +++ b/drivers/gpu/drm/bridge/dw-hdmi.c @@ -1420,8 +1420,11 @@ static int dw_hdmi_setup(struct dw_hdmi *hdmi, struct drm_display_mode *mode) hdmi->hdmi_data.video_mode.mpixelrepetitionoutput = 0; hdmi->hdmi_data.video_mode.mpixelrepetitioninput = 0; - /* TODO: Get input format from IPU (via FB driver interface) */ - hdmi->hdmi_data.enc_in_format = RGB; + /* Get input format from plat data or fallback to RGB */ + if (hdmi->plat_data->input_fmt >= 0) + hdmi->hdmi_data.enc_in_format = hdmi->plat_data->input_fmt; + else + hdmi->hdmi_data.enc_in_format = RGB; hdmi->hdmi_data.enc_out_format = RGB; diff --git a/include/drm/bridge/dw_hdmi.h b/include/drm/bridge/dw_hdmi.h index d6a0ab3..4f426c3 100644 --- a/include/drm/bridge/dw_hdmi.h +++ b/include/drm/bridge/dw_hdmi.h @@ -21,6 +21,14 @@ enum { DW_HDMI_RES_MAX, }; +enum { + DW_HDMI_INPUT_FMT_RGB = 0, + DW_HDMI_INPUT_FMT_YCBCR444, + DW_HDMI_INPUT_FMT_YCBCR422_16BITS, + DW_HDMI_INPUT_FMT_YCBCR422_8BITS, + DW_HDMI_INPUT_FMT_XVYCC444, +}; + enum dw_hdmi_phy_type { DW_HDMI_PHY_DWC_HDMI_TX_PHY = 0x00, DW_HDMI_PHY_DWC_MHL_PHY_HEAC = 0xb2, @@ -68,6 +76,7 @@ struct dw_hdmi_plat_data { const struct dw_hdmi_plat_data *data); bool (*hdmi_read_hpd)(struct dw_hdmi *hdmi, const struct dw_hdmi_plat_data *data); + int input_fmt; }; int dw_hdmi_probe(struct platform_device *pdev,