From: Sandor Yu <Sandor.yu@nxp.com>
To: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
andrzej.hajda@intel.com, narmstrong@baylibre.com,
robert.foss@linaro.org, Laurent.pinchart@ideasonboard.com,
jonas@kwiboo.se, jernej.skrabec@gmail.com,
hverkuil-cisco@xs4all.nl
Cc: Sandor.yu@nxp.com, shengjiu.wang@nxp.com, cai.huoqing@linux.dev,
maxime@cerno.tech, harry.wentland@amd.com
Subject: [PATCH v2 3/5] drm: bridge: dw_hdmi: Enable GCP only for Deep Color
Date: Fri, 8 Apr 2022 18:32:26 +0800 [thread overview]
Message-ID: <a0f9def7e7438592f78ef0a16cd0a560be0e6133.1649412256.git.Sandor.yu@nxp.com> (raw)
In-Reply-To: <cover.1649412256.git.Sandor.yu@nxp.com>
HDMI1.4b specification section 6.5.3:
Source shall only send GCPs with non-zero CD to sinks
that indicate support for Deep Color.
DW HDMI GCP default enabled, clear gpc_auto bit for 24-bit color depth.
Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
---
drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
index 02d8f7e08814..5a7ec066e37a 100644
--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
@@ -1108,6 +1108,8 @@ static void hdmi_video_packetize(struct dw_hdmi *hdmi)
unsigned int output_select = HDMI_VP_CONF_OUTPUT_SELECTOR_PP;
struct hdmi_data_info *hdmi_data = &hdmi->hdmi_data;
u8 val, vp_conf;
+ u8 clear_gcp_auto = 0;
+
if (hdmi_bus_fmt_is_rgb(hdmi->hdmi_data.enc_out_bus_format) ||
hdmi_bus_fmt_is_yuv444(hdmi->hdmi_data.enc_out_bus_format) ||
@@ -1117,6 +1119,7 @@ static void hdmi_video_packetize(struct dw_hdmi *hdmi)
case 8:
color_depth = 4;
output_select = HDMI_VP_CONF_OUTPUT_SELECTOR_BYPASS;
+ clear_gcp_auto = 1;
break;
case 10:
color_depth = 5;
@@ -1136,6 +1139,7 @@ static void hdmi_video_packetize(struct dw_hdmi *hdmi)
case 0:
case 8:
remap_size = HDMI_VP_REMAP_YCC422_16bit;
+ clear_gcp_auto = 1;
break;
case 10:
remap_size = HDMI_VP_REMAP_YCC422_20bit;
@@ -1160,6 +1164,14 @@ static void hdmi_video_packetize(struct dw_hdmi *hdmi)
HDMI_VP_PR_CD_DESIRED_PR_FACTOR_MASK);
hdmi_writeb(hdmi, val, HDMI_VP_PR_CD);
+ val = hdmi_readb(hdmi, HDMI_FC_DATAUTO3);
+ if (clear_gcp_auto == 1)
+ /* disable Auto GCP when 24-bit color */
+ val &= ~0x4;
+ else
+ val |= 0x4;
+ hdmi_writeb(hdmi, val, HDMI_FC_DATAUTO3);
+
hdmi_modb(hdmi, HDMI_VP_STUFF_PR_STUFFING_STUFFING_MODE,
HDMI_VP_STUFF_PR_STUFFING_MASK, HDMI_VP_STUFF);
--
2.25.1
next prev parent reply other threads:[~2022-04-08 10:33 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-08 10:32 [PATCH v2 0/5] DRM: Bridge: DW_HDMI: Add new features and bug fix Sandor Yu
2022-04-08 10:32 ` [PATCH v2 1/5] drm: bridge: dw_hdmi: cec: Add cec suspend/resume function Sandor Yu
2022-04-08 13:41 ` Neil Armstrong
2022-04-10 10:13 ` Jernej Škrabec
2022-04-11 7:42 ` Neil Armstrong
2022-04-11 7:47 ` [EXT] " Sandor Yu
2022-04-08 10:32 ` [PATCH v2 2/5] drm: bridge: dw_hdmi: default enable workaround to clear the overflow Sandor Yu
2022-04-08 12:20 ` Neil Armstrong
2022-04-10 10:20 ` Jernej Škrabec
2022-04-08 10:32 ` Sandor Yu [this message]
2022-04-08 12:40 ` [PATCH v2 3/5] drm: bridge: dw_hdmi: Enable GCP only for Deep Color Neil Armstrong
2022-04-11 9:24 ` [EXT] " Sandor Yu
2022-04-08 10:32 ` [PATCH v2 4/5] drm: bridge: dw_hdmi: add reset function for PHY GEN1 Sandor Yu
2022-04-08 12:22 ` Neil Armstrong
2022-04-10 10:14 ` Jernej Škrabec
2022-04-08 10:32 ` [PATCH v2 5/5] drm: bridge: dw_hdmi: Audio: Add General Parallel Audio (GPA) driver Sandor Yu
2022-04-08 12:51 ` Neil Armstrong
2022-04-11 8:52 ` [EXT] " Sandor Yu
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=a0f9def7e7438592f78ef0a16cd0a560be0e6133.1649412256.git.Sandor.yu@nxp.com \
--to=sandor.yu@nxp.com \
--cc=Laurent.pinchart@ideasonboard.com \
--cc=andrzej.hajda@intel.com \
--cc=cai.huoqing@linux.dev \
--cc=dri-devel@lists.freedesktop.org \
--cc=harry.wentland@amd.com \
--cc=hverkuil-cisco@xs4all.nl \
--cc=jernej.skrabec@gmail.com \
--cc=jonas@kwiboo.se \
--cc=linux-kernel@vger.kernel.org \
--cc=maxime@cerno.tech \
--cc=narmstrong@baylibre.com \
--cc=robert.foss@linaro.org \
--cc=shengjiu.wang@nxp.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®