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: 9520683 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 0598E60244 for ; Tue, 17 Jan 2017 12:32:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D3A4F28500 for ; Tue, 17 Jan 2017 12:32:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C88A128522; Tue, 17 Jan 2017 12:32:21 +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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8563E28500 for ; Tue, 17 Jan 2017 12:32:21 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cTSvx-0003Nn-6U; Tue, 17 Jan 2017 12:32:17 +0000 Received: from mail-wm0-x22e.google.com ([2a00:1450:400c:c09::22e]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cTSvs-0003FO-T0 for linux-amlogic@lists.infradead.org; Tue, 17 Jan 2017 12:32:14 +0000 Received: by mail-wm0-x22e.google.com with SMTP id r144so220050316wme.1 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=M7/kEqphhftAnN9mgdOY+JUckhtLOpIaKhsbev/4ZX/L1owul2A5ngUaT479vTcQgw rDnZPQsC4RzgRHbqFTZ2D2tpNyLGE1cKOnbVF2pAY3eBhXgEDBY4p575ZlRAGHZ27LR8 Tb4kEaVHmbpbos6G3xDHvZxXh5OUOOuIBvM82GtSlguh9IckN/lYqlgcm5J7en5ON/hz egUc2NWHhxKI4hXkBP6k+M+ZmsFlMxFt5iHFLYHxBY6rOkWaDxuqTGvY3OxIX/wnx4/h zTdmzlGwN1AuXKfHlsMzD5ilRYr9NoNWC9PL4NPnfr48i5FZFJw0RPU1BPlufvVMYu8+ VYHA== X-Gm-Message-State: AIkVDXIt+CnOJJoY85ZyWnp180Oi10JXz4TdFDSJtuvoVjEo+Xl4yUUVhJPziN86NR8zVnye 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170117_043213_090446_69BED0A4 X-CRM114-Status: GOOD ( 11.52 ) 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: Jose.Abreu@synopsys.com, linux-amlogic@lists.infradead.org, kieran.bingham@ideasonboard.com, linux-kernel@vger.kernel.org, Neil Armstrong MIME-Version: 1.0 Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org 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,