[PATCH] drm/drm_edid: correct VIC and HDMI_VIC under HDMI 2.0
ville.syrjala at linux.intel.com
Fri Oct 4 14:24:03 UTC 2019
On Fri, Oct 04, 2019 at 10:41:20AM +0000, Lin, Wayne wrote:
> From: Ville Syrjälä <ville.syrjala at linux.intel.com>
> Sent: Thursday, October 3, 2019 21:29
> To: Lin, Wayne <Wayne.Lin at amd.com>
> Cc: dri-devel at lists.freedesktop.org <dri-devel at lists.freedesktop.org>; amd-gfx at lists.freedesktop.org <amd-gfx at lists.freedesktop.org>; Li, Sun peng (Leo) <Sunpeng.Li at amd.com>; Kazlauskas, Nicholas <Nicholas.Kazlauskas at amd.com>
> Subject: Re: [PATCH] drm/drm_edid: correct VIC and HDMI_VIC under HDMI 2.0
> On Thu, Oct 03, 2019 at 06:49:05AM +0000, Lin, Wayne wrote:
> > ________________________________
> > From: Ville Syrjälä <ville.syrjala at linux.intel.com>
> > Sent: Wednesday, October 2, 2019 19:58
> > To: Lin, Wayne <Wayne.Lin at amd.com>
> > Cc: dri-devel at lists.freedesktop.org <dri-devel at lists.freedesktop.org>; amd-gfx at lists.freedesktop.org <amd-gfx at lists.freedesktop.org>; Li, Sun peng (Leo) <Sunpeng.Li at amd.com>; Kazlauskas, Nicholas <Nicholas.Kazlauskas at amd.com>
> > Subject: Re: [PATCH] drm/drm_edid: correct VIC and HDMI_VIC under HDMI 2.0
> > On Tue, Sep 24, 2019 at 01:26:21PM +0800, Wayne Lin wrote:
> > > In HDMI 1.4 defines 4k modes without specific aspect ratio.
> > > However, in HDMI 2.0, adds aspect ratio attribute to distinguish different
> > > 4k modes.
> > >
> > > According to Appendix E of HDMI 2.0 spec, source should use VSIF to
> > > indicate VIC mode only when the mode is one defined in HDMI 1.4b 4K modes.
> > > Otherwise, use AVI infoframes to convey VIC.
> > >
> > > eg: VIC_103 should use AVI infoframes and VIC_93 use VSIF
> > >
> > > When the sink is HDMI 2.0, current code in
> > > drm_hdmi_avi_infoframe_from_display_mode will also force mode VIC_103 to
> > > have VIC value 0. This violates the spec and needs to be corrected.
> > > Where is that being done? We only set the AVI VIC to zero if we're going
> > > to use the HDMI VIC instead.
> > Appreciate for your time and apologize for not explaining it clearly.
> > Current code in drm_hdmi_avi_infoframe_from_display_mode() will call
> > drm_match_hdmi_mode() to set up vendor_if_vic. By checking
> > drm_valid_hdmi_vic(vendor_if_vic) to see if the vic info should be conveyed by avi
> > or not.
> > But in drm_match_hdmi_mode(), code doesn't enable match_flags with
> > DRM_MODE_MATCH_ASPECT_RATIO. I think it's due to HDMI1.4b doesn't specify
> > 4K mode conveyed by HDMI VIC with particular aspect ratio. But in Appendix E of
> > HDMI 2.0 spec, it specify only 4k modes with particular aspect ratio should use VSIF to convey.
> > Hence, when the sink support HDMI 2.0 and set the mode to be VIC_103, calling
> > drm_match_hdmi_mode(mode) will return vendor_if_vic = 3 (VIC_93 and VIC_103 are having
> > the same timing but different aspect ratio). Thereafter will set the frame->video_code to 0.
> > However, VIC_103 should use AVI VIC according to HDMI 2.0 spec (only VIC: 93, 94, 95 &
> > 98 should use VSIF).
> > This patch try to revise that, when the sink support HDMI 2.0, drm_match_hdmi_mode()
> > should also take aspect ratio into consideration.
> > But for easy reading, I add another function "drm_match_hdmi_1_4_mode" to do so.
> > Seems rather convoluted. I think we should just add the aspect ratios
> > to edid_4k_modes. Or is there some problem with that approach?
> Thanks for your time.
> Since HDMI 1.4b doesn't require edid_4k_modes with specific aspect ratio, modes as the same
> timing in edid_4k_modes but with different aspect ratios are also expected to convey VIC by
> VSIF to HDMI 1.4 sink. Might can't guarantee that there wont't be any compatibility side effect with
> that approach when the sink is HDMI 1.4b .
I think adding them should be fine. But while checking the existing
code I noticed a few problems, so I sent out some fixes (cc:d you).
More information about the dri-devel