All of lore.kernel.org
 help / color / mirror / Atom feed
From: Neil Armstrong <narmstrong@baylibre.com>
To: a.hajda@samsung.com, Laurent.pinchart@ideasonboard.com,
	jonas@kwiboo.se, jernej.skrabec@siol.net,
	boris.brezillon@collabora.com
Cc: Neil Armstrong <narmstrong@baylibre.com>,
	linux-amlogic@lists.infradead.org,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: [RFC 05/11] drm/bridge: synopsys: dw-hdmi: use negociated bus formats
Date: Tue, 20 Aug 2019 10:41:03 +0200	[thread overview]
Message-ID: <20190820084109.24616-6-narmstrong@baylibre.com> (raw)
In-Reply-To: <20190820084109.24616-1-narmstrong@baylibre.com>

Use the negociated bus formats from the atomic check function if
the input and output formats are non NULL, otherwise fallback to
the plat_data->input_bus_format or the default MEDIA_BUS_FMT_RGB888_1X24
bus format.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
---
 drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
index 121c2167ee20..316823abdd00 100644
--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
@@ -1968,11 +1968,10 @@ 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;
 
-	/* TOFIX: Get input format from plat data or fallback to RGB888 */
 	if (hdmi->plat_data->input_bus_format)
 		hdmi->hdmi_data.enc_in_bus_format =
 			hdmi->plat_data->input_bus_format;
-	else
+	else if (!hdmi->hdmi_data.enc_in_bus_format)
 		hdmi->hdmi_data.enc_in_bus_format = MEDIA_BUS_FMT_RGB888_1X24;
 
 	/* TOFIX: Get input encoding from plat data or fallback to none */
@@ -1982,8 +1981,8 @@ static int dw_hdmi_setup(struct dw_hdmi *hdmi, struct drm_display_mode *mode)
 	else
 		hdmi->hdmi_data.enc_in_encoding = V4L2_YCBCR_ENC_DEFAULT;
 
-	/* TOFIX: Default to RGB888 output format */
-	hdmi->hdmi_data.enc_out_bus_format = MEDIA_BUS_FMT_RGB888_1X24;
+	if (!hdmi->hdmi_data.enc_out_bus_format)
+		hdmi->hdmi_data.enc_out_bus_format = MEDIA_BUS_FMT_RGB888_1X24;
 
 	hdmi->hdmi_data.pix_repet_factor = 0;
 	hdmi->hdmi_data.hdcp_enable = 0;
@@ -2224,6 +2223,8 @@ static int dw_hdmi_bridge_atomic_check(struct drm_bridge *bridge,
 	dev_dbg(hdmi->dev, "selected output format %x\n",
 			bridge_state->output_bus_cfg.fmt);
 
+	hdmi->hdmi_data.enc_out_bus_format = bridge_state->output_bus_cfg.fmt;
+
 	ret = drm_atomic_bridge_choose_input_bus_cfg(bridge_state, crtc_state,
 						      conn_state);
 	if (ret)
@@ -2232,6 +2233,8 @@ static int dw_hdmi_bridge_atomic_check(struct drm_bridge *bridge,
 	dev_dbg(hdmi->dev, "selected input format %x\n",
 			bridge_state->input_bus_cfg.fmt);
 
+	hdmi->hdmi_data.enc_in_bus_format = bridge_state->input_bus_cfg.fmt;
+
 	return 0;
 }
 
-- 
2.22.0


WARNING: multiple messages have this Message-ID (diff)
From: Neil Armstrong <narmstrong@baylibre.com>
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, linux-kernel@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	Neil Armstrong <narmstrong@baylibre.com>
Subject: [RFC 05/11] drm/bridge: synopsys: dw-hdmi: use negociated bus formats
Date: Tue, 20 Aug 2019 10:41:03 +0200	[thread overview]
Message-ID: <20190820084109.24616-6-narmstrong@baylibre.com> (raw)
In-Reply-To: <20190820084109.24616-1-narmstrong@baylibre.com>

Use the negociated bus formats from the atomic check function if
the input and output formats are non NULL, otherwise fallback to
the plat_data->input_bus_format or the default MEDIA_BUS_FMT_RGB888_1X24
bus format.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
---
 drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
index 121c2167ee20..316823abdd00 100644
--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
@@ -1968,11 +1968,10 @@ 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;
 
-	/* TOFIX: Get input format from plat data or fallback to RGB888 */
 	if (hdmi->plat_data->input_bus_format)
 		hdmi->hdmi_data.enc_in_bus_format =
 			hdmi->plat_data->input_bus_format;
-	else
+	else if (!hdmi->hdmi_data.enc_in_bus_format)
 		hdmi->hdmi_data.enc_in_bus_format = MEDIA_BUS_FMT_RGB888_1X24;
 
 	/* TOFIX: Get input encoding from plat data or fallback to none */
@@ -1982,8 +1981,8 @@ static int dw_hdmi_setup(struct dw_hdmi *hdmi, struct drm_display_mode *mode)
 	else
 		hdmi->hdmi_data.enc_in_encoding = V4L2_YCBCR_ENC_DEFAULT;
 
-	/* TOFIX: Default to RGB888 output format */
-	hdmi->hdmi_data.enc_out_bus_format = MEDIA_BUS_FMT_RGB888_1X24;
+	if (!hdmi->hdmi_data.enc_out_bus_format)
+		hdmi->hdmi_data.enc_out_bus_format = MEDIA_BUS_FMT_RGB888_1X24;
 
 	hdmi->hdmi_data.pix_repet_factor = 0;
 	hdmi->hdmi_data.hdcp_enable = 0;
@@ -2224,6 +2223,8 @@ static int dw_hdmi_bridge_atomic_check(struct drm_bridge *bridge,
 	dev_dbg(hdmi->dev, "selected output format %x\n",
 			bridge_state->output_bus_cfg.fmt);
 
+	hdmi->hdmi_data.enc_out_bus_format = bridge_state->output_bus_cfg.fmt;
+
 	ret = drm_atomic_bridge_choose_input_bus_cfg(bridge_state, crtc_state,
 						      conn_state);
 	if (ret)
@@ -2232,6 +2233,8 @@ static int dw_hdmi_bridge_atomic_check(struct drm_bridge *bridge,
 	dev_dbg(hdmi->dev, "selected input format %x\n",
 			bridge_state->input_bus_cfg.fmt);
 
+	hdmi->hdmi_data.enc_in_bus_format = bridge_state->input_bus_cfg.fmt;
+
 	return 0;
 }
 
-- 
2.22.0


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

  parent reply	other threads:[~2019-08-20  8:41 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-20  8:40 [RFC 00/11] drm/bridge: dw-hdmi: implement bus-format negotiation and YUV420 support Neil Armstrong
2019-08-20  8:40 ` Neil Armstrong
2019-08-20  8:40 ` Neil Armstrong
2019-08-20  8:40 ` [RFC 01/11] fixup! drm/bridge: Add the necessary bits to support bus format negotiation Neil Armstrong
2019-08-20  8:40   ` Neil Armstrong
2019-08-20  8:41 ` [RFC 02/11] drm/meson: venc: make drm_display_mode const Neil Armstrong
2019-08-20  8:41   ` Neil Armstrong
2019-08-20  8:41   ` Neil Armstrong
2019-08-21 18:32   ` Boris Brezillon
2019-08-21 18:32     ` Boris Brezillon
2019-08-21 18:32     ` Boris Brezillon
2019-08-20  8:41 ` [RFC 03/11] drm/meson: meson_dw_hdmi: switch to drm_bridge_funcs Neil Armstrong
2019-08-20  8:41   ` Neil Armstrong
2019-08-20  8:41   ` Neil Armstrong
2019-08-20  8:41 ` [RFC 04/11] drm/bridge: synopsys: dw-hdmi: add basic bridge_atomic_check Neil Armstrong
2019-08-20  8:41   ` Neil Armstrong
2019-08-20  8:41 ` Neil Armstrong [this message]
2019-08-20  8:41   ` [RFC 05/11] drm/bridge: synopsys: dw-hdmi: use negociated bus formats Neil Armstrong
2019-08-20  8:41 ` [RFC 06/11] drm/meson: dw-hdmi: stop enforcing input_bus_format Neil Armstrong
2019-08-20  8:41   ` Neil Armstrong
2019-08-20  8:41   ` Neil Armstrong
2019-08-20  8:41 ` [RFC 07/11] drm/bridge: dw-hdmi: allow ycbcr420 modes for >= 0x200a Neil Armstrong
2019-08-20  8:41   ` Neil Armstrong
2019-08-20  8:41 ` [RFC 08/11] drm/bridge: synopsys: dw-hdmi: add 420 mode format negociation Neil Armstrong
2019-08-20  8:41   ` Neil Armstrong
2019-08-20  8:41   ` Neil Armstrong
2019-08-20  8:41 ` [RFC 09/11] drm/meson: venc: add support for YUV420 setup Neil Armstrong
2019-08-20  8:41   ` Neil Armstrong
2019-08-20  8:41 ` [RFC 10/11] drm/meson: vclk: " Neil Armstrong
2019-08-20  8:41   ` Neil Armstrong
2019-08-20  8:41 ` [RFC 11/11] drm/meson: Add YUV420 output support Neil Armstrong
2019-08-20  8:41   ` Neil Armstrong
2019-08-21 18:30 ` [RFC 00/11] drm/bridge: dw-hdmi: implement bus-format negotiation and YUV420 support Boris Brezillon
2019-08-21 18:30   ` Boris Brezillon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190820084109.24616-6-narmstrong@baylibre.com \
    --to=narmstrong@baylibre.com \
    --cc=Laurent.pinchart@ideasonboard.com \
    --cc=a.hajda@samsung.com \
    --cc=boris.brezillon@collabora.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jernej.skrabec@siol.net \
    --cc=jonas@kwiboo.se \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.