This is a workaround for HDMI 1.4 sink which has a CEA mode with higher vic than what is defined in CEA-861-D.
As an example, a HDMI 1.4 sink has the video format 2560x1080p to be displayed and the video format is indicated by both SVD (with vic 90 and pictuure aspect ratio 64:27) and DTD. When connecting to such sink, source can't output the video format in SVD because an error is returned by drm_hdmi_avi_infoframe_from_display_mode(), which can't fill the infoframe with pictuure aspect ratio 64:27 and the vic, which is originally 90 and is changed to 0 by drm_mode_cea_vic().
To work around it, this patch ignores such CEA modes in do_cea_modes() so the modes won't be processed in drm_hdmi_avi_infoframe_from_display_mode(). And only the video format in DTD can be dispalyed.
Cc: Ville Syrjälä ville.syrjala@linux.intel.com Cc: Wayne Lin waynelin@amd.com Cc: Lee Shawn C shawn.c.lee@intel.com Signed-off-by: William Tseng william.tseng@intel.com --- drivers/gpu/drm/drm_edid.c | 39 +++++++++++++++++++++++++------------- 1 file changed, 26 insertions(+), 13 deletions(-)
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index bc43e1b32092..a93f68878bfd 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -3982,6 +3982,19 @@ drm_display_mode_from_cea_vic(struct drm_device *dev, } EXPORT_SYMBOL(drm_display_mode_from_cea_vic);
+static bool is_hdmi2_sink(const struct drm_connector *connector) +{ + /* + * FIXME: sil-sii8620 doesn't have a connector around when + * we need one, so we have to be prepared for a NULL connector. + */ + if (!connector) + return true; + + return connector->display_info.hdmi.scdc.supported || + connector->display_info.color_formats & DRM_COLOR_FORMAT_YCBCR420; +} + static int do_cea_modes(struct drm_connector *connector, const u8 *db, u8 len) { @@ -3993,6 +4006,19 @@ do_cea_modes(struct drm_connector *connector, const u8 *db, u8 len)
mode = drm_display_mode_from_vic_index(connector, db, len, i); if (mode) { + u8 vic = svd_to_vic(db[i]); + + if (!drm_valid_cea_vic(vic)) + continue; + + /* + * 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_sink(connector) && vic > 64) + continue; + /* * YCBCR420 capability block contains a bitmap which * gives the index of CEA modes from CEA VDB, which @@ -5846,19 +5872,6 @@ void drm_set_preferred_mode(struct drm_connector *connector, } EXPORT_SYMBOL(drm_set_preferred_mode);
-static bool is_hdmi2_sink(const struct drm_connector *connector) -{ - /* - * FIXME: sil-sii8620 doesn't have a connector around when - * we need one, so we have to be prepared for a NULL connector. - */ - if (!connector) - return true; - - return connector->display_info.hdmi.scdc.supported || - connector->display_info.color_formats & DRM_COLOR_FORMAT_YCBCR420; -} - static u8 drm_mode_hdmi_vic(const struct drm_connector *connector, const struct drm_display_mode *mode) {
On Tue, 31 May 2022, William Tseng william.tseng@intel.com wrote:
This is a workaround for HDMI 1.4 sink which has a CEA mode with higher vic than what is defined in CEA-861-D.
As an example, a HDMI 1.4 sink has the video format 2560x1080p to be displayed and the video format is indicated by both SVD (with vic 90 and pictuure aspect ratio 64:27) and DTD. When connecting to such sink, source can't output the video format in SVD because an error is returned by drm_hdmi_avi_infoframe_from_display_mode(), which can't fill the infoframe with pictuure aspect ratio 64:27 and the vic, which is originally 90 and is changed to 0 by drm_mode_cea_vic().
To work around it, this patch ignores such CEA modes in do_cea_modes() so the modes won't be processed in drm_hdmi_avi_infoframe_from_display_mode(). And only the video format in DTD can be dispalyed.
Cc: Ville Syrjälä ville.syrjala@linux.intel.com Cc: Wayne Lin waynelin@amd.com Cc: Lee Shawn C shawn.c.lee@intel.com Signed-off-by: William Tseng william.tseng@intel.com
drivers/gpu/drm/drm_edid.c | 39 +++++++++++++++++++++++++------------- 1 file changed, 26 insertions(+), 13 deletions(-)
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index bc43e1b32092..a93f68878bfd 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -3982,6 +3982,19 @@ drm_display_mode_from_cea_vic(struct drm_device *dev, } EXPORT_SYMBOL(drm_display_mode_from_cea_vic);
+static bool is_hdmi2_sink(const struct drm_connector *connector) +{
- /*
* FIXME: sil-sii8620 doesn't have a connector around when
* we need one, so we have to be prepared for a NULL connector.
*/
- if (!connector)
return true;
- return connector->display_info.hdmi.scdc.supported ||
connector->display_info.color_formats & DRM_COLOR_FORMAT_YCBCR420;
+}
static int do_cea_modes(struct drm_connector *connector, const u8 *db, u8 len) { @@ -3993,6 +4006,19 @@ do_cea_modes(struct drm_connector *connector, const u8 *db, u8 len)
mode = drm_display_mode_from_vic_index(connector, db, len, i); if (mode) {
u8 vic = svd_to_vic(db[i]);
if (!drm_valid_cea_vic(vic))
continue;
drm_display_mode_from_vic_index() returns NULL in this case.
/*
* 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_sink(connector) && vic > 64)
continue;
I'll need to double check if this is the right thing to do... but I guess the question becomes if this shouldn't be within drm_display_mode_from_vic_index().
Duplicating the condition from drm_mode_cea_vic() is probably not a good idea.
The continues in both above branches leak the mode.
BR, Jani.
/* * YCBCR420 capability block contains a bitmap which * gives the index of CEA modes from CEA VDB, which
@@ -5846,19 +5872,6 @@ void drm_set_preferred_mode(struct drm_connector *connector, } EXPORT_SYMBOL(drm_set_preferred_mode);
-static bool is_hdmi2_sink(const struct drm_connector *connector) -{
- /*
* FIXME: sil-sii8620 doesn't have a connector around when
* we need one, so we have to be prepared for a NULL connector.
*/
- if (!connector)
return true;
- return connector->display_info.hdmi.scdc.supported ||
connector->display_info.color_formats & DRM_COLOR_FORMAT_YCBCR420;
-}
static u8 drm_mode_hdmi_vic(const struct drm_connector *connector, const struct drm_display_mode *mode) {
On Tue, 31 May 2022, Jani Nikula jani.nikula@linux.intel.com wrote:
On Tue, 31 May 2022, William Tseng william.tseng@intel.com wrote:
This is a workaround for HDMI 1.4 sink which has a CEA mode with higher vic than what is defined in CEA-861-D.
As an example, a HDMI 1.4 sink has the video format 2560x1080p to be displayed and the video format is indicated by both SVD (with vic 90 and pictuure aspect ratio 64:27) and DTD. When connecting to such sink, source can't output the video format in SVD because an error is returned by drm_hdmi_avi_infoframe_from_display_mode(), which can't fill the infoframe with pictuure aspect ratio 64:27 and the vic, which is originally 90 and is changed to 0 by drm_mode_cea_vic().
To work around it, this patch ignores such CEA modes in do_cea_modes() so the modes won't be processed in drm_hdmi_avi_infoframe_from_display_mode(). And only the video format in DTD can be dispalyed.
I think we should also have a bug filed on this, with the offending EDID attached for posterity.
BR, Jani.
Cc: Ville Syrjälä ville.syrjala@linux.intel.com Cc: Wayne Lin waynelin@amd.com Cc: Lee Shawn C shawn.c.lee@intel.com Signed-off-by: William Tseng william.tseng@intel.com
drivers/gpu/drm/drm_edid.c | 39 +++++++++++++++++++++++++------------- 1 file changed, 26 insertions(+), 13 deletions(-)
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index bc43e1b32092..a93f68878bfd 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -3982,6 +3982,19 @@ drm_display_mode_from_cea_vic(struct drm_device *dev, } EXPORT_SYMBOL(drm_display_mode_from_cea_vic);
+static bool is_hdmi2_sink(const struct drm_connector *connector) +{
- /*
* FIXME: sil-sii8620 doesn't have a connector around when
* we need one, so we have to be prepared for a NULL connector.
*/
- if (!connector)
return true;
- return connector->display_info.hdmi.scdc.supported ||
connector->display_info.color_formats & DRM_COLOR_FORMAT_YCBCR420;
+}
static int do_cea_modes(struct drm_connector *connector, const u8 *db, u8 len) { @@ -3993,6 +4006,19 @@ do_cea_modes(struct drm_connector *connector, const u8 *db, u8 len)
mode = drm_display_mode_from_vic_index(connector, db, len, i); if (mode) {
u8 vic = svd_to_vic(db[i]);
if (!drm_valid_cea_vic(vic))
continue;
drm_display_mode_from_vic_index() returns NULL in this case.
/*
* 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_sink(connector) && vic > 64)
continue;
I'll need to double check if this is the right thing to do... but I guess the question becomes if this shouldn't be within drm_display_mode_from_vic_index().
Duplicating the condition from drm_mode_cea_vic() is probably not a good idea.
The continues in both above branches leak the mode.
BR, Jani.
/* * YCBCR420 capability block contains a bitmap which * gives the index of CEA modes from CEA VDB, which
@@ -5846,19 +5872,6 @@ void drm_set_preferred_mode(struct drm_connector *connector, } EXPORT_SYMBOL(drm_set_preferred_mode);
-static bool is_hdmi2_sink(const struct drm_connector *connector) -{
- /*
* FIXME: sil-sii8620 doesn't have a connector around when
* we need one, so we have to be prepared for a NULL connector.
*/
- if (!connector)
return true;
- return connector->display_info.hdmi.scdc.supported ||
connector->display_info.color_formats & DRM_COLOR_FORMAT_YCBCR420;
-}
static u8 drm_mode_hdmi_vic(const struct drm_connector *connector, const struct drm_display_mode *mode) {
Thanks, Jani. This is the issue ticket. https://gitlab.freedesktop.org/drm/intel/-/issues/6087#note_1400843
Regards William
-----Original Message----- From: Jani Nikula jani.nikula@linux.intel.com Sent: Tuesday, May 31, 2022 7:07 PM To: Tseng, William william.tseng@intel.com; dri-devel@lists.freedesktop.org Cc: Lee, Shawn C shawn.c.lee@intel.com; Wayne Lin waynelin@amd.com; Tseng, William william.tseng@intel.com Subject: Re: [PATCH] drm/edid: ignore the CEA modes not defined in CEA-861-D
On Tue, 31 May 2022, Jani Nikula jani.nikula@linux.intel.com wrote:
On Tue, 31 May 2022, William Tseng william.tseng@intel.com wrote:
This is a workaround for HDMI 1.4 sink which has a CEA mode with higher vic than what is defined in CEA-861-D.
As an example, a HDMI 1.4 sink has the video format 2560x1080p to be displayed and the video format is indicated by both SVD (with vic 90 and pictuure aspect ratio 64:27) and DTD. When connecting to such sink, source can't output the video format in SVD because an error is returned by drm_hdmi_avi_infoframe_from_display_mode(), which can't fill the infoframe with pictuure aspect ratio 64:27 and the vic, which is originally 90 and is changed to 0 by drm_mode_cea_vic().
To work around it, this patch ignores such CEA modes in do_cea_modes() so the modes won't be processed in drm_hdmi_avi_infoframe_from_display_mode(). And only the video format in DTD can be dispalyed.
I think we should also have a bug filed on this, with the offending EDID attached for posterity.
BR, Jani.
Cc: Ville Syrjälä ville.syrjala@linux.intel.com Cc: Wayne Lin waynelin@amd.com Cc: Lee Shawn C shawn.c.lee@intel.com Signed-off-by: William Tseng william.tseng@intel.com
drivers/gpu/drm/drm_edid.c | 39 +++++++++++++++++++++++++------------- 1 file changed, 26 insertions(+), 13 deletions(-)
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index bc43e1b32092..a93f68878bfd 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -3982,6 +3982,19 @@ drm_display_mode_from_cea_vic(struct drm_device *dev, } EXPORT_SYMBOL(drm_display_mode_from_cea_vic);
+static bool is_hdmi2_sink(const struct drm_connector *connector) {
- /*
* FIXME: sil-sii8620 doesn't have a connector around when
* we need one, so we have to be prepared for a NULL connector.
*/
- if (!connector)
return true;
- return connector->display_info.hdmi.scdc.supported ||
connector->display_info.color_formats & DRM_COLOR_FORMAT_YCBCR420;
+}
static int do_cea_modes(struct drm_connector *connector, const u8 *db, u8 len) { @@ -3993,6 +4006,19 @@ do_cea_modes(struct drm_connector *connector, const u8 *db, u8 len)
mode = drm_display_mode_from_vic_index(connector, db, len, i); if (mode) {
u8 vic = svd_to_vic(db[i]);
if (!drm_valid_cea_vic(vic))
continue;
drm_display_mode_from_vic_index() returns NULL in this case.
/*
* 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_sink(connector) && vic > 64)
continue;
I'll need to double check if this is the right thing to do... but I guess the question becomes if this shouldn't be within drm_display_mode_from_vic_index().
Duplicating the condition from drm_mode_cea_vic() is probably not a good idea.
The continues in both above branches leak the mode.
BR, Jani.
/* * YCBCR420 capability block contains a bitmap which * gives the index of CEA modes from CEA VDB, which @@ -5846,19
+5872,6 @@ void drm_set_preferred_mode(struct drm_connector *connector, } EXPORT_SYMBOL(drm_set_preferred_mode);
-static bool is_hdmi2_sink(const struct drm_connector *connector) -{
- /*
* FIXME: sil-sii8620 doesn't have a connector around when
* we need one, so we have to be prepared for a NULL connector.
*/
- if (!connector)
return true;
- return connector->display_info.hdmi.scdc.supported ||
connector->display_info.color_formats & DRM_COLOR_FORMAT_YCBCR420;
-}
static u8 drm_mode_hdmi_vic(const struct drm_connector *connector, const struct drm_display_mode *mode) {
-- Jani Nikula, Intel Open Source Graphics Center
On Wed, 01 Jun 2022, "Tseng, William" william.tseng@intel.com wrote:
Thanks, Jani. This is the issue ticket. https://gitlab.freedesktop.org/drm/intel/-/issues/6087#note_1400843
Copy-paste fail? Does not seem right.
BR, Jani.
PS. Also, for some reason you added this in your mail:
Reply-To: "20220531103421.11363-1-william.tseng@intel.com" 20220531103421.11363-1-william.tseng@intel.com
Regards William
-----Original Message----- From: Jani Nikula jani.nikula@linux.intel.com Sent: Tuesday, May 31, 2022 7:07 PM To: Tseng, William william.tseng@intel.com; dri-devel@lists.freedesktop.org Cc: Lee, Shawn C shawn.c.lee@intel.com; Wayne Lin waynelin@amd.com; Tseng, William william.tseng@intel.com Subject: Re: [PATCH] drm/edid: ignore the CEA modes not defined in CEA-861-D
On Tue, 31 May 2022, Jani Nikula jani.nikula@linux.intel.com wrote:
On Tue, 31 May 2022, William Tseng william.tseng@intel.com wrote:
This is a workaround for HDMI 1.4 sink which has a CEA mode with higher vic than what is defined in CEA-861-D.
As an example, a HDMI 1.4 sink has the video format 2560x1080p to be displayed and the video format is indicated by both SVD (with vic 90 and pictuure aspect ratio 64:27) and DTD. When connecting to such sink, source can't output the video format in SVD because an error is returned by drm_hdmi_avi_infoframe_from_display_mode(), which can't fill the infoframe with pictuure aspect ratio 64:27 and the vic, which is originally 90 and is changed to 0 by drm_mode_cea_vic().
To work around it, this patch ignores such CEA modes in do_cea_modes() so the modes won't be processed in drm_hdmi_avi_infoframe_from_display_mode(). And only the video format in DTD can be dispalyed.
I think we should also have a bug filed on this, with the offending EDID attached for posterity.
BR, Jani.
Cc: Ville Syrjälä ville.syrjala@linux.intel.com Cc: Wayne Lin waynelin@amd.com Cc: Lee Shawn C shawn.c.lee@intel.com Signed-off-by: William Tseng william.tseng@intel.com
drivers/gpu/drm/drm_edid.c | 39 +++++++++++++++++++++++++------------- 1 file changed, 26 insertions(+), 13 deletions(-)
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index bc43e1b32092..a93f68878bfd 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -3982,6 +3982,19 @@ drm_display_mode_from_cea_vic(struct drm_device *dev, } EXPORT_SYMBOL(drm_display_mode_from_cea_vic);
+static bool is_hdmi2_sink(const struct drm_connector *connector) {
- /*
* FIXME: sil-sii8620 doesn't have a connector around when
* we need one, so we have to be prepared for a NULL connector.
*/
- if (!connector)
return true;
- return connector->display_info.hdmi.scdc.supported ||
connector->display_info.color_formats & DRM_COLOR_FORMAT_YCBCR420;
+}
static int do_cea_modes(struct drm_connector *connector, const u8 *db, u8 len) { @@ -3993,6 +4006,19 @@ do_cea_modes(struct drm_connector *connector, const u8 *db, u8 len)
mode = drm_display_mode_from_vic_index(connector, db, len, i); if (mode) {
u8 vic = svd_to_vic(db[i]);
if (!drm_valid_cea_vic(vic))
continue;
drm_display_mode_from_vic_index() returns NULL in this case.
/*
* 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_sink(connector) && vic > 64)
continue;
I'll need to double check if this is the right thing to do... but I guess the question becomes if this shouldn't be within drm_display_mode_from_vic_index().
Duplicating the condition from drm_mode_cea_vic() is probably not a good idea.
The continues in both above branches leak the mode.
BR, Jani.
/* * YCBCR420 capability block contains a bitmap which * gives the index of CEA modes from CEA VDB, which @@ -5846,19
+5872,6 @@ void drm_set_preferred_mode(struct drm_connector *connector, } EXPORT_SYMBOL(drm_set_preferred_mode);
-static bool is_hdmi2_sink(const struct drm_connector *connector) -{
- /*
* FIXME: sil-sii8620 doesn't have a connector around when
* we need one, so we have to be prepared for a NULL connector.
*/
- if (!connector)
return true;
- return connector->display_info.hdmi.scdc.supported ||
connector->display_info.color_formats & DRM_COLOR_FORMAT_YCBCR420;
-}
static u8 drm_mode_hdmi_vic(const struct drm_connector *connector, const struct drm_display_mode *mode) {
-- Jani Nikula, Intel Open Source Graphics Center
Thanks, Jani. This is the bug.
https://gitlab.freedesktop.org/drm/intel/-/issues/6153
Sorry about my mistake.
Regards William
-----Original Message----- From: Jani Nikula jani.nikula@linux.intel.com Sent: Wednesday, June 1, 2022 5:57 PM To: Tseng, William william.tseng@intel.com; dri-devel@lists.freedesktop.org Cc: Lee, Shawn C shawn.c.lee@intel.com; Wayne Lin waynelin@amd.com Subject: RE: [PATCH] drm/edid: ignore the CEA modes not defined in CEA-861-D
On Wed, 01 Jun 2022, "Tseng, William" william.tseng@intel.com wrote:
Thanks, Jani. This is the issue ticket. https://gitlab.freedesktop.org/drm/intel/-/issues/6087#note_1400843
Copy-paste fail? Does not seem right.
BR, Jani.
PS. Also, for some reason you added this in your mail:
Reply-To: "20220531103421.11363-1-william.tseng@intel.com" 20220531103421.11363-1-william.tseng@intel.com
Regards William
-----Original Message----- From: Jani Nikula jani.nikula@linux.intel.com Sent: Tuesday, May 31, 2022 7:07 PM To: Tseng, William william.tseng@intel.com; dri-devel@lists.freedesktop.org Cc: Lee, Shawn C shawn.c.lee@intel.com; Wayne Lin waynelin@amd.com; Tseng, William william.tseng@intel.com Subject: Re: [PATCH] drm/edid: ignore the CEA modes not defined in CEA-861-D
On Tue, 31 May 2022, Jani Nikula jani.nikula@linux.intel.com wrote:
On Tue, 31 May 2022, William Tseng william.tseng@intel.com wrote:
This is a workaround for HDMI 1.4 sink which has a CEA mode with higher vic than what is defined in CEA-861-D.
As an example, a HDMI 1.4 sink has the video format 2560x1080p to be displayed and the video format is indicated by both SVD (with vic 90 and pictuure aspect ratio 64:27) and DTD. When connecting to such sink, source can't output the video format in SVD because an error is returned by drm_hdmi_avi_infoframe_from_display_mode(), which can't fill the infoframe with pictuure aspect ratio 64:27 and the vic, which is originally 90 and is changed to 0 by drm_mode_cea_vic().
To work around it, this patch ignores such CEA modes in do_cea_modes() so the modes won't be processed in drm_hdmi_avi_infoframe_from_display_mode(). And only the video format in DTD can be dispalyed.
I think we should also have a bug filed on this, with the offending EDID attached for posterity.
BR, Jani.
Cc: Ville Syrjälä ville.syrjala@linux.intel.com Cc: Wayne Lin waynelin@amd.com Cc: Lee Shawn C shawn.c.lee@intel.com Signed-off-by: William Tseng william.tseng@intel.com
drivers/gpu/drm/drm_edid.c | 39 +++++++++++++++++++++++++------------- 1 file changed, 26 insertions(+), 13 deletions(-)
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index bc43e1b32092..a93f68878bfd 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -3982,6 +3982,19 @@ drm_display_mode_from_cea_vic(struct drm_device *dev, } EXPORT_SYMBOL(drm_display_mode_from_cea_vic);
+static bool is_hdmi2_sink(const struct drm_connector *connector) {
- /*
* FIXME: sil-sii8620 doesn't have a connector around when
* we need one, so we have to be prepared for a NULL connector.
*/
- if (!connector)
return true;
- return connector->display_info.hdmi.scdc.supported ||
connector->display_info.color_formats &
+DRM_COLOR_FORMAT_YCBCR420; }
static int do_cea_modes(struct drm_connector *connector, const u8 *db, u8 len) { @@ -3993,6 +4006,19 @@ do_cea_modes(struct drm_connector *connector, const u8 *db, u8 len)
mode = drm_display_mode_from_vic_index(connector, db, len, i); if (mode) {
u8 vic = svd_to_vic(db[i]);
if (!drm_valid_cea_vic(vic))
continue;
drm_display_mode_from_vic_index() returns NULL in this case.
/*
* 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_sink(connector) && vic > 64)
continue;
I'll need to double check if this is the right thing to do... but I guess the question becomes if this shouldn't be within drm_display_mode_from_vic_index().
Duplicating the condition from drm_mode_cea_vic() is probably not a good idea.
The continues in both above branches leak the mode.
BR, Jani.
/* * YCBCR420 capability block contains a bitmap which * gives the index of CEA modes from CEA VDB, which @@ -5846,19
+5872,6 @@ void drm_set_preferred_mode(struct drm_connector *connector, } EXPORT_SYMBOL(drm_set_preferred_mode);
-static bool is_hdmi2_sink(const struct drm_connector *connector) -{
- /*
* FIXME: sil-sii8620 doesn't have a connector around when
* we need one, so we have to be prepared for a NULL connector.
*/
- if (!connector)
return true;
- return connector->display_info.hdmi.scdc.supported ||
connector->display_info.color_formats & DRM_COLOR_FORMAT_YCBCR420;
-}
static u8 drm_mode_hdmi_vic(const struct drm_connector *connector, const struct drm_display_mode *mode) {
-- Jani Nikula, Intel Open Source Graphics Center
-- Jani Nikula, Intel Open Source Graphics Center
On Wed, 01 Jun 2022, "Tseng, William" william.tseng@intel.com wrote:
Thanks, Jani. This is the bug.
https://gitlab.freedesktop.org/drm/intel/-/issues/6153
Sorry about my mistake.
Np. Please also attach the EDID you have to the bug.
Thanks, Jani.
Regards William
-----Original Message----- From: Jani Nikula jani.nikula@linux.intel.com Sent: Wednesday, June 1, 2022 5:57 PM To: Tseng, William william.tseng@intel.com; dri-devel@lists.freedesktop.org Cc: Lee, Shawn C shawn.c.lee@intel.com; Wayne Lin waynelin@amd.com Subject: RE: [PATCH] drm/edid: ignore the CEA modes not defined in CEA-861-D
On Wed, 01 Jun 2022, "Tseng, William" william.tseng@intel.com wrote:
Thanks, Jani. This is the issue ticket. https://gitlab.freedesktop.org/drm/intel/-/issues/6087#note_1400843
Copy-paste fail? Does not seem right.
BR, Jani.
PS. Also, for some reason you added this in your mail:
Reply-To: "20220531103421.11363-1-william.tseng@intel.com" 20220531103421.11363-1-william.tseng@intel.com
Regards William
-----Original Message----- From: Jani Nikula jani.nikula@linux.intel.com Sent: Tuesday, May 31, 2022 7:07 PM To: Tseng, William william.tseng@intel.com; dri-devel@lists.freedesktop.org Cc: Lee, Shawn C shawn.c.lee@intel.com; Wayne Lin waynelin@amd.com; Tseng, William william.tseng@intel.com Subject: Re: [PATCH] drm/edid: ignore the CEA modes not defined in CEA-861-D
On Tue, 31 May 2022, Jani Nikula jani.nikula@linux.intel.com wrote:
On Tue, 31 May 2022, William Tseng william.tseng@intel.com wrote:
This is a workaround for HDMI 1.4 sink which has a CEA mode with higher vic than what is defined in CEA-861-D.
As an example, a HDMI 1.4 sink has the video format 2560x1080p to be displayed and the video format is indicated by both SVD (with vic 90 and pictuure aspect ratio 64:27) and DTD. When connecting to such sink, source can't output the video format in SVD because an error is returned by drm_hdmi_avi_infoframe_from_display_mode(), which can't fill the infoframe with pictuure aspect ratio 64:27 and the vic, which is originally 90 and is changed to 0 by drm_mode_cea_vic().
To work around it, this patch ignores such CEA modes in do_cea_modes() so the modes won't be processed in drm_hdmi_avi_infoframe_from_display_mode(). And only the video format in DTD can be dispalyed.
I think we should also have a bug filed on this, with the offending EDID attached for posterity.
BR, Jani.
Cc: Ville Syrjälä ville.syrjala@linux.intel.com Cc: Wayne Lin waynelin@amd.com Cc: Lee Shawn C shawn.c.lee@intel.com Signed-off-by: William Tseng william.tseng@intel.com
drivers/gpu/drm/drm_edid.c | 39 +++++++++++++++++++++++++------------- 1 file changed, 26 insertions(+), 13 deletions(-)
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index bc43e1b32092..a93f68878bfd 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -3982,6 +3982,19 @@ drm_display_mode_from_cea_vic(struct drm_device *dev, } EXPORT_SYMBOL(drm_display_mode_from_cea_vic);
+static bool is_hdmi2_sink(const struct drm_connector *connector) {
- /*
* FIXME: sil-sii8620 doesn't have a connector around when
* we need one, so we have to be prepared for a NULL connector.
*/
- if (!connector)
return true;
- return connector->display_info.hdmi.scdc.supported ||
connector->display_info.color_formats &
+DRM_COLOR_FORMAT_YCBCR420; }
static int do_cea_modes(struct drm_connector *connector, const u8 *db, u8 len) { @@ -3993,6 +4006,19 @@ do_cea_modes(struct drm_connector *connector, const u8 *db, u8 len)
mode = drm_display_mode_from_vic_index(connector, db, len, i); if (mode) {
u8 vic = svd_to_vic(db[i]);
if (!drm_valid_cea_vic(vic))
continue;
drm_display_mode_from_vic_index() returns NULL in this case.
/*
* 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_sink(connector) && vic > 64)
continue;
I'll need to double check if this is the right thing to do... but I guess the question becomes if this shouldn't be within drm_display_mode_from_vic_index().
Duplicating the condition from drm_mode_cea_vic() is probably not a good idea.
The continues in both above branches leak the mode.
BR, Jani.
/* * YCBCR420 capability block contains a bitmap which * gives the index of CEA modes from CEA VDB, which @@ -5846,19
+5872,6 @@ void drm_set_preferred_mode(struct drm_connector *connector, } EXPORT_SYMBOL(drm_set_preferred_mode);
-static bool is_hdmi2_sink(const struct drm_connector *connector) -{
- /*
* FIXME: sil-sii8620 doesn't have a connector around when
* we need one, so we have to be prepared for a NULL connector.
*/
- if (!connector)
return true;
- return connector->display_info.hdmi.scdc.supported ||
connector->display_info.color_formats & DRM_COLOR_FORMAT_YCBCR420;
-}
static u8 drm_mode_hdmi_vic(const struct drm_connector *connector, const struct drm_display_mode *mode) {
-- Jani Nikula, Intel Open Source Graphics Center
-- Jani Nikula, Intel Open Source Graphics Center
Thanks, Jani.
Maybe it is better to make drm_display_mode_from_vic_index() return a mode with valid VIC. So it ends up with that all probed modes have valid VICs for HDMI 1.4 and 2.0 respectively.
Regards William
-----Original Message----- From: Jani Nikula jani.nikula@linux.intel.com Sent: Tuesday, May 31, 2022 6:56 PM To: Tseng, William william.tseng@intel.com; dri-devel@lists.freedesktop.org Cc: Lee, Shawn C shawn.c.lee@intel.com; Wayne Lin waynelin@amd.com; Tseng, William william.tseng@intel.com Subject: Re: [PATCH] drm/edid: ignore the CEA modes not defined in CEA-861-D
On Tue, 31 May 2022, William Tseng william.tseng@intel.com wrote:
This is a workaround for HDMI 1.4 sink which has a CEA mode with higher vic than what is defined in CEA-861-D.
As an example, a HDMI 1.4 sink has the video format 2560x1080p to be displayed and the video format is indicated by both SVD (with vic 90 and pictuure aspect ratio 64:27) and DTD. When connecting to such sink, source can't output the video format in SVD because an error is returned by drm_hdmi_avi_infoframe_from_display_mode(), which can't fill the infoframe with pictuure aspect ratio 64:27 and the vic, which is originally 90 and is changed to 0 by drm_mode_cea_vic().
To work around it, this patch ignores such CEA modes in do_cea_modes() so the modes won't be processed in drm_hdmi_avi_infoframe_from_display_mode(). And only the video format in DTD can be dispalyed.
Cc: Ville Syrjälä ville.syrjala@linux.intel.com Cc: Wayne Lin waynelin@amd.com Cc: Lee Shawn C shawn.c.lee@intel.com Signed-off-by: William Tseng william.tseng@intel.com
drivers/gpu/drm/drm_edid.c | 39 +++++++++++++++++++++++++------------- 1 file changed, 26 insertions(+), 13 deletions(-)
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index bc43e1b32092..a93f68878bfd 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -3982,6 +3982,19 @@ drm_display_mode_from_cea_vic(struct drm_device *dev, } EXPORT_SYMBOL(drm_display_mode_from_cea_vic);
+static bool is_hdmi2_sink(const struct drm_connector *connector) {
- /*
* FIXME: sil-sii8620 doesn't have a connector around when
* we need one, so we have to be prepared for a NULL connector.
*/
- if (!connector)
return true;
- return connector->display_info.hdmi.scdc.supported ||
connector->display_info.color_formats & DRM_COLOR_FORMAT_YCBCR420;
+}
static int do_cea_modes(struct drm_connector *connector, const u8 *db, u8 len) { @@ -3993,6 +4006,19 @@ do_cea_modes(struct drm_connector *connector, const u8 *db, u8 len)
mode = drm_display_mode_from_vic_index(connector, db, len, i); if (mode) {
u8 vic = svd_to_vic(db[i]);
if (!drm_valid_cea_vic(vic))
continue;
drm_display_mode_from_vic_index() returns NULL in this case.
/*
* 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_sink(connector) && vic > 64)
continue;
I'll need to double check if this is the right thing to do... but I guess the question becomes if this shouldn't be within drm_display_mode_from_vic_index().
Duplicating the condition from drm_mode_cea_vic() is probably not a good idea.
The continues in both above branches leak the mode.
BR, Jani.
/* * YCBCR420 capability block contains a bitmap which * gives the index of CEA modes from CEA VDB, which @@ -5846,19
+5872,6 @@ void drm_set_preferred_mode(struct drm_connector *connector, } EXPORT_SYMBOL(drm_set_preferred_mode);
-static bool is_hdmi2_sink(const struct drm_connector *connector) -{
- /*
* FIXME: sil-sii8620 doesn't have a connector around when
* we need one, so we have to be prepared for a NULL connector.
*/
- if (!connector)
return true;
- return connector->display_info.hdmi.scdc.supported ||
connector->display_info.color_formats & DRM_COLOR_FORMAT_YCBCR420;
-}
static u8 drm_mode_hdmi_vic(const struct drm_connector *connector, const struct drm_display_mode *mode) {
On Tue, May 31, 2022 at 06:34:21PM +0800, William Tseng wrote:
This is a workaround for HDMI 1.4 sink which has a CEA mode with higher vic than what is defined in CEA-861-D.
As an example, a HDMI 1.4 sink has the video format 2560x1080p to be displayed and the video format is indicated by both SVD (with vic 90 and pictuure aspect ratio 64:27) and DTD. When connecting to such sink, source can't output the video format in SVD because an error is returned by drm_hdmi_avi_infoframe_from_display_mode(), which can't fill the infoframe with pictuure aspect ratio 64:27 and the vic, which is originally 90 and is changed to 0 by drm_mode_cea_vic().
Hmm. I think either we need to change the logic in drm_hdmi_avi_infoframe_from_display_mode() somehow to accept this or we need to strip the aspect ratio from such modes when we probe them.
The first option might be nicer, and something like this might even work:
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index 929fc0e46751..3d5c76acf42a 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -6082,7 +6082,8 @@ static u8 drm_mode_hdmi_vic(const struct drm_connector *connector, }
static u8 drm_mode_cea_vic(const struct drm_connector *connector, - const struct drm_display_mode *mode) + const struct drm_display_mode *mode, + bool is_hdmi2_sink) { u8 vic;
@@ -6102,7 +6103,7 @@ static u8 drm_mode_cea_vic(const struct drm_connector *connector, * 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_sink(connector) && vic > 64) + if (!is_hdmi2_sink && vic > 64) return 0;
return vic; @@ -6133,7 +6134,7 @@ drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame, if (mode->flags & DRM_MODE_FLAG_DBLCLK) frame->pixel_repeat = 1;
- vic = drm_mode_cea_vic(connector, mode); + vic = drm_mode_cea_vic(connector, mode, true); hdmi_vic = drm_mode_hdmi_vic(connector, mode);
frame->picture_aspect = HDMI_PICTURE_ASPECT_NONE; @@ -6177,7 +6178,7 @@ drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame, picture_aspect = HDMI_PICTURE_ASPECT_NONE; }
- frame->video_code = vic; + frame->video_code = drm_mode_cea_vic(connector, mode, is_hdmi2_sink(connector)); frame->picture_aspect = picture_aspect; frame->active_aspect = HDMI_ACTIVE_ASPECT_PICTURE; frame->scan_mode = HDMI_SCAN_MODE_UNDERSCAN;
But I don't quite remember off hand how the CEA VIC vs. HDMI VIC decision plays into this, so there might be some issues with that approach.
Thanks, Ville Syrjälä.
It seems the change regarding drm_mode_cea_vic() works for the issue.
If so, three video formats with the same resolution, say 2560x1080, may be probed; two from SAD and one from DTD. Then, depending on which is selected, any of the three video formats may be set to the HDMI 1.4 sink. I am wondering if this works for all the other HDMI 1.4 sinks. What do you think of it?
Regards William
-----Original Message----- From: Ville Syrjälä ville.syrjala@linux.intel.com Sent: Wednesday, June 1, 2022 12:42 AM To: Tseng, William william.tseng@intel.com Cc: dri-devel@lists.freedesktop.org; Wayne Lin waynelin@amd.com; Lee, Shawn C shawn.c.lee@intel.com Subject: Re: [PATCH] drm/edid: ignore the CEA modes not defined in CEA-861-D
On Tue, May 31, 2022 at 06:34:21PM +0800, William Tseng wrote:
This is a workaround for HDMI 1.4 sink which has a CEA mode with higher vic than what is defined in CEA-861-D.
As an example, a HDMI 1.4 sink has the video format 2560x1080p to be displayed and the video format is indicated by both SVD (with vic 90 and pictuure aspect ratio 64:27) and DTD. When connecting to such sink, source can't output the video format in SVD because an error is returned by drm_hdmi_avi_infoframe_from_display_mode(), which can't fill the infoframe with pictuure aspect ratio 64:27 and the vic, which is originally 90 and is changed to 0 by drm_mode_cea_vic().
Hmm. I think either we need to change the logic in drm_hdmi_avi_infoframe_from_display_mode() somehow to accept this or we need to strip the aspect ratio from such modes when we probe them.
The first option might be nicer, and something like this might even work:
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index 929fc0e46751..3d5c76acf42a 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -6082,7 +6082,8 @@ static u8 drm_mode_hdmi_vic(const struct drm_connector *connector, }
static u8 drm_mode_cea_vic(const struct drm_connector *connector, - const struct drm_display_mode *mode) + const struct drm_display_mode *mode, + bool is_hdmi2_sink) { u8 vic;
@@ -6102,7 +6103,7 @@ static u8 drm_mode_cea_vic(const struct drm_connector *connector, * 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_sink(connector) && vic > 64) + if (!is_hdmi2_sink && vic > 64) return 0;
return vic; @@ -6133,7 +6134,7 @@ drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame, if (mode->flags & DRM_MODE_FLAG_DBLCLK) frame->pixel_repeat = 1;
- vic = drm_mode_cea_vic(connector, mode); + vic = drm_mode_cea_vic(connector, mode, true); hdmi_vic = drm_mode_hdmi_vic(connector, mode);
frame->picture_aspect = HDMI_PICTURE_ASPECT_NONE; @@ -6177,7 +6178,7 @@ drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame, picture_aspect = HDMI_PICTURE_ASPECT_NONE; }
- frame->video_code = vic; + frame->video_code = drm_mode_cea_vic(connector, mode, +is_hdmi2_sink(connector)); frame->picture_aspect = picture_aspect; frame->active_aspect = HDMI_ACTIVE_ASPECT_PICTURE; frame->scan_mode = HDMI_SCAN_MODE_UNDERSCAN;
But I don't quite remember off hand how the CEA VIC vs. HDMI VIC decision plays into this, so there might be some issues with that approach.
-- Ville Syrjälä Intel
This is a workaround for HDMI 1.4 sink which has a CEA mode with higher vic than what is defined in CEA-861-D.
As an example, a HDMI 1.4 sink has the video format 2560x1080p to be displayed and the video format is indicated by both SVD (with vic 90 and pictuure aspect ratio 64:27) and DTD. When connecting to such sink, source can't output the video format in SVD because an error is returned by drm_hdmi_avi_infoframe_from_display_mode(), which can't fill the infoframe with pictuure aspect ratio 64:27 and the vic, which is originally 90 and is changed to 0 by drm_mode_cea_vic().
To work around it, do not set the vic 0 so the corresponding mode may be accepted in drm_hdmi_avi_infoframe_from_display_mode() and be dispalyed.
Cc: Ville Syrjälä ville.syrjala@linux.intel.com Cc: Jani Nikula jani.nikula@linux.intel.com Cc: Wayne Lin waynelin@amd.com Cc: Lee Shawn C shawn.c.lee@intel.com Signed-off-by: William Tseng william.tseng@intel.com --- drivers/gpu/drm/drm_edid.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index bc43e1b32092..a4582627ec9d 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -5876,7 +5876,8 @@ static u8 drm_mode_hdmi_vic(const struct drm_connector *connector, }
static u8 drm_mode_cea_vic(const struct drm_connector *connector, - const struct drm_display_mode *mode) + const struct drm_display_mode *mode, + bool is_hdmi2_sink) { u8 vic;
@@ -5896,7 +5897,7 @@ static u8 drm_mode_cea_vic(const struct drm_connector *connector, * 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_sink(connector) && vic > 64) + if (!is_hdmi2_sink && vic > 64) return 0;
return vic; @@ -5927,7 +5928,7 @@ drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame, if (mode->flags & DRM_MODE_FLAG_DBLCLK) frame->pixel_repeat = 1;
- vic = drm_mode_cea_vic(connector, mode); + vic = drm_mode_cea_vic(connector, mode, true); hdmi_vic = drm_mode_hdmi_vic(connector, mode);
frame->picture_aspect = HDMI_PICTURE_ASPECT_NONE; @@ -5971,7 +5972,8 @@ drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame, picture_aspect = HDMI_PICTURE_ASPECT_NONE; }
- frame->video_code = vic; + frame->video_code = drm_mode_cea_vic(connector, mode, + is_hdmi2_sink(connector)); frame->picture_aspect = picture_aspect; frame->active_aspect = HDMI_ACTIVE_ASPECT_PICTURE; frame->scan_mode = HDMI_SCAN_MODE_UNDERSCAN;
[AMD Official Use Only - General]
Thanks William!
After fixing few typos below, feel free to add:
Acked-by: Wayne Lin Wayne.Lin@amd.com
-----Original Message----- From: William Tseng william.tseng@intel.com Sent: Monday, June 13, 2022 12:27 PM To: dri-devel@lists.freedesktop.org Cc: William Tseng william.tseng@intel.com; Ville Syrjälä ville.syrjala@linux.intel.com; Jani Nikula jani.nikula@linux.intel.com; Lin, Wayne Wayne.Lin@amd.com; Lee Shawn C shawn.c.lee@intel.com Subject: [PATCH v2] drm/edid: ignore the CEA modes not defined in CEA- 861-D
This is a workaround for HDMI 1.4 sink which has a CEA mode with higher vic than what is defined in CEA-861-D.
As an example, a HDMI 1.4 sink has the video format 2560x1080p to be displayed and the video format is indicated by both SVD (with vic 90 and pictuure aspect ratio 64:27) and DTD. When connecting to such sink, source
Typo - picture
can't output the video format in SVD because an error is returned by drm_hdmi_avi_infoframe_from_display_mode(), which can't fill the infoframe with pictuure aspect ratio 64:27 and the vic, which is originally 90
Typo - picture
and is changed to 0 by drm_mode_cea_vic().
To work around it, do not set the vic 0 so the corresponding mode may be accepted in drm_hdmi_avi_infoframe_from_display_mode() and be dispalyed.
Cc: Ville Syrjälä ville.syrjala@linux.intel.com Cc: Jani Nikula jani.nikula@linux.intel.com Cc: Wayne Lin waynelin@amd.com Cc: Lee Shawn C shawn.c.lee@intel.com Signed-off-by: William Tseng william.tseng@intel.com
drivers/gpu/drm/drm_edid.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index bc43e1b32092..a4582627ec9d 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -5876,7 +5876,8 @@ static u8 drm_mode_hdmi_vic(const struct drm_connector *connector, }
static u8 drm_mode_cea_vic(const struct drm_connector *connector,
const struct drm_display_mode *mode)
const struct drm_display_mode *mode,
bool is_hdmi2_sink)
{ u8 vic;
@@ -5896,7 +5897,7 @@ static u8 drm_mode_cea_vic(const struct drm_connector *connector, * 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_sink(connector) && vic > 64)
if (!is_hdmi2_sink && vic > 64) return 0;
return vic;
@@ -5927,7 +5928,7 @@ drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame, if (mode->flags & DRM_MODE_FLAG_DBLCLK) frame->pixel_repeat = 1;
- vic = drm_mode_cea_vic(connector, mode);
vic = drm_mode_cea_vic(connector, mode, true); hdmi_vic = drm_mode_hdmi_vic(connector, mode);
frame->picture_aspect = HDMI_PICTURE_ASPECT_NONE; @@ -
5971,7 +5972,8 @@ drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame, picture_aspect = HDMI_PICTURE_ASPECT_NONE; }
- frame->video_code = vic;
- frame->video_code = drm_mode_cea_vic(connector, mode,
frame->picture_aspect = picture_aspect; frame->active_aspect = HDMI_ACTIVE_ASPECT_PICTURE; frame->scan_mode = HDMI_SCAN_MODE_UNDERSCAN;is_hdmi2_sink(connector));
-- 2.17.1
Thanks Wayne for the comment. I don't quite understand what the typos are. Could you elaborate on them? Thank you.
-----Original Message----- From: Lin, Wayne Wayne.Lin@amd.com Sent: Monday, June 13, 2022 3:25 PM To: Tseng, William william.tseng@intel.com; dri-devel@lists.freedesktop.org Cc: Ville Syrjälä ville.syrjala@linux.intel.com; Jani Nikula jani.nikula@linux.intel.com; Lee, Shawn C shawn.c.lee@intel.com Subject: RE: [PATCH v2] drm/edid: ignore the CEA modes not defined in CEA-861-D
[AMD Official Use Only - General]
Thanks William!
After fixing few typos below, feel free to add:
Acked-by: Wayne Lin Wayne.Lin@amd.com
-----Original Message----- From: William Tseng william.tseng@intel.com Sent: Monday, June 13, 2022 12:27 PM To: dri-devel@lists.freedesktop.org Cc: William Tseng william.tseng@intel.com; Ville Syrjälä ville.syrjala@linux.intel.com; Jani Nikula jani.nikula@linux.intel.com; Lin, Wayne Wayne.Lin@amd.com; Lee Shawn C shawn.c.lee@intel.com Subject: [PATCH v2] drm/edid: ignore the CEA modes not defined in CEA- 861-D
This is a workaround for HDMI 1.4 sink which has a CEA mode with higher vic than what is defined in CEA-861-D.
As an example, a HDMI 1.4 sink has the video format 2560x1080p to be displayed and the video format is indicated by both SVD (with vic 90 and pictuure aspect ratio 64:27) and DTD. When connecting to such sink, source
Typo - picture
can't output the video format in SVD because an error is returned by drm_hdmi_avi_infoframe_from_display_mode(), which can't fill the infoframe with pictuure aspect ratio 64:27 and the vic, which is originally 90
Typo - picture
and is changed to 0 by drm_mode_cea_vic().
To work around it, do not set the vic 0 so the corresponding mode may be accepted in drm_hdmi_avi_infoframe_from_display_mode() and be dispalyed.
Cc: Ville Syrjälä ville.syrjala@linux.intel.com Cc: Jani Nikula jani.nikula@linux.intel.com Cc: Wayne Lin waynelin@amd.com Cc: Lee Shawn C shawn.c.lee@intel.com Signed-off-by: William Tseng william.tseng@intel.com
drivers/gpu/drm/drm_edid.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index bc43e1b32092..a4582627ec9d 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -5876,7 +5876,8 @@ static u8 drm_mode_hdmi_vic(const struct drm_connector *connector, }
static u8 drm_mode_cea_vic(const struct drm_connector *connector,
const struct drm_display_mode *mode)
const struct drm_display_mode *mode,
bool is_hdmi2_sink)
{ u8 vic;
@@ -5896,7 +5897,7 @@ static u8 drm_mode_cea_vic(const struct drm_connector *connector, * 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_sink(connector) && vic > 64)
if (!is_hdmi2_sink && vic > 64) return 0;
return vic;
@@ -5927,7 +5928,7 @@ drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame, if (mode->flags & DRM_MODE_FLAG_DBLCLK) frame->pixel_repeat = 1;
- vic = drm_mode_cea_vic(connector, mode);
vic = drm_mode_cea_vic(connector, mode, true); hdmi_vic = drm_mode_hdmi_vic(connector, mode);
frame->picture_aspect = HDMI_PICTURE_ASPECT_NONE; @@ -
5971,7 +5972,8 @@ drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame, picture_aspect = HDMI_PICTURE_ASPECT_NONE; }
- frame->video_code = vic;
- frame->video_code = drm_mode_cea_vic(connector, mode,
frame->picture_aspect = picture_aspect; frame->active_aspect = HDMI_ACTIVE_ASPECT_PICTURE; frame->scan_mode = HDMI_SCAN_MODE_UNDERSCAN;is_hdmi2_sink(connector));
-- 2.17.1
[Public]
-----Original Message----- From: Tseng, William william.tseng@intel.com Sent: Monday, June 13, 2022 4:05 PM To: Lin, Wayne Wayne.Lin@amd.com; dri-devel@lists.freedesktop.org Cc: Ville Syrjälä ville.syrjala@linux.intel.com; Jani Nikula jani.nikula@linux.intel.com; Lee, Shawn C shawn.c.lee@intel.com Subject: RE: [PATCH v2] drm/edid: ignore the CEA modes not defined in CEA- 861-D
Thanks Wayne for the comment. I don't quite understand what the typos are. Could you elaborate on them? Thank you.
-----Original Message----- From: Lin, Wayne Wayne.Lin@amd.com Sent: Monday, June 13, 2022 3:25 PM To: Tseng, William william.tseng@intel.com; dri- devel@lists.freedesktop.org Cc: Ville Syrjälä ville.syrjala@linux.intel.com; Jani Nikula jani.nikula@linux.intel.com; Lee, Shawn C shawn.c.lee@intel.com Subject: RE: [PATCH v2] drm/edid: ignore the CEA modes not defined in CEA- 861-D
[AMD Official Use Only - General]
Thanks William!
After fixing few typos below, feel free to add:
Acked-by: Wayne Lin Wayne.Lin@amd.com
-----Original Message----- From: William Tseng william.tseng@intel.com Sent: Monday, June 13, 2022 12:27 PM To: dri-devel@lists.freedesktop.org Cc: William Tseng william.tseng@intel.com; Ville Syrjälä ville.syrjala@linux.intel.com; Jani Nikula jani.nikula@linux.intel.com; Lin, Wayne Wayne.Lin@amd.com; Lee Shawn C shawn.c.lee@intel.com Subject: [PATCH v2] drm/edid: ignore the CEA modes not defined in CEA- 861-D
This is a workaround for HDMI 1.4 sink which has a CEA mode with higher vic than what is defined in CEA-861-D.
As an example, a HDMI 1.4 sink has the video format 2560x1080p to be displayed and the video format is indicated by both SVD (with vic 90 and pictuure aspect ratio 64:27) and DTD. When connecting to such
Hi William, Change "pictuure aspect ratio" to "picture aspect ratio ".
sink, source
Typo - picture
can't output the video format in SVD because an error is returned by drm_hdmi_avi_infoframe_from_display_mode(), which can't fill the infoframe with pictuure aspect ratio 64:27 and the vic, which is
Same here.
originally 90
Typo - picture
and is changed to 0 by drm_mode_cea_vic().
To work around it, do not set the vic 0 so the corresponding mode may be accepted in drm_hdmi_avi_infoframe_from_display_mode() and be dispalyed.
Cc: Ville Syrjälä ville.syrjala@linux.intel.com Cc: Jani Nikula jani.nikula@linux.intel.com Cc: Wayne Lin waynelin@amd.com Cc: Lee Shawn C shawn.c.lee@intel.com Signed-off-by: William Tseng william.tseng@intel.com
drivers/gpu/drm/drm_edid.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index bc43e1b32092..a4582627ec9d 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -5876,7 +5876,8 @@ static u8 drm_mode_hdmi_vic(const struct drm_connector *connector, }
static u8 drm_mode_cea_vic(const struct drm_connector *connector,
const struct drm_display_mode *mode)
const struct drm_display_mode *mode,
bool is_hdmi2_sink)
{ u8 vic;
@@ -5896,7 +5897,7 @@ static u8 drm_mode_cea_vic(const struct drm_connector *connector, * 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_sink(connector) && vic > 64)
if (!is_hdmi2_sink && vic > 64) return 0;
return vic;
@@ -5927,7 +5928,7 @@ drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame, if (mode->flags & DRM_MODE_FLAG_DBLCLK) frame->pixel_repeat = 1;
- vic = drm_mode_cea_vic(connector, mode);
vic = drm_mode_cea_vic(connector, mode, true); hdmi_vic = drm_mode_hdmi_vic(connector, mode);
frame->picture_aspect = HDMI_PICTURE_ASPECT_NONE; @@ -
5971,7 +5972,8 @@ drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame, picture_aspect = HDMI_PICTURE_ASPECT_NONE; }
- frame->video_code = vic;
- frame->video_code = drm_mode_cea_vic(connector, mode,
frame->picture_aspect = picture_aspect; frame->active_aspect = HDMI_ACTIVE_ASPECT_PICTURE; frame->scan_mode = HDMI_SCAN_MODE_UNDERSCAN;is_hdmi2_sink(connector));
-- 2.17.1
-- Regards, Wayne Lin
Thanks Wayne for clarifying. I will correct the typos and submit the patch again.
-----Original Message----- From: Lin, Wayne Wayne.Lin@amd.com Sent: Monday, June 13, 2022 3:25 PM To: Tseng, William william.tseng@intel.com; dri-devel@lists.freedesktop.org Cc: Ville Syrjälä ville.syrjala@linux.intel.com; Jani Nikula jani.nikula@linux.intel.com; Lee, Shawn C shawn.c.lee@intel.com Subject: RE: [PATCH v2] drm/edid: ignore the CEA modes not defined in CEA-861-D
[AMD Official Use Only - General]
Thanks William!
After fixing few typos below, feel free to add:
Acked-by: Wayne Lin Wayne.Lin@amd.com
-----Original Message----- From: William Tseng william.tseng@intel.com Sent: Monday, June 13, 2022 12:27 PM To: dri-devel@lists.freedesktop.org Cc: William Tseng william.tseng@intel.com; Ville Syrjälä ville.syrjala@linux.intel.com; Jani Nikula jani.nikula@linux.intel.com; Lin, Wayne Wayne.Lin@amd.com; Lee Shawn C shawn.c.lee@intel.com Subject: [PATCH v2] drm/edid: ignore the CEA modes not defined in CEA- 861-D
This is a workaround for HDMI 1.4 sink which has a CEA mode with higher vic than what is defined in CEA-861-D.
As an example, a HDMI 1.4 sink has the video format 2560x1080p to be displayed and the video format is indicated by both SVD (with vic 90 and pictuure aspect ratio 64:27) and DTD. When connecting to such sink, source
Typo - picture
can't output the video format in SVD because an error is returned by drm_hdmi_avi_infoframe_from_display_mode(), which can't fill the infoframe with pictuure aspect ratio 64:27 and the vic, which is originally 90
Typo - picture
and is changed to 0 by drm_mode_cea_vic().
To work around it, do not set the vic 0 so the corresponding mode may be accepted in drm_hdmi_avi_infoframe_from_display_mode() and be dispalyed.
Cc: Ville Syrjälä ville.syrjala@linux.intel.com Cc: Jani Nikula jani.nikula@linux.intel.com Cc: Wayne Lin waynelin@amd.com Cc: Lee Shawn C shawn.c.lee@intel.com Signed-off-by: William Tseng william.tseng@intel.com
drivers/gpu/drm/drm_edid.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index bc43e1b32092..a4582627ec9d 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -5876,7 +5876,8 @@ static u8 drm_mode_hdmi_vic(const struct drm_connector *connector, }
static u8 drm_mode_cea_vic(const struct drm_connector *connector,
const struct drm_display_mode *mode)
const struct drm_display_mode *mode,
bool is_hdmi2_sink)
{ u8 vic;
@@ -5896,7 +5897,7 @@ static u8 drm_mode_cea_vic(const struct drm_connector *connector, * 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_sink(connector) && vic > 64)
if (!is_hdmi2_sink && vic > 64) return 0;
return vic;
@@ -5927,7 +5928,7 @@ drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame, if (mode->flags & DRM_MODE_FLAG_DBLCLK) frame->pixel_repeat = 1;
- vic = drm_mode_cea_vic(connector, mode);
vic = drm_mode_cea_vic(connector, mode, true); hdmi_vic = drm_mode_hdmi_vic(connector, mode);
frame->picture_aspect = HDMI_PICTURE_ASPECT_NONE; @@ -
5971,7 +5972,8 @@ drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame, picture_aspect = HDMI_PICTURE_ASPECT_NONE; }
- frame->video_code = vic;
- frame->video_code = drm_mode_cea_vic(connector, mode,
frame->picture_aspect = picture_aspect; frame->active_aspect = HDMI_ACTIVE_ASPECT_PICTURE; frame->scan_mode = HDMI_SCAN_MODE_UNDERSCAN;is_hdmi2_sink(connector));
-- 2.17.1
This is a workaround for HDMI 1.4 sink which has a CEA mode with higher vic than what is defined in CEA-861-D.
As an example, a HDMI 1.4 sink has the video format 2560x1080p to be displayed and the video format is indicated by both SVD (with vic 90 and picture aspect ratio 64:27) and DTD. When connecting to such sink, source can't output the video format in SVD because an error is returned by drm_hdmi_avi_infoframe_from_display_mode(), which can't fill the infoframe with picture aspect ratio 64:27 and the vic, which is originally 90 and is changed to 0 by drm_mode_cea_vic().
To work around it, do not set the vic 0 so the corresponding mode may be accepted in drm_hdmi_avi_infoframe_from_display_mode() and be dispalyed.
Cc: Ville Syrjälä ville.syrjala@linux.intel.com Cc: Jani Nikula jani.nikula@linux.intel.com Cc: Wayne Lin waynelin@amd.com Cc: Lee Shawn C shawn.c.lee@intel.com Signed-off-by: William Tseng william.tseng@intel.com --- drivers/gpu/drm/drm_edid.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index bc43e1b32092..a4582627ec9d 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -5876,7 +5876,8 @@ static u8 drm_mode_hdmi_vic(const struct drm_connector *connector, }
static u8 drm_mode_cea_vic(const struct drm_connector *connector, - const struct drm_display_mode *mode) + const struct drm_display_mode *mode, + bool is_hdmi2_sink) { u8 vic;
@@ -5896,7 +5897,7 @@ static u8 drm_mode_cea_vic(const struct drm_connector *connector, * 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_sink(connector) && vic > 64) + if (!is_hdmi2_sink && vic > 64) return 0;
return vic; @@ -5927,7 +5928,7 @@ drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame, if (mode->flags & DRM_MODE_FLAG_DBLCLK) frame->pixel_repeat = 1;
- vic = drm_mode_cea_vic(connector, mode); + vic = drm_mode_cea_vic(connector, mode, true); hdmi_vic = drm_mode_hdmi_vic(connector, mode);
frame->picture_aspect = HDMI_PICTURE_ASPECT_NONE; @@ -5971,7 +5972,8 @@ drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame, picture_aspect = HDMI_PICTURE_ASPECT_NONE; }
- frame->video_code = vic; + frame->video_code = drm_mode_cea_vic(connector, mode, + is_hdmi2_sink(connector)); frame->picture_aspect = picture_aspect; frame->active_aspect = HDMI_ACTIVE_ASPECT_PICTURE; frame->scan_mode = HDMI_SCAN_MODE_UNDERSCAN;
dri-devel@lists.freedesktop.org