Message ID | ebd9830fe35d79153cb0051bed0d255fb004fb63.1649230434.git.Sandor.yu@nxp.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | DRM: Bridge: DW_HDMI: Add new features and bug fix | expand |
On 06/04/2022 10:48, Sandor.yu@nxp.com wrote: > From: Sandor Yu <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 GPC default enabled, clear gpc_auto bit for bpp 24. > > Signed-off-by: Sandor Yu <Sandor.yu@nxp.com> > --- > drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c > index b11577de4836..c7b11582529e 100644 > --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c > +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c > @@ -1160,6 +1160,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 (color_depth == 4) > + /* disable Auto GCP when bpp 24 */ > + 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); > Do you handle the case when color_depth == 0 when output is YUV422 ? Neil
Hi, > -----Original Message----- > From: Neil Armstrong <narmstrong@baylibre.com> > Sent: 2022年4月6日 17:20 > To: Sandor Yu <sandor.yu@nxp.com>; dri-devel@lists.freedesktop.org; > linux-kernel@vger.kernel.org; andrzej.hajda@intel.com; > robert.foss@linaro.org; Laurent.pinchart@ideasonboard.com; > jonas@kwiboo.se; jernej.skrabec@gmail.com > Cc: S.J. Wang <shengjiu.wang@nxp.com>; cai.huoqing@linux.dev; > maxime@cerno.tech; harry.wentland@amd.com; hverkuil-cisco@xs4all.nl; > amuel@sholland.org > Subject: [EXT] Re: [PATCH v1 3/5] drm: bridge: dw_hdmi: Enable GCP only for > Deep Color > > Caution: EXT Email > > On 06/04/2022 10:48, Sandor.yu@nxp.com wrote: > > From: Sandor Yu <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 GPC default enabled, clear gpc_auto bit for bpp 24. > > > > Signed-off-by: Sandor Yu <Sandor.yu@nxp.com> > > --- > > drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 8 ++++++++ > > 1 file changed, 8 insertions(+) > > > > diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c > > b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c > > index b11577de4836..c7b11582529e 100644 > > --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c > > +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c > > @@ -1160,6 +1160,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 (color_depth == 4) > > + /* disable Auto GCP when bpp 24 */ > > + 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); > > > > Do you handle the case when color_depth == 0 when output is YUV422 ? For YUV422 color depth 8, the gcp_auto bit need clear too, I will add it. > > Neil Thanks, Sandor
diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c index b11577de4836..c7b11582529e 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c @@ -1160,6 +1160,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 (color_depth == 4) + /* disable Auto GCP when bpp 24 */ + 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);