HDMI YCBCR output handling in DRM layer
Subsystems (16)
v2 cover HDMI YCBCR output handling in DRM layer
This patch series adds DRM layer support for YCBCR HDMI output handling. The target HDMI YCBCR outputs are:
- YCBCR444
- YCBCR422
- YCBCR420
As YCBCR420 output is added in HDMI 2.0, this patch series also contain few patches to handle new EDID extention blocks, added for YCBCR420 modes (CEA-861-F)
First two patches, complete the CEA modedb in drm driver, by adding new 4k modes. Current CEA modedb contains 64 modes only (VIC 1-64), whereas YCBCR420 output can support 4k modes, from VIC range 93-107. First patch makes sure that it doesn't break existing HDMI 1.4 monitors, adding new VICs.
Next 3 patches, parse and accomodate YCBCR420 suppor information from the sink, and stores into display info strucure. This contains parsing YCBCR420 supported modes, and deep color information.
Next 2 patch create a property (hdmi_output) using which, as userspace can set its preferred HDMI output from RGB, YCBCR444/422/420 etc. Default value of the property is set to RGB(0) so that it doesnt affect existing implementations. Other patch takes care of setting AVI IF colorspace as per the selected output.
Last 3 patches contain implementation of YCBCR output in I915 HDMI subsystem.
V2:
- V1 of this patch series was handling both VDB(YCBCR420 only) and VCB (YCBCR420 also) EDID blocks to extract YCBCR420 modes. This series handles only VCB blocks, a follow up series will handle VDB blocks.
This series is tested on Intel GLK platform, using ASTRO-VA-1844A HDMI tester.
Shashank Sharma (11):
drm: Add HDMI 2.0 VIC support for AVI info-frames drm/edid: Complete CEA modedb(VIC 1-107)
drm: parse ycbcr420 cmdb block
drm: parse ycbcr 420 deep color information
drm: create hdmi output property
drm: set output colorspace in AVI infoframe
drm: add ycbcr helper functions
drm/i915: handle ycbcr outputs
drm/i915: handle csc for ycbcr HDMI output drm/i915: prepare ycbcr420 modeset drm/i915: set colorspace for ycbcr outputs
drivers/gpu/drm/amd/amdgpu/dce_v10_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/dce_v11_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/dce_v8_0.c | 2 +- drivers/gpu/drm/bridge/analogix-anx78xx.c | 3 +- drivers/gpu/drm/bridge/sii902x.c | 2 +- drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 2 +- drivers/gpu/drm/drm_atomic.c | 2 + drivers/gpu/drm/drm_atomic_helper.c | 4 + drivers/gpu/drm/drm_connector.c | 32 +++ drivers/gpu/drm/drm_edid.c | 402 +++++++++++++++++++++++++++++- drivers/gpu/drm/drm_modes.c | 177 +++++++++++++ drivers/gpu/drm/exynos/exynos_hdmi.c | 2 +- drivers/gpu/drm/i2c/tda998x_drv.c | 2 +- drivers/gpu/drm/i915/i915_reg.h | 3 + drivers/gpu/drm/i915/intel_atomic.c | 6 + drivers/gpu/drm/i915/intel_color.c | 47 +++- drivers/gpu/drm/i915/intel_display.c | 67 +++++ drivers/gpu/drm/i915/intel_drv.h | 13 +- drivers/gpu/drm/i915/intel_hdmi.c | 149 ++++++++++- drivers/gpu/drm/i915/intel_panel.c | 3 +- drivers/gpu/drm/i915/intel_sdvo.c | 3 +- drivers/gpu/drm/mediatek/mtk_hdmi.c | 2 +- drivers/gpu/drm/omapdrm/omap_encoder.c | 3 +- drivers/gpu/drm/radeon/radeon_audio.c | 2 +- drivers/gpu/drm/rockchip/inno_hdmi.c | 2 +- drivers/gpu/drm/sti/sti_hdmi.c | 2 +- drivers/gpu/drm/tegra/hdmi.c | 2 +- drivers/gpu/drm/tegra/sor.c | 2 +- drivers/gpu/drm/vc4/vc4_hdmi.c | 2 +- drivers/gpu/drm/zte/zx_hdmi.c | 2 +- include/drm/drm_connector.h | 33 +++ include/drm/drm_edid.h | 14 +- include/drm/drm_mode_config.h | 5 + include/drm/drm_modes.h | 16 ++ 34 files changed, 981 insertions(+), 31 deletions(-)
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v2 1/11 drm: Add HDMI 2.0 VIC support for AVI info-frames
HDMI 1.4b support the CEA video modes as per range of CEA-861-D (VIC 1-64). For any other mode, the VIC filed in AVI infoframes should be 0. HDMI 2.0 sinks, support video modes range as per CEA-861-F spec, which is extended to (VIC 1-107).
This patch adds a bool input variable, which indicates if the connected sink is a HDMI 2.0 sink or not. This will make sure that we don't pass a HDMI 2.0 VIC to a HDMI 1.4 sink.
This patch touches all drm drivers, who are callers of this function drm_hdmi_avi_infoframe_from_display_mode but to make sure there is no change in current behavior, is_hdmi2 is kept as false.
In case of I915 driver, this patch checks the connector->display_info to check if the connected display is HDMI 2.0.
PS: This patch touches a few lines in few files, which were already above 80 char, so checkpatch gives 80 char warning again.
- gpu/drm/omapdrm/omap_encoder.c
- gpu/drm/i915/intel_sdvo.c
V2: Rebase, Added r-b from Andrzej
--- drivers/gpu/drm/amd/amdgpu/dce_v10_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/dce_v11_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/dce_v8_0.c | 2 +- drivers/gpu/drm/bridge/analogix-anx78xx.c | 3 ++- drivers/gpu/drm/bridge/sii902x.c | 2 +- drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 2 +- drivers/gpu/drm/drm_edid.c | 12 +++++++++++- drivers/gpu/drm/exynos/exynos_hdmi.c | 2 +- drivers/gpu/drm/i2c/tda998x_drv.c | 2 +- drivers/gpu/drm/i915/intel_hdmi.c | 5 ++++- drivers/gpu/drm/i915/intel_sdvo.c | 3 ++- drivers/gpu/drm/mediatek/mtk_hdmi.c | 2 +- drivers/gpu/drm/omapdrm/omap_encoder.c | 3 ++- drivers/gpu/drm/radeon/radeon_audio.c | 2 +- drivers/gpu/drm/rockchip/inno_hdmi.c | 2 +- drivers/gpu/drm/sti/sti_hdmi.c | 2 +- drivers/gpu/drm/tegra/hdmi.c | 2 +- drivers/gpu/drm/tegra/sor.c | 2 +- drivers/gpu/drm/vc4/vc4_hdmi.c | 2 +- drivers/gpu/drm/zte/zx_hdmi.c | 2 +- include/drm/drm_edid.h | 3 ++- 21 files changed, 38 insertions(+), 21 deletions(-)
drivers/gpu/drm/amd/amdgpu/dce_v10_0.c +1 -1
@@ -1864,7 +1864,7 @@ static void dce_v10_0_afmt_setmode(struct drm_encoder *encoder,dce_v10_0_audio_write_sad_regs (encoder);dce_v10_0_audio_write_latency_fields (encoder, mode); - err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode); + err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode, false);if (err <0 ) {DRM_ERROR ("failed to setup AVI infoframe: %zd\n" , err);return ;
drivers/gpu/drm/amd/amdgpu/dce_v11_0.c +1 -1
@@ -1848,7 +1848,7 @@ static void dce_v11_0_afmt_setmode(struct drm_encoder *encoder,dce_v11_0_audio_write_sad_regs (encoder);dce_v11_0_audio_write_latency_fields (encoder, mode); - err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode); + err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode, false);if (err <0 ) {DRM_ERROR ("failed to setup AVI infoframe: %zd\n" , err);return ;
drivers/gpu/drm/amd/amdgpu/dce_v8_0.c +1 -1
@@ -1747,7 +1747,7 @@ static void dce_v8_0_afmt_setmode(struct drm_encoder *encoder,dce_v8_0_audio_write_sad_regs (encoder);dce_v8_0_audio_write_latency_fields (encoder, mode); - err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode); + err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode, false);if (err <0 ) {DRM_ERROR ("failed to setup AVI infoframe: %zd\n" , err);return ;
drivers/gpu/drm/bridge/analogix-anx78xx.c +2 -1
@@ -1097,7 +1097,8 @@ static void anx78xx_bridge_mode_set(struct drm_bridge *bridge,mutex_lock (&anx78xx->lock); - err =drm_hdmi_avi_infoframe_from_display_mode (&frame, adjusted_mode); + err =drm_hdmi_avi_infoframe_from_display_mode (&frame, adjusted_mode, + false);if (err) {DRM_ERROR ("Failed to setup AVI infoframe: %d\n" , err); goto unlock;
drivers/gpu/drm/bridge/sii902x.c +1 -1
@@ -269,7 +269,7 @@ static void sii902x_bridge_mode_set(struct drm_bridge *bridge,if (ret)return ; - ret =drm_hdmi_avi_infoframe_from_display_mode (&frame, adj); + ret =drm_hdmi_avi_infoframe_from_display_mode (&frame, adj, false);if (ret <0 ) {DRM_ERROR ("couldn't fill AVI infoframe\n" );return ;
drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +1 -1
@@ -1317,7 +1317,7 @@ static void hdmi_config_AVI(struct dw_hdmi *hdmi, struct drm_display_mode *mode)u8 val;/* Initialise info frame from DRM mode */ -drm_hdmi_avi_infoframe_from_display_mode (&frame, mode); +drm_hdmi_avi_infoframe_from_display_mode (&frame, mode, false);if (hdmi_bus_fmt_is_yuv444 (hdmi->hdmi_data.enc_out_bus_format)) frame.colorspace =HDMI_COLORSPACE_YUV444 ;
drivers/gpu/drm/drm_edid.c +11 -1
@@ -4334,12 +4334,14 @@ EXPORT_SYMBOL(drm_set_preferred_mode);* data from a DRM display mode * @frame: HDMI AVI infoframe * @mode: DRM display mode +* @is_hdmi2: Sink is HDMI 2.0 compliant * * Return: 0 on success or a negative error code on failure. */ int drm_hdmi_avi_infoframe_from_display_mode (struct hdmi_avi_infoframe *frame, -const struct drm_display_mode *mode) +const struct drm_display_mode *mode, +bool is_hdmi2) {int err;
@@ -4355,6 +4357,14 @@ drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame, frame->video_code =drm_match_cea_mode (mode); +/* +* HDMI 1.4 VIC range: 1 <= VIC <= 64 (CEA-861-D) but +* HDMI 2.0 VIC range: 1 <= VIC <= 107 (CEA-861-F). So we +* have to make sure we dont break HDMI 1.4 sinks. +*/ +if (!is_hdmi2 && frame->video_code >64 ) + frame->video_code =0 ; + frame->picture_aspect =HDMI_PICTURE_ASPECT_NONE ;/*
drivers/gpu/drm/exynos/exynos_hdmi.c +1 -1
@@ -784,7 +784,7 @@ static void hdmi_reg_infoframes(struct hdmi_context *hdata) } ret =drm_hdmi_avi_infoframe_from_display_mode (&frm.avi, - &hdata->current_mode); + &hdata->current_mode, false);if (!ret) ret =hdmi_avi_infoframe_pack (&frm.avi, buf,sizeof (buf));if (ret >0 ) {
drivers/gpu/drm/i2c/tda998x_drv.c +1 -1
@@ -712,7 +712,7 @@ tda998x_write_avi(struct tda998x_priv *priv, struct drm_display_mode *mode) {union hdmi_infoframe frame; -drm_hdmi_avi_infoframe_from_display_mode (&frame.avi, mode); +drm_hdmi_avi_infoframe_from_display_mode (&frame.avi, mode, false); frame.avi.quantization_range =HDMI_QUANTIZATION_RANGE_FULL ;tda998x_write_if (priv,DIP_IF_FLAGS_IF2 ,REG_IF2_HB0 , &frame);
drivers/gpu/drm/i915/intel_hdmi.c +4 -1
@@ -459,11 +459,14 @@ static void intel_hdmi_set_avi_infoframe(struct drm_encoder *encoder,struct intel_hdmi *intel_hdmi =enc_to_intel_hdmi (encoder);const struct drm_display_mode *adjusted_mode = &crtc_state->base.adjusted_mode; +struct drm_connector *connector = &intel_hdmi->attached_connector->base; +bool is_hdmi2 = connector->display_info.hdmi.scdc.supported;union hdmi_infoframe frame;int ret; ret =drm_hdmi_avi_infoframe_from_display_mode (&frame.avi, - adjusted_mode); + adjusted_mode, + is_hdmi2);if (ret <0 ) {DRM_ERROR ("couldn't fill AVI infoframe\n" );return ;
drivers/gpu/drm/i915/intel_sdvo.c +2 -1
@@ -1006,7 +1006,8 @@ static bool intel_sdvo_set_avi_infoframe(struct intel_sdvo *intel_sdvo,ssize_t len; ret =drm_hdmi_avi_infoframe_from_display_mode (&frame.avi, - &pipe_config->base.adjusted_mode); + &pipe_config->base.adjusted_mode, + false);if (ret <0 ) {DRM_ERROR ("couldn't fill AVI infoframe\n" );return false;
drivers/gpu/drm/mediatek/mtk_hdmi.c +1 -1
@@ -975,7 +975,7 @@ static int mtk_hdmi_setup_avi_infoframe(struct mtk_hdmi *hdmi,u8 buffer[17 ];ssize_t err; - err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode); + err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode, false);if (err <0 ) {dev_err (hdmi->dev,"Failed to get AVI infoframe from mode: %zd\n" , err);
drivers/gpu/drm/omapdrm/omap_encoder.c +2 -1
@@ -85,7 +85,8 @@ static void omap_encoder_mode_set(struct drm_encoder *encoder,if (hdmi_mode && dssdev->driver->set_hdmi_infoframe) {struct hdmi_avi_infoframe avi; - r =drm_hdmi_avi_infoframe_from_display_mode (&avi, adjusted_mode); + r =drm_hdmi_avi_infoframe_from_display_mode (&avi, adjusted_mode, + false);if (r ==0 ) dssdev->driver->set_hdmi_infoframe (dssdev, &avi); }
drivers/gpu/drm/radeon/radeon_audio.c +1 -1
@@ -516,7 +516,7 @@ static int radeon_audio_set_avi_packet(struct drm_encoder *encoder,if (!connector)return -EINVAL ; - err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode); + err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode, false);if (err <0 ) {DRM_ERROR ("failed to setup AVI infoframe: %d\n" , err);return err;
drivers/gpu/drm/rockchip/inno_hdmi.c +1 -1
@@ -294,7 +294,7 @@ static int inno_hdmi_config_video_avi(struct inno_hdmi *hdmi,union hdmi_infoframe frame;int rc; - rc =drm_hdmi_avi_infoframe_from_display_mode (&frame.avi, mode); + rc =drm_hdmi_avi_infoframe_from_display_mode (&frame.avi, mode, false);if (hdmi->hdmi_data.enc_out_format ==HDMI_COLORSPACE_YUV444 ) frame.avi.colorspace =HDMI_COLORSPACE_YUV444 ;
drivers/gpu/drm/sti/sti_hdmi.c +1 -1
@@ -434,7 +434,7 @@ static int hdmi_avi_infoframe_config(struct sti_hdmi *hdmi)DRM_DEBUG_DRIVER ("\n" ); - ret =drm_hdmi_avi_infoframe_from_display_mode (&infoframe, mode); + ret =drm_hdmi_avi_infoframe_from_display_mode (&infoframe, mode, false);if (ret <0 ) {DRM_ERROR ("failed to setup AVI infoframe: %d\n" , ret);return ret;
drivers/gpu/drm/tegra/hdmi.c +1 -1
@@ -734,7 +734,7 @@ static void tegra_hdmi_setup_avi_infoframe(struct tegra_hdmi *hdmi,u8 buffer[17 ];ssize_t err; - err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode); + err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode, false);if (err <0 ) {dev_err (hdmi->dev,"failed to setup AVI infoframe: %zd\n" , err);return ;
drivers/gpu/drm/tegra/sor.c +1 -1
@@ -1904,7 +1904,7 @@ tegra_sor_hdmi_setup_avi_infoframe(struct tegra_sor *sor, value &= ~INFOFRAME_CTRL_ENABLE ;tegra_sor_writel (sor, value,SOR_HDMI_AVI_INFOFRAME_CTRL ); - err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode); + err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode, false);if (err <0 ) {dev_err (sor->dev,"failed to setup AVI infoframe: %d\n" , err);return err;
drivers/gpu/drm/vc4/vc4_hdmi.c +1 -1
@@ -395,7 +395,7 @@ static void vc4_hdmi_set_avi_infoframe(struct drm_encoder *encoder)union hdmi_infoframe frame;int ret; - ret =drm_hdmi_avi_infoframe_from_display_mode (&frame.avi, mode); + ret =drm_hdmi_avi_infoframe_from_display_mode (&frame.avi, mode, false);if (ret <0 ) {DRM_ERROR ("couldn't fill AVI infoframe\n" );return ;
drivers/gpu/drm/zte/zx_hdmi.c +1 -1
@@ -124,7 +124,7 @@ static int zx_hdmi_config_video_avi(struct zx_hdmi *hdmi,union hdmi_infoframe frame;int ret; - ret =drm_hdmi_avi_infoframe_from_display_mode (&frame.avi, mode); + ret =drm_hdmi_avi_infoframe_from_display_mode (&frame.avi, mode, false);if (ret) {DRM_DEV_ERROR (hdmi->dev,"failed to get avi infoframe: %d\n" , ret);
include/drm/drm_edid.h +2 -1
@@ -343,7 +343,8 @@ drm_load_edid_firmware(struct drm_connector *connector)int drm_hdmi_avi_infoframe_from_display_mode (struct hdmi_avi_infoframe *frame, -const struct drm_display_mode *mode); +const struct drm_display_mode *mode, +bool is_hdmi2);int drm_hdmi_vendor_infoframe_from_display_mode (struct hdmi_vendor_infoframe *frame,const struct drm_display_mode *mode);
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v2 01/11] drm: Add HDMI 2.0 VIC support for AVI info-frames
Quoted 155 lines · Shashank Sharma
HDMI 1.4b support the CEA video modes as per range of CEA-861-D (VIC 1-64). For any other mode, the VIC filed in AVI infoframes should be 0. HDMI 2.0 sinks, support video modes range as per CEA-861-F spec, which is extended to (VIC 1-107).
This patch adds a bool input variable, which indicates if the connected sink is a HDMI 2.0 sink or not. This will make sure that we don't pass a HDMI 2.0 VIC to a HDMI 1.4 sink.
This patch touches all drm drivers, who are callers of this function
drm_hdmi_avi_infoframe_from_display_modebut to make sure there is no change in current behavior,is_hdmi2is kept as false.In case of I915 driver, this patch checks the
connector->display_infoto check if the connected display is HDMI 2.0.Cc Ville Syrjala <[email protected]>Cc Jose Abreu <[email protected]>Cc Andrzej Hajda <[email protected]>Cc Alex Deucher <[email protected]>Cc Daniel Vetter <[email protected]>PS: This patch touches a few lines in few files, which were already above 80 char, so checkpatch gives 80 char warning again.
-gpu/drm/omapdrm/omap_encoder.c
-gpu/drm/i915/intel_sdvo.cV2: Rebase, Added r-b from Andrzej
Reviewed-by Andrzej Hajda <[email protected]>Signed-off-by Shashank Sharma <[email protected]>--- drivers/gpu/drm/amd/amdgpu/dce_v10_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/dce_v11_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/dce_v8_0.c | 2 +- drivers/gpu/drm/bridge/analogix-anx78xx.c | 3 ++- drivers/gpu/drm/bridge/sii902x.c | 2 +- drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 2 +- drivers/gpu/drm/drm_edid.c | 12 +++++++++++- drivers/gpu/drm/exynos/exynos_hdmi.c | 2 +- drivers/gpu/drm/i2c/tda998x_drv.c | 2 +- drivers/gpu/drm/i915/intel_hdmi.c | 5 ++++- drivers/gpu/drm/i915/intel_sdvo.c | 3 ++- drivers/gpu/drm/mediatek/mtk_hdmi.c | 2 +- drivers/gpu/drm/omapdrm/omap_encoder.c | 3 ++- drivers/gpu/drm/radeon/radeon_audio.c | 2 +- drivers/gpu/drm/rockchip/inno_hdmi.c | 2 +- drivers/gpu/drm/sti/sti_hdmi.c | 2 +- drivers/gpu/drm/tegra/hdmi.c | 2 +- drivers/gpu/drm/tegra/sor.c | 2 +- drivers/gpu/drm/vc4/vc4_hdmi.c | 2 +- drivers/gpu/drm/zte/zx_hdmi.c | 2 +- include/drm/drm_edid.h | 3 ++- 21 files changed, 38 insertions(+), 21 deletions(-)drivers/gpu/drm/amd/amdgpu/dce_v10_0.c +1
-1@@ -1864,7 +1864,7 @@ static void dce_v10_0_afmt_setmode(struct drm_encoder *encoder,dce_v10_0_audio_write_sad_regs (encoder);dce_v10_0_audio_write_latency_fields (encoder, mode); - err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode); + err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode, false);if (err <0 ) {DRM_ERROR ("failed to setup AVI infoframe: %zd\n" , err);return ;drivers/gpu/drm/amd/amdgpu/dce_v11_0.c +1
-1@@ -1848,7 +1848,7 @@ static void dce_v11_0_afmt_setmode(struct drm_encoder *encoder,dce_v11_0_audio_write_sad_regs (encoder);dce_v11_0_audio_write_latency_fields (encoder, mode); - err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode); + err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode, false);if (err <0 ) {DRM_ERROR ("failed to setup AVI infoframe: %zd\n" , err);return ;drivers/gpu/drm/amd/amdgpu/dce_v8_0.c +1
-1@@ -1747,7 +1747,7 @@ static void dce_v8_0_afmt_setmode(struct drm_encoder *encoder,dce_v8_0_audio_write_sad_regs (encoder);dce_v8_0_audio_write_latency_fields (encoder, mode); - err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode); + err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode, false);if (err <0 ) {DRM_ERROR ("failed to setup AVI infoframe: %zd\n" , err);return ;drivers/gpu/drm/bridge/analogix-anx78xx.c +2
-1@@ -1097,7 +1097,8 @@ static void anx78xx_bridge_mode_set(struct drm_bridge *bridge,mutex_lock (&anx78xx->lock); - err =drm_hdmi_avi_infoframe_from_display_mode (&frame, adjusted_mode); + err =drm_hdmi_avi_infoframe_from_display_mode (&frame, adjusted_mode, + false);if (err) {DRM_ERROR ("Failed to setup AVI infoframe: %d\n" , err); goto unlock;drivers/gpu/drm/bridge/sii902x.c +1
-1@@ -269,7 +269,7 @@ static void sii902x_bridge_mode_set(struct drm_bridge *bridge,if (ret)return ; - ret =drm_hdmi_avi_infoframe_from_display_mode (&frame, adj); + ret =drm_hdmi_avi_infoframe_from_display_mode (&frame, adj, false);if (ret <0 ) {DRM_ERROR ("couldn't fill AVI infoframe\n" );return ;drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +1
-1@@ -1317,7 +1317,7 @@ static void hdmi_config_AVI(struct dw_hdmi *hdmi, struct drm_display_mode *mode)u8 val;/* Initialise info frame from DRM mode */ -drm_hdmi_avi_infoframe_from_display_mode (&frame, mode); +drm_hdmi_avi_infoframe_from_display_mode (&frame, mode, false);if (hdmi_bus_fmt_is_yuv444 (hdmi->hdmi_data.enc_out_bus_format)) frame.colorspace =HDMI_COLORSPACE_YUV444 ;drivers/gpu/drm/drm_edid.c +3
-1@@ -4334,12 +4334,14 @@ EXPORT_SYMBOL(drm_set_preferred_mode);* data from a DRM display mode * @frame: HDMI AVI infoframe * @mode: DRM display mode +* @is_hdmi2: Sink is HDMI 2.0 compliant * * Return: 0 on success or a negative error code on failure. */ int drm_hdmi_avi_infoframe_from_display_mode (struct hdmi_avi_infoframe *frame, -const struct drm_display_mode *mode) +const struct drm_display_mode *mode, +bool is_hdmi2) {int err;
drivers/gpu/drm/drm_edid.c drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame, · line 4366
Quoted 10 lines
drivers/gpu/drm/drm_edid.c +7
-0@@ -4355,6 +4357,14 @@ drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame, frame->video_code =drm_match_cea_mode (mode); +/* +* HDMI 1.4 VIC range: 1 <= VIC <= 64 (CEA-861-D) but +* HDMI 2.0 VIC range: 1 <= VIC <= 107 (CEA-861-F). So we +* have to make sure we dont break HDMI 1.4 sinks. +*/ +if (!is_hdmi2 && frame->video_code >64 ) + frame->video_code =0 ;
Seems I've totally forgotten what we concluded about the AVI VIC vs. HDMI VIC, but I have a feeling this isn't sufficient.
Quoted 198 lines
drivers/gpu/drm/drm_edid.c +1
-0+ frame->picture_aspect =HDMI_PICTURE_ASPECT_NONE ;/* drivers/gpu/drm/exynos/exynos_hdmi.c +1
-1@@ -784,7 +784,7 @@ static void hdmi_reg_infoframes(struct hdmi_context *hdata) } ret =drm_hdmi_avi_infoframe_from_display_mode (&frm.avi, - &hdata->current_mode); + &hdata->current_mode, false);if (!ret) ret =hdmi_avi_infoframe_pack (&frm.avi, buf,sizeof (buf));if (ret >0 ) {drivers/gpu/drm/i2c/tda998x_drv.c +1
-1@@ -712,7 +712,7 @@ tda998x_write_avi(struct tda998x_priv *priv, struct drm_display_mode *mode) {union hdmi_infoframe frame; -drm_hdmi_avi_infoframe_from_display_mode (&frame.avi, mode); +drm_hdmi_avi_infoframe_from_display_mode (&frame.avi, mode, false); frame.avi.quantization_range =HDMI_QUANTIZATION_RANGE_FULL ;tda998x_write_if (priv,DIP_IF_FLAGS_IF2 ,REG_IF2_HB0 , &frame);drivers/gpu/drm/i915/intel_hdmi.c +4
-1@@ -459,11 +459,14 @@ static void intel_hdmi_set_avi_infoframe(struct drm_encoder *encoder,struct intel_hdmi *intel_hdmi =enc_to_intel_hdmi (encoder);const struct drm_display_mode *adjusted_mode = &crtc_state->base.adjusted_mode; +struct drm_connector *connector = &intel_hdmi->attached_connector->base; +bool is_hdmi2 = connector->display_info.hdmi.scdc.supported;union hdmi_infoframe frame;int ret; ret =drm_hdmi_avi_infoframe_from_display_mode (&frame.avi, - adjusted_mode); + adjusted_mode, + is_hdmi2);if (ret <0 ) {DRM_ERROR ("couldn't fill AVI infoframe\n" );return ;drivers/gpu/drm/i915/intel_sdvo.c +2
-1@@ -1006,7 +1006,8 @@ static bool intel_sdvo_set_avi_infoframe(struct intel_sdvo *intel_sdvo,ssize_t len; ret =drm_hdmi_avi_infoframe_from_display_mode (&frame.avi, - &pipe_config->base.adjusted_mode); + &pipe_config->base.adjusted_mode, + false);if (ret <0 ) {DRM_ERROR ("couldn't fill AVI infoframe\n" );return false;drivers/gpu/drm/mediatek/mtk_hdmi.c +1
-1@@ -975,7 +975,7 @@ static int mtk_hdmi_setup_avi_infoframe(struct mtk_hdmi *hdmi,u8 buffer[17 ];ssize_t err; - err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode); + err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode, false);if (err <0 ) {dev_err (hdmi->dev,"Failed to get AVI infoframe from mode: %zd\n" , err);drivers/gpu/drm/omapdrm/omap_encoder.c +2
-1@@ -85,7 +85,8 @@ static void omap_encoder_mode_set(struct drm_encoder *encoder,if (hdmi_mode && dssdev->driver->set_hdmi_infoframe) {struct hdmi_avi_infoframe avi; - r =drm_hdmi_avi_infoframe_from_display_mode (&avi, adjusted_mode); + r =drm_hdmi_avi_infoframe_from_display_mode (&avi, adjusted_mode, + false);if (r ==0 ) dssdev->driver->set_hdmi_infoframe (dssdev, &avi); }drivers/gpu/drm/radeon/radeon_audio.c +1
-1@@ -516,7 +516,7 @@ static int radeon_audio_set_avi_packet(struct drm_encoder *encoder,if (!connector)return -EINVAL ; - err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode); + err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode, false);if (err <0 ) {DRM_ERROR ("failed to setup AVI infoframe: %d\n" , err);return err;drivers/gpu/drm/rockchip/inno_hdmi.c +1
-1@@ -294,7 +294,7 @@ static int inno_hdmi_config_video_avi(struct inno_hdmi *hdmi,union hdmi_infoframe frame;int rc; - rc =drm_hdmi_avi_infoframe_from_display_mode (&frame.avi, mode); + rc =drm_hdmi_avi_infoframe_from_display_mode (&frame.avi, mode, false);if (hdmi->hdmi_data.enc_out_format ==HDMI_COLORSPACE_YUV444 ) frame.avi.colorspace =HDMI_COLORSPACE_YUV444 ;drivers/gpu/drm/sti/sti_hdmi.c +1
-1@@ -434,7 +434,7 @@ static int hdmi_avi_infoframe_config(struct sti_hdmi *hdmi)DRM_DEBUG_DRIVER ("\n" ); - ret =drm_hdmi_avi_infoframe_from_display_mode (&infoframe, mode); + ret =drm_hdmi_avi_infoframe_from_display_mode (&infoframe, mode, false);if (ret <0 ) {DRM_ERROR ("failed to setup AVI infoframe: %d\n" , ret);return ret;drivers/gpu/drm/tegra/hdmi.c +1
-1@@ -734,7 +734,7 @@ static void tegra_hdmi_setup_avi_infoframe(struct tegra_hdmi *hdmi,u8 buffer[17 ];ssize_t err; - err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode); + err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode, false);if (err <0 ) {dev_err (hdmi->dev,"failed to setup AVI infoframe: %zd\n" , err);return ;drivers/gpu/drm/tegra/sor.c +1
-1@@ -1904,7 +1904,7 @@ tegra_sor_hdmi_setup_avi_infoframe(struct tegra_sor *sor, value &= ~INFOFRAME_CTRL_ENABLE ;tegra_sor_writel (sor, value,SOR_HDMI_AVI_INFOFRAME_CTRL ); - err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode); + err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode, false);if (err <0 ) {dev_err (sor->dev,"failed to setup AVI infoframe: %d\n" , err);return err;drivers/gpu/drm/vc4/vc4_hdmi.c +1
-1@@ -395,7 +395,7 @@ static void vc4_hdmi_set_avi_infoframe(struct drm_encoder *encoder)union hdmi_infoframe frame;int ret; - ret =drm_hdmi_avi_infoframe_from_display_mode (&frame.avi, mode); + ret =drm_hdmi_avi_infoframe_from_display_mode (&frame.avi, mode, false);if (ret <0 ) {DRM_ERROR ("couldn't fill AVI infoframe\n" );return ;drivers/gpu/drm/zte/zx_hdmi.c +1
-1@@ -124,7 +124,7 @@ static int zx_hdmi_config_video_avi(struct zx_hdmi *hdmi,union hdmi_infoframe frame;int ret; - ret =drm_hdmi_avi_infoframe_from_display_mode (&frame.avi, mode); + ret =drm_hdmi_avi_infoframe_from_display_mode (&frame.avi, mode, false);if (ret) {DRM_DEV_ERROR (hdmi->dev,"failed to get avi infoframe: %d\n" , ret);include/drm/drm_edid.h +2
-1@@ -343,7 +343,8 @@ drm_load_edid_firmware(struct drm_connector *connector)int drm_hdmi_avi_infoframe_from_display_mode (struct hdmi_avi_infoframe *frame, -const struct drm_display_mode *mode); +const struct drm_display_mode *mode, +bool is_hdmi2);int drm_hdmi_vendor_infoframe_from_display_mode (struct hdmi_vendor_infoframe *frame,const struct drm_display_mode *mode);Signature · 1 line
2.7.4
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v2 01/11] drm: Add HDMI 2.0 VIC support for AVI info-frames
Regards
Shashank
Quoted 159 lines · Ville Syrjälä
Quoted 158 lines · Shashank Sharma
HDMI 1.4b support the CEA video modes as per range of CEA-861-D (VIC 1-64). For any other mode, the VIC filed in AVI infoframes should be 0. HDMI 2.0 sinks, support video modes range as per CEA-861-F spec, which is extended to (VIC 1-107).
This patch adds a bool input variable, which indicates if the connected sink is a HDMI 2.0 sink or not. This will make sure that we don't pass a HDMI 2.0 VIC to a HDMI 1.4 sink.
This patch touches all drm drivers, who are callers of this function
drm_hdmi_avi_infoframe_from_display_modebut to make sure there is no change in current behavior,is_hdmi2is kept as false.In case of I915 driver, this patch checks the
connector->display_infoto check if the connected display is HDMI 2.0.Cc Ville Syrjala <[email protected]>Cc Jose Abreu <[email protected]>Cc Andrzej Hajda <[email protected]>Cc Alex Deucher <[email protected]>Cc Daniel Vetter <[email protected]>PS: This patch touches a few lines in few files, which were already above 80 char, so checkpatch gives 80 char warning again.
-gpu/drm/omapdrm/omap_encoder.c
-gpu/drm/i915/intel_sdvo.cV2: Rebase, Added r-b from Andrzej
Reviewed-by Andrzej Hajda <[email protected]>Signed-off-by Shashank Sharma <[email protected]>--- drivers/gpu/drm/amd/amdgpu/dce_v10_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/dce_v11_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/dce_v8_0.c | 2 +- drivers/gpu/drm/bridge/analogix-anx78xx.c | 3 ++- drivers/gpu/drm/bridge/sii902x.c | 2 +- drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 2 +- drivers/gpu/drm/drm_edid.c | 12 +++++++++++- drivers/gpu/drm/exynos/exynos_hdmi.c | 2 +- drivers/gpu/drm/i2c/tda998x_drv.c | 2 +- drivers/gpu/drm/i915/intel_hdmi.c | 5 ++++- drivers/gpu/drm/i915/intel_sdvo.c | 3 ++- drivers/gpu/drm/mediatek/mtk_hdmi.c | 2 +- drivers/gpu/drm/omapdrm/omap_encoder.c | 3 ++- drivers/gpu/drm/radeon/radeon_audio.c | 2 +- drivers/gpu/drm/rockchip/inno_hdmi.c | 2 +- drivers/gpu/drm/sti/sti_hdmi.c | 2 +- drivers/gpu/drm/tegra/hdmi.c | 2 +- drivers/gpu/drm/tegra/sor.c | 2 +- drivers/gpu/drm/vc4/vc4_hdmi.c | 2 +- drivers/gpu/drm/zte/zx_hdmi.c | 2 +- include/drm/drm_edid.h | 3 ++- 21 files changed, 38 insertions(+), 21 deletions(-)drivers/gpu/drm/amd/amdgpu/dce_v10_0.c +1
-1@@ -1864,7 +1864,7 @@ static void dce_v10_0_afmt_setmode(struct drm_encoder *encoder,dce_v10_0_audio_write_sad_regs (encoder);dce_v10_0_audio_write_latency_fields (encoder, mode); - err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode); + err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode, false);if (err <0 ) {DRM_ERROR ("failed to setup AVI infoframe: %zd\n" , err);return ;drivers/gpu/drm/amd/amdgpu/dce_v11_0.c +1
-1@@ -1848,7 +1848,7 @@ static void dce_v11_0_afmt_setmode(struct drm_encoder *encoder,dce_v11_0_audio_write_sad_regs (encoder);dce_v11_0_audio_write_latency_fields (encoder, mode); - err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode); + err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode, false);if (err <0 ) {DRM_ERROR ("failed to setup AVI infoframe: %zd\n" , err);return ;drivers/gpu/drm/amd/amdgpu/dce_v8_0.c +1
-1@@ -1747,7 +1747,7 @@ static void dce_v8_0_afmt_setmode(struct drm_encoder *encoder,dce_v8_0_audio_write_sad_regs (encoder);dce_v8_0_audio_write_latency_fields (encoder, mode); - err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode); + err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode, false);if (err <0 ) {DRM_ERROR ("failed to setup AVI infoframe: %zd\n" , err);return ;drivers/gpu/drm/bridge/analogix-anx78xx.c +2
-1@@ -1097,7 +1097,8 @@ static void anx78xx_bridge_mode_set(struct drm_bridge *bridge,mutex_lock (&anx78xx->lock); - err =drm_hdmi_avi_infoframe_from_display_mode (&frame, adjusted_mode); + err =drm_hdmi_avi_infoframe_from_display_mode (&frame, adjusted_mode, + false);if (err) {DRM_ERROR ("Failed to setup AVI infoframe: %d\n" , err); goto unlock;drivers/gpu/drm/bridge/sii902x.c +1
-1@@ -269,7 +269,7 @@ static void sii902x_bridge_mode_set(struct drm_bridge *bridge,if (ret)return ; - ret =drm_hdmi_avi_infoframe_from_display_mode (&frame, adj); + ret =drm_hdmi_avi_infoframe_from_display_mode (&frame, adj, false);if (ret <0 ) {DRM_ERROR ("couldn't fill AVI infoframe\n" );return ;drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +1
-1@@ -1317,7 +1317,7 @@ static void hdmi_config_AVI(struct dw_hdmi *hdmi, struct drm_display_mode *mode)u8 val;/* Initialise info frame from DRM mode */ -drm_hdmi_avi_infoframe_from_display_mode (&frame, mode); +drm_hdmi_avi_infoframe_from_display_mode (&frame, mode, false);if (hdmi_bus_fmt_is_yuv444 (hdmi->hdmi_data.enc_out_bus_format)) frame.colorspace =HDMI_COLORSPACE_YUV444 ;drivers/gpu/drm/drm_edid.c +3
-1@@ -4334,12 +4334,14 @@ EXPORT_SYMBOL(drm_set_preferred_mode);* data from a DRM display mode * @frame: HDMI AVI infoframe * @mode: DRM display mode +* @is_hdmi2: Sink is HDMI 2.0 compliant * * Return: 0 on success or a negative error code on failure. */ int drm_hdmi_avi_infoframe_from_display_mode (struct hdmi_avi_infoframe *frame, -const struct drm_display_mode *mode) +const struct drm_display_mode *mode, +bool is_hdmi2) {int err;@@ -4355,6 +4357,14 @@ drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame, frame->video_code =drm_match_cea_mode (mode);
Quoted 9 lines
drivers/gpu/drm/drm_edid.c drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame, · line 4366
Quoted 7 lines
drivers/gpu/drm/drm_edid.c +7
-0+/* +* HDMI 1.4 VIC range: 1 <= VIC <= 64 (CEA-861-D) but +* HDMI 2.0 VIC range: 1 <= VIC <= 107 (CEA-861-F). So we +* have to make sure we dont break HDMI 1.4 sinks. +*/ +if (!is_hdmi2 && frame->video_code >64 ) + frame->video_code =0 ;Seems I've totally forgotten what we concluded about the AVI VIC vs. HDMI VIC, but I have a feeling this isn't sufficient.
As far as I remember, we decided to send VICs > 64 to HDMI 2.0 monitors only. If you can provide some more thoughts about how can we make it better ?
- Shashank
Quoted 188 lines
Quoted 188 lines
drivers/gpu/drm/drm_edid.c +1
-0+ frame->picture_aspect =HDMI_PICTURE_ASPECT_NONE ;/* drivers/gpu/drm/exynos/exynos_hdmi.c +1
-1@@ -784,7 +784,7 @@ static void hdmi_reg_infoframes(struct hdmi_context *hdata) } ret =drm_hdmi_avi_infoframe_from_display_mode (&frm.avi, - &hdata->current_mode); + &hdata->current_mode, false);if (!ret) ret =hdmi_avi_infoframe_pack (&frm.avi, buf,sizeof (buf));if (ret >0 ) {drivers/gpu/drm/i2c/tda998x_drv.c +1
-1@@ -712,7 +712,7 @@ tda998x_write_avi(struct tda998x_priv *priv, struct drm_display_mode *mode) {union hdmi_infoframe frame; -drm_hdmi_avi_infoframe_from_display_mode (&frame.avi, mode); +drm_hdmi_avi_infoframe_from_display_mode (&frame.avi, mode, false); frame.avi.quantization_range =HDMI_QUANTIZATION_RANGE_FULL ;tda998x_write_if (priv,DIP_IF_FLAGS_IF2 ,REG_IF2_HB0 , &frame);drivers/gpu/drm/i915/intel_hdmi.c +4
-1@@ -459,11 +459,14 @@ static void intel_hdmi_set_avi_infoframe(struct drm_encoder *encoder,struct intel_hdmi *intel_hdmi =enc_to_intel_hdmi (encoder);const struct drm_display_mode *adjusted_mode = &crtc_state->base.adjusted_mode; +struct drm_connector *connector = &intel_hdmi->attached_connector->base; +bool is_hdmi2 = connector->display_info.hdmi.scdc.supported;union hdmi_infoframe frame;int ret; ret =drm_hdmi_avi_infoframe_from_display_mode (&frame.avi, - adjusted_mode); + adjusted_mode, + is_hdmi2);if (ret <0 ) {DRM_ERROR ("couldn't fill AVI infoframe\n" );return ;drivers/gpu/drm/i915/intel_sdvo.c +2
-1@@ -1006,7 +1006,8 @@ static bool intel_sdvo_set_avi_infoframe(struct intel_sdvo *intel_sdvo,ssize_t len; ret =drm_hdmi_avi_infoframe_from_display_mode (&frame.avi, - &pipe_config->base.adjusted_mode); + &pipe_config->base.adjusted_mode, + false);if (ret <0 ) {DRM_ERROR ("couldn't fill AVI infoframe\n" );return false;drivers/gpu/drm/mediatek/mtk_hdmi.c +1
-1@@ -975,7 +975,7 @@ static int mtk_hdmi_setup_avi_infoframe(struct mtk_hdmi *hdmi,u8 buffer[17 ];ssize_t err; - err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode); + err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode, false);if (err <0 ) {dev_err (hdmi->dev,"Failed to get AVI infoframe from mode: %zd\n" , err);drivers/gpu/drm/omapdrm/omap_encoder.c +2
-1@@ -85,7 +85,8 @@ static void omap_encoder_mode_set(struct drm_encoder *encoder,if (hdmi_mode && dssdev->driver->set_hdmi_infoframe) {struct hdmi_avi_infoframe avi; - r =drm_hdmi_avi_infoframe_from_display_mode (&avi, adjusted_mode); + r =drm_hdmi_avi_infoframe_from_display_mode (&avi, adjusted_mode, + false);if (r ==0 ) dssdev->driver->set_hdmi_infoframe (dssdev, &avi); }drivers/gpu/drm/radeon/radeon_audio.c +1
-1@@ -516,7 +516,7 @@ static int radeon_audio_set_avi_packet(struct drm_encoder *encoder,if (!connector)return -EINVAL ; - err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode); + err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode, false);if (err <0 ) {DRM_ERROR ("failed to setup AVI infoframe: %d\n" , err);return err;drivers/gpu/drm/rockchip/inno_hdmi.c +1
-1@@ -294,7 +294,7 @@ static int inno_hdmi_config_video_avi(struct inno_hdmi *hdmi,union hdmi_infoframe frame;int rc; - rc =drm_hdmi_avi_infoframe_from_display_mode (&frame.avi, mode); + rc =drm_hdmi_avi_infoframe_from_display_mode (&frame.avi, mode, false);if (hdmi->hdmi_data.enc_out_format ==HDMI_COLORSPACE_YUV444 ) frame.avi.colorspace =HDMI_COLORSPACE_YUV444 ;drivers/gpu/drm/sti/sti_hdmi.c +1
-1@@ -434,7 +434,7 @@ static int hdmi_avi_infoframe_config(struct sti_hdmi *hdmi)DRM_DEBUG_DRIVER ("\n" ); - ret =drm_hdmi_avi_infoframe_from_display_mode (&infoframe, mode); + ret =drm_hdmi_avi_infoframe_from_display_mode (&infoframe, mode, false);if (ret <0 ) {DRM_ERROR ("failed to setup AVI infoframe: %d\n" , ret);return ret;drivers/gpu/drm/tegra/hdmi.c +1
-1@@ -734,7 +734,7 @@ static void tegra_hdmi_setup_avi_infoframe(struct tegra_hdmi *hdmi,u8 buffer[17 ];ssize_t err; - err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode); + err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode, false);if (err <0 ) {dev_err (hdmi->dev,"failed to setup AVI infoframe: %zd\n" , err);return ;drivers/gpu/drm/tegra/sor.c +1
-1@@ -1904,7 +1904,7 @@ tegra_sor_hdmi_setup_avi_infoframe(struct tegra_sor *sor, value &= ~INFOFRAME_CTRL_ENABLE ;tegra_sor_writel (sor, value,SOR_HDMI_AVI_INFOFRAME_CTRL ); - err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode); + err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode, false);if (err <0 ) {dev_err (sor->dev,"failed to setup AVI infoframe: %d\n" , err);return err;drivers/gpu/drm/vc4/vc4_hdmi.c +1
-1@@ -395,7 +395,7 @@ static void vc4_hdmi_set_avi_infoframe(struct drm_encoder *encoder)union hdmi_infoframe frame;int ret; - ret =drm_hdmi_avi_infoframe_from_display_mode (&frame.avi, mode); + ret =drm_hdmi_avi_infoframe_from_display_mode (&frame.avi, mode, false);if (ret <0 ) {DRM_ERROR ("couldn't fill AVI infoframe\n" );return ;drivers/gpu/drm/zte/zx_hdmi.c +1
-1@@ -124,7 +124,7 @@ static int zx_hdmi_config_video_avi(struct zx_hdmi *hdmi,union hdmi_infoframe frame;int ret; - ret =drm_hdmi_avi_infoframe_from_display_mode (&frame.avi, mode); + ret =drm_hdmi_avi_infoframe_from_display_mode (&frame.avi, mode, false);if (ret) {DRM_DEV_ERROR (hdmi->dev,"failed to get avi infoframe: %d\n" , ret);include/drm/drm_edid.h +0
-0@@ -343,7 +343,8 @@ drm_load_edid_firmware(struct drm_connector *connector)
Quoted 10 lines
Quoted 10 lines
include/drm/drm_edid.h +2
-1int drm_hdmi_avi_infoframe_from_display_mode (struct hdmi_avi_infoframe *frame, -const struct drm_display_mode *mode); +const struct drm_display_mode *mode, +bool is_hdmi2);int drm_hdmi_vendor_infoframe_from_display_mode (struct hdmi_vendor_infoframe *frame,const struct drm_display_mode *mode);Signature · 1 line
2.7.4
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v2 01/11] drm: Add HDMI 2.0 VIC support for AVI info-frames
Quoted 174 lines · Shashank
Regards
Shashank
Quoted 159 lines · Ville Syrjälä
Quoted 158 lines · Shashank Sharma
HDMI 1.4b support the CEA video modes as per range of CEA-861-D (VIC 1-64). For any other mode, the VIC filed in AVI infoframes should be 0. HDMI 2.0 sinks, support video modes range as per CEA-861-F spec, which is extended to (VIC 1-107).
This patch adds a bool input variable, which indicates if the connected sink is a HDMI 2.0 sink or not. This will make sure that we don't pass a HDMI 2.0 VIC to a HDMI 1.4 sink.
This patch touches all drm drivers, who are callers of this function
drm_hdmi_avi_infoframe_from_display_modebut to make sure there is no change in current behavior,is_hdmi2is kept as false.In case of I915 driver, this patch checks the
connector->display_infoto check if the connected display is HDMI 2.0.Cc Ville Syrjala <[email protected]>Cc Jose Abreu <[email protected]>Cc Andrzej Hajda <[email protected]>Cc Alex Deucher <[email protected]>Cc Daniel Vetter <[email protected]>PS: This patch touches a few lines in few files, which were already above 80 char, so checkpatch gives 80 char warning again.
-gpu/drm/omapdrm/omap_encoder.c
-gpu/drm/i915/intel_sdvo.cV2: Rebase, Added r-b from Andrzej
Reviewed-by Andrzej Hajda <[email protected]>Signed-off-by Shashank Sharma <[email protected]>--- drivers/gpu/drm/amd/amdgpu/dce_v10_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/dce_v11_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/dce_v8_0.c | 2 +- drivers/gpu/drm/bridge/analogix-anx78xx.c | 3 ++- drivers/gpu/drm/bridge/sii902x.c | 2 +- drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 2 +- drivers/gpu/drm/drm_edid.c | 12 +++++++++++- drivers/gpu/drm/exynos/exynos_hdmi.c | 2 +- drivers/gpu/drm/i2c/tda998x_drv.c | 2 +- drivers/gpu/drm/i915/intel_hdmi.c | 5 ++++- drivers/gpu/drm/i915/intel_sdvo.c | 3 ++- drivers/gpu/drm/mediatek/mtk_hdmi.c | 2 +- drivers/gpu/drm/omapdrm/omap_encoder.c | 3 ++- drivers/gpu/drm/radeon/radeon_audio.c | 2 +- drivers/gpu/drm/rockchip/inno_hdmi.c | 2 +- drivers/gpu/drm/sti/sti_hdmi.c | 2 +- drivers/gpu/drm/tegra/hdmi.c | 2 +- drivers/gpu/drm/tegra/sor.c | 2 +- drivers/gpu/drm/vc4/vc4_hdmi.c | 2 +- drivers/gpu/drm/zte/zx_hdmi.c | 2 +- include/drm/drm_edid.h | 3 ++- 21 files changed, 38 insertions(+), 21 deletions(-)drivers/gpu/drm/amd/amdgpu/dce_v10_0.c +1
-1@@ -1864,7 +1864,7 @@ static void dce_v10_0_afmt_setmode(struct drm_encoder *encoder,dce_v10_0_audio_write_sad_regs (encoder);dce_v10_0_audio_write_latency_fields (encoder, mode); - err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode); + err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode, false);if (err <0 ) {DRM_ERROR ("failed to setup AVI infoframe: %zd\n" , err);return ;drivers/gpu/drm/amd/amdgpu/dce_v11_0.c +1
-1@@ -1848,7 +1848,7 @@ static void dce_v11_0_afmt_setmode(struct drm_encoder *encoder,dce_v11_0_audio_write_sad_regs (encoder);dce_v11_0_audio_write_latency_fields (encoder, mode); - err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode); + err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode, false);if (err <0 ) {DRM_ERROR ("failed to setup AVI infoframe: %zd\n" , err);return ;drivers/gpu/drm/amd/amdgpu/dce_v8_0.c +1
-1@@ -1747,7 +1747,7 @@ static void dce_v8_0_afmt_setmode(struct drm_encoder *encoder,dce_v8_0_audio_write_sad_regs (encoder);dce_v8_0_audio_write_latency_fields (encoder, mode); - err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode); + err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode, false);if (err <0 ) {DRM_ERROR ("failed to setup AVI infoframe: %zd\n" , err);return ;drivers/gpu/drm/bridge/analogix-anx78xx.c +2
-1@@ -1097,7 +1097,8 @@ static void anx78xx_bridge_mode_set(struct drm_bridge *bridge,mutex_lock (&anx78xx->lock); - err =drm_hdmi_avi_infoframe_from_display_mode (&frame, adjusted_mode); + err =drm_hdmi_avi_infoframe_from_display_mode (&frame, adjusted_mode, + false);if (err) {DRM_ERROR ("Failed to setup AVI infoframe: %d\n" , err); goto unlock;drivers/gpu/drm/bridge/sii902x.c +1
-1@@ -269,7 +269,7 @@ static void sii902x_bridge_mode_set(struct drm_bridge *bridge,if (ret)return ; - ret =drm_hdmi_avi_infoframe_from_display_mode (&frame, adj); + ret =drm_hdmi_avi_infoframe_from_display_mode (&frame, adj, false);if (ret <0 ) {DRM_ERROR ("couldn't fill AVI infoframe\n" );return ;drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +1
-1@@ -1317,7 +1317,7 @@ static void hdmi_config_AVI(struct dw_hdmi *hdmi, struct drm_display_mode *mode)u8 val;/* Initialise info frame from DRM mode */ -drm_hdmi_avi_infoframe_from_display_mode (&frame, mode); +drm_hdmi_avi_infoframe_from_display_mode (&frame, mode, false);if (hdmi_bus_fmt_is_yuv444 (hdmi->hdmi_data.enc_out_bus_format)) frame.colorspace =HDMI_COLORSPACE_YUV444 ;drivers/gpu/drm/drm_edid.c +3
-1@@ -4334,12 +4334,14 @@ EXPORT_SYMBOL(drm_set_preferred_mode);* data from a DRM display mode * @frame: HDMI AVI infoframe * @mode: DRM display mode +* @is_hdmi2: Sink is HDMI 2.0 compliant * * Return: 0 on success or a negative error code on failure. */ int drm_hdmi_avi_infoframe_from_display_mode (struct hdmi_avi_infoframe *frame, -const struct drm_display_mode *mode) +const struct drm_display_mode *mode, +bool is_hdmi2) {int err;@@ -4355,6 +4357,14 @@ drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame, frame->video_code =drm_match_cea_mode (mode);Quoted 9 lines
drivers/gpu/drm/drm_edid.c drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame, · line 4366
Quoted 7 lines
drivers/gpu/drm/drm_edid.c +7
-0+/* +* HDMI 1.4 VIC range: 1 <= VIC <= 64 (CEA-861-D) but +* HDMI 2.0 VIC range: 1 <= VIC <= 107 (CEA-861-F). So we +* have to make sure we dont break HDMI 1.4 sinks. +*/ +if (!is_hdmi2 && frame->video_code >64 ) + frame->video_code =0 ;Seems I've totally forgotten what we concluded about the AVI VIC vs. HDMI VIC, but I have a feeling this isn't sufficient.
Quoted 3 lines
As far as I remember, we decided to send VICs > 64 to HDMI 2.0 monitors only.
If you can provide some more thoughts about how can we make it better ?
The question is whether we send the VIC in the AVI infoframe of the HDMI infoframe. IIRC sending both isn't legal, and I think we might have concluded that we might have to pass the AVI infoframe to the HDMI infoframe construction function or vice versa to figure out which gets sent.
Quoted 200 lines
- Shashank
Quoted 198 lines
Quoted 198 lines
drivers/gpu/drm/drm_edid.c +1
-0+ frame->picture_aspect =HDMI_PICTURE_ASPECT_NONE ;/* drivers/gpu/drm/exynos/exynos_hdmi.c +1
-1@@ -784,7 +784,7 @@ static void hdmi_reg_infoframes(struct hdmi_context *hdata) } ret =drm_hdmi_avi_infoframe_from_display_mode (&frm.avi, - &hdata->current_mode); + &hdata->current_mode, false);if (!ret) ret =hdmi_avi_infoframe_pack (&frm.avi, buf,sizeof (buf));if (ret >0 ) {drivers/gpu/drm/i2c/tda998x_drv.c +1
-1@@ -712,7 +712,7 @@ tda998x_write_avi(struct tda998x_priv *priv, struct drm_display_mode *mode) {union hdmi_infoframe frame; -drm_hdmi_avi_infoframe_from_display_mode (&frame.avi, mode); +drm_hdmi_avi_infoframe_from_display_mode (&frame.avi, mode, false); frame.avi.quantization_range =HDMI_QUANTIZATION_RANGE_FULL ;tda998x_write_if (priv,DIP_IF_FLAGS_IF2 ,REG_IF2_HB0 , &frame);drivers/gpu/drm/i915/intel_hdmi.c +4
-1@@ -459,11 +459,14 @@ static void intel_hdmi_set_avi_infoframe(struct drm_encoder *encoder,struct intel_hdmi *intel_hdmi =enc_to_intel_hdmi (encoder);const struct drm_display_mode *adjusted_mode = &crtc_state->base.adjusted_mode; +struct drm_connector *connector = &intel_hdmi->attached_connector->base; +bool is_hdmi2 = connector->display_info.hdmi.scdc.supported;union hdmi_infoframe frame;int ret; ret =drm_hdmi_avi_infoframe_from_display_mode (&frame.avi, - adjusted_mode); + adjusted_mode, + is_hdmi2);if (ret <0 ) {DRM_ERROR ("couldn't fill AVI infoframe\n" );return ;drivers/gpu/drm/i915/intel_sdvo.c +2
-1@@ -1006,7 +1006,8 @@ static bool intel_sdvo_set_avi_infoframe(struct intel_sdvo *intel_sdvo,ssize_t len; ret =drm_hdmi_avi_infoframe_from_display_mode (&frame.avi, - &pipe_config->base.adjusted_mode); + &pipe_config->base.adjusted_mode, + false);if (ret <0 ) {DRM_ERROR ("couldn't fill AVI infoframe\n" );return false;drivers/gpu/drm/mediatek/mtk_hdmi.c +1
-1@@ -975,7 +975,7 @@ static int mtk_hdmi_setup_avi_infoframe(struct mtk_hdmi *hdmi,u8 buffer[17 ];ssize_t err; - err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode); + err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode, false);if (err <0 ) {dev_err (hdmi->dev,"Failed to get AVI infoframe from mode: %zd\n" , err);drivers/gpu/drm/omapdrm/omap_encoder.c +2
-1@@ -85,7 +85,8 @@ static void omap_encoder_mode_set(struct drm_encoder *encoder,if (hdmi_mode && dssdev->driver->set_hdmi_infoframe) {struct hdmi_avi_infoframe avi; - r =drm_hdmi_avi_infoframe_from_display_mode (&avi, adjusted_mode); + r =drm_hdmi_avi_infoframe_from_display_mode (&avi, adjusted_mode, + false);if (r ==0 ) dssdev->driver->set_hdmi_infoframe (dssdev, &avi); }drivers/gpu/drm/radeon/radeon_audio.c +1
-1@@ -516,7 +516,7 @@ static int radeon_audio_set_avi_packet(struct drm_encoder *encoder,if (!connector)return -EINVAL ; - err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode); + err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode, false);if (err <0 ) {DRM_ERROR ("failed to setup AVI infoframe: %d\n" , err);return err;drivers/gpu/drm/rockchip/inno_hdmi.c +1
-1@@ -294,7 +294,7 @@ static int inno_hdmi_config_video_avi(struct inno_hdmi *hdmi,union hdmi_infoframe frame;int rc; - rc =drm_hdmi_avi_infoframe_from_display_mode (&frame.avi, mode); + rc =drm_hdmi_avi_infoframe_from_display_mode (&frame.avi, mode, false);if (hdmi->hdmi_data.enc_out_format ==HDMI_COLORSPACE_YUV444 ) frame.avi.colorspace =HDMI_COLORSPACE_YUV444 ;drivers/gpu/drm/sti/sti_hdmi.c +1
-1@@ -434,7 +434,7 @@ static int hdmi_avi_infoframe_config(struct sti_hdmi *hdmi)DRM_DEBUG_DRIVER ("\n" ); - ret =drm_hdmi_avi_infoframe_from_display_mode (&infoframe, mode); + ret =drm_hdmi_avi_infoframe_from_display_mode (&infoframe, mode, false);if (ret <0 ) {DRM_ERROR ("failed to setup AVI infoframe: %d\n" , ret);return ret;drivers/gpu/drm/tegra/hdmi.c +1
-1@@ -734,7 +734,7 @@ static void tegra_hdmi_setup_avi_infoframe(struct tegra_hdmi *hdmi,u8 buffer[17 ];ssize_t err; - err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode); + err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode, false);if (err <0 ) {dev_err (hdmi->dev,"failed to setup AVI infoframe: %zd\n" , err);return ;drivers/gpu/drm/tegra/sor.c +1
-1@@ -1904,7 +1904,7 @@ tegra_sor_hdmi_setup_avi_infoframe(struct tegra_sor *sor, value &= ~INFOFRAME_CTRL_ENABLE ;tegra_sor_writel (sor, value,SOR_HDMI_AVI_INFOFRAME_CTRL ); - err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode); + err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode, false);if (err <0 ) {dev_err (sor->dev,"failed to setup AVI infoframe: %d\n" , err);return err;drivers/gpu/drm/vc4/vc4_hdmi.c +1
-1@@ -395,7 +395,7 @@ static void vc4_hdmi_set_avi_infoframe(struct drm_encoder *encoder)union hdmi_infoframe frame;int ret; - ret =drm_hdmi_avi_infoframe_from_display_mode (&frame.avi, mode); + ret =drm_hdmi_avi_infoframe_from_display_mode (&frame.avi, mode, false);if (ret <0 ) {DRM_ERROR ("couldn't fill AVI infoframe\n" );return ;drivers/gpu/drm/zte/zx_hdmi.c +1
-1@@ -124,7 +124,7 @@ static int zx_hdmi_config_video_avi(struct zx_hdmi *hdmi,union hdmi_infoframe frame;int ret; - ret =drm_hdmi_avi_infoframe_from_display_mode (&frame.avi, mode); + ret =drm_hdmi_avi_infoframe_from_display_mode (&frame.avi, mode, false);if (ret) {DRM_DEV_ERROR (hdmi->dev,"failed to get avi infoframe: %d\n" , ret);include/drm/drm_edid.h +2
-1@@ -343,7 +343,8 @@ drm_load_edid_firmware(struct drm_connector *connector)int drm_hdmi_avi_infoframe_from_display_mode (struct hdmi_avi_infoframe *frame, -const struct drm_display_mode *mode); +const struct drm_display_mode *mode, +bool is_hdmi2);int drm_hdmi_vendor_infoframe_from_display_mode (struct hdmi_vendor_infoframe *frame,const struct drm_display_mode *mode);Signature · 1 line
2.7.4
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v2 01/11] drm: Add HDMI 2.0 VIC support for AVI info-frames
Regards
Shashank
Quoted 175 lines · Ville Syrjälä
Quoted 174 lines · Shashank
Regards
Shashank
Quoted 168 lines · Ville Syrjälä
Quoted 155 lines · Shashank Sharma
HDMI 1.4b support the CEA video modes as per range of CEA-861-D (VIC 1-64). For any other mode, the VIC filed in AVI infoframes should be 0. HDMI 2.0 sinks, support video modes range as per CEA-861-F spec, which is extended to (VIC 1-107).
This patch adds a bool input variable, which indicates if the connected sink is a HDMI 2.0 sink or not. This will make sure that we don't pass a HDMI 2.0 VIC to a HDMI 1.4 sink.
This patch touches all drm drivers, who are callers of this function
drm_hdmi_avi_infoframe_from_display_modebut to make sure there is no change in current behavior,is_hdmi2is kept as false.In case of I915 driver, this patch checks the
connector->display_infoto check if the connected display is HDMI 2.0.Cc Ville Syrjala <[email protected]>Cc Jose Abreu <[email protected]>Cc Andrzej Hajda <[email protected]>Cc Alex Deucher <[email protected]>Cc Daniel Vetter <[email protected]>PS: This patch touches a few lines in few files, which were already above 80 char, so checkpatch gives 80 char warning again.
-gpu/drm/omapdrm/omap_encoder.c
-gpu/drm/i915/intel_sdvo.cV2: Rebase, Added r-b from Andrzej
Reviewed-by Andrzej Hajda <[email protected]>Signed-off-by Shashank Sharma <[email protected]>--- drivers/gpu/drm/amd/amdgpu/dce_v10_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/dce_v11_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/dce_v8_0.c | 2 +- drivers/gpu/drm/bridge/analogix-anx78xx.c | 3 ++- drivers/gpu/drm/bridge/sii902x.c | 2 +- drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 2 +- drivers/gpu/drm/drm_edid.c | 12 +++++++++++- drivers/gpu/drm/exynos/exynos_hdmi.c | 2 +- drivers/gpu/drm/i2c/tda998x_drv.c | 2 +- drivers/gpu/drm/i915/intel_hdmi.c | 5 ++++- drivers/gpu/drm/i915/intel_sdvo.c | 3 ++- drivers/gpu/drm/mediatek/mtk_hdmi.c | 2 +- drivers/gpu/drm/omapdrm/omap_encoder.c | 3 ++- drivers/gpu/drm/radeon/radeon_audio.c | 2 +- drivers/gpu/drm/rockchip/inno_hdmi.c | 2 +- drivers/gpu/drm/sti/sti_hdmi.c | 2 +- drivers/gpu/drm/tegra/hdmi.c | 2 +- drivers/gpu/drm/tegra/sor.c | 2 +- drivers/gpu/drm/vc4/vc4_hdmi.c | 2 +- drivers/gpu/drm/zte/zx_hdmi.c | 2 +- include/drm/drm_edid.h | 3 ++- 21 files changed, 38 insertions(+), 21 deletions(-)drivers/gpu/drm/amd/amdgpu/dce_v10_0.c +1
-1@@ -1864,7 +1864,7 @@ static void dce_v10_0_afmt_setmode(struct drm_encoder *encoder,dce_v10_0_audio_write_sad_regs (encoder);dce_v10_0_audio_write_latency_fields (encoder, mode); - err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode); + err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode, false);if (err <0 ) {DRM_ERROR ("failed to setup AVI infoframe: %zd\n" , err);return ;drivers/gpu/drm/amd/amdgpu/dce_v11_0.c +1
-1@@ -1848,7 +1848,7 @@ static void dce_v11_0_afmt_setmode(struct drm_encoder *encoder,dce_v11_0_audio_write_sad_regs (encoder);dce_v11_0_audio_write_latency_fields (encoder, mode); - err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode); + err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode, false);if (err <0 ) {DRM_ERROR ("failed to setup AVI infoframe: %zd\n" , err);return ;drivers/gpu/drm/amd/amdgpu/dce_v8_0.c +1
-1@@ -1747,7 +1747,7 @@ static void dce_v8_0_afmt_setmode(struct drm_encoder *encoder,dce_v8_0_audio_write_sad_regs (encoder);dce_v8_0_audio_write_latency_fields (encoder, mode); - err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode); + err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode, false);if (err <0 ) {DRM_ERROR ("failed to setup AVI infoframe: %zd\n" , err);return ;drivers/gpu/drm/bridge/analogix-anx78xx.c +2
-1@@ -1097,7 +1097,8 @@ static void anx78xx_bridge_mode_set(struct drm_bridge *bridge,mutex_lock (&anx78xx->lock); - err =drm_hdmi_avi_infoframe_from_display_mode (&frame, adjusted_mode); + err =drm_hdmi_avi_infoframe_from_display_mode (&frame, adjusted_mode, + false);if (err) {DRM_ERROR ("Failed to setup AVI infoframe: %d\n" , err); goto unlock;drivers/gpu/drm/bridge/sii902x.c +1
-1@@ -269,7 +269,7 @@ static void sii902x_bridge_mode_set(struct drm_bridge *bridge,if (ret)return ; - ret =drm_hdmi_avi_infoframe_from_display_mode (&frame, adj); + ret =drm_hdmi_avi_infoframe_from_display_mode (&frame, adj, false);if (ret <0 ) {DRM_ERROR ("couldn't fill AVI infoframe\n" );return ;drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +1
-1@@ -1317,7 +1317,7 @@ static void hdmi_config_AVI(struct dw_hdmi *hdmi, struct drm_display_mode *mode)u8 val;/* Initialise info frame from DRM mode */ -drm_hdmi_avi_infoframe_from_display_mode (&frame, mode); +drm_hdmi_avi_infoframe_from_display_mode (&frame, mode, false);if (hdmi_bus_fmt_is_yuv444 (hdmi->hdmi_data.enc_out_bus_format)) frame.colorspace =HDMI_COLORSPACE_YUV444 ;drivers/gpu/drm/drm_edid.c +3
-1@@ -4334,12 +4334,14 @@ EXPORT_SYMBOL(drm_set_preferred_mode);* data from a DRM display mode * @frame: HDMI AVI infoframe * @mode: DRM display mode +* @is_hdmi2: Sink is HDMI 2.0 compliant * * Return: 0 on success or a negative error code on failure. */ int drm_hdmi_avi_infoframe_from_display_mode (struct hdmi_avi_infoframe *frame, -const struct drm_display_mode *mode) +const struct drm_display_mode *mode, +bool is_hdmi2) {int err;drivers/gpu/drm/drm_edid.c drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame, · line 4366
Quoted 10 lines
drivers/gpu/drm/drm_edid.c +7
-0@@ -4355,6 +4357,14 @@ drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame, frame->video_code =drm_match_cea_mode (mode); +/* +* HDMI 1.4 VIC range: 1 <= VIC <= 64 (CEA-861-D) but +* HDMI 2.0 VIC range: 1 <= VIC <= 107 (CEA-861-F). So we +* have to make sure we dont break HDMI 1.4 sinks. +*/ +if (!is_hdmi2 && frame->video_code >64 ) + frame->video_code =0 ;Seems I've totally forgotten what we concluded about the AVI VIC vs. HDMI VIC, but I have a feeling this isn't sufficient.
Quoted 8 lines
Quoted 3 lines
As far as I remember, we decided to send VICs > 64 to HDMI 2.0 monitors only.
If you can provide some more thoughts about how can we make it better ?The question is whether we send the VIC in the AVI infoframe of the HDMI infoframe. IIRC sending both isn't legal, and I think we might have concluded that we might have to pass the AVI infoframe to the HDMI infoframe construction function or vice versa to figure out which gets sent.
Yes, you are correct, and this is what we decided. But on a recent development, I was able to test this patch series with a HDMI 2.0 analyzer, and when I tested the AVI IF (with VIC 97, 38x21@60 16:9) the analyzer was calling it legal, and was also able to detect the mode based on VIC. So looks like its (fortunately) correct interpretation of the spec. But do you still think we should change it ?
- Shashank
Quoted 189 lines
Quoted 189 lines
- Shashank
Quoted 188 lines
Quoted 188 lines
drivers/gpu/drm/drm_edid.c +1
-0+ frame->picture_aspect =HDMI_PICTURE_ASPECT_NONE ;/* drivers/gpu/drm/exynos/exynos_hdmi.c +1
-1@@ -784,7 +784,7 @@ static void hdmi_reg_infoframes(struct hdmi_context *hdata) } ret =drm_hdmi_avi_infoframe_from_display_mode (&frm.avi, - &hdata->current_mode); + &hdata->current_mode, false);if (!ret) ret =hdmi_avi_infoframe_pack (&frm.avi, buf,sizeof (buf));if (ret >0 ) {drivers/gpu/drm/i2c/tda998x_drv.c +1
-1@@ -712,7 +712,7 @@ tda998x_write_avi(struct tda998x_priv *priv, struct drm_display_mode *mode) {union hdmi_infoframe frame; -drm_hdmi_avi_infoframe_from_display_mode (&frame.avi, mode); +drm_hdmi_avi_infoframe_from_display_mode (&frame.avi, mode, false); frame.avi.quantization_range =HDMI_QUANTIZATION_RANGE_FULL ;tda998x_write_if (priv,DIP_IF_FLAGS_IF2 ,REG_IF2_HB0 , &frame);drivers/gpu/drm/i915/intel_hdmi.c +4
-1@@ -459,11 +459,14 @@ static void intel_hdmi_set_avi_infoframe(struct drm_encoder *encoder,struct intel_hdmi *intel_hdmi =enc_to_intel_hdmi (encoder);const struct drm_display_mode *adjusted_mode = &crtc_state->base.adjusted_mode; +struct drm_connector *connector = &intel_hdmi->attached_connector->base; +bool is_hdmi2 = connector->display_info.hdmi.scdc.supported;union hdmi_infoframe frame;int ret; ret =drm_hdmi_avi_infoframe_from_display_mode (&frame.avi, - adjusted_mode); + adjusted_mode, + is_hdmi2);if (ret <0 ) {DRM_ERROR ("couldn't fill AVI infoframe\n" );return ;drivers/gpu/drm/i915/intel_sdvo.c +2
-1@@ -1006,7 +1006,8 @@ static bool intel_sdvo_set_avi_infoframe(struct intel_sdvo *intel_sdvo,ssize_t len; ret =drm_hdmi_avi_infoframe_from_display_mode (&frame.avi, - &pipe_config->base.adjusted_mode); + &pipe_config->base.adjusted_mode, + false);if (ret <0 ) {DRM_ERROR ("couldn't fill AVI infoframe\n" );return false;drivers/gpu/drm/mediatek/mtk_hdmi.c +1
-1@@ -975,7 +975,7 @@ static int mtk_hdmi_setup_avi_infoframe(struct mtk_hdmi *hdmi,u8 buffer[17 ];ssize_t err; - err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode); + err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode, false);if (err <0 ) {dev_err (hdmi->dev,"Failed to get AVI infoframe from mode: %zd\n" , err);drivers/gpu/drm/omapdrm/omap_encoder.c +2
-1@@ -85,7 +85,8 @@ static void omap_encoder_mode_set(struct drm_encoder *encoder,if (hdmi_mode && dssdev->driver->set_hdmi_infoframe) {struct hdmi_avi_infoframe avi; - r =drm_hdmi_avi_infoframe_from_display_mode (&avi, adjusted_mode); + r =drm_hdmi_avi_infoframe_from_display_mode (&avi, adjusted_mode, + false);if (r ==0 ) dssdev->driver->set_hdmi_infoframe (dssdev, &avi); }drivers/gpu/drm/radeon/radeon_audio.c +1
-1@@ -516,7 +516,7 @@ static int radeon_audio_set_avi_packet(struct drm_encoder *encoder,if (!connector)return -EINVAL ; - err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode); + err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode, false);if (err <0 ) {DRM_ERROR ("failed to setup AVI infoframe: %d\n" , err);return err;drivers/gpu/drm/rockchip/inno_hdmi.c +1
-1@@ -294,7 +294,7 @@ static int inno_hdmi_config_video_avi(struct inno_hdmi *hdmi,union hdmi_infoframe frame;int rc; - rc =drm_hdmi_avi_infoframe_from_display_mode (&frame.avi, mode); + rc =drm_hdmi_avi_infoframe_from_display_mode (&frame.avi, mode, false);if (hdmi->hdmi_data.enc_out_format ==HDMI_COLORSPACE_YUV444 ) frame.avi.colorspace =HDMI_COLORSPACE_YUV444 ;drivers/gpu/drm/sti/sti_hdmi.c +1
-1@@ -434,7 +434,7 @@ static int hdmi_avi_infoframe_config(struct sti_hdmi *hdmi)DRM_DEBUG_DRIVER ("\n" ); - ret =drm_hdmi_avi_infoframe_from_display_mode (&infoframe, mode); + ret =drm_hdmi_avi_infoframe_from_display_mode (&infoframe, mode, false);if (ret <0 ) {DRM_ERROR ("failed to setup AVI infoframe: %d\n" , ret);return ret;drivers/gpu/drm/tegra/hdmi.c +1
-1@@ -734,7 +734,7 @@ static void tegra_hdmi_setup_avi_infoframe(struct tegra_hdmi *hdmi,u8 buffer[17 ];ssize_t err; - err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode); + err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode, false);if (err <0 ) {dev_err (hdmi->dev,"failed to setup AVI infoframe: %zd\n" , err);return ;drivers/gpu/drm/tegra/sor.c +1
-1@@ -1904,7 +1904,7 @@ tegra_sor_hdmi_setup_avi_infoframe(struct tegra_sor *sor, value &= ~INFOFRAME_CTRL_ENABLE ;tegra_sor_writel (sor, value,SOR_HDMI_AVI_INFOFRAME_CTRL ); - err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode); + err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode, false);if (err <0 ) {dev_err (sor->dev,"failed to setup AVI infoframe: %d\n" , err);return err;drivers/gpu/drm/vc4/vc4_hdmi.c +1
-1@@ -395,7 +395,7 @@ static void vc4_hdmi_set_avi_infoframe(struct drm_encoder *encoder)union hdmi_infoframe frame;int ret; - ret =drm_hdmi_avi_infoframe_from_display_mode (&frame.avi, mode); + ret =drm_hdmi_avi_infoframe_from_display_mode (&frame.avi, mode, false);if (ret <0 ) {DRM_ERROR ("couldn't fill AVI infoframe\n" );return ;drivers/gpu/drm/zte/zx_hdmi.c +1
-1@@ -124,7 +124,7 @@ static int zx_hdmi_config_video_avi(struct zx_hdmi *hdmi,union hdmi_infoframe frame;int ret; - ret =drm_hdmi_avi_infoframe_from_display_mode (&frame.avi, mode); + ret =drm_hdmi_avi_infoframe_from_display_mode (&frame.avi, mode, false);if (ret) {DRM_DEV_ERROR (hdmi->dev,"failed to get avi infoframe: %d\n" , ret);include/drm/drm_edid.h +0
-0@@ -343,7 +343,8 @@ drm_load_edid_firmware(struct drm_connector *connector)
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
include/drm/drm_edid.h +2
-1int drm_hdmi_avi_infoframe_from_display_mode (struct hdmi_avi_infoframe *frame, -const struct drm_display_mode *mode); +const struct drm_display_mode *mode, +bool is_hdmi2);int drm_hdmi_vendor_infoframe_from_display_mode (struct hdmi_vendor_infoframe *frame,const struct drm_display_mode *mode);Signature · 1 line
2.7.4
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v2 01/11] drm: Add HDMI 2.0 VIC support for AVI info-frames
Quoted 189 lines · Shashank
Regards
Shashank
Quoted 175 lines · Ville Syrjälä
Quoted 174 lines · Shashank
Regards
Shashank
Quoted 168 lines · Ville Syrjälä
Quoted 155 lines · Shashank Sharma
HDMI 1.4b support the CEA video modes as per range of CEA-861-D (VIC 1-64). For any other mode, the VIC filed in AVI infoframes should be 0. HDMI 2.0 sinks, support video modes range as per CEA-861-F spec, which is extended to (VIC 1-107).
This patch adds a bool input variable, which indicates if the connected sink is a HDMI 2.0 sink or not. This will make sure that we don't pass a HDMI 2.0 VIC to a HDMI 1.4 sink.
This patch touches all drm drivers, who are callers of this function
drm_hdmi_avi_infoframe_from_display_modebut to make sure there is no change in current behavior,is_hdmi2is kept as false.In case of I915 driver, this patch checks the
connector->display_infoto check if the connected display is HDMI 2.0.Cc Ville Syrjala <[email protected]>Cc Jose Abreu <[email protected]>Cc Andrzej Hajda <[email protected]>Cc Alex Deucher <[email protected]>Cc Daniel Vetter <[email protected]>PS: This patch touches a few lines in few files, which were already above 80 char, so checkpatch gives 80 char warning again.
-gpu/drm/omapdrm/omap_encoder.c
-gpu/drm/i915/intel_sdvo.cV2: Rebase, Added r-b from Andrzej
Reviewed-by Andrzej Hajda <[email protected]>Signed-off-by Shashank Sharma <[email protected]>--- drivers/gpu/drm/amd/amdgpu/dce_v10_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/dce_v11_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/dce_v8_0.c | 2 +- drivers/gpu/drm/bridge/analogix-anx78xx.c | 3 ++- drivers/gpu/drm/bridge/sii902x.c | 2 +- drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 2 +- drivers/gpu/drm/drm_edid.c | 12 +++++++++++- drivers/gpu/drm/exynos/exynos_hdmi.c | 2 +- drivers/gpu/drm/i2c/tda998x_drv.c | 2 +- drivers/gpu/drm/i915/intel_hdmi.c | 5 ++++- drivers/gpu/drm/i915/intel_sdvo.c | 3 ++- drivers/gpu/drm/mediatek/mtk_hdmi.c | 2 +- drivers/gpu/drm/omapdrm/omap_encoder.c | 3 ++- drivers/gpu/drm/radeon/radeon_audio.c | 2 +- drivers/gpu/drm/rockchip/inno_hdmi.c | 2 +- drivers/gpu/drm/sti/sti_hdmi.c | 2 +- drivers/gpu/drm/tegra/hdmi.c | 2 +- drivers/gpu/drm/tegra/sor.c | 2 +- drivers/gpu/drm/vc4/vc4_hdmi.c | 2 +- drivers/gpu/drm/zte/zx_hdmi.c | 2 +- include/drm/drm_edid.h | 3 ++- 21 files changed, 38 insertions(+), 21 deletions(-)drivers/gpu/drm/amd/amdgpu/dce_v10_0.c +1
-1@@ -1864,7 +1864,7 @@ static void dce_v10_0_afmt_setmode(struct drm_encoder *encoder,dce_v10_0_audio_write_sad_regs (encoder);dce_v10_0_audio_write_latency_fields (encoder, mode); - err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode); + err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode, false);if (err <0 ) {DRM_ERROR ("failed to setup AVI infoframe: %zd\n" , err);return ;drivers/gpu/drm/amd/amdgpu/dce_v11_0.c +1
-1@@ -1848,7 +1848,7 @@ static void dce_v11_0_afmt_setmode(struct drm_encoder *encoder,dce_v11_0_audio_write_sad_regs (encoder);dce_v11_0_audio_write_latency_fields (encoder, mode); - err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode); + err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode, false);if (err <0 ) {DRM_ERROR ("failed to setup AVI infoframe: %zd\n" , err);return ;drivers/gpu/drm/amd/amdgpu/dce_v8_0.c +1
-1@@ -1747,7 +1747,7 @@ static void dce_v8_0_afmt_setmode(struct drm_encoder *encoder,dce_v8_0_audio_write_sad_regs (encoder);dce_v8_0_audio_write_latency_fields (encoder, mode); - err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode); + err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode, false);if (err <0 ) {DRM_ERROR ("failed to setup AVI infoframe: %zd\n" , err);return ;drivers/gpu/drm/bridge/analogix-anx78xx.c +2
-1@@ -1097,7 +1097,8 @@ static void anx78xx_bridge_mode_set(struct drm_bridge *bridge,mutex_lock (&anx78xx->lock); - err =drm_hdmi_avi_infoframe_from_display_mode (&frame, adjusted_mode); + err =drm_hdmi_avi_infoframe_from_display_mode (&frame, adjusted_mode, + false);if (err) {DRM_ERROR ("Failed to setup AVI infoframe: %d\n" , err); goto unlock;drivers/gpu/drm/bridge/sii902x.c +1
-1@@ -269,7 +269,7 @@ static void sii902x_bridge_mode_set(struct drm_bridge *bridge,if (ret)return ; - ret =drm_hdmi_avi_infoframe_from_display_mode (&frame, adj); + ret =drm_hdmi_avi_infoframe_from_display_mode (&frame, adj, false);if (ret <0 ) {DRM_ERROR ("couldn't fill AVI infoframe\n" );return ;drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +1
-1@@ -1317,7 +1317,7 @@ static void hdmi_config_AVI(struct dw_hdmi *hdmi, struct drm_display_mode *mode)u8 val;/* Initialise info frame from DRM mode */ -drm_hdmi_avi_infoframe_from_display_mode (&frame, mode); +drm_hdmi_avi_infoframe_from_display_mode (&frame, mode, false);if (hdmi_bus_fmt_is_yuv444 (hdmi->hdmi_data.enc_out_bus_format)) frame.colorspace =HDMI_COLORSPACE_YUV444 ;drivers/gpu/drm/drm_edid.c +3
-1@@ -4334,12 +4334,14 @@ EXPORT_SYMBOL(drm_set_preferred_mode);* data from a DRM display mode * @frame: HDMI AVI infoframe * @mode: DRM display mode +* @is_hdmi2: Sink is HDMI 2.0 compliant * * Return: 0 on success or a negative error code on failure. */ int drm_hdmi_avi_infoframe_from_display_mode (struct hdmi_avi_infoframe *frame, -const struct drm_display_mode *mode) +const struct drm_display_mode *mode, +bool is_hdmi2) {int err;drivers/gpu/drm/drm_edid.c drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame, · line 4366
Quoted 10 lines
drivers/gpu/drm/drm_edid.c +7
-0@@ -4355,6 +4357,14 @@ drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame, frame->video_code =drm_match_cea_mode (mode); +/* +* HDMI 1.4 VIC range: 1 <= VIC <= 64 (CEA-861-D) but +* HDMI 2.0 VIC range: 1 <= VIC <= 107 (CEA-861-F). So we +* have to make sure we dont break HDMI 1.4 sinks. +*/ +if (!is_hdmi2 && frame->video_code >64 ) + frame->video_code =0 ;Seems I've totally forgotten what we concluded about the AVI VIC vs. HDMI VIC, but I have a feeling this isn't sufficient.
Quoted 8 lines
Quoted 3 lines
As far as I remember, we decided to send VICs > 64 to HDMI 2.0 monitors only.
If you can provide some more thoughts about how can we make it better ?The question is whether we send the VIC in the AVI infoframe of the HDMI infoframe. IIRC sending both isn't legal, and I think we might have concluded that we might have to pass the AVI infoframe to the HDMI infoframe construction function or vice versa to figure out which gets sent.
Quoted 6 lines
Yes, you are correct, and this is what we decided. But on a recent development, I was able to test this patch series with a HDMI 2.0 analyzer, and when I tested the AVI IF (with VIC 97, 38x21@60 16:9) the analyzer was calling it legal, and was also able to detect the mode based on VIC. So looks like its (fortunately) correct interpretation of the spec. But do you still think we should change it ?
I'm pretty sure the spec said you're not supposed to send two VICs.
Quoted 201 lines
- Shashank
Quoted 199 lines
Quoted 199 lines
- Shashank
Quoted 198 lines
Quoted 198 lines
drivers/gpu/drm/drm_edid.c +1
-0+ frame->picture_aspect =HDMI_PICTURE_ASPECT_NONE ;/* drivers/gpu/drm/exynos/exynos_hdmi.c +1
-1@@ -784,7 +784,7 @@ static void hdmi_reg_infoframes(struct hdmi_context *hdata) } ret =drm_hdmi_avi_infoframe_from_display_mode (&frm.avi, - &hdata->current_mode); + &hdata->current_mode, false);if (!ret) ret =hdmi_avi_infoframe_pack (&frm.avi, buf,sizeof (buf));if (ret >0 ) {drivers/gpu/drm/i2c/tda998x_drv.c +1
-1@@ -712,7 +712,7 @@ tda998x_write_avi(struct tda998x_priv *priv, struct drm_display_mode *mode) {union hdmi_infoframe frame; -drm_hdmi_avi_infoframe_from_display_mode (&frame.avi, mode); +drm_hdmi_avi_infoframe_from_display_mode (&frame.avi, mode, false); frame.avi.quantization_range =HDMI_QUANTIZATION_RANGE_FULL ;tda998x_write_if (priv,DIP_IF_FLAGS_IF2 ,REG_IF2_HB0 , &frame);drivers/gpu/drm/i915/intel_hdmi.c +4
-1@@ -459,11 +459,14 @@ static void intel_hdmi_set_avi_infoframe(struct drm_encoder *encoder,struct intel_hdmi *intel_hdmi =enc_to_intel_hdmi (encoder);const struct drm_display_mode *adjusted_mode = &crtc_state->base.adjusted_mode; +struct drm_connector *connector = &intel_hdmi->attached_connector->base; +bool is_hdmi2 = connector->display_info.hdmi.scdc.supported;union hdmi_infoframe frame;int ret; ret =drm_hdmi_avi_infoframe_from_display_mode (&frame.avi, - adjusted_mode); + adjusted_mode, + is_hdmi2);if (ret <0 ) {DRM_ERROR ("couldn't fill AVI infoframe\n" );return ;drivers/gpu/drm/i915/intel_sdvo.c +2
-1@@ -1006,7 +1006,8 @@ static bool intel_sdvo_set_avi_infoframe(struct intel_sdvo *intel_sdvo,ssize_t len; ret =drm_hdmi_avi_infoframe_from_display_mode (&frame.avi, - &pipe_config->base.adjusted_mode); + &pipe_config->base.adjusted_mode, + false);if (ret <0 ) {DRM_ERROR ("couldn't fill AVI infoframe\n" );return false;drivers/gpu/drm/mediatek/mtk_hdmi.c +1
-1@@ -975,7 +975,7 @@ static int mtk_hdmi_setup_avi_infoframe(struct mtk_hdmi *hdmi,u8 buffer[17 ];ssize_t err; - err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode); + err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode, false);if (err <0 ) {dev_err (hdmi->dev,"Failed to get AVI infoframe from mode: %zd\n" , err);drivers/gpu/drm/omapdrm/omap_encoder.c +2
-1@@ -85,7 +85,8 @@ static void omap_encoder_mode_set(struct drm_encoder *encoder,if (hdmi_mode && dssdev->driver->set_hdmi_infoframe) {struct hdmi_avi_infoframe avi; - r =drm_hdmi_avi_infoframe_from_display_mode (&avi, adjusted_mode); + r =drm_hdmi_avi_infoframe_from_display_mode (&avi, adjusted_mode, + false);if (r ==0 ) dssdev->driver->set_hdmi_infoframe (dssdev, &avi); }drivers/gpu/drm/radeon/radeon_audio.c +1
-1@@ -516,7 +516,7 @@ static int radeon_audio_set_avi_packet(struct drm_encoder *encoder,if (!connector)return -EINVAL ; - err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode); + err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode, false);if (err <0 ) {DRM_ERROR ("failed to setup AVI infoframe: %d\n" , err);return err;drivers/gpu/drm/rockchip/inno_hdmi.c +1
-1@@ -294,7 +294,7 @@ static int inno_hdmi_config_video_avi(struct inno_hdmi *hdmi,union hdmi_infoframe frame;int rc; - rc =drm_hdmi_avi_infoframe_from_display_mode (&frame.avi, mode); + rc =drm_hdmi_avi_infoframe_from_display_mode (&frame.avi, mode, false);if (hdmi->hdmi_data.enc_out_format ==HDMI_COLORSPACE_YUV444 ) frame.avi.colorspace =HDMI_COLORSPACE_YUV444 ;drivers/gpu/drm/sti/sti_hdmi.c +1
-1@@ -434,7 +434,7 @@ static int hdmi_avi_infoframe_config(struct sti_hdmi *hdmi)DRM_DEBUG_DRIVER ("\n" ); - ret =drm_hdmi_avi_infoframe_from_display_mode (&infoframe, mode); + ret =drm_hdmi_avi_infoframe_from_display_mode (&infoframe, mode, false);if (ret <0 ) {DRM_ERROR ("failed to setup AVI infoframe: %d\n" , ret);return ret;drivers/gpu/drm/tegra/hdmi.c +1
-1@@ -734,7 +734,7 @@ static void tegra_hdmi_setup_avi_infoframe(struct tegra_hdmi *hdmi,u8 buffer[17 ];ssize_t err; - err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode); + err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode, false);if (err <0 ) {dev_err (hdmi->dev,"failed to setup AVI infoframe: %zd\n" , err);return ;drivers/gpu/drm/tegra/sor.c +1
-1@@ -1904,7 +1904,7 @@ tegra_sor_hdmi_setup_avi_infoframe(struct tegra_sor *sor, value &= ~INFOFRAME_CTRL_ENABLE ;tegra_sor_writel (sor, value,SOR_HDMI_AVI_INFOFRAME_CTRL ); - err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode); + err =drm_hdmi_avi_infoframe_from_display_mode (&frame, mode, false);if (err <0 ) {dev_err (sor->dev,"failed to setup AVI infoframe: %d\n" , err);return err;drivers/gpu/drm/vc4/vc4_hdmi.c +1
-1@@ -395,7 +395,7 @@ static void vc4_hdmi_set_avi_infoframe(struct drm_encoder *encoder)union hdmi_infoframe frame;int ret; - ret =drm_hdmi_avi_infoframe_from_display_mode (&frame.avi, mode); + ret =drm_hdmi_avi_infoframe_from_display_mode (&frame.avi, mode, false);if (ret <0 ) {DRM_ERROR ("couldn't fill AVI infoframe\n" );return ;drivers/gpu/drm/zte/zx_hdmi.c +1
-1@@ -124,7 +124,7 @@ static int zx_hdmi_config_video_avi(struct zx_hdmi *hdmi,union hdmi_infoframe frame;int ret; - ret =drm_hdmi_avi_infoframe_from_display_mode (&frame.avi, mode); + ret =drm_hdmi_avi_infoframe_from_display_mode (&frame.avi, mode, false);if (ret) {DRM_DEV_ERROR (hdmi->dev,"failed to get avi infoframe: %d\n" , ret);include/drm/drm_edid.h +2
-1@@ -343,7 +343,8 @@ drm_load_edid_firmware(struct drm_connector *connector)int drm_hdmi_avi_infoframe_from_display_mode (struct hdmi_avi_infoframe *frame, -const struct drm_display_mode *mode); +const struct drm_display_mode *mode, +bool is_hdmi2);int drm_hdmi_vendor_infoframe_from_display_mode (struct hdmi_vendor_infoframe *frame,const struct drm_display_mode *mode);Signature · 1 line
2.7.4
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v2 2/11 drm/edid: Complete CEA modedb(VIC 1-107)
In reply to Shashank SharmaCEA-861-F specs defines new video modes to be used with HDMI 2.0 EDIDs. The VIC range has been extended from 1-64 to 1-107.
Our existing CEA modedb contains only 64 modes (VIC=1 to VIC=64). Now to be able to parse new CEA modes using the existing methods, we have to complete the modedb (VIC=65 onwards).
This patch adds:
- Timings for existing CEA video modes (from VIC=65 till VIC=92)
- Newly added 4k modes (from VIC=93 to VIC=107).
The patch was originaly discussed and reviewed here:
https://patchwork.freedesktop.org/patch/135810/
V2: Rebase
--- drivers/gpu/drm/drm_edid.c | 215 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 215 insertions(+)
drivers/gpu/drm/drm_edid.c +215 -0
@@ -1006,6 +1006,221 @@ static const struct drm_display_mode edid_cea_modes[] = { 2492, 2640, 0, 1080, 1084, 1089, 1125, 0, DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC), .vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, }, +/* 65 - 1280x720@24Hz */ + {DRM_MODE ("1280x720" ,DRM_MODE_TYPE_DRIVER ,59400 ,1280 ,3040 , +3080 ,3300 ,0 ,720 ,725 ,730 ,750 ,0 , + DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC), + .vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 66 - 1280x720@25Hz */ + { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74250, 1280, 3700, +3740 ,3960 ,0 ,720 ,725 ,730 ,750 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 67 - 1280x720@30Hz */ + { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74250, 1280, 3040, +3080 ,3300 ,0 ,720 ,725 ,730 ,750 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 68 - 1280x720@50Hz */ + { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74250, 1280, 1720, +1760 ,1980 ,0 ,720 ,725 ,730 ,750 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 69 - 1280x720@60Hz */ + { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74250, 1280, 1390, +1430 ,1650 ,0 ,720 ,725 ,730 ,750 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 70 - 1280x720@100Hz */ + { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 148500, 1280, 1720, +1760 ,1980 ,0 ,720 ,725 ,730 ,750 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 71 - 1280x720@120Hz */ + { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 148500, 1280, 1390, +1430 ,1650 ,0 ,720 ,725 ,730 ,750 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 120, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 72 - 1920x1080@24Hz */ + { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 74250, 1920, 2558, +2602 ,2750 ,0 ,1080 ,1084 ,1089 ,1125 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 73 - 1920x1080@25Hz */ + { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 74250, 1920, 2448, +2492 ,2640 ,0 ,1080 ,1084 ,1089 ,1125 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 74 - 1920x1080@30Hz */ + { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 74250, 1920, 2008, +2052 ,2200 ,0 ,1080 ,1084 ,1089 ,1125 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 75 - 1920x1080@50Hz */ + { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 148500, 1920, 2448, +2492 ,2640 ,0 ,1080 ,1084 ,1089 ,1125 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 76 - 1920x1080@60Hz */ + { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 148500, 1920, 2008, +2052 ,2200 ,0 ,1080 ,1084 ,1089 ,1125 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 77 - 1920x1080@100Hz */ + { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 297000, 1920, 2448, +2492 ,2640 ,0 ,1080 ,1084 ,1094 ,1125 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 78 - 1920x1080@120Hz */ + { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 297000, 1920, 2008, +2052 ,2200 ,0 ,1080 ,1084 ,1089 ,1125 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 120, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 79 - 1680x720@24Hz */ + { DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 59400, 1680, 3040, +3080 ,3300 ,0 ,720 ,725 ,730 ,750 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 80 - 1680x720@25Hz */ + { DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 59400, 1680, 2908, +2948 ,3168 ,0 ,720 ,725 ,730 ,750 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 81 - 1680x720@30Hz */ + { DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 59400, 1680, 2380, +2420 ,2640 ,0 ,720 ,725 ,730 ,750 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 82 - 1680x720@50Hz */ + { DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 82500, 1680, 1940, +1980 ,2200 ,0 ,720 ,725 ,730 ,750 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 83 - 1680x720@60Hz */ + { DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 99000, 1680, 1940, +1980 ,2200 ,0 ,720 ,725 ,730 ,750 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 84 - 1680x720@100Hz */ + { DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 165000, 1680, 1740, +1780 ,2000 ,0 ,720 ,725 ,730 ,825 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 85 - 1680x720@120Hz */ + { DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 198000, 1680, 1740, +1780 ,2000 ,0 ,720 ,725 ,730 ,825 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 120, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 86 - 2560x1080@24Hz */ + { DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 99000, 2560, 3558, +3602 ,3750 ,0 ,1080 ,1084 ,1089 ,1100 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 87 - 2560x1080@25Hz */ + { DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 90000, 2560, 3008, +3052 ,3200 ,0 ,1080 ,1084 ,1089 ,1125 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 88 - 2560x1080@30Hz */ + { DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 118800, 2560, 3328, +3372 ,3520 ,0 ,1080 ,1084 ,1089 ,1125 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 89 - 2560x1080@50Hz */ + { DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 185625, 2560, 3108, +3152 ,3300 ,0 ,1080 ,1084 ,1089 ,1125 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 90 - 2560x1080@60Hz */ + { DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 198000, 2560, 2808, +2852 ,3000 ,0 ,1080 ,1084 ,1089 ,1100 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 91 - 2560x1080@100Hz */ + { DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 371250, 2560, 2778, +2822 ,2970 ,0 ,1080 ,1084 ,1089 ,1250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 92 - 2560x1080@120Hz */ + { DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 495000, 2560, 3108, +3152 ,3300 ,0 ,1080 ,1084 ,1089 ,1250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 120, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 93 - 3840x2160p@24Hz 16:9 */ + { DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 5116, +5204 ,5500 ,0 ,2160 ,2168 ,2178 ,2250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9,}, + /* 94 - 3840x2160p@25Hz 16:9 */ + { DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 4896, +4984 ,5280 ,0 ,2160 ,2168 ,2178 ,2250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9}, +/* 95 - 3840x2160p@30Hz 16:9 */ + { DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 4016, +4104 ,4400 ,0 ,2160 ,2168 ,2178 ,2250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9}, +/* 96 - 3840x2160p@50Hz 16:9 */ + { DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 594000, 3840, 4896, +4984 ,5280 ,0 ,2160 ,2168 ,2178 ,2250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9}, +/* 97 - 3840x2160p@60Hz 16:9 */ + { DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 594000, 3840, 4016, +4104 ,4400 ,0 ,2160 ,2168 ,2178 ,2250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9}, +/* 98 - 4096x2160p@24Hz 256:135 */ + { DRM_MODE("4096x2160", DRM_MODE_TYPE_DRIVER, 297000, 4096, 5116, +5204 ,5500 ,0 ,2160 ,2168 ,2178 ,2250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135}, +/* 99 - 4096x2160p@25Hz 256:135 */ + { DRM_MODE("4096x2160", DRM_MODE_TYPE_DRIVER, 297000, 4096, 5064, +5152 ,5280 ,0 ,2160 ,2168 ,2178 ,2250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135}, +/* 100 - 4096x2160p@30Hz 256:135 */ + { DRM_MODE("4096x2160", DRM_MODE_TYPE_DRIVER, 297000, 4096, 4184, +4272 ,4400 ,0 ,2160 ,2168 ,2178 ,2250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135}, +/* 101 - 4096x2160p@50Hz 256:135 */ + { DRM_MODE("4096x2160", DRM_MODE_TYPE_DRIVER, 594000, 4096, 5064, +5152 ,5280 ,0 ,2160 ,2168 ,2178 ,2250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135}, +/* 102 - 4096x2160p@60Hz 256:135 */ + { DRM_MODE("4096x2160", DRM_MODE_TYPE_DRIVER, 594000, 4096, 4184, +4272 ,4400 ,0 ,2160 ,2168 ,2178 ,2250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135}, +/* 103 - 3840x2160p@24Hz 64:27 */ + { DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 5116, +5204 ,5500 ,0 ,2160 ,2168 ,2178 ,2250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27}, +/* 104 - 3840x2160p@25Hz 64:27 */ + { DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 4016, +4104 ,4400 ,0 ,2160 ,2168 ,2178 ,2250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27}, +/* 105 - 3840x2160p@30Hz 64:27 */ + { DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 4016, +4104 ,4400 ,0 ,2160 ,2168 ,2178 ,2250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27}, +/* 106 - 3840x2160p@50Hz 64:27 */ + { DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 594000, 3840, 4896, +4984 ,5280 ,0 ,2160 ,2168 ,2178 ,2250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27}, +/* 107 - 3840x2160p@60Hz 64:27 */ + { DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 594000, 3840, 4016, +4104 ,4400 ,0 ,2160 ,2168 ,2178 ,2250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27}, };/*
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v2 02/11] drm/edid: Complete CEA modedb(VIC 1-107)
Quoted 11 lines · Shashank Sharma
CEA-861-F specs defines new video modes to be used with HDMI 2.0 EDIDs. The VIC range has been extended from 1-64 to 1-107.
Our existing CEA modedb contains only 64 modes (VIC=1 to VIC=64). Now to be able to parse new CEA modes using the existing methods, we have to complete the modedb (VIC=65 onwards).
This patch adds:
- Timings for existing CEA video modes (from VIC=65 till VIC=92)
- Newly added 4k modes (from VIC=93 to VIC=107).
Still missing the "native bit" handling.
Quoted 248 lines
The patch was originaly discussed and reviewed here:
https://patchwork.freedesktop.org/patch/135810/Cc Ville Syrjala <[email protected]>Cc Jose Abreu <[email protected]>Cc Andrzej Hajda <[email protected]>Cc Alex Deucher <[email protected]>Cc Harry Wentland <[email protected]>V2: Rebase
Reviewed-by Jose Abreu <[email protected]>Reviewed-by Alex Deucher <[email protected]>Acked-by Harry Wentland <[email protected]>Signed-off-by Shashank Sharma <[email protected]>--- drivers/gpu/drm/drm_edid.c | 215 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 215 insertions(+)drivers/gpu/drm/drm_edid.c +215
-0@@ -1006,6 +1006,221 @@ static const struct drm_display_mode edid_cea_modes[] = { 2492, 2640, 0, 1080, 1084, 1089, 1125, 0, DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC), .vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, }, +/* 65 - 1280x720@24Hz */ + {DRM_MODE ("1280x720" ,DRM_MODE_TYPE_DRIVER ,59400 ,1280 ,3040 , +3080 ,3300 ,0 ,720 ,725 ,730 ,750 ,0 , + DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC), + .vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 66 - 1280x720@25Hz */ + { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74250, 1280, 3700, +3740 ,3960 ,0 ,720 ,725 ,730 ,750 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 67 - 1280x720@30Hz */ + { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74250, 1280, 3040, +3080 ,3300 ,0 ,720 ,725 ,730 ,750 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 68 - 1280x720@50Hz */ + { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74250, 1280, 1720, +1760 ,1980 ,0 ,720 ,725 ,730 ,750 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 69 - 1280x720@60Hz */ + { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74250, 1280, 1390, +1430 ,1650 ,0 ,720 ,725 ,730 ,750 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 70 - 1280x720@100Hz */ + { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 148500, 1280, 1720, +1760 ,1980 ,0 ,720 ,725 ,730 ,750 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 71 - 1280x720@120Hz */ + { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 148500, 1280, 1390, +1430 ,1650 ,0 ,720 ,725 ,730 ,750 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 120, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 72 - 1920x1080@24Hz */ + { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 74250, 1920, 2558, +2602 ,2750 ,0 ,1080 ,1084 ,1089 ,1125 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 73 - 1920x1080@25Hz */ + { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 74250, 1920, 2448, +2492 ,2640 ,0 ,1080 ,1084 ,1089 ,1125 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 74 - 1920x1080@30Hz */ + { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 74250, 1920, 2008, +2052 ,2200 ,0 ,1080 ,1084 ,1089 ,1125 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 75 - 1920x1080@50Hz */ + { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 148500, 1920, 2448, +2492 ,2640 ,0 ,1080 ,1084 ,1089 ,1125 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 76 - 1920x1080@60Hz */ + { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 148500, 1920, 2008, +2052 ,2200 ,0 ,1080 ,1084 ,1089 ,1125 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 77 - 1920x1080@100Hz */ + { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 297000, 1920, 2448, +2492 ,2640 ,0 ,1080 ,1084 ,1094 ,1125 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 78 - 1920x1080@120Hz */ + { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 297000, 1920, 2008, +2052 ,2200 ,0 ,1080 ,1084 ,1089 ,1125 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 120, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 79 - 1680x720@24Hz */ + { DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 59400, 1680, 3040, +3080 ,3300 ,0 ,720 ,725 ,730 ,750 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 80 - 1680x720@25Hz */ + { DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 59400, 1680, 2908, +2948 ,3168 ,0 ,720 ,725 ,730 ,750 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 81 - 1680x720@30Hz */ + { DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 59400, 1680, 2380, +2420 ,2640 ,0 ,720 ,725 ,730 ,750 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 82 - 1680x720@50Hz */ + { DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 82500, 1680, 1940, +1980 ,2200 ,0 ,720 ,725 ,730 ,750 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 83 - 1680x720@60Hz */ + { DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 99000, 1680, 1940, +1980 ,2200 ,0 ,720 ,725 ,730 ,750 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 84 - 1680x720@100Hz */ + { DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 165000, 1680, 1740, +1780 ,2000 ,0 ,720 ,725 ,730 ,825 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 85 - 1680x720@120Hz */ + { DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 198000, 1680, 1740, +1780 ,2000 ,0 ,720 ,725 ,730 ,825 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 120, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 86 - 2560x1080@24Hz */ + { DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 99000, 2560, 3558, +3602 ,3750 ,0 ,1080 ,1084 ,1089 ,1100 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 87 - 2560x1080@25Hz */ + { DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 90000, 2560, 3008, +3052 ,3200 ,0 ,1080 ,1084 ,1089 ,1125 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 88 - 2560x1080@30Hz */ + { DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 118800, 2560, 3328, +3372 ,3520 ,0 ,1080 ,1084 ,1089 ,1125 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 89 - 2560x1080@50Hz */ + { DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 185625, 2560, 3108, +3152 ,3300 ,0 ,1080 ,1084 ,1089 ,1125 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 90 - 2560x1080@60Hz */ + { DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 198000, 2560, 2808, +2852 ,3000 ,0 ,1080 ,1084 ,1089 ,1100 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 91 - 2560x1080@100Hz */ + { DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 371250, 2560, 2778, +2822 ,2970 ,0 ,1080 ,1084 ,1089 ,1250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 92 - 2560x1080@120Hz */ + { DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 495000, 2560, 3108, +3152 ,3300 ,0 ,1080 ,1084 ,1089 ,1250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 120, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 93 - 3840x2160p@24Hz 16:9 */ + { DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 5116, +5204 ,5500 ,0 ,2160 ,2168 ,2178 ,2250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9,}, + /* 94 - 3840x2160p@25Hz 16:9 */ + { DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 4896, +4984 ,5280 ,0 ,2160 ,2168 ,2178 ,2250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9}, +/* 95 - 3840x2160p@30Hz 16:9 */ + { DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 4016, +4104 ,4400 ,0 ,2160 ,2168 ,2178 ,2250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9}, +/* 96 - 3840x2160p@50Hz 16:9 */ + { DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 594000, 3840, 4896, +4984 ,5280 ,0 ,2160 ,2168 ,2178 ,2250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9}, +/* 97 - 3840x2160p@60Hz 16:9 */ + { DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 594000, 3840, 4016, +4104 ,4400 ,0 ,2160 ,2168 ,2178 ,2250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9}, +/* 98 - 4096x2160p@24Hz 256:135 */ + { DRM_MODE("4096x2160", DRM_MODE_TYPE_DRIVER, 297000, 4096, 5116, +5204 ,5500 ,0 ,2160 ,2168 ,2178 ,2250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135}, +/* 99 - 4096x2160p@25Hz 256:135 */ + { DRM_MODE("4096x2160", DRM_MODE_TYPE_DRIVER, 297000, 4096, 5064, +5152 ,5280 ,0 ,2160 ,2168 ,2178 ,2250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135}, +/* 100 - 4096x2160p@30Hz 256:135 */ + { DRM_MODE("4096x2160", DRM_MODE_TYPE_DRIVER, 297000, 4096, 4184, +4272 ,4400 ,0 ,2160 ,2168 ,2178 ,2250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135}, +/* 101 - 4096x2160p@50Hz 256:135 */ + { DRM_MODE("4096x2160", DRM_MODE_TYPE_DRIVER, 594000, 4096, 5064, +5152 ,5280 ,0 ,2160 ,2168 ,2178 ,2250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135}, +/* 102 - 4096x2160p@60Hz 256:135 */ + { DRM_MODE("4096x2160", DRM_MODE_TYPE_DRIVER, 594000, 4096, 4184, +4272 ,4400 ,0 ,2160 ,2168 ,2178 ,2250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135}, +/* 103 - 3840x2160p@24Hz 64:27 */ + { DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 5116, +5204 ,5500 ,0 ,2160 ,2168 ,2178 ,2250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27}, +/* 104 - 3840x2160p@25Hz 64:27 */ + { DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 4016, +4104 ,4400 ,0 ,2160 ,2168 ,2178 ,2250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27}, +/* 105 - 3840x2160p@30Hz 64:27 */ + { DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 4016, +4104 ,4400 ,0 ,2160 ,2168 ,2178 ,2250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27}, +/* 106 - 3840x2160p@50Hz 64:27 */ + { DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 594000, 3840, 4896, +4984 ,5280 ,0 ,2160 ,2168 ,2178 ,2250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27}, +/* 107 - 3840x2160p@60Hz 64:27 */ + { DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 594000, 3840, 4016, +4104 ,4400 ,0 ,2160 ,2168 ,2178 ,2250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27}, };/* Signature · 1 line
2.7.4
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v2 02/11] drm/edid: Complete CEA modedb(VIC 1-107)
Regards
Shashank
Quoted 5 lines · Ville Syrjälä
Quoted 4 lines · Shashank Sharma
CEA-861-F specs defines new video modes to be used with HDMI 2.0 EDIDs. The VIC range has been extended from 1-64 to 1-107.
Quoted 8 lines
Quoted 7 lines
Our existing CEA modedb contains only 64 modes (VIC=1 to VIC=64). Now to be able to parse new CEA modes using the existing methods, we have to complete the modedb (VIC=65 onwards).
This patch adds:
- Timings for existing CEA video modes (from VIC=65 till VIC=92)
- Newly added 4k modes (from VIC=93 to VIC=107).Still missing the "native bit" handling.
I tried searching the native bit handling in the code, but I could not get any thing. We are typically doing a (vic & 127) and that's all. Can you please point out a bit here ?
- Shashank
Quoted 244 lines
Quoted 244 lines
The patch was originaly discussed and reviewed here:
https://patchwork.freedesktop.org/patch/135810/Cc Ville Syrjala <[email protected]>Cc Jose Abreu <[email protected]>Cc Andrzej Hajda <[email protected]>Cc Alex Deucher <[email protected]>Cc Harry Wentland <[email protected]>V2: Rebase
Reviewed-by Jose Abreu <[email protected]>Reviewed-by Alex Deucher <[email protected]>Acked-by Harry Wentland <[email protected]>Signed-off-by Shashank Sharma <[email protected]>--- drivers/gpu/drm/drm_edid.c | 215 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 215 insertions(+)drivers/gpu/drm/drm_edid.c +215
-0@@ -1006,6 +1006,221 @@ static const struct drm_display_mode edid_cea_modes[] = { 2492, 2640, 0, 1080, 1084, 1089, 1125, 0, DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC), .vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, }, +/* 65 - 1280x720@24Hz */ + {DRM_MODE ("1280x720" ,DRM_MODE_TYPE_DRIVER ,59400 ,1280 ,3040 , +3080 ,3300 ,0 ,720 ,725 ,730 ,750 ,0 , + DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC), + .vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 66 - 1280x720@25Hz */ + { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74250, 1280, 3700, +3740 ,3960 ,0 ,720 ,725 ,730 ,750 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 67 - 1280x720@30Hz */ + { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74250, 1280, 3040, +3080 ,3300 ,0 ,720 ,725 ,730 ,750 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 68 - 1280x720@50Hz */ + { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74250, 1280, 1720, +1760 ,1980 ,0 ,720 ,725 ,730 ,750 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 69 - 1280x720@60Hz */ + { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74250, 1280, 1390, +1430 ,1650 ,0 ,720 ,725 ,730 ,750 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 70 - 1280x720@100Hz */ + { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 148500, 1280, 1720, +1760 ,1980 ,0 ,720 ,725 ,730 ,750 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 71 - 1280x720@120Hz */ + { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 148500, 1280, 1390, +1430 ,1650 ,0 ,720 ,725 ,730 ,750 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 120, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 72 - 1920x1080@24Hz */ + { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 74250, 1920, 2558, +2602 ,2750 ,0 ,1080 ,1084 ,1089 ,1125 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 73 - 1920x1080@25Hz */ + { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 74250, 1920, 2448, +2492 ,2640 ,0 ,1080 ,1084 ,1089 ,1125 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 74 - 1920x1080@30Hz */ + { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 74250, 1920, 2008, +2052 ,2200 ,0 ,1080 ,1084 ,1089 ,1125 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 75 - 1920x1080@50Hz */ + { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 148500, 1920, 2448, +2492 ,2640 ,0 ,1080 ,1084 ,1089 ,1125 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 76 - 1920x1080@60Hz */ + { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 148500, 1920, 2008, +2052 ,2200 ,0 ,1080 ,1084 ,1089 ,1125 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 77 - 1920x1080@100Hz */ + { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 297000, 1920, 2448, +2492 ,2640 ,0 ,1080 ,1084 ,1094 ,1125 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 78 - 1920x1080@120Hz */ + { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 297000, 1920, 2008, +2052 ,2200 ,0 ,1080 ,1084 ,1089 ,1125 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 120, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 79 - 1680x720@24Hz */ + { DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 59400, 1680, 3040, +3080 ,3300 ,0 ,720 ,725 ,730 ,750 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 80 - 1680x720@25Hz */ + { DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 59400, 1680, 2908, +2948 ,3168 ,0 ,720 ,725 ,730 ,750 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 81 - 1680x720@30Hz */ + { DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 59400, 1680, 2380, +2420 ,2640 ,0 ,720 ,725 ,730 ,750 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 82 - 1680x720@50Hz */ + { DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 82500, 1680, 1940, +1980 ,2200 ,0 ,720 ,725 ,730 ,750 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 83 - 1680x720@60Hz */ + { DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 99000, 1680, 1940, +1980 ,2200 ,0 ,720 ,725 ,730 ,750 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 84 - 1680x720@100Hz */ + { DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 165000, 1680, 1740, +1780 ,2000 ,0 ,720 ,725 ,730 ,825 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 85 - 1680x720@120Hz */ + { DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 198000, 1680, 1740, +1780 ,2000 ,0 ,720 ,725 ,730 ,825 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 120, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 86 - 2560x1080@24Hz */ + { DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 99000, 2560, 3558, +3602 ,3750 ,0 ,1080 ,1084 ,1089 ,1100 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 87 - 2560x1080@25Hz */ + { DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 90000, 2560, 3008, +3052 ,3200 ,0 ,1080 ,1084 ,1089 ,1125 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 88 - 2560x1080@30Hz */ + { DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 118800, 2560, 3328, +3372 ,3520 ,0 ,1080 ,1084 ,1089 ,1125 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 89 - 2560x1080@50Hz */ + { DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 185625, 2560, 3108, +3152 ,3300 ,0 ,1080 ,1084 ,1089 ,1125 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 90 - 2560x1080@60Hz */ + { DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 198000, 2560, 2808, +2852 ,3000 ,0 ,1080 ,1084 ,1089 ,1100 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 91 - 2560x1080@100Hz */ + { DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 371250, 2560, 2778, +2822 ,2970 ,0 ,1080 ,1084 ,1089 ,1250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 92 - 2560x1080@120Hz */ + { DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 495000, 2560, 3108, +3152 ,3300 ,0 ,1080 ,1084 ,1089 ,1250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 120, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 93 - 3840x2160p@24Hz 16:9 */ + { DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 5116, +5204 ,5500 ,0 ,2160 ,2168 ,2178 ,2250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9,}, + /* 94 - 3840x2160p@25Hz 16:9 */ + { DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 4896, +4984 ,5280 ,0 ,2160 ,2168 ,2178 ,2250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9}, +/* 95 - 3840x2160p@30Hz 16:9 */ + { DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 4016, +4104 ,4400 ,0 ,2160 ,2168 ,2178 ,2250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9}, +/* 96 - 3840x2160p@50Hz 16:9 */ + { DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 594000, 3840, 4896, +4984 ,5280 ,0 ,2160 ,2168 ,2178 ,2250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9}, +/* 97 - 3840x2160p@60Hz 16:9 */ + { DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 594000, 3840, 4016, +4104 ,4400 ,0 ,2160 ,2168 ,2178 ,2250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9}, +/* 98 - 4096x2160p@24Hz 256:135 */ + { DRM_MODE("4096x2160", DRM_MODE_TYPE_DRIVER, 297000, 4096, 5116, +5204 ,5500 ,0 ,2160 ,2168 ,2178 ,2250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135}, +/* 99 - 4096x2160p@25Hz 256:135 */ + { DRM_MODE("4096x2160", DRM_MODE_TYPE_DRIVER, 297000, 4096, 5064, +5152 ,5280 ,0 ,2160 ,2168 ,2178 ,2250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135}, +/* 100 - 4096x2160p@30Hz 256:135 */ + { DRM_MODE("4096x2160", DRM_MODE_TYPE_DRIVER, 297000, 4096, 4184, +4272 ,4400 ,0 ,2160 ,2168 ,2178 ,2250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135}, +/* 101 - 4096x2160p@50Hz 256:135 */ + { DRM_MODE("4096x2160", DRM_MODE_TYPE_DRIVER, 594000, 4096, 5064, +5152 ,5280 ,0 ,2160 ,2168 ,2178 ,2250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135}, +/* 102 - 4096x2160p@60Hz 256:135 */ + { DRM_MODE("4096x2160", DRM_MODE_TYPE_DRIVER, 594000, 4096, 4184, +4272 ,4400 ,0 ,2160 ,2168 ,2178 ,2250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135}, +/* 103 - 3840x2160p@24Hz 64:27 */ + { DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 5116, +5204 ,5500 ,0 ,2160 ,2168 ,2178 ,2250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27}, +/* 104 - 3840x2160p@25Hz 64:27 */ + { DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 4016, +4104 ,4400 ,0 ,2160 ,2168 ,2178 ,2250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27}, +/* 105 - 3840x2160p@30Hz 64:27 */ + { DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 4016, +4104 ,4400 ,0 ,2160 ,2168 ,2178 ,2250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27}, +/* 106 - 3840x2160p@50Hz 64:27 */ + { DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 594000, 3840, 4896, +4984 ,5280 ,0 ,2160 ,2168 ,2178 ,2250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27}, +/* 107 - 3840x2160p@60Hz 64:27 */ + { DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 594000, 3840, 4016, +4104 ,4400 ,0 ,2160 ,2168 ,2178 ,2250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27}, };
Quoted 3 lines
Quoted 3 lines
drivers/gpu/drm/drm_edid.c +0
-0/* Signature · 1 line
2.7.4
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v2 02/11] drm/edid: Complete CEA modedb(VIC 1-107)
Quoted 15 lines · Shashank
Regards
Shashank
Quoted 9 lines · Ville Syrjälä
Quoted 8 lines · Shashank Sharma
CEA-861-F specs defines new video modes to be used with HDMI 2.0 EDIDs. The VIC range has been extended from 1-64 to 1-107.
Our existing CEA modedb contains only 64 modes (VIC=1 to VIC=64). Now to be able to parse new CEA modes using the existing methods, we have to complete the modedb (VIC=65 onwards).
Quoted 6 lines
Quoted 4 lines
Quoted 3 lines
This patch adds:
- Timings for existing CEA video modes (from VIC=65 till VIC=92)
- Newly added 4k modes (from VIC=93 to VIC=107).Still missing the "native bit" handling.
I tried searching the native bit handling in the code, but I could not get any thing. We are typically doing a (vic & 127) and that's all.
And that's not really correct. We shouldn't discard the msb until we've checked that we're in the correct range of VICs that have the native bit. drm_display_mode_from_vic_index() is the place where we should be checking this I think.
Quoted 250 lines
Can you please point out a bit here ?
- Shashank
Quoted 247 lines
Quoted 247 lines
The patch was originaly discussed and reviewed here:
https://patchwork.freedesktop.org/patch/135810/Cc Ville Syrjala <[email protected]>Cc Jose Abreu <[email protected]>Cc Andrzej Hajda <[email protected]>Cc Alex Deucher <[email protected]>Cc Harry Wentland <[email protected]>V2: Rebase
Reviewed-by Jose Abreu <[email protected]>Reviewed-by Alex Deucher <[email protected]>Acked-by Harry Wentland <[email protected]>Signed-off-by Shashank Sharma <[email protected]>--- drivers/gpu/drm/drm_edid.c | 215 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 215 insertions(+)drivers/gpu/drm/drm_edid.c +215
-0@@ -1006,6 +1006,221 @@ static const struct drm_display_mode edid_cea_modes[] = { 2492, 2640, 0, 1080, 1084, 1089, 1125, 0, DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC), .vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, }, +/* 65 - 1280x720@24Hz */ + {DRM_MODE ("1280x720" ,DRM_MODE_TYPE_DRIVER ,59400 ,1280 ,3040 , +3080 ,3300 ,0 ,720 ,725 ,730 ,750 ,0 , + DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC), + .vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 66 - 1280x720@25Hz */ + { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74250, 1280, 3700, +3740 ,3960 ,0 ,720 ,725 ,730 ,750 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 67 - 1280x720@30Hz */ + { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74250, 1280, 3040, +3080 ,3300 ,0 ,720 ,725 ,730 ,750 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 68 - 1280x720@50Hz */ + { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74250, 1280, 1720, +1760 ,1980 ,0 ,720 ,725 ,730 ,750 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 69 - 1280x720@60Hz */ + { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74250, 1280, 1390, +1430 ,1650 ,0 ,720 ,725 ,730 ,750 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 70 - 1280x720@100Hz */ + { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 148500, 1280, 1720, +1760 ,1980 ,0 ,720 ,725 ,730 ,750 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 71 - 1280x720@120Hz */ + { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 148500, 1280, 1390, +1430 ,1650 ,0 ,720 ,725 ,730 ,750 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 120, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 72 - 1920x1080@24Hz */ + { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 74250, 1920, 2558, +2602 ,2750 ,0 ,1080 ,1084 ,1089 ,1125 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 73 - 1920x1080@25Hz */ + { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 74250, 1920, 2448, +2492 ,2640 ,0 ,1080 ,1084 ,1089 ,1125 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 74 - 1920x1080@30Hz */ + { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 74250, 1920, 2008, +2052 ,2200 ,0 ,1080 ,1084 ,1089 ,1125 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 75 - 1920x1080@50Hz */ + { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 148500, 1920, 2448, +2492 ,2640 ,0 ,1080 ,1084 ,1089 ,1125 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 76 - 1920x1080@60Hz */ + { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 148500, 1920, 2008, +2052 ,2200 ,0 ,1080 ,1084 ,1089 ,1125 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 77 - 1920x1080@100Hz */ + { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 297000, 1920, 2448, +2492 ,2640 ,0 ,1080 ,1084 ,1094 ,1125 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 78 - 1920x1080@120Hz */ + { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 297000, 1920, 2008, +2052 ,2200 ,0 ,1080 ,1084 ,1089 ,1125 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 120, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 79 - 1680x720@24Hz */ + { DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 59400, 1680, 3040, +3080 ,3300 ,0 ,720 ,725 ,730 ,750 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 80 - 1680x720@25Hz */ + { DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 59400, 1680, 2908, +2948 ,3168 ,0 ,720 ,725 ,730 ,750 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 81 - 1680x720@30Hz */ + { DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 59400, 1680, 2380, +2420 ,2640 ,0 ,720 ,725 ,730 ,750 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 82 - 1680x720@50Hz */ + { DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 82500, 1680, 1940, +1980 ,2200 ,0 ,720 ,725 ,730 ,750 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 83 - 1680x720@60Hz */ + { DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 99000, 1680, 1940, +1980 ,2200 ,0 ,720 ,725 ,730 ,750 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 84 - 1680x720@100Hz */ + { DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 165000, 1680, 1740, +1780 ,2000 ,0 ,720 ,725 ,730 ,825 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 85 - 1680x720@120Hz */ + { DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 198000, 1680, 1740, +1780 ,2000 ,0 ,720 ,725 ,730 ,825 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 120, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 86 - 2560x1080@24Hz */ + { DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 99000, 2560, 3558, +3602 ,3750 ,0 ,1080 ,1084 ,1089 ,1100 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 87 - 2560x1080@25Hz */ + { DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 90000, 2560, 3008, +3052 ,3200 ,0 ,1080 ,1084 ,1089 ,1125 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 88 - 2560x1080@30Hz */ + { DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 118800, 2560, 3328, +3372 ,3520 ,0 ,1080 ,1084 ,1089 ,1125 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 89 - 2560x1080@50Hz */ + { DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 185625, 2560, 3108, +3152 ,3300 ,0 ,1080 ,1084 ,1089 ,1125 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 90 - 2560x1080@60Hz */ + { DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 198000, 2560, 2808, +2852 ,3000 ,0 ,1080 ,1084 ,1089 ,1100 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 91 - 2560x1080@100Hz */ + { DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 371250, 2560, 2778, +2822 ,2970 ,0 ,1080 ,1084 ,1089 ,1250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 92 - 2560x1080@120Hz */ + { DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 495000, 2560, 3108, +3152 ,3300 ,0 ,1080 ,1084 ,1089 ,1250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 120, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 93 - 3840x2160p@24Hz 16:9 */ + { DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 5116, +5204 ,5500 ,0 ,2160 ,2168 ,2178 ,2250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9,}, + /* 94 - 3840x2160p@25Hz 16:9 */ + { DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 4896, +4984 ,5280 ,0 ,2160 ,2168 ,2178 ,2250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9}, +/* 95 - 3840x2160p@30Hz 16:9 */ + { DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 4016, +4104 ,4400 ,0 ,2160 ,2168 ,2178 ,2250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9}, +/* 96 - 3840x2160p@50Hz 16:9 */ + { DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 594000, 3840, 4896, +4984 ,5280 ,0 ,2160 ,2168 ,2178 ,2250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9}, +/* 97 - 3840x2160p@60Hz 16:9 */ + { DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 594000, 3840, 4016, +4104 ,4400 ,0 ,2160 ,2168 ,2178 ,2250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9}, +/* 98 - 4096x2160p@24Hz 256:135 */ + { DRM_MODE("4096x2160", DRM_MODE_TYPE_DRIVER, 297000, 4096, 5116, +5204 ,5500 ,0 ,2160 ,2168 ,2178 ,2250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135}, +/* 99 - 4096x2160p@25Hz 256:135 */ + { DRM_MODE("4096x2160", DRM_MODE_TYPE_DRIVER, 297000, 4096, 5064, +5152 ,5280 ,0 ,2160 ,2168 ,2178 ,2250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135}, +/* 100 - 4096x2160p@30Hz 256:135 */ + { DRM_MODE("4096x2160", DRM_MODE_TYPE_DRIVER, 297000, 4096, 4184, +4272 ,4400 ,0 ,2160 ,2168 ,2178 ,2250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135}, +/* 101 - 4096x2160p@50Hz 256:135 */ + { DRM_MODE("4096x2160", DRM_MODE_TYPE_DRIVER, 594000, 4096, 5064, +5152 ,5280 ,0 ,2160 ,2168 ,2178 ,2250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135}, +/* 102 - 4096x2160p@60Hz 256:135 */ + { DRM_MODE("4096x2160", DRM_MODE_TYPE_DRIVER, 594000, 4096, 4184, +4272 ,4400 ,0 ,2160 ,2168 ,2178 ,2250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135}, +/* 103 - 3840x2160p@24Hz 64:27 */ + { DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 5116, +5204 ,5500 ,0 ,2160 ,2168 ,2178 ,2250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27}, +/* 104 - 3840x2160p@25Hz 64:27 */ + { DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 4016, +4104 ,4400 ,0 ,2160 ,2168 ,2178 ,2250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27}, +/* 105 - 3840x2160p@30Hz 64:27 */ + { DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 4016, +4104 ,4400 ,0 ,2160 ,2168 ,2178 ,2250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27}, +/* 106 - 3840x2160p@50Hz 64:27 */ + { DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 594000, 3840, 4896, +4984 ,5280 ,0 ,2160 ,2168 ,2178 ,2250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27}, +/* 107 - 3840x2160p@60Hz 64:27 */ + { DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 594000, 3840, 4016, +4104 ,4400 ,0 ,2160 ,2168 ,2178 ,2250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27}, };/* Signature · 1 line
2.7.4
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v2 02/11] drm/edid: Complete CEA modedb(VIC 1-107)
Regards
Shashank
Quoted 19 lines · Ville Syrjälä
Quoted 18 lines · Shashank
Regards
Shashank
Quoted 12 lines · Ville Syrjälä
Quoted 11 lines · Shashank Sharma
CEA-861-F specs defines new video modes to be used with HDMI 2.0 EDIDs. The VIC range has been extended from 1-64 to 1-107.
Our existing CEA modedb contains only 64 modes (VIC=1 to VIC=64). Now to be able to parse new CEA modes using the existing methods, we have to complete the modedb (VIC=65 onwards).
This patch adds:
- Timings for existing CEA video modes (from VIC=65 till VIC=92)
- Newly added 4k modes (from VIC=93 to VIC=107).
Quoted 7 lines
Quoted 3 lines
Quoted 1 line
Still missing the "native bit" handling.
I tried searching the native bit handling in the code, but I could not get any thing. We are typically doing a (vic & 127) and that's all.
And that's not really correct. We shouldn't discard the msb until we've checked that we're in the correct range of VICs that have the native bit.
drm_display_mode_from_vic_index()is the place where we should be checking this I think.
Yep, Even I looked into these function only for the native mode processing, But looks like all its doing is:
vic = (video_db[video_index] & 127);
- Shashank
Quoted 247 lines
Quoted 247 lines
Can you please point out a bit here ?
- Shashank
Quoted 244 lines
Quoted 244 lines
The patch was originaly discussed and reviewed here:
https://patchwork.freedesktop.org/patch/135810/Cc Ville Syrjala <[email protected]>Cc Jose Abreu <[email protected]>Cc Andrzej Hajda <[email protected]>Cc Alex Deucher <[email protected]>Cc Harry Wentland <[email protected]>V2: Rebase
Reviewed-by Jose Abreu <[email protected]>Reviewed-by Alex Deucher <[email protected]>Acked-by Harry Wentland <[email protected]>Signed-off-by Shashank Sharma <[email protected]>--- drivers/gpu/drm/drm_edid.c | 215 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 215 insertions(+)drivers/gpu/drm/drm_edid.c +215
-0@@ -1006,6 +1006,221 @@ static const struct drm_display_mode edid_cea_modes[] = { 2492, 2640, 0, 1080, 1084, 1089, 1125, 0, DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC), .vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, }, +/* 65 - 1280x720@24Hz */ + {DRM_MODE ("1280x720" ,DRM_MODE_TYPE_DRIVER ,59400 ,1280 ,3040 , +3080 ,3300 ,0 ,720 ,725 ,730 ,750 ,0 , + DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC), + .vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 66 - 1280x720@25Hz */ + { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74250, 1280, 3700, +3740 ,3960 ,0 ,720 ,725 ,730 ,750 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 67 - 1280x720@30Hz */ + { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74250, 1280, 3040, +3080 ,3300 ,0 ,720 ,725 ,730 ,750 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 68 - 1280x720@50Hz */ + { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74250, 1280, 1720, +1760 ,1980 ,0 ,720 ,725 ,730 ,750 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 69 - 1280x720@60Hz */ + { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74250, 1280, 1390, +1430 ,1650 ,0 ,720 ,725 ,730 ,750 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 70 - 1280x720@100Hz */ + { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 148500, 1280, 1720, +1760 ,1980 ,0 ,720 ,725 ,730 ,750 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 71 - 1280x720@120Hz */ + { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 148500, 1280, 1390, +1430 ,1650 ,0 ,720 ,725 ,730 ,750 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 120, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 72 - 1920x1080@24Hz */ + { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 74250, 1920, 2558, +2602 ,2750 ,0 ,1080 ,1084 ,1089 ,1125 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 73 - 1920x1080@25Hz */ + { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 74250, 1920, 2448, +2492 ,2640 ,0 ,1080 ,1084 ,1089 ,1125 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 74 - 1920x1080@30Hz */ + { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 74250, 1920, 2008, +2052 ,2200 ,0 ,1080 ,1084 ,1089 ,1125 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 75 - 1920x1080@50Hz */ + { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 148500, 1920, 2448, +2492 ,2640 ,0 ,1080 ,1084 ,1089 ,1125 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 76 - 1920x1080@60Hz */ + { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 148500, 1920, 2008, +2052 ,2200 ,0 ,1080 ,1084 ,1089 ,1125 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 77 - 1920x1080@100Hz */ + { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 297000, 1920, 2448, +2492 ,2640 ,0 ,1080 ,1084 ,1094 ,1125 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 78 - 1920x1080@120Hz */ + { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 297000, 1920, 2008, +2052 ,2200 ,0 ,1080 ,1084 ,1089 ,1125 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 120, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 79 - 1680x720@24Hz */ + { DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 59400, 1680, 3040, +3080 ,3300 ,0 ,720 ,725 ,730 ,750 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 80 - 1680x720@25Hz */ + { DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 59400, 1680, 2908, +2948 ,3168 ,0 ,720 ,725 ,730 ,750 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 81 - 1680x720@30Hz */ + { DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 59400, 1680, 2380, +2420 ,2640 ,0 ,720 ,725 ,730 ,750 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 82 - 1680x720@50Hz */ + { DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 82500, 1680, 1940, +1980 ,2200 ,0 ,720 ,725 ,730 ,750 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 83 - 1680x720@60Hz */ + { DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 99000, 1680, 1940, +1980 ,2200 ,0 ,720 ,725 ,730 ,750 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 84 - 1680x720@100Hz */ + { DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 165000, 1680, 1740, +1780 ,2000 ,0 ,720 ,725 ,730 ,825 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 85 - 1680x720@120Hz */ + { DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 198000, 1680, 1740, +1780 ,2000 ,0 ,720 ,725 ,730 ,825 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 120, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 86 - 2560x1080@24Hz */ + { DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 99000, 2560, 3558, +3602 ,3750 ,0 ,1080 ,1084 ,1089 ,1100 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 87 - 2560x1080@25Hz */ + { DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 90000, 2560, 3008, +3052 ,3200 ,0 ,1080 ,1084 ,1089 ,1125 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 88 - 2560x1080@30Hz */ + { DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 118800, 2560, 3328, +3372 ,3520 ,0 ,1080 ,1084 ,1089 ,1125 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 89 - 2560x1080@50Hz */ + { DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 185625, 2560, 3108, +3152 ,3300 ,0 ,1080 ,1084 ,1089 ,1125 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 90 - 2560x1080@60Hz */ + { DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 198000, 2560, 2808, +2852 ,3000 ,0 ,1080 ,1084 ,1089 ,1100 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 91 - 2560x1080@100Hz */ + { DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 371250, 2560, 2778, +2822 ,2970 ,0 ,1080 ,1084 ,1089 ,1250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 92 - 2560x1080@120Hz */ + { DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 495000, 2560, 3108, +3152 ,3300 ,0 ,1080 ,1084 ,1089 ,1250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 120, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, }, + /* 93 - 3840x2160p@24Hz 16:9 */ + { DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 5116, +5204 ,5500 ,0 ,2160 ,2168 ,2178 ,2250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9,}, + /* 94 - 3840x2160p@25Hz 16:9 */ + { DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 4896, +4984 ,5280 ,0 ,2160 ,2168 ,2178 ,2250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9}, +/* 95 - 3840x2160p@30Hz 16:9 */ + { DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 4016, +4104 ,4400 ,0 ,2160 ,2168 ,2178 ,2250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9}, +/* 96 - 3840x2160p@50Hz 16:9 */ + { DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 594000, 3840, 4896, +4984 ,5280 ,0 ,2160 ,2168 ,2178 ,2250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9}, +/* 97 - 3840x2160p@60Hz 16:9 */ + { DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 594000, 3840, 4016, +4104 ,4400 ,0 ,2160 ,2168 ,2178 ,2250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9}, +/* 98 - 4096x2160p@24Hz 256:135 */ + { DRM_MODE("4096x2160", DRM_MODE_TYPE_DRIVER, 297000, 4096, 5116, +5204 ,5500 ,0 ,2160 ,2168 ,2178 ,2250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135}, +/* 99 - 4096x2160p@25Hz 256:135 */ + { DRM_MODE("4096x2160", DRM_MODE_TYPE_DRIVER, 297000, 4096, 5064, +5152 ,5280 ,0 ,2160 ,2168 ,2178 ,2250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135}, +/* 100 - 4096x2160p@30Hz 256:135 */ + { DRM_MODE("4096x2160", DRM_MODE_TYPE_DRIVER, 297000, 4096, 4184, +4272 ,4400 ,0 ,2160 ,2168 ,2178 ,2250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135}, +/* 101 - 4096x2160p@50Hz 256:135 */ + { DRM_MODE("4096x2160", DRM_MODE_TYPE_DRIVER, 594000, 4096, 5064, +5152 ,5280 ,0 ,2160 ,2168 ,2178 ,2250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135}, +/* 102 - 4096x2160p@60Hz 256:135 */ + { DRM_MODE("4096x2160", DRM_MODE_TYPE_DRIVER, 594000, 4096, 4184, +4272 ,4400 ,0 ,2160 ,2168 ,2178 ,2250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135}, +/* 103 - 3840x2160p@24Hz 64:27 */ + { DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 5116, +5204 ,5500 ,0 ,2160 ,2168 ,2178 ,2250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27}, +/* 104 - 3840x2160p@25Hz 64:27 */ + { DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 4016, +4104 ,4400 ,0 ,2160 ,2168 ,2178 ,2250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27}, +/* 105 - 3840x2160p@30Hz 64:27 */ + { DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 4016, +4104 ,4400 ,0 ,2160 ,2168 ,2178 ,2250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27}, +/* 106 - 3840x2160p@50Hz 64:27 */ + { DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 594000, 3840, 4896, +4984 ,5280 ,0 ,2160 ,2168 ,2178 ,2250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27}, +/* 107 - 3840x2160p@60Hz 64:27 */ + { DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 594000, 3840, 4016, +4104 ,4400 ,0 ,2160 ,2168 ,2178 ,2250 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27}, };
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
drivers/gpu/drm/drm_edid.c +0
-0/* Signature · 1 line
2.7.4
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v2 3/11 drm: parse ycbcr420 cmdb block
In reply to Shashank SharmaHDMI 2.0 spec adds support for ycbcr420 sub-sampled output. CEA-861-F adds two new blocks in EDID, to provide information about sink's support for ycbcr420 output.
One of these new blocks is: ycbcr420cmdb(ycbcr 420 capability map data block). This gives information about video modes which can support ycbcr420 output mode also (along with RGB,YCBCR444/ 422 etc)
This block contains a bitmap index of normal svd videomodes, which can support ycbcr420 output too.
So if bit 0 from first vcb byte is set,first video mode in the svd list can support ycbcr420 output too. Bit 2 means second video mode from svd list can support ycbcr420 output too, and so on.
This patch adds parsing and handling of ycbcr420-cmdb in the DRM layer.
V2: Addressed
Review comments from Emil:
- Use 1ULL<<i instead of 1<<i to make sure the output is 64bit.
- Use the suggested method for updating dbmap.
- Add documentation for ycbcr420_vcb_map to fix kbuild warning.
Review comments from Ville:
- Do not expose the ycbcr420 flags in uabi layer, keep it internal.
- Save a map of ycbcr420 modes for future reference.
- Check db length before trying to parse extended tag.
- Add a warning if there are > 64 modes in capability map block.
- Use y420cmdb in function names and macros while dealing with vcb to be aligned with spec.
- Move the display information parsing block ahead of mode parsing blocks.
--- drivers/gpu/drm/drm_edid.c | 118 ++++++++++++++++++++++++++++++++++++++++++-- include/drm/drm_connector.h | 12 +++++ 2 files changed, 127 insertions(+), 3 deletions(-)
drivers/gpu/drm/drm_edid.c +115 -3
@@ -2781,7 +2781,9 @@ add_detailed_modes(struct drm_connector *connector, struct edid *edid,#define VIDEO_BLOCK 0x02#define VENDOR_BLOCK 0x03#define SPEAKER_BLOCK 0x04 -#define VIDEO_CAPABILITY_BLOCK 0x07 +#define VIDEO_CAPABILITY_BLOCK 0x07 +#define VIDEO_DATA_BLOCK_420 0x0E +#define VIDEO_CAP_BLOCK_Y420CMDB 0x0F#define EDID_BASIC_AUDIO (1 << 6)#define EDID_CEA_YCRCB444 (1 << 5)#define EDID_CEA_YCRCB422 (1 << 4)
@@ -3143,15 +3145,50 @@ drm_display_mode_from_vic_index(struct drm_connector *connector,return newmode; } +static void +drm_add_vcb_modes (struct drm_connector *connector,u8 vic) +{ +u32 *map; +u8 index =0 ; +struct drm_hdmi_info *hdmi = &connector->display_info.hdmi; + +/* VICs are 1 to 127(107 defined till CEA-861-F) */ + vic &=127 ; + +/* +* ycbcr420_vcb_modes is a fix position 128 bit bitmap. This indicates +* support for ycbcr420 output per VIC. Arrangement is bit[n] indicates +* if vic[n+1] supports ycbcr420 output. +* ycbcr420_vcb_modes[0] = |VIC=32 |VIC=31 |............|VIC=2 |VIC=1 | +* ycbcr420_vcb_modes[1] = |VIC=64 |VIC=63 |............|VIC=34|VIC=33| +* ycbcr420_vcb_modes[2] = |VIC=96 |VIC=95 |............|VIC=66|VIC=65| +* ycbcr420_vcb_modes[3] = |VIC=128|VIC=127|............|VIC=34|VIC=97| +*/ + map = &(hdmi->ycbcr420_vcb_modes[(vic -1 ) /32 ]); + index = (vic -1 ) %32 ; + *map |= (1 << index); +} +static int do_cea_modes (struct drm_connector *connector,const u8 *db,u8 len) {int i, modes =0 ; +struct drm_hdmi_info *hdmi = &connector->display_info.hdmi; +u64 hdmi_vcb_map = hdmi->ycbcr420_vcb_map;for (i =0 ; i < len; i++) {struct drm_display_mode *mode; mode =drm_display_mode_from_vic_index (connector, db, len, i);if (mode) { +/* +* ycbcr420 capability block contains a bitmap which +* gives the index of such CEA modes in VDB, which can +* support ycbcr420 sampling output also. +* For example, if the bit 0 in bitmap is set, +* first mode in VDB can support ycbcr420 output too. +*/ +if (hdmi_vcb_map & (1 << i)) +drm_add_vcb_modes (connector, db[i]);drm_mode_probed_add (connector, mode); modes++; }
@@ -3427,6 +3464,12 @@ do_hdmi_vsdb_modes(struct drm_connector *connector, const u8 *db, u8 len, }static int +cea_db_extended_tag (const u8 *db) +{ +return db[1 ]; +} + +static int cea_db_payload_len (const u8 *db) {return db[0 ] &0x1f ;
@@ -3487,9 +3530,70 @@ static bool cea_db_is_hdmi_forum_vsdb(const u8 *db)return oui ==HDMI_FORUM_IEEE_OUI ; } +static bool cea_db_is_y420cmdb (const u8 *db) +{ +u8 len =cea_db_payload_len (db); + +if (cea_db_tag (db) !=VIDEO_CAPABILITY_BLOCK ) +return false; + +if (!len) +return false; + +if (cea_db_extended_tag (db) !=VIDEO_CAP_BLOCK_Y420CMDB ) +return false; + +return true; +} +#define for_each_cea_db (cea, i, start, end) \ for ((i) = (start); (i) < (end) && (i) + cea_db_payload_len(&(cea)[(i)]) < (end); (i) += cea_db_payload_len(&(cea)[(i)]) + 1) +static void drm_parse_y420cmdb_bitmap (struct drm_connector *connector, +const u8 *db) +{ +struct drm_display_info *info = &connector->display_info; +struct drm_hdmi_info *hdmi = &info->hdmi; +u8 map_len =cea_db_payload_len (db) -1 ; +u8 count; +u64 map =0 ; + +if (!db) +return ; + +if (map_len ==0 ) { +/* All CEA modes support ycbcr420 sampling also.*/ + hdmi->ycbcr420_vcb_map =U64_MAX ; + info->color_formats |=DRM_COLOR_FORMAT_YCRCB420 ; +return ; + } + +/* +* This map indicates which of the existing CEA block modes +* from VDB can support YCBCR420 output too. So if bit=0 is +* set, first mode from VDB can support YCBCR420 output too. +* We will parse and keep this map, before parsing VDB itself +* to avoid going through the same block again and again. +* +* Spec is not clear about max possible size of this block. +* Clamping max bitmap block size at 8 bytes. Every byte can +* address 8 CEA modes, in this way this map can address +* 8*8 = first 64 SVDs. +*/ +if (WARN_ON_ONCE (map_len >8 )) + map_len =8 ; + +for (count =0 ; count < map_len; count++) + map |= (u64 )db[2 + count] << (8 * count); + +if (map) { +DRM_DEBUG_KMS ("Sink supports ycbcr 420\n" ); + info->color_formats |=DRM_COLOR_FORMAT_YCRCB420 ; + } + + hdmi->ycbcr420_vcb_map = map; +} +static int add_cea_modes (struct drm_connector *connector,struct edid *edid) {
@@ -4196,6 +4300,8 @@ static void drm_parse_cea_ext(struct drm_connector *connector,drm_parse_hdmi_vsdb_video (connector, db);if (cea_db_is_hdmi_forum_vsdb (db))drm_parse_hdmi_forum_vsdb (connector, db); +if (cea_db_is_y420cmdb (db)) +drm_parse_y420cmdb_bitmap (connector, db); } }
@@ -4430,6 +4536,13 @@ int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid) quirks =edid_get_quirks (edid);/* +* CEA-861-F adds ycbcr capability map block, for HDMI 2.0 sinks. +* To avoid multiple parsing of same block, lets get the sink info +* before parsing CEA modes. +*/ +drm_add_display_info (connector, edid); + +/* * EDID spec says modes should be preferred in this order: * - preferred detailed mode * - other detailed modes from base block
@@ -4450,14 +4563,13 @@ int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid) num_modes +=add_cea_modes (connector, edid); num_modes +=add_alternate_cea_modes (connector, edid); num_modes +=add_displayid_detailed_modes (connector, edid); +if (edid->features &DRM_EDID_FEATURE_DEFAULT_GTF ) num_modes +=add_inferred_modes (connector, edid);if (quirks & (EDID_QUIRK_PREFER_LARGE_60 |EDID_QUIRK_PREFER_LARGE_75 ))edid_fixup_preferred (connector, quirks); -drm_add_display_info (connector, edid); -if (quirks &EDID_QUIRK_FORCE_6BPC ) connector->display_info.bpc =6 ;
include/drm/drm_connector.h +12 -0
@@ -137,6 +137,17 @@ struct drm_scdc {struct drm_hdmi_info {/** @scdc: sink's scdc support and capabilities */ struct drm_scdc scdc; + +/** +* @ycbcr420_vcb_modes: bitmap of modes which can support ycbcr420 +* output also along with normal outputs. There are total 107 VICs +* defined by CEA-861-F spec, so the size is 128bits to map upto 128 +* VICs; +*/ +u32 ycbcr420_vcb_modes[4 ]; + +/** @ycbcr420_vcb_map: bitmap of SVD index, to extraxt vcb modes */ +u64 ycbcr420_vcb_map; };/**
@@ -200,6 +211,7 @@ struct drm_display_info {#define DRM_COLOR_FORMAT_RGB444 (1<<0)#define DRM_COLOR_FORMAT_YCRCB444 (1<<1)#define DRM_COLOR_FORMAT_YCRCB422 (1<<2) +#define DRM_COLOR_FORMAT_YCRCB420 (1<<3)/** * @color_formats: HDMI Color formats, selects between RGB and YCrCb
Signature · 6 lines
2.7.4 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v2 03/11] drm: parse ycbcr420 cmdb block
Quoted 74 lines · Shashank Sharma
HDMI 2.0 spec adds support for ycbcr420 sub-sampled output. CEA-861-F adds two new blocks in EDID, to provide information about sink's support for ycbcr420 output.
One of these new blocks is: ycbcr420cmdb(ycbcr 420 capability map data block). This gives information about video modes which can support ycbcr420 output mode also (along with RGB,YCBCR444/ 422 etc)
This block contains a bitmap index of normal svd videomodes, which can support ycbcr420 output too.
So if bit 0 from first vcb byte is set,first video mode in the svd list can support ycbcr420 output too. Bit 2 means second video mode from svd list can support ycbcr420 output too, and so on.This patch adds parsing and handling of ycbcr420-cmdb in the DRM layer.
Cc Ville Syrjala <[email protected]>Cc Jose Abreu <[email protected]>Cc Emil Velikov <[email protected]>V2: Addressed
Review comments from Emil:
- Use 1ULL<<i instead of 1<<i to make sure the output is 64bit.
- Use the suggested method for updating dbmap.
- Add documentation forycbcr420_vcb_mapto fix kbuild warning.Review comments from Ville:
- Do not expose the ycbcr420 flags in uabi layer, keep it internal.
- Save a map of ycbcr420 modes for future reference.
- Check db length before trying to parse extended tag.
- Add a warning if there are > 64 modes in capability map block.
- Use y420cmdb in function names and macros while dealing with vcb to be aligned with spec.
- Move the display information parsing block ahead of mode parsing blocks.Signed-off-by Shashank Sharma <[email protected]>--- drivers/gpu/drm/drm_edid.c | 118 ++++++++++++++++++++++++++++++++++++++++++-- include/drm/drm_connector.h | 12 +++++ 2 files changed, 127 insertions(+), 3 deletions(-)drivers/gpu/drm/drm_edid.c +15
-1@@ -2781,7 +2781,9 @@ add_detailed_modes(struct drm_connector *connector, struct edid *edid,#define VIDEO_BLOCK 0x02#define VENDOR_BLOCK 0x03#define SPEAKER_BLOCK 0x04 -#define VIDEO_CAPABILITY_BLOCK 0x07 +#define VIDEO_CAPABILITY_BLOCK 0x07 +#define VIDEO_DATA_BLOCK_420 0x0E +#define VIDEO_CAP_BLOCK_Y420CMDB 0x0F#define EDID_BASIC_AUDIO (1 << 6)#define EDID_CEA_YCRCB444 (1 << 5)#define EDID_CEA_YCRCB422 (1 << 4)@@ -3143,15 +3145,50 @@ drm_display_mode_from_vic_index(struct drm_connector *connector,return newmode; } +static void +drm_add_vcb_modes (struct drm_connector *connector,u8 vic) +{ +u32 *map; +u8 index =0 ; +struct drm_hdmi_info *hdmi = &connector->display_info.hdmi; + +/* VICs are 1 to 127(107 defined till CEA-861-F) */ + vic &=127 ; + +/* +* ycbcr420_vcb_modes is a fix position 128 bit bitmap. This indicates
drivers/gpu/drm/drm_edid.c drm_display_mode_from_vic_index(struct drm_connector *connector, · line 3169
Quoted 10 lines
drivers/gpu/drm/drm_edid.c +10
-0+* support for ycbcr420 output per VIC. Arrangement is bit[n] indicates +* if vic[n+1] supports ycbcr420 output. +* ycbcr420_vcb_modes[0] = |VIC=32 |VIC=31 |............|VIC=2 |VIC=1 | +* ycbcr420_vcb_modes[1] = |VIC=64 |VIC=63 |............|VIC=34|VIC=33| +* ycbcr420_vcb_modes[2] = |VIC=96 |VIC=95 |............|VIC=66|VIC=65| +* ycbcr420_vcb_modes[3] = |VIC=128|VIC=127|............|VIC=34|VIC=97| +*/ + map = &(hdmi->ycbcr420_vcb_modes[(vic -1 ) /32 ]); + index = (vic -1 ) %32 ; + *map |= (1 << index);
unsigned long whatever[BITS_TO_LONGS(nr)];
__set_bit(), test_bit(), etc.
Quoted 180 lines
drivers/gpu/drm/drm_edid.c +90
-2+} +static int do_cea_modes (struct drm_connector *connector,const u8 *db,u8 len) {int i, modes =0 ; +struct drm_hdmi_info *hdmi = &connector->display_info.hdmi; +u64 hdmi_vcb_map = hdmi->ycbcr420_vcb_map;for (i =0 ; i < len; i++) {struct drm_display_mode *mode; mode =drm_display_mode_from_vic_index (connector, db, len, i);if (mode) { +/* +* ycbcr420 capability block contains a bitmap which +* gives the index of such CEA modes in VDB, which can +* support ycbcr420 sampling output also. +* For example, if the bit 0 in bitmap is set, +* first mode in VDB can support ycbcr420 output too. +*/ +if (hdmi_vcb_map & (1 << i)) +drm_add_vcb_modes (connector, db[i]);drm_mode_probed_add (connector, mode); modes++; }@@ -3427,6 +3464,12 @@ do_hdmi_vsdb_modes(struct drm_connector *connector, const u8 *db, u8 len, }static int +cea_db_extended_tag (const u8 *db) +{ +return db[1 ]; +} + +static int cea_db_payload_len (const u8 *db) {return db[0 ] &0x1f ;@@ -3487,9 +3530,70 @@ static bool cea_db_is_hdmi_forum_vsdb(const u8 *db)return oui ==HDMI_FORUM_IEEE_OUI ; } +static bool cea_db_is_y420cmdb (const u8 *db) +{ +u8 len =cea_db_payload_len (db); + +if (cea_db_tag (db) !=VIDEO_CAPABILITY_BLOCK ) +return false; + +if (!len) +return false; + +if (cea_db_extended_tag (db) !=VIDEO_CAP_BLOCK_Y420CMDB ) +return false; + +return true; +} +#define for_each_cea_db (cea, i, start, end) \ for ((i) = (start); (i) < (end) && (i) + cea_db_payload_len(&(cea)[(i)]) < (end); (i) += cea_db_payload_len(&(cea)[(i)]) + 1) +static void drm_parse_y420cmdb_bitmap (struct drm_connector *connector, +const u8 *db) +{ +struct drm_display_info *info = &connector->display_info; +struct drm_hdmi_info *hdmi = &info->hdmi; +u8 map_len =cea_db_payload_len (db) -1 ; +u8 count; +u64 map =0 ; + +if (!db) +return ; + +if (map_len ==0 ) { +/* All CEA modes support ycbcr420 sampling also.*/ + hdmi->ycbcr420_vcb_map =U64_MAX ; + info->color_formats |=DRM_COLOR_FORMAT_YCRCB420 ; +return ; + } + +/* +* This map indicates which of the existing CEA block modes +* from VDB can support YCBCR420 output too. So if bit=0 is +* set, first mode from VDB can support YCBCR420 output too. +* We will parse and keep this map, before parsing VDB itself +* to avoid going through the same block again and again. +* +* Spec is not clear about max possible size of this block. +* Clamping max bitmap block size at 8 bytes. Every byte can +* address 8 CEA modes, in this way this map can address +* 8*8 = first 64 SVDs. +*/ +if (WARN_ON_ONCE (map_len >8 )) + map_len =8 ; + +for (count =0 ; count < map_len; count++) + map |= (u64 )db[2 + count] << (8 * count); + +if (map) { +DRM_DEBUG_KMS ("Sink supports ycbcr 420\n" ); + info->color_formats |=DRM_COLOR_FORMAT_YCRCB420 ; + } + + hdmi->ycbcr420_vcb_map = map; +} +static int add_cea_modes (struct drm_connector *connector,struct edid *edid) {@@ -4196,6 +4300,8 @@ static void drm_parse_cea_ext(struct drm_connector *connector,drm_parse_hdmi_vsdb_video (connector, db);if (cea_db_is_hdmi_forum_vsdb (db))drm_parse_hdmi_forum_vsdb (connector, db); +if (cea_db_is_y420cmdb (db)) +drm_parse_y420cmdb_bitmap (connector, db); } }@@ -4430,6 +4536,13 @@ int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid) quirks =edid_get_quirks (edid);/* +* CEA-861-F adds ycbcr capability map block, for HDMI 2.0 sinks. +* To avoid multiple parsing of same block, lets get the sink info +* before parsing CEA modes. +*/ +drm_add_display_info (connector, edid); + +/* * EDID spec says modes should be preferred in this order: * - preferred detailed mode * - other detailed modes from base block @@ -4450,14 +4563,13 @@ int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid) num_modes +=add_cea_modes (connector, edid); num_modes +=add_alternate_cea_modes (connector, edid); num_modes +=add_displayid_detailed_modes (connector, edid); +if (edid->features &DRM_EDID_FEATURE_DEFAULT_GTF ) num_modes +=add_inferred_modes (connector, edid);if (quirks & (EDID_QUIRK_PREFER_LARGE_60 |EDID_QUIRK_PREFER_LARGE_75 ))edid_fixup_preferred (connector, quirks); -drm_add_display_info (connector, edid); -if (quirks &EDID_QUIRK_FORCE_6BPC ) connector->display_info.bpc =6 ;include/drm/drm_connector.h +12
-0@@ -137,6 +137,17 @@ struct drm_scdc {struct drm_hdmi_info {/** @scdc: sink's scdc support and capabilities */ struct drm_scdc scdc; + +/** +* @ycbcr420_vcb_modes: bitmap of modes which can support ycbcr420 +* output also along with normal outputs. There are total 107 VICs +* defined by CEA-861-F spec, so the size is 128bits to map upto 128 +* VICs; +*/ +u32 ycbcr420_vcb_modes[4 ]; + +/** @ycbcr420_vcb_map: bitmap of SVD index, to extraxt vcb modes */ +u64 ycbcr420_vcb_map; };/** @@ -200,6 +211,7 @@ struct drm_display_info {#define DRM_COLOR_FORMAT_RGB444 (1<<0)#define DRM_COLOR_FORMAT_YCRCB444 (1<<1)#define DRM_COLOR_FORMAT_YCRCB422 (1<<2) +#define DRM_COLOR_FORMAT_YCRCB420 (1<<3)/** * @color_formats: HDMI Color formats, selects between RGB and YCrCb Signature · 1 line
2.7.4
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v2 4/11 drm: parse ycbcr 420 deep color information
In reply to Shashank SharmaCEA-861-F spec adds ycbcr420 deep color support information in hf-vsdb block. This patch extends the existing hf-vsdb parsing function by adding parsing of ycbcr420 deep color support from the EDID and adding it into display information stored.
--- drivers/gpu/drm/drm_edid.c | 15 +++++++++++++++ include/drm/drm_connector.h | 3 +++ include/drm/drm_edid.h | 5 +++++ 3 files changed, 23 insertions(+)
drivers/gpu/drm/drm_edid.c +15 -0
@@ -4142,6 +4142,19 @@ drm_default_rgb_quant_range(const struct drm_display_mode *mode) }EXPORT_SYMBOL (drm_default_rgb_quant_range); +static void drm_parse_ycbcr420_deep_color_info (struct drm_connector *connector, +const u8 *db) +{ +struct drm_hdmi_info *info = &connector->display_info.hdmi; + +if (db[7 ] &DRM_EDID_YCBCR420_DC_48 ) + info->ycbcr420_dc_modes |=DRM_EDID_YCBCR420_DC_48 ; +if (db[7 ] &DRM_EDID_YCBCR420_DC_36 ) + info->ycbcr420_dc_modes |=DRM_EDID_YCBCR420_DC_36 ; +if (db[7 ] &DRM_EDID_YCBCR420_DC_30 ) + info->ycbcr420_dc_modes |=DRM_EDID_YCBCR420_DC_30 ; +} +static void drm_parse_hdmi_forum_vsdb (struct drm_connector *connector,const u8 *hf_vsdb) {
@@ -4182,6 +4195,8 @@ static void drm_parse_hdmi_forum_vsdb(struct drm_connector *connector, scdc->scrambling.low_rates = true; } } + +drm_parse_ycbcr420_deep_color_info (connector, hf_vsdb); } static void drm_parse_hdmi_deep_color_info(struct drm_connector *connector,
include/drm/drm_connector.h +3 -0
@@ -148,6 +148,9 @@ struct drm_hdmi_info {/** @ycbcr420_vcb_map: bitmap of SVD index, to extraxt vcb modes */ u64 ycbcr420_vcb_map; + +/** @ycbcr420_dc_modes: bitmap of deep color support index */ +u8 ycbcr420_dc_modes; };/**
include/drm/drm_edid.h +5 -0
@@ -213,6 +213,11 @@ struct detailed_timing {#define DRM_EDID_HDMI_DC_30 (1 << 4)#define DRM_EDID_HDMI_DC_Y444 (1 << 3) +/* YCBCR 420 deep color modes */ +#define DRM_EDID_YCBCR420_DC_48 (1 << 6) +#define DRM_EDID_YCBCR420_DC_36 (1 << 5) +#define DRM_EDID_YCBCR420_DC_30 (1 << 4) +/* ELD Header Block */ #define DRM_ELD_HEADER_BLOCK_SIZE 4
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v2 04/11] drm: parse ycbcr 420 deep color information
Quoted 52 lines · Shashank Sharma
CEA-861-F spec adds ycbcr420 deep color support information in hf-vsdb block. This patch extends the existing hf-vsdb parsing function by adding parsing of ycbcr420 deep color support from the EDID and adding it into display information stored.
Cc Ville Syrjälä <[email protected]>Cc Jose Abreu <[email protected]>Signed-off-by Shashank Sharma <[email protected]>--- drivers/gpu/drm/drm_edid.c | 15 +++++++++++++++ include/drm/drm_connector.h | 3 +++ include/drm/drm_edid.h | 5 +++++ 3 files changed, 23 insertions(+)drivers/gpu/drm/drm_edid.c +15
-0@@ -4142,6 +4142,19 @@ drm_default_rgb_quant_range(const struct drm_display_mode *mode) }EXPORT_SYMBOL (drm_default_rgb_quant_range); +static void drm_parse_ycbcr420_deep_color_info (struct drm_connector *connector, +const u8 *db) +{ +struct drm_hdmi_info *info = &connector->display_info.hdmi; + +if (db[7 ] &DRM_EDID_YCBCR420_DC_48 ) + info->ycbcr420_dc_modes |=DRM_EDID_YCBCR420_DC_48 ; +if (db[7 ] &DRM_EDID_YCBCR420_DC_36 ) + info->ycbcr420_dc_modes |=DRM_EDID_YCBCR420_DC_36 ; +if (db[7 ] &DRM_EDID_YCBCR420_DC_30 ) + info->ycbcr420_dc_modes |=DRM_EDID_YCBCR420_DC_30 ; +} +static void drm_parse_hdmi_forum_vsdb (struct drm_connector *connector,const u8 *hf_vsdb) {@@ -4182,6 +4195,8 @@ static void drm_parse_hdmi_forum_vsdb(struct drm_connector *connector, scdc->scrambling.low_rates = true; } } + +drm_parse_ycbcr420_deep_color_info (connector, hf_vsdb); } static void drm_parse_hdmi_deep_color_info(struct drm_connector *connector,include/drm/drm_connector.h +0
-0
include/drm/drm_connector.h struct drm_hdmi_info { · line 153
Quoted 6 lines
include/drm/drm_connector.h +3
-0@@ -148,6 +148,9 @@ struct drm_hdmi_info {/** @ycbcr420_vcb_map: bitmap of SVD index, to extraxt vcb modes */ u64 ycbcr420_vcb_map; + +/** @ycbcr420_dc_modes: bitmap of deep color support index */ +u8 ycbcr420_dc_modes;
We seem to be wasting quite a few bits by reusing the EDID bit definition directly. Maybe we should consider packing these better? But I suppose we can look into that later.
Quoted 21 lines
include/drm/drm_connector.h +0
-0};/** include/drm/drm_edid.h +5
-0@@ -213,6 +213,11 @@ struct detailed_timing {#define DRM_EDID_HDMI_DC_30 (1 << 4)#define DRM_EDID_HDMI_DC_Y444 (1 << 3) +/* YCBCR 420 deep color modes */ +#define DRM_EDID_YCBCR420_DC_48 (1 << 6) +#define DRM_EDID_YCBCR420_DC_36 (1 << 5) +#define DRM_EDID_YCBCR420_DC_30 (1 << 4) +/* ELD Header Block */ #define DRM_ELD_HEADER_BLOCK_SIZE 4Signature · 1 line
2.7.4
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v2 5/11 drm: create hdmi output property
In reply to Shashank SharmaHDMI displays can support various output types, based on the color space and subsampling type. The possible outputs from a HDMI 2.0 monitor could be:
- RGB
- YCBCR 444
- YCBCR 422
- YCBCR 420
This patch adds a drm property, using which, a userspace can specify its preference, for the HDMI output type.
The output type enums are similar to the mentioned outputs above. To handle various subsampling of YCBCR output types, this property allows two special cases:
- DRM_HDMI_OUTPUT_YCBCR_HQ
This indicates preferred output should be YCBCR output, with highest subsampling rate by the source/sink, which can be typically:
- ycbcr444
- ycbcr422
- ycbcr420
- DRM_HDMI_OUTPUT_YCBCR_LQ
This indicates preferred output should be YCBCR output, with lowest subsampling rate supported by source/sink, which can be:
- ycbcr420
- ycbcr422
- ycbcr444
Default value of the property is set to 0 = RGB, so no changes if you dont set the property.
V2: Added description for the new variable to address build warning
--- drivers/gpu/drm/drm_atomic.c | 2 ++ drivers/gpu/drm/drm_atomic_helper.c | 4 ++++ drivers/gpu/drm/drm_connector.c | 32 ++++++++++++++++++++++++++++++++ include/drm/drm_connector.h | 18 ++++++++++++++++++ include/drm/drm_mode_config.h | 5 +++++ 5 files changed, 61 insertions(+)
drivers/gpu/drm/drm_atomic.c +2 -0
@@ -1192,6 +1192,8 @@ int drm_atomic_connector_set_property(struct drm_connector *connector, state->picture_aspect_ratio = val; }else if (property == connector->scaling_mode_property) { state->scaling_mode = val; + }else if (property == config->hdmi_output_property) { + state->hdmi_output = val; }else if (connector->funcs->atomic_set_property) {return connector->funcs->atomic_set_property (connector, state, property, val);
drivers/gpu/drm/drm_atomic_helper.c +4 -0
@@ -567,6 +567,10 @@ drm_atomic_helper_check_modeset(struct drm_device *dev,if (old_connector_state->link_status != new_connector_state->link_status) new_crtc_state->connectors_changed = true; + +if (old_connector_state->hdmi_output != + new_connector_state->hdmi_output) + new_crtc_state->connectors_changed = true; }if (funcs->atomic_check)
drivers/gpu/drm/drm_connector.c +32 -0
@@ -227,6 +227,11 @@ int drm_connector_init(struct drm_device *dev, config->edid_property, 0); +if (connector_type !=DRM_MODE_CONNECTOR_VIRTUAL ) +drm_object_attach_property (&connector->base, + config->hdmi_output_property, +0 ); +drm_object_attach_property (&connector->base, config->dpms_property,0 );
@@ -617,6 +622,26 @@ static const struct drm_prop_enum_list drm_link_status_enum_list[] = { }; DRM_ENUM_NAME_FN(drm_get_link_status_name, drm_link_status_enum_list) +static const struct drm_prop_enum_list drm_hdmi_output_enum_list[] = { + {DRM_HDMI_OUTPUT_DEFAULT_RGB ,"output_rgb" }, + {DRM_HDMI_OUTPUT_YCBCR444 ,"output_ycbcr444" }, + {DRM_HDMI_OUTPUT_YCBCR422 ,"output_ycbcr422" }, + {DRM_HDMI_OUTPUT_YCBCR420 ,"output_ycbcr420" }, + {DRM_HDMI_OUTPUT_YCBCR_HQ ,"output_ycbcr_high_subsampling" }, + {DRM_HDMI_OUTPUT_YCBCR_LQ ,"output_ycbcr_low_subsampling" }, + {DRM_HDMI_OUTPUT_INVALID ,"invalid_output" }, +}; + +/** +* drm_get_hdmi_output_name - return a string for a given hdmi output enum +* @type: enum of output type +*/ +const char *drm_get_hdmi_output_name (enum drm_hdmi_output_type type) +{ +return drm_hdmi_output_enum_list[type].name; +} +EXPORT_SYMBOL (drm_get_hdmi_output_name); +/** * drm_display_info_set_bus_formats - set the supported bus formats * @info: display info to store bus formats in
@@ -789,6 +814,13 @@ int drm_connector_create_standard_properties(struct drm_device *dev)return -ENOMEM ; dev->mode_config.link_status_property = prop; + prop =drm_property_create_enum (dev,0 ,"hdmi_output_format" , + drm_hdmi_output_enum_list, +ARRAY_SIZE (drm_hdmi_output_enum_list)); +if (!prop) +return -ENOMEM ; + dev->mode_config.hdmi_output_property = prop; +return 0 ; }
include/drm/drm_connector.h +18 -0
@@ -313,6 +313,17 @@ struct drm_tv_connector_state {unsigned int hue; }; +/* HDMI output pixel format */ +enum drm_hdmi_output_type { +DRM_HDMI_OUTPUT_DEFAULT_RGB ,/* default RGB */ +DRM_HDMI_OUTPUT_YCBCR444 ,/* YCBCR 444 */ +DRM_HDMI_OUTPUT_YCBCR422 ,/* YCBCR 422 */ +DRM_HDMI_OUTPUT_YCBCR420 ,/* YCBCR 420 */ +DRM_HDMI_OUTPUT_YCBCR_HQ ,/* Highest subsampled YUV */ +DRM_HDMI_OUTPUT_YCBCR_LQ ,/* Lowest subsampled YUV */ +DRM_HDMI_OUTPUT_INVALID ,/* Guess what ? */ +}; +/** * struct drm_connector_state - mutable connector state * @connector: backpointer to the connector
@@ -357,6 +368,12 @@ struct drm_connector_state {* upscaling, mostly used for built-in panels. */ unsigned int scaling_mode; + +/** +* @hdmi_output: Connector property to control the +* HDMI output mode (RGB/YCBCR444/422/420). +*/ +enum drm_hdmi_output_type hdmi_output; };/**
@@ -976,6 +993,7 @@ static inline void drm_connector_unreference(struct drm_connector *connector)const char *drm_get_connector_status_name (enum drm_connector_status status);const char *drm_get_subpixel_order_name (enum subpixel_order order); +const char *drm_get_hdmi_output_name (enum drm_hdmi_output_type type);const char *drm_get_dpms_name (int val);const char *drm_get_dvi_i_subconnector_name (int val);const char *drm_get_dvi_i_select_name (int val);
include/drm/drm_mode_config.h +5 -0
@@ -740,6 +740,11 @@ struct drm_mode_config {* the position of the output on the host's screen. */ struct drm_property *suggested_y_property; +/** +* @hdmi_output_property: output pixel format from HDMI display +* Default is set for RGB +*/ +struct drm_property *hdmi_output_property;/* dumb ioctl parameters */ uint32_t preferred_depth, prefer_shadow;
Signature · 6 lines
2.7.4 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v2 05/11] drm: create hdmi output property
Quoted 9 lines · Shashank Sharma
HDMI displays can support various output types, based on the color space and subsampling type. The possible outputs from a HDMI 2.0 monitor could be:
- RGB
- YCBCR 444
- YCBCR 422
- YCBCR 420This patch adds a drm property, using which, a userspace
I think we should add the 4:2:0 only mode support first since that doesn't require new uapi. The uapi stuff probably needs more careful thought as we might want to consider exposing more of the colorimetry stuff supported by the HDMI infoframes, and DP MSA MISC and VSC SDP.
Quoted 180 lines
can specify its preference, for the HDMI output type.
The output type enums are similar to the mentioned outputs above. To handle various subsampling of YCBCR output types, this property allows two special cases:
-DRM_HDMI_OUTPUT_YCBCR_HQ
This indicates preferred output should be YCBCR output, with highest subsampling rate by the source/sink, which can be typically:
- ycbcr444
- ycbcr422
- ycbcr420
-DRM_HDMI_OUTPUT_YCBCR_LQ
This indicates preferred output should be YCBCR output, with lowest subsampling rate supported by source/sink, which can be:
- ycbcr420
- ycbcr422
- ycbcr444Default value of the property is set to 0 = RGB, so no changes if you dont set the property.
V2: Added description for the new variable to address build warning
Cc Ville Syrjala <[email protected]>Cc Jose Abreu <[email protected]>Cc Daniel Vetter <[email protected]>Signed-off-by Shashank Sharma <[email protected]>--- drivers/gpu/drm/drm_atomic.c | 2 ++ drivers/gpu/drm/drm_atomic_helper.c | 4 ++++ drivers/gpu/drm/drm_connector.c | 32 ++++++++++++++++++++++++++++++++ include/drm/drm_connector.h | 18 ++++++++++++++++++ include/drm/drm_mode_config.h | 5 +++++ 5 files changed, 61 insertions(+)drivers/gpu/drm/drm_atomic.c +2
-0@@ -1192,6 +1192,8 @@ int drm_atomic_connector_set_property(struct drm_connector *connector, state->picture_aspect_ratio = val; }else if (property == connector->scaling_mode_property) { state->scaling_mode = val; + }else if (property == config->hdmi_output_property) { + state->hdmi_output = val; }else if (connector->funcs->atomic_set_property) {return connector->funcs->atomic_set_property (connector, state, property, val);drivers/gpu/drm/drm_atomic_helper.c +4
-0@@ -567,6 +567,10 @@ drm_atomic_helper_check_modeset(struct drm_device *dev,if (old_connector_state->link_status != new_connector_state->link_status) new_crtc_state->connectors_changed = true; + +if (old_connector_state->hdmi_output != + new_connector_state->hdmi_output) + new_crtc_state->connectors_changed = true; }if (funcs->atomic_check)drivers/gpu/drm/drm_connector.c +32
-0@@ -227,6 +227,11 @@ int drm_connector_init(struct drm_device *dev, config->edid_property, 0); +if (connector_type !=DRM_MODE_CONNECTOR_VIRTUAL ) +drm_object_attach_property (&connector->base, + config->hdmi_output_property, +0 ); +drm_object_attach_property (&connector->base, config->dpms_property,0 );@@ -617,6 +622,26 @@ static const struct drm_prop_enum_list drm_link_status_enum_list[] = { }; DRM_ENUM_NAME_FN(drm_get_link_status_name, drm_link_status_enum_list) +static const struct drm_prop_enum_list drm_hdmi_output_enum_list[] = { + {DRM_HDMI_OUTPUT_DEFAULT_RGB ,"output_rgb" }, + {DRM_HDMI_OUTPUT_YCBCR444 ,"output_ycbcr444" }, + {DRM_HDMI_OUTPUT_YCBCR422 ,"output_ycbcr422" }, + {DRM_HDMI_OUTPUT_YCBCR420 ,"output_ycbcr420" }, + {DRM_HDMI_OUTPUT_YCBCR_HQ ,"output_ycbcr_high_subsampling" }, + {DRM_HDMI_OUTPUT_YCBCR_LQ ,"output_ycbcr_low_subsampling" }, + {DRM_HDMI_OUTPUT_INVALID ,"invalid_output" }, +}; + +/** +* drm_get_hdmi_output_name - return a string for a given hdmi output enum +* @type: enum of output type +*/ +const char *drm_get_hdmi_output_name (enum drm_hdmi_output_type type) +{ +return drm_hdmi_output_enum_list[type].name; +} +EXPORT_SYMBOL (drm_get_hdmi_output_name); +/** * drm_display_info_set_bus_formats - set the supported bus formats * @info: display info to store bus formats in @@ -789,6 +814,13 @@ int drm_connector_create_standard_properties(struct drm_device *dev)return -ENOMEM ; dev->mode_config.link_status_property = prop; + prop =drm_property_create_enum (dev,0 ,"hdmi_output_format" , + drm_hdmi_output_enum_list, +ARRAY_SIZE (drm_hdmi_output_enum_list)); +if (!prop) +return -ENOMEM ; + dev->mode_config.hdmi_output_property = prop; +return 0 ; }include/drm/drm_connector.h +18
-0@@ -313,6 +313,17 @@ struct drm_tv_connector_state {unsigned int hue; }; +/* HDMI output pixel format */ +enum drm_hdmi_output_type { +DRM_HDMI_OUTPUT_DEFAULT_RGB ,/* default RGB */ +DRM_HDMI_OUTPUT_YCBCR444 ,/* YCBCR 444 */ +DRM_HDMI_OUTPUT_YCBCR422 ,/* YCBCR 422 */ +DRM_HDMI_OUTPUT_YCBCR420 ,/* YCBCR 420 */ +DRM_HDMI_OUTPUT_YCBCR_HQ ,/* Highest subsampled YUV */ +DRM_HDMI_OUTPUT_YCBCR_LQ ,/* Lowest subsampled YUV */ +DRM_HDMI_OUTPUT_INVALID ,/* Guess what ? */ +}; +/** * struct drm_connector_state - mutable connector state * @connector: backpointer to the connector @@ -357,6 +368,12 @@ struct drm_connector_state {* upscaling, mostly used for built-in panels. */ unsigned int scaling_mode; + +/** +* @hdmi_output: Connector property to control the +* HDMI output mode (RGB/YCBCR444/422/420). +*/ +enum drm_hdmi_output_type hdmi_output; };/** @@ -976,6 +993,7 @@ static inline void drm_connector_unreference(struct drm_connector *connector)const char *drm_get_connector_status_name (enum drm_connector_status status);const char *drm_get_subpixel_order_name (enum subpixel_order order); +const char *drm_get_hdmi_output_name (enum drm_hdmi_output_type type);const char *drm_get_dpms_name (int val);const char *drm_get_dvi_i_subconnector_name (int val);const char *drm_get_dvi_i_select_name (int val);include/drm/drm_mode_config.h +5
-0@@ -740,6 +740,11 @@ struct drm_mode_config {* the position of the output on the host's screen. */ struct drm_property *suggested_y_property; +/** +* @hdmi_output_property: output pixel format from HDMI display +* Default is set for RGB +*/ +struct drm_property *hdmi_output_property;/* dumb ioctl parameters */ uint32_t preferred_depth, prefer_shadow;Signature · 1 line
2.7.4
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v2 05/11] drm: create hdmi output property
Regards
Shashank
Quoted 9 lines · Ville Syrjälä
Quoted 8 lines · Shashank Sharma
HDMI displays can support various output types, based on the color space and subsampling type. The possible outputs from a HDMI 2.0 monitor could be:
- RGB
- YCBCR 444
- YCBCR 422
- YCBCR 420
Quoted 6 lines
Quoted 1 line
This patch adds a drm property, using which, a userspace
I think we should add the 4:2:0 only mode support first since that doesn't require new uapi. The uapi stuff probably needs more careful thought as we might want to consider exposing more of the colorimetry stuff supported by the HDMI infoframes, and DP MSA MISC and VSC SDP.
I was coming from the opposite school of thought. I was thinking 420_only modes should be handled carefully, whereas 420_also doesnt need any uapi (This patch series contains 420_also and doesnt modify the UAPI) due to following reasons:
assume there is a mode 3840x2160@60 appears to be in 2 different EDIDs, in first EDID as a 420_only mode and in other as 420_also mode.
- If we add a 420_also mode in the mode_list, userspace might pick it for the modeset as favorite, as most of the 420 modes are 4k modes.
- Now, if userspace doesn't set the hdmi_output property to YCBCR420, and sends a modeset on this mode:
- the modeset will be successful in case of a 420_also mode, as it
can be supported in RGB/YUV444 also.
- the modeset will fail in case of 420_only mode, as this mode
cant be supported in any other hdmi output format.
In this case, addition of 420_only mode, in the connectors->modes list should be done, only when the driver is ready to handle the YCBCR420 output, or we have to inform userspace about these modes which need the hdmi_ouput property to be set with the modeset, which might in turn need an uabi.
Does it make a case ?
- Shashank
Quoted 176 lines
Quoted 176 lines
can specify its preference, for the HDMI output type.
The output type enums are similar to the mentioned outputs above. To handle various subsampling of YCBCR output types, this property allows two special cases:
-DRM_HDMI_OUTPUT_YCBCR_HQ
This indicates preferred output should be YCBCR output, with highest subsampling rate by the source/sink, which can be typically:
- ycbcr444
- ycbcr422
- ycbcr420
-DRM_HDMI_OUTPUT_YCBCR_LQ
This indicates preferred output should be YCBCR output, with lowest subsampling rate supported by source/sink, which can be:
- ycbcr420
- ycbcr422
- ycbcr444Default value of the property is set to 0 = RGB, so no changes if you dont set the property.
V2: Added description for the new variable to address build warning
Cc Ville Syrjala <[email protected]>Cc Jose Abreu <[email protected]>Cc Daniel Vetter <[email protected]>Signed-off-by Shashank Sharma <[email protected]>--- drivers/gpu/drm/drm_atomic.c | 2 ++ drivers/gpu/drm/drm_atomic_helper.c | 4 ++++ drivers/gpu/drm/drm_connector.c | 32 ++++++++++++++++++++++++++++++++ include/drm/drm_connector.h | 18 ++++++++++++++++++ include/drm/drm_mode_config.h | 5 +++++ 5 files changed, 61 insertions(+)drivers/gpu/drm/drm_atomic.c +2
-0@@ -1192,6 +1192,8 @@ int drm_atomic_connector_set_property(struct drm_connector *connector, state->picture_aspect_ratio = val; }else if (property == connector->scaling_mode_property) { state->scaling_mode = val; + }else if (property == config->hdmi_output_property) { + state->hdmi_output = val; }else if (connector->funcs->atomic_set_property) {return connector->funcs->atomic_set_property (connector, state, property, val);drivers/gpu/drm/drm_atomic_helper.c +4
-0@@ -567,6 +567,10 @@ drm_atomic_helper_check_modeset(struct drm_device *dev,if (old_connector_state->link_status != new_connector_state->link_status) new_crtc_state->connectors_changed = true; + +if (old_connector_state->hdmi_output != + new_connector_state->hdmi_output) + new_crtc_state->connectors_changed = true; }if (funcs->atomic_check)drivers/gpu/drm/drm_connector.c +32
-0@@ -227,6 +227,11 @@ int drm_connector_init(struct drm_device *dev, config->edid_property, 0); +if (connector_type !=DRM_MODE_CONNECTOR_VIRTUAL ) +drm_object_attach_property (&connector->base, + config->hdmi_output_property, +0 ); +drm_object_attach_property (&connector->base, config->dpms_property,0 );@@ -617,6 +622,26 @@ static const struct drm_prop_enum_list drm_link_status_enum_list[] = { }; DRM_ENUM_NAME_FN(drm_get_link_status_name, drm_link_status_enum_list) +static const struct drm_prop_enum_list drm_hdmi_output_enum_list[] = { + {DRM_HDMI_OUTPUT_DEFAULT_RGB ,"output_rgb" }, + {DRM_HDMI_OUTPUT_YCBCR444 ,"output_ycbcr444" }, + {DRM_HDMI_OUTPUT_YCBCR422 ,"output_ycbcr422" }, + {DRM_HDMI_OUTPUT_YCBCR420 ,"output_ycbcr420" }, + {DRM_HDMI_OUTPUT_YCBCR_HQ ,"output_ycbcr_high_subsampling" }, + {DRM_HDMI_OUTPUT_YCBCR_LQ ,"output_ycbcr_low_subsampling" }, + {DRM_HDMI_OUTPUT_INVALID ,"invalid_output" }, +}; + +/** +* drm_get_hdmi_output_name - return a string for a given hdmi output enum +* @type: enum of output type +*/ +const char *drm_get_hdmi_output_name (enum drm_hdmi_output_type type) +{ +return drm_hdmi_output_enum_list[type].name; +} +EXPORT_SYMBOL (drm_get_hdmi_output_name); +/** * drm_display_info_set_bus_formats - set the supported bus formats * @info: display info to store bus formats in @@ -789,6 +814,13 @@ int drm_connector_create_standard_properties(struct drm_device *dev)return -ENOMEM ; dev->mode_config.link_status_property = prop; + prop =drm_property_create_enum (dev,0 ,"hdmi_output_format" , + drm_hdmi_output_enum_list, +ARRAY_SIZE (drm_hdmi_output_enum_list)); +if (!prop) +return -ENOMEM ; + dev->mode_config.hdmi_output_property = prop; +return 0 ; }include/drm/drm_connector.h +18
-0@@ -313,6 +313,17 @@ struct drm_tv_connector_state {unsigned int hue; }; +/* HDMI output pixel format */ +enum drm_hdmi_output_type { +DRM_HDMI_OUTPUT_DEFAULT_RGB ,/* default RGB */ +DRM_HDMI_OUTPUT_YCBCR444 ,/* YCBCR 444 */ +DRM_HDMI_OUTPUT_YCBCR422 ,/* YCBCR 422 */ +DRM_HDMI_OUTPUT_YCBCR420 ,/* YCBCR 420 */ +DRM_HDMI_OUTPUT_YCBCR_HQ ,/* Highest subsampled YUV */ +DRM_HDMI_OUTPUT_YCBCR_LQ ,/* Lowest subsampled YUV */ +DRM_HDMI_OUTPUT_INVALID ,/* Guess what ? */ +}; +/** * struct drm_connector_state - mutable connector state * @connector: backpointer to the connector @@ -357,6 +368,12 @@ struct drm_connector_state {* upscaling, mostly used for built-in panels. */ unsigned int scaling_mode; + +/** +* @hdmi_output: Connector property to control the +* HDMI output mode (RGB/YCBCR444/422/420). +*/ +enum drm_hdmi_output_type hdmi_output; };/** @@ -976,6 +993,7 @@ static inline void drm_connector_unreference(struct drm_connector *connector)const char *drm_get_connector_status_name (enum drm_connector_status status);const char *drm_get_subpixel_order_name (enum subpixel_order order); +const char *drm_get_hdmi_output_name (enum drm_hdmi_output_type type);const char *drm_get_dpms_name (int val);const char *drm_get_dvi_i_subconnector_name (int val);const char *drm_get_dvi_i_select_name (int val);include/drm/drm_mode_config.h +5
-0@@ -740,6 +740,11 @@ struct drm_mode_config {* the position of the output on the host's screen. */ struct drm_property *suggested_y_property; +/** +* @hdmi_output_property: output pixel format from HDMI display +* Default is set for RGB +*/ +struct drm_property *hdmi_output_property;
Quoted 4 lines
Quoted 4 lines
include/drm/drm_mode_config.h +0
-0/* dumb ioctl parameters */ uint32_t preferred_depth, prefer_shadow;Signature · 1 line
2.7.4
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v2 05/11] drm: create hdmi output property
Quoted 40 lines · Shashank
Regards
Shashank
Quoted 9 lines · Ville Syrjälä
Quoted 8 lines · Shashank Sharma
HDMI displays can support various output types, based on the color space and subsampling type. The possible outputs from a HDMI 2.0 monitor could be:
- RGB
- YCBCR 444
- YCBCR 422
- YCBCR 420Quoted 6 lines
Quoted 1 line
This patch adds a drm property, using which, a userspace
I think we should add the 4:2:0 only mode support first since that doesn't require new uapi. The uapi stuff probably needs more careful thought as we might want to consider exposing more of the colorimetry stuff supported by the HDMI infoframes, and DP MSA MISC and VSC SDP.
I was coming from the opposite school of thought. I was thinking 420_only modes should
be handled carefully, whereas 420_also doesnt need any uapi (This patch series contains
420_also and doesnt modify the UAPI) due to following reasons:assume there is a mode 3840x2160@60 appears to be in 2 different EDIDs, in first EDID as a 420_only mode
and in other as 420_also mode.
- If we add a 420_also mode in themode_list, userspace might pick it for the modeset as favorite, as most of the
420 modes are 4k modes.
- Now, if userspace doesn't set thehdmi_outputproperty to YCBCR420, and sends a modeset on this mode:
- the modeset will be successful in case of a 420_also mode, as it
can be supported in RGB/YUV444 also.
- the modeset will fail in case of 420_only mode, as this mode
cant be supported in any other hdmi output format.
Quoted 7 lines
In this case, addition of 420_only mode, in the
connectors->modeslist should be done, only when the driver is ready to
handle the YCBCR420 output, or we have to inform userspace about these modes which need thehdmi_ouputproperty to
be set with the modeset, which might in turn need an uabi.Does it make a case ?
What I think we want is to automagically enable 4:2:0 output if userspace picks a 4:2:0 only mode, regardless of the property value. And in fact this way we don't even need the property to enable the use of 4:2:0 only modes. Which is great because it means current userspace can start to use those modes without any code changes.
Quoted 181 lines
- Shashank
Quoted 180 lines
Quoted 180 lines
can specify its preference, for the HDMI output type.
The output type enums are similar to the mentioned outputs above. To handle various subsampling of YCBCR output types, this property allows two special cases:
-DRM_HDMI_OUTPUT_YCBCR_HQ
This indicates preferred output should be YCBCR output, with highest subsampling rate by the source/sink, which can be typically:
- ycbcr444
- ycbcr422
- ycbcr420
-DRM_HDMI_OUTPUT_YCBCR_LQ
This indicates preferred output should be YCBCR output, with lowest subsampling rate supported by source/sink, which can be:
- ycbcr420
- ycbcr422
- ycbcr444Default value of the property is set to 0 = RGB, so no changes if you dont set the property.
V2: Added description for the new variable to address build warning
Cc Ville Syrjala <[email protected]>Cc Jose Abreu <[email protected]>Cc Daniel Vetter <[email protected]>Signed-off-by Shashank Sharma <[email protected]>--- drivers/gpu/drm/drm_atomic.c | 2 ++ drivers/gpu/drm/drm_atomic_helper.c | 4 ++++ drivers/gpu/drm/drm_connector.c | 32 ++++++++++++++++++++++++++++++++ include/drm/drm_connector.h | 18 ++++++++++++++++++ include/drm/drm_mode_config.h | 5 +++++ 5 files changed, 61 insertions(+)drivers/gpu/drm/drm_atomic.c +2
-0@@ -1192,6 +1192,8 @@ int drm_atomic_connector_set_property(struct drm_connector *connector, state->picture_aspect_ratio = val; }else if (property == connector->scaling_mode_property) { state->scaling_mode = val; + }else if (property == config->hdmi_output_property) { + state->hdmi_output = val; }else if (connector->funcs->atomic_set_property) {return connector->funcs->atomic_set_property (connector, state, property, val);drivers/gpu/drm/drm_atomic_helper.c +4
-0@@ -567,6 +567,10 @@ drm_atomic_helper_check_modeset(struct drm_device *dev,if (old_connector_state->link_status != new_connector_state->link_status) new_crtc_state->connectors_changed = true; + +if (old_connector_state->hdmi_output != + new_connector_state->hdmi_output) + new_crtc_state->connectors_changed = true; }if (funcs->atomic_check)drivers/gpu/drm/drm_connector.c +32
-0@@ -227,6 +227,11 @@ int drm_connector_init(struct drm_device *dev, config->edid_property, 0); +if (connector_type !=DRM_MODE_CONNECTOR_VIRTUAL ) +drm_object_attach_property (&connector->base, + config->hdmi_output_property, +0 ); +drm_object_attach_property (&connector->base, config->dpms_property,0 );@@ -617,6 +622,26 @@ static const struct drm_prop_enum_list drm_link_status_enum_list[] = { }; DRM_ENUM_NAME_FN(drm_get_link_status_name, drm_link_status_enum_list) +static const struct drm_prop_enum_list drm_hdmi_output_enum_list[] = { + {DRM_HDMI_OUTPUT_DEFAULT_RGB ,"output_rgb" }, + {DRM_HDMI_OUTPUT_YCBCR444 ,"output_ycbcr444" }, + {DRM_HDMI_OUTPUT_YCBCR422 ,"output_ycbcr422" }, + {DRM_HDMI_OUTPUT_YCBCR420 ,"output_ycbcr420" }, + {DRM_HDMI_OUTPUT_YCBCR_HQ ,"output_ycbcr_high_subsampling" }, + {DRM_HDMI_OUTPUT_YCBCR_LQ ,"output_ycbcr_low_subsampling" }, + {DRM_HDMI_OUTPUT_INVALID ,"invalid_output" }, +}; + +/** +* drm_get_hdmi_output_name - return a string for a given hdmi output enum +* @type: enum of output type +*/ +const char *drm_get_hdmi_output_name (enum drm_hdmi_output_type type) +{ +return drm_hdmi_output_enum_list[type].name; +} +EXPORT_SYMBOL (drm_get_hdmi_output_name); +/** * drm_display_info_set_bus_formats - set the supported bus formats * @info: display info to store bus formats in @@ -789,6 +814,13 @@ int drm_connector_create_standard_properties(struct drm_device *dev)return -ENOMEM ; dev->mode_config.link_status_property = prop; + prop =drm_property_create_enum (dev,0 ,"hdmi_output_format" , + drm_hdmi_output_enum_list, +ARRAY_SIZE (drm_hdmi_output_enum_list)); +if (!prop) +return -ENOMEM ; + dev->mode_config.hdmi_output_property = prop; +return 0 ; }include/drm/drm_connector.h +18
-0@@ -313,6 +313,17 @@ struct drm_tv_connector_state {unsigned int hue; }; +/* HDMI output pixel format */ +enum drm_hdmi_output_type { +DRM_HDMI_OUTPUT_DEFAULT_RGB ,/* default RGB */ +DRM_HDMI_OUTPUT_YCBCR444 ,/* YCBCR 444 */ +DRM_HDMI_OUTPUT_YCBCR422 ,/* YCBCR 422 */ +DRM_HDMI_OUTPUT_YCBCR420 ,/* YCBCR 420 */ +DRM_HDMI_OUTPUT_YCBCR_HQ ,/* Highest subsampled YUV */ +DRM_HDMI_OUTPUT_YCBCR_LQ ,/* Lowest subsampled YUV */ +DRM_HDMI_OUTPUT_INVALID ,/* Guess what ? */ +}; +/** * struct drm_connector_state - mutable connector state * @connector: backpointer to the connector @@ -357,6 +368,12 @@ struct drm_connector_state {* upscaling, mostly used for built-in panels. */ unsigned int scaling_mode; + +/** +* @hdmi_output: Connector property to control the +* HDMI output mode (RGB/YCBCR444/422/420). +*/ +enum drm_hdmi_output_type hdmi_output; };/** @@ -976,6 +993,7 @@ static inline void drm_connector_unreference(struct drm_connector *connector)const char *drm_get_connector_status_name (enum drm_connector_status status);const char *drm_get_subpixel_order_name (enum subpixel_order order); +const char *drm_get_hdmi_output_name (enum drm_hdmi_output_type type);const char *drm_get_dpms_name (int val);const char *drm_get_dvi_i_subconnector_name (int val);const char *drm_get_dvi_i_select_name (int val);include/drm/drm_mode_config.h +5
-0@@ -740,6 +740,11 @@ struct drm_mode_config {* the position of the output on the host's screen. */ struct drm_property *suggested_y_property; +/** +* @hdmi_output_property: output pixel format from HDMI display +* Default is set for RGB +*/ +struct drm_property *hdmi_output_property;/* dumb ioctl parameters */ uint32_t preferred_depth, prefer_shadow;Signature · 1 line
2.7.4
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v2 05/11] drm: create hdmi output property
Regards
Shashank
Quoted 47 lines · Ville Syrjälä
Quoted 46 lines · Shashank
Regards
Shashank
Quoted 9 lines · Ville Syrjälä
Quoted 8 lines · Shashank Sharma
HDMI displays can support various output types, based on the color space and subsampling type. The possible outputs from a HDMI 2.0 monitor could be:
- RGB
- YCBCR 444
- YCBCR 422
- YCBCR 420Quoted 6 lines
Quoted 1 line
This patch adds a drm property, using which, a userspace
I think we should add the 4:2:0 only mode support first since that doesn't require new uapi. The uapi stuff probably needs more careful thought as we might want to consider exposing more of the colorimetry stuff supported by the HDMI infoframes, and DP MSA MISC and VSC SDP.
I was coming from the opposite school of thought. I was thinking 420_only modes should
be handled carefully, whereas 420_also doesnt need any uapi (This patch series contains
420_also and doesnt modify the UAPI) due to following reasons:assume there is a mode 3840x2160@60 appears to be in 2 different EDIDs, in first EDID as a 420_only mode
and in other as 420_also mode.
- If we add a 420_also mode in themode_list, userspace might pick it for the modeset as favorite, as most of the
420 modes are 4k modes.
- Now, if userspace doesn't set thehdmi_outputproperty to YCBCR420, and sends a modeset on this mode:
- the modeset will be successful in case of a 420_also mode, as it
can be supported in RGB/YUV444 also.
- the modeset will fail in case of 420_only mode, as this mode
cant be supported in any other hdmi output format.In this case, addition of 420_only mode, in the
connectors->modeslist should be done, only when the driver is ready to
handle the YCBCR420 output, or we have to inform userspace about these modes which need thehdmi_ouputproperty to
be set with the modeset, which might in turn need an uabi.
Quoted 6 lines
Quoted 1 line
Does it make a case ?
What I think we want is to automagically enable 4:2:0 output if userspace picks a 4:2:0 only mode, regardless of the property value. And in fact this way we don't even need the property to enable the use of 4:2:0 only modes. Which is great because it means current userspace can start to use those modes without any code changes.
I was worried about this sitution:
- There is one 420_only mode (38x21@60) in EDID
- We added a 420_only mode in the list, which userspace can see (but cant differentiate between non-420 or 420 mode)
- Userspace triggers a modeset on this, but the driver doesn't support YCBCR420 output yet, as source doesn't support it yet.
In this case, we will cause modeset failure for each driver which doesnt support HDMI 2.0.
So if we have to make a 420_only mode visible to userspace, we have to indicate somehow that its 420_only mode. Do you think so ?
- Shashank
Quoted 177 lines
Quoted 177 lines
- Shashank
Quoted 176 lines
Quoted 176 lines
can specify its preference, for the HDMI output type.
The output type enums are similar to the mentioned outputs above. To handle various subsampling of YCBCR output types, this property allows two special cases:
-DRM_HDMI_OUTPUT_YCBCR_HQ
This indicates preferred output should be YCBCR output, with highest subsampling rate by the source/sink, which can be typically:
- ycbcr444
- ycbcr422
- ycbcr420
-DRM_HDMI_OUTPUT_YCBCR_LQ
This indicates preferred output should be YCBCR output, with lowest subsampling rate supported by source/sink, which can be:
- ycbcr420
- ycbcr422
- ycbcr444Default value of the property is set to 0 = RGB, so no changes if you dont set the property.
V2: Added description for the new variable to address build warning
Cc Ville Syrjala <[email protected]>Cc Jose Abreu <[email protected]>Cc Daniel Vetter <[email protected]>Signed-off-by Shashank Sharma <[email protected]>--- drivers/gpu/drm/drm_atomic.c | 2 ++ drivers/gpu/drm/drm_atomic_helper.c | 4 ++++ drivers/gpu/drm/drm_connector.c | 32 ++++++++++++++++++++++++++++++++ include/drm/drm_connector.h | 18 ++++++++++++++++++ include/drm/drm_mode_config.h | 5 +++++ 5 files changed, 61 insertions(+)drivers/gpu/drm/drm_atomic.c +2
-0@@ -1192,6 +1192,8 @@ int drm_atomic_connector_set_property(struct drm_connector *connector, state->picture_aspect_ratio = val; }else if (property == connector->scaling_mode_property) { state->scaling_mode = val; + }else if (property == config->hdmi_output_property) { + state->hdmi_output = val; }else if (connector->funcs->atomic_set_property) {return connector->funcs->atomic_set_property (connector, state, property, val);drivers/gpu/drm/drm_atomic_helper.c +4
-0@@ -567,6 +567,10 @@ drm_atomic_helper_check_modeset(struct drm_device *dev,if (old_connector_state->link_status != new_connector_state->link_status) new_crtc_state->connectors_changed = true; + +if (old_connector_state->hdmi_output != + new_connector_state->hdmi_output) + new_crtc_state->connectors_changed = true; }if (funcs->atomic_check)drivers/gpu/drm/drm_connector.c +32
-0@@ -227,6 +227,11 @@ int drm_connector_init(struct drm_device *dev, config->edid_property, 0); +if (connector_type !=DRM_MODE_CONNECTOR_VIRTUAL ) +drm_object_attach_property (&connector->base, + config->hdmi_output_property, +0 ); +drm_object_attach_property (&connector->base, config->dpms_property,0 );@@ -617,6 +622,26 @@ static const struct drm_prop_enum_list drm_link_status_enum_list[] = { }; DRM_ENUM_NAME_FN(drm_get_link_status_name, drm_link_status_enum_list) +static const struct drm_prop_enum_list drm_hdmi_output_enum_list[] = { + {DRM_HDMI_OUTPUT_DEFAULT_RGB ,"output_rgb" }, + {DRM_HDMI_OUTPUT_YCBCR444 ,"output_ycbcr444" }, + {DRM_HDMI_OUTPUT_YCBCR422 ,"output_ycbcr422" }, + {DRM_HDMI_OUTPUT_YCBCR420 ,"output_ycbcr420" }, + {DRM_HDMI_OUTPUT_YCBCR_HQ ,"output_ycbcr_high_subsampling" }, + {DRM_HDMI_OUTPUT_YCBCR_LQ ,"output_ycbcr_low_subsampling" }, + {DRM_HDMI_OUTPUT_INVALID ,"invalid_output" }, +}; + +/** +* drm_get_hdmi_output_name - return a string for a given hdmi output enum +* @type: enum of output type +*/ +const char *drm_get_hdmi_output_name (enum drm_hdmi_output_type type) +{ +return drm_hdmi_output_enum_list[type].name; +} +EXPORT_SYMBOL (drm_get_hdmi_output_name); +/** * drm_display_info_set_bus_formats - set the supported bus formats * @info: display info to store bus formats in @@ -789,6 +814,13 @@ int drm_connector_create_standard_properties(struct drm_device *dev)return -ENOMEM ; dev->mode_config.link_status_property = prop; + prop =drm_property_create_enum (dev,0 ,"hdmi_output_format" , + drm_hdmi_output_enum_list, +ARRAY_SIZE (drm_hdmi_output_enum_list)); +if (!prop) +return -ENOMEM ; + dev->mode_config.hdmi_output_property = prop; +return 0 ; }include/drm/drm_connector.h +18
-0@@ -313,6 +313,17 @@ struct drm_tv_connector_state {unsigned int hue; }; +/* HDMI output pixel format */ +enum drm_hdmi_output_type { +DRM_HDMI_OUTPUT_DEFAULT_RGB ,/* default RGB */ +DRM_HDMI_OUTPUT_YCBCR444 ,/* YCBCR 444 */ +DRM_HDMI_OUTPUT_YCBCR422 ,/* YCBCR 422 */ +DRM_HDMI_OUTPUT_YCBCR420 ,/* YCBCR 420 */ +DRM_HDMI_OUTPUT_YCBCR_HQ ,/* Highest subsampled YUV */ +DRM_HDMI_OUTPUT_YCBCR_LQ ,/* Lowest subsampled YUV */ +DRM_HDMI_OUTPUT_INVALID ,/* Guess what ? */ +}; +/** * struct drm_connector_state - mutable connector state * @connector: backpointer to the connector @@ -357,6 +368,12 @@ struct drm_connector_state {* upscaling, mostly used for built-in panels. */ unsigned int scaling_mode; + +/** +* @hdmi_output: Connector property to control the +* HDMI output mode (RGB/YCBCR444/422/420). +*/ +enum drm_hdmi_output_type hdmi_output; };/** @@ -976,6 +993,7 @@ static inline void drm_connector_unreference(struct drm_connector *connector)const char *drm_get_connector_status_name (enum drm_connector_status status);const char *drm_get_subpixel_order_name (enum subpixel_order order); +const char *drm_get_hdmi_output_name (enum drm_hdmi_output_type type);const char *drm_get_dpms_name (int val);const char *drm_get_dvi_i_subconnector_name (int val);const char *drm_get_dvi_i_select_name (int val);include/drm/drm_mode_config.h +5
-0@@ -740,6 +740,11 @@ struct drm_mode_config {* the position of the output on the host's screen. */ struct drm_property *suggested_y_property; +/** +* @hdmi_output_property: output pixel format from HDMI display +* Default is set for RGB +*/ +struct drm_property *hdmi_output_property;
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
include/drm/drm_mode_config.h +0
-0/* dumb ioctl parameters */ uint32_t preferred_depth, prefer_shadow;Signature · 1 line
2.7.4
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v2 6/11 drm: set output colorspace in AVI infoframe
In reply to Shashank SharmaHDMI source must set output colorspace information in AVI infoframes, so that the sink can decode upcoming frames accordingly.
As this patch series is adding support for HDMI output modes other than RGB, this patch adds a function in DRM layer, to add the output colorspace information in the AVI infoframes.
V2: Rebase
--- drivers/gpu/drm/drm_edid.c | 40 ++++++++++++++++++++++++++++++++++++++++ include/drm/drm_edid.h | 5 +++++ 2 files changed, 45 insertions(+)
drivers/gpu/drm/drm_edid.c +40 -0
@@ -4728,6 +4728,46 @@ drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame,EXPORT_SYMBOL (drm_hdmi_avi_infoframe_from_display_mode);/** +* drm_hdmi_avi_infoframe_set_colorspace() - fill an HDMI AVI infoframe with +* colorspace data of the output type +* +* @frame: HDMI AVI infoframe +* @mode: DRM display mode +* @hdmi_output: HDMI output colorspace +* +* Return: 0 on success or a negative error code on failure. +*/ +int +drm_hdmi_avi_infoframe_set_colorspace (struct hdmi_avi_infoframe *frame, +const struct drm_display_mode *mode, +enum drm_hdmi_output_type hdmi_output) +{ +switch (hdmi_output) { +case DRM_HDMI_OUTPUT_YCBCR444 : + frame->colorspace =HDMI_COLORSPACE_YUV444 ; +break ; +case DRM_HDMI_OUTPUT_YCBCR422 : + frame->colorspace =HDMI_COLORSPACE_YUV422 ; +break ; +case DRM_HDMI_OUTPUT_YCBCR420 : + frame->colorspace =HDMI_COLORSPACE_YUV420 ; + frame->pixel_repeat =0 ; +break ; +case DRM_HDMI_OUTPUT_DEFAULT_RGB : + frame->colorspace =HDMI_COLORSPACE_RGB ; +break ; +case DRM_HDMI_OUTPUT_YCBCR_HQ : +case DRM_HDMI_OUTPUT_YCBCR_LQ : +case DRM_HDMI_OUTPUT_INVALID : +DRM_ERROR ("Invalid HDMI output type\n" ); +return -EINVAL ; + } + +return 0 ; +} +EXPORT_SYMBOL (drm_hdmi_avi_infoframe_set_colorspace); + +/** * drm_hdmi_avi_infoframe_quant_range() - fill the HDMI AVI infoframe * quantization range information * @frame: HDMI AVI infoframe
include/drm/drm_edid.h +5 -0
@@ -329,6 +329,7 @@ struct cea_sad {struct drm_encoder ;struct drm_connector ;struct drm_display_mode ; +enum drm_hdmi_output_type ;void drm_edid_to_eld (struct drm_connector *connector,struct edid *edid);int drm_edid_to_sad (struct edid *edid,struct cea_sad **sads);
@@ -351,6 +352,10 @@ drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame,const struct drm_display_mode *mode, bool is_hdmi2);int +drm_hdmi_avi_infoframe_set_colorspace (struct hdmi_avi_infoframe *frame, +const struct drm_display_mode *mode, +enum drm_hdmi_output_type hdmi_output); +int drm_hdmi_vendor_infoframe_from_display_mode (struct hdmi_vendor_infoframe *frame,const struct drm_display_mode *mode);void
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v2 7/11 drm: add ycbcr helper functions
In reply to Shashank SharmaThis patch adds helper functions for ycbcr HDMI output handling. These functions provide functionality like:
- getting the highest subsamled ycbcr output
- getting the lowest subsamled ycbcr output
- check if a given source and sink combination can support any YCBCR output
- check if a given source and sink combination can support a particular YCBCR output
- check if a give mode can be driven in YCBCR420 subsampling.
These functions will be used in next few patches in this series from I915 driver.
V2: Added YCBCR functions as helpers in DRM layer, instead of
keeping it in I915 layer
--- drivers/gpu/drm/drm_edid.c | 2 +- drivers/gpu/drm/drm_modes.c | 177 ++++++++++++++++++++++++++++++++++++++++++++ include/drm/drm_edid.h | 1 + include/drm/drm_modes.h | 16 ++++ 4 files changed, 195 insertions(+), 1 deletion(-)
drivers/gpu/drm/drm_edid.c +1 -1
@@ -2949,7 +2949,7 @@ u8 drm_match_cea_mode(const struct drm_display_mode *to_match) }EXPORT_SYMBOL (drm_match_cea_mode); -static bool drm_valid_cea_vic (u8 vic) +bool drm_valid_cea_vic (u8 vic) {return vic >0 && vic <ARRAY_SIZE (edid_cea_modes); }
drivers/gpu/drm/drm_modes.c +177 -0
180 lines not on this page · raw message
include/drm/drm_edid.h +1 -0
@@ -468,6 +468,7 @@ int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid);u8 drm_match_cea_mode (const struct drm_display_mode *to_match);enum hdmi_picture_aspect drm_get_cea_aspect_ratio (const u8 video_code); +bool drm_valid_cea_vic (u8 vic);bool drm_detect_hdmi_monitor (struct edid *edid);bool drm_detect_monitor_audio (struct edid *edid);bool drm_rgb_quant_range_selectable (struct edid *edid);
include/drm/drm_modes.h +16 -0
@@ -433,6 +433,22 @@ int drm_mode_convert_umode(struct drm_display_mode *out, const struct drm_mode_modeinfo *in);void drm_mode_probed_add (struct drm_connector *connector,struct drm_display_mode *mode);void drm_mode_debug_printmodeline (const struct drm_display_mode *mode); +bool drm_mode_is_420 (struct drm_display_info *display, +struct drm_display_mode *mode); +bool drm_can_support_this_ycbcr_output (struct drm_display_info *display, +struct drm_display_mode *mode, +enum drm_hdmi_output_type type, +u32 source_outputs); +bool drm_can_support_any_ycbcr_output (struct drm_display_info *display, +u32 source_outputs); +enum drm_hdmi_output_type +drm_get_highest_quality_ycbcr_supported (struct drm_display_info *display, +struct drm_display_mode *mode, +u32 source_output_map); +enum drm_hdmi_output_type +drm_get_lowest_quality_ycbcr_supported (struct drm_display_info *display, +struct drm_display_mode *mode, +u32 source_output_map); struct drm_display_mode *drm_cvt_mode(struct drm_device *dev, int hdisplay, int vdisplay, int vrefresh,
Signature · 6 lines
2.7.4 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
kbuild test robot
build botRe: [PATCH v2 07/11] drm: add ycbcr helper functions
All warnings (new ones prefixed by >>):
Hi Shashank,
[auto build test WARNING on drm/drm-next]
[also build test WARNING on next-20170530]
[cannot apply to v4.12-rc3]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Shashank-Sharma/HDMI-YCBCR-output-handling-in-DRM-layer/20170531-045411 base: git://people.freedesktop.org/~airlied/linux.git drm-next reproduce: make htmldocs
All warnings (new ones prefixed by >>):
WARNING: convert(1) not found, for SVG to PDF conversion install ImageMagick (https://www.imagemagick.org)
arch/x86/include/asm/uaccess_32.h:1: warning: no structured comments found
include/linux/init.h:1: warning: no structured comments found
include/linux/mod_devicetable.h:686: warning: Excess struct/union/enum/typedef member 'ver_major' description in 'fsl_mc_device_id' include/linux/mod_devicetable.h:686: warning: Excess struct/union/enum/typedef member 'ver_minor' description in 'fsl_mc_device_id' kernel/sched/core.c:2088: warning: No description found for parameter 'rf'
kernel/sched/core.c:2088: warning: Excess function parameter 'cookie' description in 'try_to_wake_up_local' include/linux/kthread.h:26: warning: Excess function parameter '...' description in 'kthread_create' kernel/sys.c:1: warning: no structured comments found
include/linux/device.h:969: warning: No description found for parameter 'dma_ops' drivers/dma-buf/seqno-fence.c:1: warning: no structured comments found
include/linux/iio/iio.h:597: warning: No description found for parameter 'trig_readonly' include/linux/iio/trigger.h:151: warning: No description found for parameter 'indio_dev' include/linux/iio/trigger.h:151: warning: No description found for parameter 'trig' include/linux/device.h:970: warning: No description found for parameter 'dma_ops' include/linux/usb/gadget.h:230: warning: No description found for parameter 'claimed' include/linux/usb/gadget.h:230: warning: No description found for parameter 'enabled' include/linux/usb/gadget.h:408: warning: No description found for parameter 'quirk_altset_not_supp' include/linux/usb/gadget.h:408: warning: No description found for parameter 'quirk_stall_not_supp' include/linux/usb/gadget.h:408: warning: No description found for parameter 'quirk_zlp_not_supp' include/drm/drm_drv.h:507: warning: No description found for parameter 'set_busid'
include/drm/drm_drv.h:507: warning: No description found for parameter 'irq_handler' include/drm/drm_drv.h:507: warning: No description found for parameter 'irq_preinstall' include/drm/drm_drv.h:507: warning: No description found for parameter 'irq_postinstall' include/drm/drm_drv.h:507: warning: No description found for parameter 'irq_uninstall' include/drm/drm_drv.h:507: warning: No description found for parameter 'debugfs_init' include/drm/drm_drv.h:507: warning: No description found for parameter 'gem_open_object' include/drm/drm_drv.h:507: warning: No description found for parameter 'gem_close_object' include/drm/drm_drv.h:507: warning: No description found for parameter 'prime_handle_to_fd' include/drm/drm_drv.h:507: warning: No description found for parameter 'prime_fd_to_handle' include/drm/drm_drv.h:507: warning: No description found for parameter 'gem_prime_export' include/drm/drm_drv.h:507: warning: No description found for parameter 'gem_prime_import' include/drm/drm_drv.h:507: warning: No description found for parameter 'gem_prime_pin' include/drm/drm_drv.h:507: warning: No description found for parameter 'gem_prime_unpin' include/drm/drm_drv.h:507: warning: No description found for parameter 'gem_prime_res_obj' include/drm/drm_drv.h:507: warning: No description found for parameter 'gem_prime_get_sg_table' include/drm/drm_drv.h:507: warning: No description found for parameter 'gem_prime_import_sg_table' include/drm/drm_drv.h:507: warning: No description found for parameter 'gem_prime_vmap' include/drm/drm_drv.h:507: warning: No description found for parameter 'gem_prime_vunmap' include/drm/drm_drv.h:507: warning: No description found for parameter 'gem_prime_mmap' include/drm/drm_drv.h:507: warning: No description found for parameter 'gem_vm_ops' include/drm/drm_drv.h:507: warning: No description found for parameter 'major'
include/drm/drm_drv.h:507: warning: No description found for parameter 'minor'
include/drm/drm_drv.h:507: warning: No description found for parameter 'patchlevel' include/drm/drm_drv.h:507: warning: No description found for parameter 'name'
include/drm/drm_drv.h:507: warning: No description found for parameter 'desc'
include/drm/drm_drv.h:507: warning: No description found for parameter 'date'
include/drm/drm_drv.h:507: warning: No description found for parameter 'driver_features' include/drm/drm_drv.h:507: warning: No description found for parameter 'ioctls'
include/drm/drm_drv.h:507: warning: No description found for parameter 'num_ioctls' include/drm/drm_drv.h:507: warning: No description found for parameter 'fops'
>> drivers/gpu/drm/drm_modes.c:1594: warning: No description found for parameter 'display' >> drivers/gpu/drm/drm_modes.c:1594: warning: Excess function parameter 'connector' description in 'drm_mode_is_420'
include/drm/drm_color_mgmt.h:1: warning: no structured comments found
Documentation/core-api/assoc_array.rst:13: WARNING: Enumerated list ends without a blank line; unexpected unindent. Documentation/doc-guide/sphinx.rst:126: ERROR: Unknown target name: "sphinx c domain".
kernel/sched/fair.c:7650: WARNING: Inline emphasis start-string without end-string.
kernel/time/timer.c:1200: ERROR: Unexpected indentation.
kernel/time/timer.c:1202: ERROR: Unexpected indentation.
kernel/time/timer.c:1203: WARNING: Block quote ends without a blank line; unexpected unindent.
include/linux/wait.h:122: WARNING: Block quote ends without a blank line; unexpected unindent.
include/linux/wait.h:125: ERROR: Unexpected indentation.
include/linux/wait.h:127: WARNING: Block quote ends without a blank line; unexpected unindent.
kernel/time/hrtimer.c:990: WARNING: Block quote ends without a blank line; unexpected unindent.
kernel/signal.c:322: WARNING: Inline literal start-string without end-string.
include/linux/iio/iio.h:219: ERROR: Unexpected indentation.
include/linux/iio/iio.h:220: WARNING: Block quote ends without a blank line; unexpected unindent.
include/linux/iio/iio.h:226: WARNING: Definition list ends without a blank line; unexpected unindent. drivers/iio/industrialio-core.c:638: ERROR: Unknown target name: "iio_val".
drivers/iio/industrialio-core.c:645: ERROR: Unknown target name: "iio_val".
drivers/message/fusion/mptbase.c:5051: WARNING: Definition list ends without a blank line; unexpected unindent. drivers/tty/serial/serial_core.c:1898: WARNING: Definition list ends without a blank line; unexpected unindent. drivers/pci/pci.c:3457: ERROR: Unexpected indentation.
include/linux/regulator/driver.h:271: ERROR: Unknown target name: "regulator_regmap_x_voltage".
include/linux/spi/spi.h:370: ERROR: Unexpected indentation.
drivers/gpu/drm/drm_scdc_helper.c:203: ERROR: Unexpected indentation.
drivers/gpu/drm/drm_scdc_helper.c:204: WARNING: Block quote ends without a blank line; unexpected unindent. drivers/gpu/drm/drm_ioctl.c:690: WARNING: Definition list ends without a blank line; unexpected unindent. Documentation/gpu/todo.rst:111: ERROR: Unknown target name: "drm_fb".
sound/soc/soc-core.c:2670: ERROR: Unknown target name: "snd_soc_daifmt".
sound/core/jack.c:312: ERROR: Unknown target name: "snd_jack_btn".
Documentation/userspace-api/unshare.rst:108: WARNING: Inline emphasis start-string without end-string. Documentation/usb/typec.rst:: WARNING: document isn't included in any toctree
Documentation/usb/usb3-debug-port.rst:: WARNING: document isn't included in any toctree
Fontconfig warning: "/home/kbuild/.config/fontconfig/fonts.conf", line 43: Having multiple values in <test> isn't supported and may not work as expected Fontconfig warning: "/home/kbuild/.config/fontconfig/fonts.conf", line 56: Having multiple values in <test> isn't supported and may not work as expected Fontconfig warning: "/home/kbuild/.config/fontconfig/fonts.conf", line 69: Having multiple values in <test> isn't supported and may not work as expected Fontconfig warning: "/home/kbuild/.config/fontconfig/fonts.conf", line 82: Having multiple values in <test> isn't supported and may not work as expected Fontconfig warning: "/home/kbuild/.config/fontconfig/fonts.conf", line 96: Having multiple values in <test> isn't supported and may not work as expected Fontconfig warning: "/home/kbuild/.config/fontconfig/fonts.conf", line 109: Having multiple values in <test> isn't supported and may not work as expected Fontconfig warning: "/home/kbuild/.config/fontconfig/fonts.conf", line 122: Having multiple values in <test> isn't supported and may not work as expected Fontconfig warning: "/home/kbuild/.config/fontconfig/fonts.conf", line 133: Having multiple values in <test> isn't supported and may not work as expected Fontconfig warning: "/home/kbuild/.config/fontconfig/fonts.conf", line 164: Having multiple values in <test> isn't supported and may not work as expected Fontconfig warning: "/home/kbuild/.config/fontconfig/fonts.conf", line 193: Having multiple values in <test> isn't supported and may not work as expected Fontconfig warning: "~/.fonts.conf", line 43: Having multiple values in <test> isn't supported and may not work as expected Fontconfig warning: "~/.fonts.conf", line 56: Having multiple values in <test> isn't supported and may not work as expected Fontconfig warning: "~/.fonts.conf", line 69: Having multiple values in <test> isn't supported and may not work as expected Fontconfig warning: "~/.fonts.conf", line 82: Having multiple values in <test> isn't supported and may not work as expected Fontconfig warning: "~/.fonts.conf", line 96: Having multiple values in <test> isn't supported and may not work as expected Fontconfig warning: "~/.fonts.conf", line 109: Having multiple values in <test> isn't supported and may not work as expected Fontconfig warning: "~/.fonts.conf", line 122: Having multiple values in <test> isn't supported and may not work as expected Fontconfig warning: "~/.fonts.conf", line 133: Having multiple values in <test> isn't supported and may not work as expected Fontconfig warning: "~/.fonts.conf", line 164: Having multiple values in <test> isn't supported and may not work as expected Fontconfig warning: "~/.fonts.conf", line 193: Having multiple values in <test> isn't supported and may not work as expected Fontconfig warning: "/home/kbuild/.config/fontconfig/fonts.conf", line 43: Having multiple values in <test> isn't supported and may not work as expected Fontconfig warning: "/home/kbuild/.config/fontconfig/fonts.conf", line 56: Having multiple values in <test> isn't supported and may not work as expected Fontconfig warning: "/home/kbuild/.config/fontconfig/fonts.conf", line 69: Having multiple values in <test> isn't supported and may not work as expected Fontconfig warning: "/home/kbuild/.config/fontconfig/fonts.conf", line 82: Having multiple values in <test> isn't supported and may not work as expected Fontconfig warning: "/home/kbuild/.config/fontconfig/fonts.conf", line 96: Having multiple values in <test> isn't supported and may not work as expected Fontconfig warning: "/home/kbuild/.config/fontconfig/fonts.conf", line 109: Having multiple values in <test> isn't supported and may not work as expected Fontconfig warning: "/home/kbuild/.config/fontconfig/fonts.conf", line 122: Having multiple values in <test> isn't supported and may not work as expected Fontconfig warning: "/home/kbuild/.config/fontconfig/fonts.conf", line 133: Having multiple values in <test> isn't supported and may not work as expected Fontconfig warning: "/home/kbuild/.config/fontconfig/fonts.conf", line 164: Having multiple values in <test> isn't supported and may not work as expected Fontconfig warning: "/home/kbuild/.config/fontconfig/fonts.conf", line 193: Having multiple values in <test> isn't supported and may not work as expected Fontconfig warning: "~/.fonts.conf", line 43: Having multiple values in <test> isn't supported and may not work as expected Fontconfig warning: "~/.fonts.conf", line 56: Having multiple values in <test> isn't supported and may not work as expected Fontconfig warning: "~/.fonts.conf", line 69: Having multiple values in <test> isn't supported and may not work as expected Fontconfig warning: "~/.fonts.conf", line 82: Having multiple values in <test> isn't supported and may not work as expected Fontconfig warning: "~/.fonts.conf", line 96: Having multiple values in <test> isn't supported and may not work as expected Fontconfig warning: "~/.fonts.conf", line 109: Having multiple values in <test> isn't supported and may not work as expected Fontconfig warning: "~/.fonts.conf", line 122: Having multiple values in <test> isn't supported and may not work as expected Fontconfig warning: "~/.fonts.conf", line 133: Having multiple values in <test> isn't supported and may not work as expected Fontconfig warning: "~/.fonts.conf", line 164: Having multiple values in <test> isn't supported and may not work as expected Fontconfig warning: "~/.fonts.conf", line 193: Having multiple values in <test> isn't supported and may not work as expected Fontconfig warning: "/home/kbuild/.config/fontconfig/fonts.conf", line 43: Having multiple values in <test> isn't supported and may not work as expected Fontconfig warning: "/home/kbuild/.config/fontconfig/fonts.conf", line 56: Having multiple values in <test> isn't supported and may not work as expected Fontconfig warning: "/home/kbuild/.config/fontconfig/fonts.conf", line 69: Having multiple values in <test> isn't supported and may not work as expected Fontconfig warning: "/home/kbuild/.config/fontconfig/fonts.conf", line 82: Having multiple values in <test> isn't supported and may not work as expected Fontconfig warning: "/home/kbuild/.config/fontconfig/fonts.conf", line 96: Having multiple values in <test> isn't supported and may not work as expected Fontconfig warning: "/home/kbuild/.config/fontconfig/fonts.conf", line 109: Having multiple values in <test> isn't supported and may not work as expected Fontconfig warning: "/home/kbuild/.config/fontconfig/fonts.conf", line 122: Having multiple values in <test> isn't supported and may not work as expected Fontconfig warning: "/home/kbuild/.config/fontconfig/fonts.conf", line 133: Having multiple values in <test> isn't supported and may not work as expected Fontconfig warning: "/home/kbuild/.config/fontconfig/fonts.conf", line 164: Having multiple values in <test> isn't supported and may not work as expected Fontconfig warning: "/home/kbuild/.config/fontconfig/fonts.conf", line 193: Having multiple values in <test> isn't supported and may not work as expected Fontconfig warning: "~/.fonts.conf", line 43: Having multiple values in <test> isn't supported and may not work as expected Fontconfig warning: "~/.fonts.conf", line 56: Having multiple values in <test> isn't supported and may not work as expected Fontconfig warning: "~/.fonts.conf", line 69: Having multiple values in <test> isn't supported and may not work as expected Fontconfig warning: "~/.fonts.conf", line 82: Having multiple values in <test> isn't supported and may not work as expected Fontconfig warning: "~/.fonts.conf", line 96: Having multiple values in <test> isn't supported and may not work as expected Fontconfig warning: "~/.fonts.conf", line 109: Having multiple values in <test> isn't supported and may not work as expected Fontconfig warning: "~/.fonts.conf", line 122: Having multiple values in <test> isn't supported and may not work as expected Fontconfig warning: "~/.fonts.conf", line 133: Having multiple values in <test> isn't supported and may not work as expected Fontconfig warning: "~/.fonts.conf", line 164: Having multiple values in <test> isn't supported and may not work as expected Fontconfig warning: "~/.fonts.conf", line 193: Having multiple values in <test> isn't supported and may not work as expected Fontconfig warning: "/home/kbuild/.config/fontconfig/fonts.conf", line 43: Having multiple values in <test> isn't supported and may not work as expected Fontconfig warning: "/home/kbuild/.config/fontconfig/fonts.conf", line 56: Having multiple values in <test> isn't supported and may not work as expected Fontconfig warning: "/home/kbuild/.config/fontconfig/fonts.conf", line 69: Having multiple values in <test> isn't supported and may not work as expected Fontconfig warning: "/home/kbuild/.config/fontconfig/fonts.conf", line 82: Having multiple values in <test> isn't supported and may not work as expected Fontconfig warning: "/home/kbuild/.config/fontconfig/fonts.conf", line 96: Having multiple values in <test> isn't supported and may not work as expected Fontconfig warning: "/home/kbuild/.config/fontconfig/fonts.conf", line 109: Having multiple values in <test> isn't supported and may not work as expected Fontconfig warning: "/home/kbuild/.config/fontconfig/fonts.conf", line 122: Having multiple values in <test> isn't supported and may not work as expected Fontconfig warning: "/home/kbuild/.config/fontconfig/fonts.conf", line 133: Having multiple values in <test> isn't supported and may not work as expected Fontconfig warning: "/home/kbuild/.config/fontconfig/fonts.conf", line 164: Having multiple values in <test> isn't supported and may not work as expected
vim +/display +1594 drivers/gpu/drm/drm_modes.c
1578 }
1579
1580 /**
1581 * drm_mode_is_420 - if a given videomode can be supported in YCBCR420
1582 * output format also
1583 *
1584 * @connector: drm connector under action.
1585 * @mode: video mode to be tested.
1586 *
1587 * Returns:
1588 * true if the mode can support YCBCR420 output
1589 * false if not.
1590 */
1591 bool drm_mode_is_420(struct drm_display_info *display,
1592 struct drm_display_mode *mode)
1593 {
> 1594 u8 vic = drm_match_cea_mode(mode);
1595 u32 *vcb_map;
1596 u8 index;
1597
1598 if (!drm_valid_cea_vic(vic))
1599 return false;
1600 /*
1601 * ycbcr420_vcb_modes is a fix position 128 bit bitmap. This indicates
1602 * support for ycbcr420 output per VIC. Arrangement is bit[n] indicates
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
_______________________________________________
dri-devel mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v2 8/11 drm/i915: handle ycbcr outputs
In reply to Shashank SharmaThis patch adds support for HDMI ycbcr outputs in i915 layer. HDMI output mode is a connector property, this patch checks if source and sink can support the HDMI output type selected by user. And if they both can, it commits the hdmi output type into crtc state, for further staging in driver.
V2: Split the patch into two, kept helper functions in DRM layer
--- drivers/gpu/drm/i915/intel_display.c | 1 + drivers/gpu/drm/i915/intel_drv.h | 3 + drivers/gpu/drm/i915/intel_hdmi.c | 125 ++++++++++++++++++++++++++++++++++- 3 files changed, 126 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/intel_display.c +1 -0
@@ -11888,6 +11888,7 @@ intel_pipe_config_compare(struct drm_i915_private *dev_priv,PIPE_CONF_CHECK_I (hdmi_scrambling);PIPE_CONF_CHECK_I (hdmi_high_tmds_clock_ratio);PIPE_CONF_CHECK_I (has_infoframe); +PIPE_CONF_CHECK_I (hdmi_output);PIPE_CONF_CHECK_I (has_audio);
drivers/gpu/drm/i915/intel_drv.h +3 -0
@@ -771,6 +771,9 @@ struct intel_crtc_state {/* HDMI High TMDS char rate ratio */ bool hdmi_high_tmds_clock_ratio; + +/* HDMI output type */ +enum drm_hdmi_output_type hdmi_output; };struct intel_crtc {
drivers/gpu/drm/i915/intel_hdmi.c +122 -3
167 lines not on this page · raw message
Signature · 6 lines
2.7.4 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
kbuild test robot
build botRe: [PATCH v2 08/11] drm/i915: handle ycbcr outputs
reproduce:
Hi Shashank,
[auto build test ERROR on drm/drm-next]
[also build test ERROR on next-20170530]
[cannot apply to v4.12-rc3]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Shashank-Sharma/HDMI-YCBCR-output-handling-in-DRM-layer/20170531-045411 base: git://people.freedesktop.org/~airlied/linux.git drm-next config: x86_64-rhel (attached as .config) compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901 reproduce: # save the attached .config to linux build tree make ARCH=x86_64
All errors (new ones prefixed by >>):
>> ERROR: "drm_get_highest_quality_ycbcr_supported" [drivers/gpu/drm/i915/i915.ko] undefined! >> ERROR: "drm_get_lowest_quality_ycbcr_supported" [drivers/gpu/drm/i915/i915.ko] undefined! >> ERROR: "drm_can_support_this_ycbcr_output" [drivers/gpu/drm/i915/i915.ko] undefined! >> ERROR: "drm_can_support_any_ycbcr_output" [drivers/gpu/drm/i915/i915.ko] undefined!
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
_______________________________________________
dri-devel mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v2 9/11 drm/i915: handle csc for ycbcr HDMI output
In reply to Shashank SharmaTo support ycbcr HDMI output, we need a pipe CSC block to do the RGB->YCBCR conversion, as the blender output is in RGB.
Current Intel platforms have only one pipe CSC unit, so we can either do color correction using it, or we can perform RGB->YCBCR conversion.
This function adds a csc handler, to perform RGB->YCBCR conversion as per recommended spec values.
V2: Rebase
--- drivers/gpu/drm/i915/intel_color.c | 47 +++++++++++++++++++++++++++++++++++- drivers/gpu/drm/i915/intel_display.c | 32 ++++++++++++++++++++++++ 2 files changed, 78 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_color.c +46 -1
@@ -41,6 +41,19 @@#define LEGACY_LUT_LENGTH (sizeof(struct drm_color_lut) * 256) +/* Post offset values for RGB->YCBCR conversion */ +#define POSTOFF_RGB_TO_YUV_HI 0x800 +#define POSTOFF_RGB_TO_YUV_ME 0x100 +#define POSTOFF_RGB_TO_YUV_LO 0x800 + +/* Direct spec values for RGB->YUV conversion matrix */ +#define CSC_RGB_TO_YUV_RU_GU 0x2ba809d8 +#define CSC_RGB_TO_YUV_BU 0x37e80000 +#define CSC_RGB_TO_YUV_RY_GY 0x1e089cc0 +#define CSC_RGB_TO_YUV_BY 0xb5280000 +#define CSC_RGB_TO_YUV_RV_GV 0xbce89ad8 +#define CSC_RGB_TO_YUV_BV 0x1e080000 +/* * Extract the CSC coefficient from a CTM coefficient (in U32.32 fixed point * format). This macro takes the coefficient we want transformed and the
@@ -91,6 +104,35 @@ static void ctm_mult_by_limited(uint64_t *result, int64_t *input) } } +void i9xx_load_ycbcr_conversion_matrix (struct intel_crtc *intel_crtc) +{ +int pipe = intel_crtc->pipe; +struct drm_i915_private *dev_priv =to_i915 (intel_crtc->base.dev); + +/* We don't use high values for conversion */ +I915_WRITE (PIPE_CSC_PREOFF_HI (pipe),0 ); +I915_WRITE (PIPE_CSC_PREOFF_ME (pipe),0 ); +I915_WRITE (PIPE_CSC_PREOFF_LO (pipe),0 ); + +/* Program direct spec values for RGB to YCBCR conversion matrix */ +I915_WRITE (PIPE_CSC_COEFF_RU_GU (pipe),CSC_RGB_TO_YUV_RU_GU ); +I915_WRITE (PIPE_CSC_COEFF_BU (pipe),CSC_RGB_TO_YUV_BU ); + +I915_WRITE (PIPE_CSC_COEFF_RY_GY (pipe),CSC_RGB_TO_YUV_RY_GY ); +I915_WRITE (PIPE_CSC_COEFF_BY (pipe),CSC_RGB_TO_YUV_BY ); + +I915_WRITE (PIPE_CSC_COEFF_RV_GV (pipe),CSC_RGB_TO_YUV_RV_GV ); +I915_WRITE (PIPE_CSC_COEFF_BV (pipe),CSC_RGB_TO_YUV_BV ); + +/* Spec postoffset values */ +I915_WRITE (PIPE_CSC_POSTOFF_HI (pipe),POSTOFF_RGB_TO_YUV_HI ); +I915_WRITE (PIPE_CSC_POSTOFF_ME (pipe),POSTOFF_RGB_TO_YUV_ME ); +I915_WRITE (PIPE_CSC_POSTOFF_LO (pipe),POSTOFF_RGB_TO_YUV_LO ); + +/* CSC mode before gamma */ +I915_WRITE (PIPE_CSC_MODE (pipe),0 ); +} +/* Set up the pipe CSC unit. */ static void i9xx_load_csc_matrix (struct drm_crtc_state *crtc_state) {
@@ -101,7 +143,10 @@ static void i9xx_load_csc_matrix(struct drm_crtc_state *crtc_state)uint16_t coeffs[9 ] = {0 , };struct intel_crtc_state *intel_crtc_state =to_intel_crtc_state (crtc_state); -if (crtc_state->ctm) { +if (intel_crtc_state->hdmi_output >DRM_HDMI_OUTPUT_DEFAULT_RGB ) { +i9xx_load_ycbcr_conversion_matrix (intel_crtc); +return ; + }else if (crtc_state->ctm) {struct drm_color_ctm *ctm = (struct drm_color_ctm *)crtc_state->ctm->data;uint64_t input[9 ] = {0 , };
drivers/gpu/drm/i915/intel_display.c +32 -0
@@ -6224,6 +6224,29 @@ static void intel_crtc_compute_pixel_rate(struct intel_crtc_state *crtc_state)ilk_pipe_pixel_rate (crtc_state); } +static int intel_crtc_ycbcr_config (struct intel_crtc_state *state) +{ +struct drm_crtc_state *drm_state = &state->base; +struct drm_i915_private *dev_priv =to_i915 (drm_state->crtc->dev); + +/* YCBCR420 is supported only in HDMI 2.0 controllers */ +if ((state->hdmi_output ==DRM_HDMI_OUTPUT_YCBCR420 ) && + !IS_GEMINILAKE (dev_priv)) { +DRM_ERROR ("YCBCR420 output is not supported\n" ); +return -EINVAL ; + } + +/* We need CSC for output conversion from RGB->YCBCR */ +if (drm_state->ctm) { +DRM_ERROR ("YCBCR output and CTM is not possible together\n" ); +return -EINVAL ; + } + +DRM_DEBUG_DRIVER ("Output %s can be supported\n" , +drm_get_hdmi_output_name (state->hdmi_output)); +return 0 ; +} +static int intel_crtc_compute_config (struct intel_crtc *crtc,struct intel_crtc_state *pipe_config) {
@@ -6253,6 +6276,14 @@ static int intel_crtc_compute_config(struct intel_crtc *crtc,return -EINVAL ; } +/* YCBCR output check */ +if (pipe_config->hdmi_output >DRM_HDMI_OUTPUT_DEFAULT_RGB ) { +if (intel_crtc_ycbcr_config (pipe_config)) { +DRM_ERROR ("Cant enable HDMI YCBCR output\n" ); +return -EINVAL ; + } + } +/* * Pipe horizontal size must be even in: * - DVO ganged mode
@@ -11581,6 +11612,7 @@ intel_modeset_pipe_config(struct drm_crtc *crtc,DRM_DEBUG_KMS ("Encoder config failure\n" ); goto fail; } + }/* Set default port clock if not overwritten by the encoder. Needs to be
Signature · 6 lines
2.7.4 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v2 10/11 drm/i915: prepare ycbcr420 modeset
In reply to Shashank SharmaTo get a ycbcr420 output from intel platforms, there are two major steps:
- RGB->YCBCR conversion using a pipe CSC.
- Program PIPE_MISC register to generate a ycbcr420 output.
- Scaling down YCBCR444 samples to YCBCR420 samples using a pipe scaler.
This patch:
- Does scaler allocation for HDMI ycbcr420 outputs.
- Programs PIPE_MISC register for ycbcr420 output.
- Adds a new scaler user "HDMI output" to plug-into existing scaler framework. This output type is identified using bit 30 of the scaler users bitmap.
--- drivers/gpu/drm/i915/i915_reg.h | 3 +++ drivers/gpu/drm/i915/intel_atomic.c | 6 ++++++ drivers/gpu/drm/i915/intel_display.c | 34 ++++++++++++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_drv.h | 10 +++++++++- drivers/gpu/drm/i915/intel_hdmi.c | 11 +++++++++++ drivers/gpu/drm/i915/intel_panel.c | 3 ++- 6 files changed, 65 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/i915_reg.h +3 -0
@@ -5026,6 +5026,9 @@ enum {#define _PIPE_MISC_A 0x70030#define _PIPE_MISC_B 0x71030 +#define PIPEMISC_YCBCR420_ENABLE (1<<27) +#define PIPEMISC_YCBCR420_MODE_BLEND (1<<26) +#define PIPEMISC_OUTPUT_YCBCR (1<<11)#define PIPEMISC_DITHER_BPC_MASK (7<<5)#define PIPEMISC_DITHER_8_BPC (0<<5)#define PIPEMISC_DITHER_10_BPC (1<<5)
drivers/gpu/drm/i915/intel_atomic.c +6 -0
@@ -187,6 +187,12 @@ int intel_atomic_setup_scalers(struct drm_i915_private *dev_priv,/* panel fitter case: assign as a crtc scaler */ scaler_id = &scaler_state->scaler_id; + }else if (i ==SKL_HDMI_OUTPUT_INDEX ) { + name ="HDMI-OUTPUT" ; + idx = intel_crtc->base.base.id; + +/* hdmi output case: needs a pipe scaler */ + scaler_id = &scaler_state->scaler_id; }else { name ="PLANE" ;
drivers/gpu/drm/i915/intel_display.c +34 -0
@@ -4623,6 +4623,11 @@ skl_update_scaler(struct intel_crtc_state *crtc_state, bool force_detach, (src_h != dst_w || src_w != dst_h): (src_w != dst_w || src_h != dst_h); +if (crtc_state->hdmi_output ==DRM_HDMI_OUTPUT_YCBCR420 + && scaler_user ==SKL_HDMI_OUTPUT_INDEX ) +/* YCBCR 444 -> 420 conversion needs a scaler */ + need_scaling = true; +/* * if plane is being disabled or scaler is no more required or force detach * - free scaler binded to this plane/crtc
@@ -4670,6 +4675,26 @@ skl_update_scaler(struct intel_crtc_state *crtc_state, bool force_detach, }/** +* skl_update_scaler_hdmi_output - Stages update to scaler state for HDMI. +* HDMI YCBCR 420 output needs a scaler, for downsampling. +* +* @state: crtc's scaler state +* +* Return +* 0 - scaler_usage updated successfully +* error - requested scaling cannot be supported or other error condition +*/ +int skl_update_scaler_crtc_hdmi_output (struct intel_crtc_state *state) +{ +const struct drm_display_mode *mode = &state->base.adjusted_mode; + +return skl_update_scaler (state, !state->base.active, +SKL_HDMI_OUTPUT_INDEX , &state->scaler_state.scaler_id, +DRM_MODE_ROTATE_0 , state->pipe_src_w, state->pipe_src_h, + mode->crtc_hdisplay, mode->crtc_vdisplay); +} + +/** * skl_update_scaler_crtc - Stages update to scaler state for a given crtc. * * @state: crtc's scaler state
@@ -8071,6 +8096,7 @@ static void haswell_set_pipemisc(struct drm_crtc *crtc) {struct drm_i915_private *dev_priv =to_i915 (crtc->dev);struct intel_crtc *intel_crtc =to_intel_crtc (crtc); +enum drm_hdmi_output_type hdmi_out = intel_crtc->config->hdmi_output;if (IS_BROADWELL (dev_priv) ||INTEL_INFO (dev_priv)->gen >=9 ) {u32 val =0 ;
@@ -8096,6 +8122,14 @@ static void haswell_set_pipemisc(struct drm_crtc *crtc)if (intel_crtc->config->dither) val |=PIPEMISC_DITHER_ENABLE |PIPEMISC_DITHER_TYPE_SP ; +if (hdmi_out) { + val |=PIPEMISC_OUTPUT_YCBCR ; +if (hdmi_out ==DRM_HDMI_OUTPUT_YCBCR420 ) { + val |=PIPEMISC_YCBCR420_ENABLE | +PIPEMISC_YCBCR420_MODE_BLEND ; + } + } +I915_WRITE (PIPEMISC (intel_crtc->pipe), val); } }
drivers/gpu/drm/i915/intel_drv.h +9 -1
@@ -462,7 +462,8 @@ struct intel_crtc_scaler_state {* * If a bit is set, a user is using a scaler. * Here user can be a plane or crtc as defined below: -* bits 0-30 - plane (bit position is index from drm_plane_index) +* bits 0-29 - plane (bit position is index from drm_plane_index) +* bit 30 - hdmi output * bit 31 - crtc * * Instead of creating a new index to cover planes and crtc, using
@@ -475,6 +476,12 @@ struct intel_crtc_scaler_state {* avilability. */ #define SKL_CRTC_INDEX 31 + +/* +* HDMI YCBCR 420 output consume a scaler. So adding a user +* for HDMI output 420 requirement. +*/ +#define SKL_HDMI_OUTPUT_INDEX 30unsigned scaler_users;/* scaler used by crtc for panel fitting purpose */
@@ -1485,6 +1492,7 @@ void intel_mode_from_pipe_config(struct drm_display_mode *mode, struct intel_crtc_state *pipe_config);int skl_update_scaler_crtc (struct intel_crtc_state *crtc_state); +int skl_update_scaler_crtc_hdmi_output (struct intel_crtc_state *state);int skl_max_scale (struct intel_crtc *crtc,struct intel_crtc_state *crtc_state);static inline u32 intel_plane_ggtt_offset (const struct intel_plane_state *state)
drivers/gpu/drm/i915/intel_hdmi.c +11 -0
@@ -1381,6 +1381,7 @@ intel_hdmi_compute_ycbcr_config(struct drm_connector_state *conn_state, {struct drm_connector *connector = conn_state->connector;struct drm_display_info *info = &connector->display_info; +struct intel_crtc *intel_crtc =to_intel_crtc (conn_state->crtc);struct drm_display_mode *mode = &config->base.adjusted_mode;enum drm_hdmi_output_type type = conn_state->hdmi_output;u8 src_output_cap =intel_hdmi_get_src_output_support (connector);
@@ -1425,6 +1426,16 @@ intel_hdmi_compute_ycbcr_config(struct drm_connector_state *conn_state, config->port_clock /=2 ; *clock_12bpc /=2 ; *clock_8bpc /=2 ; + +/* ycbcr 420 output conversion needs a scaler */ +if (skl_update_scaler_crtc_hdmi_output (config)) { +DRM_ERROR ("Scaler allocation for output failed\n" ); +return DRM_HDMI_OUTPUT_INVALID ; + } + +/* Bind this scaler to pipe */ +intel_pch_panel_fitting (intel_crtc, config, +DRM_MODE_SCALE_FULLSCREEN );break ;case DRM_HDMI_OUTPUT_YCBCR422 :
drivers/gpu/drm/i915/intel_panel.c +2 -1
@@ -110,7 +110,8 @@ intel_pch_panel_fitting(struct intel_crtc *intel_crtc,/* Native modes don't need fitting */ if (adjusted_mode->crtc_hdisplay == pipe_config->pipe_src_w && - adjusted_mode->crtc_vdisplay == pipe_config->pipe_src_h) + adjusted_mode->crtc_vdisplay == pipe_config->pipe_src_h && + pipe_config->hdmi_output !=DRM_HDMI_OUTPUT_YCBCR420 ) goto done;switch (fitting_mode) {
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v2 11/11 drm/i915: set colorspace for ycbcr outputs
In reply to Shashank SharmaWhen HDMI output is other than RGB, we have to load the corresponding colorspace of output mode. This patch fills the colorspace of AVI infoframe as per the HDMI output mode.
--- drivers/gpu/drm/i915/intel_hdmi.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/gpu/drm/i915/intel_hdmi.c +8 -0
@@ -472,6 +472,14 @@ static void intel_hdmi_set_avi_infoframe(struct drm_encoder *encoder,return ; } + ret =drm_hdmi_avi_infoframe_set_colorspace (&frame.avi, + adjusted_mode, + crtc_state->hdmi_output); +if (ret <0 ) { +DRM_ERROR ("couldn't fill AVI colorspace\n" ); +return ; + } + drm_hdmi_avi_infoframe_quant_range(&frame.avi, adjusted_mode, crtc_state->limited_color_range ? HDMI_QUANTIZATION_RANGE_LIMITED :
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.BAT: failure for HDMI YCBCR output handling in DRM layer (rev2)
In reply to Shashank Sharma== Series Details ==
== Series Details ==
Series: HDMI YCBCR output handling in DRM layer (rev2)
URL : https://patchwork.freedesktop.org/series/22684/
State : failure
== Summary ==
Series 22684v2 HDMI YCBCR output handling in DRM layer
https://patchwork.freedesktop.org/api/1.0/series/22684/revisions/2/mbox/
Test kms_busy:
Subgroup basic-flip-default-a:
pass -> SKIP (fi-ilk-650)
pass -> SKIP (fi-snb-2520m)
pass -> SKIP (fi-snb-2600)
pass -> SKIP (fi-ivb-3520m)
pass -> SKIP (fi-ivb-3770)
pass -> SKIP (fi-byt-j1900)
pass -> SKIP (fi-byt-n2820)
pass -> SKIP (fi-hsw-4770)
pass -> SKIP (fi-hsw-4770r)
pass -> SKIP (fi-bdw-5557u)
pass -> SKIP (fi-bdw-gvtdvm)
pass -> SKIP (fi-skl-6260u)
dmesg-warn -> SKIP (fi-skl-6700hq) fdo#101144 +2
pass -> SKIP (fi-skl-6700k)
pass -> SKIP (fi-skl-6770hq)
pass -> SKIP (fi-skl-gvtdvm)
pass -> SKIP (fi-bxt-j4205)
pass -> SKIP (fi-kbl-7500u)
pass -> SKIP (fi-kbl-7560u)
Subgroup basic-flip-default-b:
pass -> SKIP (fi-ilk-650)
pass -> SKIP (fi-snb-2520m)
pass -> SKIP (fi-snb-2600)
pass -> SKIP (fi-ivb-3520m)
pass -> SKIP (fi-ivb-3770)
pass -> SKIP (fi-byt-j1900)
pass -> SKIP (fi-byt-n2820)
pass -> SKIP (fi-hsw-4770)
pass -> SKIP (fi-hsw-4770r)
pass -> SKIP (fi-bdw-5557u)
pass -> SKIP (fi-bdw-gvtdvm)
pass -> SKIP (fi-skl-6260u)
pass -> SKIP (fi-skl-6700k)
pass -> SKIP (fi-skl-6770hq)
pass -> SKIP (fi-skl-gvtdvm)
pass -> SKIP (fi-bxt-j4205)
pass -> SKIP (fi-kbl-7500u)
pass -> SKIP (fi-kbl-7560u)
Subgroup basic-flip-default-c:
pass -> SKIP (fi-ivb-3520m)
pass -> SKIP (fi-ivb-3770)
pass -> SKIP (fi-hsw-4770)
pass -> SKIP (fi-hsw-4770r)
pass -> SKIP (fi-bdw-5557u)
pass -> SKIP (fi-bdw-gvtdvm)
pass -> SKIP (fi-bsw-n3050)
pass -> SKIP (fi-skl-6260u)
pass -> SKIP (fi-skl-6700k)
pass -> SKIP (fi-skl-6770hq)
pass -> SKIP (fi-skl-gvtdvm)
pass -> SKIP (fi-bxt-j4205) fdo#101047
pass -> SKIP (fi-kbl-7500u)
pass -> SKIP (fi-kbl-7560u)
Test kms_cursor_legacy:
Subgroup basic-busy-flip-before-cursor-atomic:
pass -> SKIP (fi-ilk-650)
pass -> SKIP (fi-snb-2520m) fdo#100215 +15
pass -> SKIP (fi-ivb-3520m)
pass -> SKIP (fi-byt-j1900)
pass -> SKIP (fi-byt-n2820)
pass -> SKIP (fi-hsw-4770)
pass -> SKIP (fi-hsw-4770r)
pass -> SKIP (fi-bdw-5557u)
pass -> SKIP (fi-bdw-gvtdvm)
pass -> SKIP (fi-bsw-n3050)
pass -> SKIP (fi-skl-6260u)
fail -> SKIP (fi-skl-6700hq) fdo#101154 +24
pass -> SKIP (fi-skl-6700k)
pass -> SKIP (fi-skl-gvtdvm)
pass -> SKIP (fi-bxt-j4205)
pass -> SKIP (fi-kbl-7500u)
pass -> SKIP (fi-kbl-7560u)
Subgroup basic-busy-flip-before-cursor-legacy:
pass -> SKIP (fi-ilk-650)
pass -> SKIP (fi-ivb-3520m)
pass -> SKIP (fi-byt-j1900)
pass -> SKIP (fi-byt-n2820)
pass -> SKIP (fi-hsw-4770)
pass -> SKIP (fi-hsw-4770r)
pass -> SKIP (fi-bdw-5557u)
pass -> SKIP (fi-bdw-gvtdvm)
pass -> SKIP (fi-bsw-n3050)
pass -> SKIP (fi-skl-6260u)
pass -> SKIP (fi-skl-6700k)
pass -> SKIP (fi-skl-gvtdvm)
pass -> SKIP (fi-bxt-j4205)
pass -> SKIP (fi-kbl-7500u)
pass -> SKIP (fi-kbl-7560u)
Subgroup basic-flip-after-cursor-atomic:
pass -> SKIP (fi-ilk-650)
pass -> SKIP (fi-ivb-3520m)
pass -> SKIP (fi-byt-j1900)
pass -> SKIP (fi-byt-n2820)
pass -> SKIP (fi-hsw-4770)
pass -> SKIP (fi-hsw-4770r)WARNING: Long output truncated
f98c6d553b47ea4ad8eed33a9e768d8e30d8674a drm-tip: 2017y-05m-30d-13h-06m-42s UTC integration manifest d69c215 drm: add ycbcr helper functions
9d106d7 drm: set output colorspace in AVI infoframe
661a468 drm: create hdmi output property
100f84f drm: parse ycbcr 420 deep color information
2fc5119 drm: parse ycbcr420 cmdb block
64a07c5 drm/edid: Complete CEA modedb(VIC 1-107)
9e301ad drm: Add HDMI 2.0 VIC support for AVI info-frames
== Logs ==
For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_4829/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx