drm/edid: Refine HDMI VSDB detect
Subsystems (2)
PATCH 1/1 drm/edid: Refine HDMI VSDB detect
According to CEA-861-F chapter 7.5.4. It says "The VSDB shall contain the 3 bytes of the IEEE OUI as well as any additional payload bytes needed." Now DRM driver check HDMI OUI but VSDB payload size at least five bytes. That may caused some HDMI monitors' audio feature can't be enabled. Because of they only have three bytes payload (OUI only) in VSDB.
--- drivers/gpu/drm/drm_edid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/drm_edid.c +1 -1
@@ -4205,7 +4205,7 @@ static bool cea_db_is_hdmi_vsdb(const u8 *db)if (cea_db_tag (db) !=VENDOR_BLOCK )return false; -if (cea_db_payload_len (db) <5 ) +if (cea_db_payload_len (db) <3 )return false;return oui (db[3 ], db[2 ], db[1 ]) ==HDMI_IEEE_OUI ;
Signature · 1 line
2.31.1
Quoted 5 lines · Lee Shawn C
According to CEA-861-F chapter 7.5.4. It says "The VSDB shall contain the 3 bytes of the IEEE OUI as well as any additional payload bytes needed." Now DRM driver check HDMI OUI but VSDB payload size at least five bytes. That may caused some HDMI monitors' audio feature can't be enabled. Because of they only have three bytes payload (OUI only) in VSDB.
HDMI 1.4a says
"Sinks shall contain an HDMI VSDB minimally containing a 2-byte Source
Physical Address field following the 24-bit identifier. ... The minimum value of N (length) is 5 and the maximum value of N is 31."
Do you actually have an EDID that violates that?
Quoted 24 lines
Cc Ville Syrjälä <[email protected]>Cc Adam Jackson <[email protected]>Cc Dave Airlie <[email protected]>Signed-off-by Lee Shawn C <[email protected]>--- drivers/gpu/drm/drm_edid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/drm_edid.c +1
-1@@ -4205,7 +4205,7 @@ static bool cea_db_is_hdmi_vsdb(const u8 *db)if (cea_db_tag (db) !=VENDOR_BLOCK )return false; -if (cea_db_payload_len (db) <5 ) +if (cea_db_payload_len (db) <3 )return false;return oui (db[3 ], db[2 ], db[1 ]) ==HDMI_IEEE_OUI ;Signature · 1 line
2.31.1
Signature · 2 lines
Ville Syrjälä Intel
Quoted 8 lines · Ville Syrjälä
Quoted 6 lines · Lee Shawn C
According to CEA-861-F chapter 7.5.4. It says "The VSDB shall contain the
3 bytes of the IEEE OUI as well as any additional payload bytes needed." Now DRM driver check HDMI OUI but VSDB payload size at least five bytes. That may caused some HDMI monitors' audio feature can't be enabled. Because of they only have three bytes payload (OUI only) in VSDB.
Quoted 6 lines
HDMI 1.4a says
"Sinks shall contain an HDMI VSDB minimally containing a 2-byte Source Physical Address field following the 24-bit identifier. ... The minimum value of N (length) is 5 and the maximum value of N is 31."Do you actually have an EDID that violates that?
Yes! User report when connect to HDMI port on Acer V226HQL. Audio is not working. But windows system did not have the same problem. We found its VSDB just have 3 bytes payload (OUI). Then we share this patch to user then they report audio works properly with this patch.
Best regards,
Shawn
Quoted 29 lines
Quoted 23 lines
Cc Ville Syrjälä <[email protected]>Cc Adam Jackson <[email protected]>Cc Dave Airlie <[email protected]>Signed-off-by Lee Shawn C <[email protected]>--- drivers/gpu/drm/drm_edid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/drm_edid.c +1
-2@@ -4205,7 +4205,7 @@ static bool cea_db_is_hdmi_vsdb(const u8 *db)if (cea_db_tag (db) !=VENDOR_BLOCK )return false; -if (cea_db_payload_len (db) <5 ) +if (cea_db_payload_len (db) <3 )return false;return oui (db[3 ], db[2 ], db[1 ]) ==HDMI_IEEE_OUI ; --Quoted 1 line
2.31.1
--
Ville Syrjälä
Intel
Quoted 14 lines · Shawn C
Quoted 12 lines · Ville Syrjälä
Quoted 6 lines · Lee Shawn C
According to CEA-861-F chapter 7.5.4. It says "The VSDB shall contain the
3 bytes of the IEEE OUI as well as any additional payload bytes needed." Now DRM driver check HDMI OUI but VSDB payload size at least five bytes. That may caused some HDMI monitors' audio feature can't be enabled. Because of they only have three bytes payload (OUI only) in VSDB.HDMI 1.4a says
"Sinks shall contain an HDMI VSDB minimally containing a 2-byte Source Physical Address field following the 24-bit identifier. ... The minimum value of N (length) is 5 and the maximum value of N is 31."
Quoted 7 lines
Quoted 2 lines
Do you actually have an EDID that violates that?
Yes! User report when connect to HDMI port on Acer V226HQL. Audio is not working. But windows system did not have the same problem. We found its VSDB just have 3 bytes payload (OUI). Then we share this patch to user then they report audio works properly with this patch.
Hrm. This deserves a comment then since it clearly violates the spec. Also a link to the bug if you have one would be nice to include here.
Quoted 33 lines
Best regards,
ShawnQuoted 29 lines
Quoted 23 lines
Cc Ville Syrjälä <[email protected]>Cc Adam Jackson <[email protected]>Cc Dave Airlie <[email protected]>Signed-off-by Lee Shawn C <[email protected]>--- drivers/gpu/drm/drm_edid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/drm_edid.c +1
-2@@ -4205,7 +4205,7 @@ static bool cea_db_is_hdmi_vsdb(const u8 *db)if (cea_db_tag (db) !=VENDOR_BLOCK )return false; -if (cea_db_payload_len (db) <5 ) +if (cea_db_payload_len (db) <3 )return false;return oui (db[3 ], db[2 ], db[1 ]) ==HDMI_IEEE_OUI ; --Quoted 1 line
2.31.1
--
Ville Syrjälä
Intel
Signature · 2 lines
Ville Syrjälä Intel
Quoted 18 lines · Ville Syrjälä
Quoted 17 lines · Shawn C
Quoted 14 lines · Ville Syrjälä
Quoted 6 lines · Lee Shawn C
According to CEA-861-F chapter 7.5.4. It says "The VSDB shall contain the
3 bytes of the IEEE OUI as well as any additional payload bytes needed." Now DRM driver check HDMI OUI but VSDB payload size at least five bytes. That may caused some HDMI monitors' audio feature can't be enabled. Because of they only have three bytes payload (OUI only) in VSDB.HDMI 1.4a says
"Sinks shall contain an HDMI VSDB minimally containing a 2-byte Source Physical Address field following the 24-bit identifier. ... The minimum value of N (length) is 5 and the maximum value of N is 31."Do you actually have an EDID that violates that?
Quoted 8 lines
Quoted 4 lines
Yes! User report when connect to HDMI port on Acer V226HQL. Audio is not working. But windows system did not have the same problem. We found its VSDB just have 3 bytes payload (OUI). Then we share this patch to user then they report audio works properly with this patch.
Hrm. This deserves a comment then since it clearly violates the spec. Also a link to the bug if you have one would be nice to include here.
Let me create an issue and update monitor's EDID for you reference.
But I'm not sure which community is suitable to report this problem.
It looks to me should belong to DRM driver https://gitlab.freedesktop.org/drm/misc/-/issues.
Do you have any suggestion? Thanks!
Quoted 33 lines
Quoted 33 lines
Best regards,
ShawnQuoted 29 lines
Quoted 23 lines
Cc Ville Syrjälä <[email protected]>Cc Adam Jackson <[email protected]>Cc Dave Airlie <[email protected]>Signed-off-by Lee Shawn C <[email protected]>--- drivers/gpu/drm/drm_edid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/drm_edid.c +1
-2@@ -4205,7 +4205,7 @@ static bool cea_db_is_hdmi_vsdb(const u8 *db)if (cea_db_tag (db) !=VENDOR_BLOCK )return false; -if (cea_db_payload_len (db) <5 ) +if (cea_db_payload_len (db) <3 )return false;return oui (db[3 ], db[2 ], db[1 ]) ==HDMI_IEEE_OUI ; --Quoted 1 line
2.31.1
--
Ville Syrjälä
Intel
Quoted 25 lines · Shawn C
Quoted 23 lines · Ville Syrjälä
Quoted 21 lines · Shawn C
Quoted 8 lines · Ville Syrjälä
Quoted 6 lines · Lee Shawn C
According to CEA-861-F chapter 7.5.4. It says "The VSDB shall contain the
3 bytes of the IEEE OUI as well as any additional payload bytes needed." Now DRM driver check HDMI OUI but VSDB payload size at least five bytes. That may caused some HDMI monitors' audio feature can't be enabled. Because of they only have three bytes payload (OUI only) in VSDB.Quoted 6 lines
HDMI 1.4a says
"Sinks shall contain an HDMI VSDB minimally containing a 2-byte Source Physical Address field following the 24-bit identifier. ... The minimum value of N (length) is 5 and the maximum value of N is 31."Do you actually have an EDID that violates that?
Yes! User report when connect to HDMI port on Acer V226HQL. Audio is not working. But windows system did not have the same problem. We found its VSDB just have 3 bytes payload (OUI). Then we share this patch to user then they report audio works properly with this patch.
Quoted 7 lines
Quoted 3 lines
Hrm. This deserves a comment then since it clearly violates the spec. Also a link to the bug if you have one would be nice to include here.
Let me create an issue and update monitor's EDID for you reference.
But I'm not sure which community is suitable to report this problem.
It looks to me should belong to DRM driver https://gitlab.freedesktop.org/drm/misc/-/issues.
That seems fine to me.
Quoted 35 lines
Do you have any suggestion? Thanks!
Quoted 33 lines
Quoted 33 lines
Best regards,
ShawnQuoted 29 lines
Quoted 23 lines
Cc Ville Syrjälä <[email protected]>Cc Adam Jackson <[email protected]>Cc Dave Airlie <[email protected]>Signed-off-by Lee Shawn C <[email protected]>--- drivers/gpu/drm/drm_edid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/drm_edid.c +1
-2@@ -4205,7 +4205,7 @@ static bool cea_db_is_hdmi_vsdb(const u8 *db)if (cea_db_tag (db) !=VENDOR_BLOCK )return false; -if (cea_db_payload_len (db) <5 ) +if (cea_db_payload_len (db) <3 )return false;return oui (db[3 ], db[2 ], db[1 ]) ==HDMI_IEEE_OUI ; --Quoted 1 line
2.31.1
--
Ville Syrjälä
Intel
Signature · 2 lines
Ville Syrjälä Intel
Quoted 30 lines · Ville Syrjälä
Quoted 29 lines · Shawn C
Quoted 26 lines · Ville Syrjälä
Quoted 14 lines · Shawn C
Quoted 12 lines · Ville Syrjälä
Quoted 6 lines · Lee Shawn C
According to CEA-861-F chapter 7.5.4. It says "The VSDB shall contain the
3 bytes of the IEEE OUI as well as any additional payload bytes needed." Now DRM driver check HDMI OUI but VSDB payload size at least five bytes. That may caused some HDMI monitors' audio feature can't be enabled. Because of they only have three bytes payload (OUI only) in VSDB.HDMI 1.4a says
"Sinks shall contain an HDMI VSDB minimally containing a 2-byte Source Physical Address field following the 24-bit identifier. ... The minimum value of N (length) is 5 and the maximum value of N is 31."Quoted 7 lines
Quoted 2 lines
Do you actually have an EDID that violates that?
Yes! User report when connect to HDMI port on Acer V226HQL. Audio is not working. But windows system did not have the same problem. We found its VSDB just have 3 bytes payload (OUI). Then we share this patch to user then they report audio works properly with this patch.
Hrm. This deserves a comment then since it clearly violates the spec. Also a link to the bug if you have one would be nice to include here.
Quoted 6 lines
Quoted 3 lines
Let me create an issue and update monitor's EDID for you reference.
But I'm not sure which community is suitable to report this problem.
It looks to me should belong to DRM driver https://gitlab.freedesktop.org/drm/misc/-/issues.That seems fine to me.
Here is the link, thanks! https://gitlab.freedesktop.org/drm/misc/-/issues/28
Quoted 36 lines
Quoted 35 lines
Do you have any suggestion? Thanks!
Quoted 33 lines
Quoted 33 lines
Best regards,
ShawnQuoted 29 lines
Quoted 23 lines
Cc Ville Syrjälä <[email protected]>Cc Adam Jackson <[email protected]>Cc Dave Airlie <[email protected]>Signed-off-by Lee Shawn C <[email protected]>--- drivers/gpu/drm/drm_edid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/drm_edid.c +1
-2@@ -4205,7 +4205,7 @@ static bool cea_db_is_hdmi_vsdb(const u8 *db)if (cea_db_tag (db) !=VENDOR_BLOCK )return false; -if (cea_db_payload_len (db) <5 ) +if (cea_db_payload_len (db) <3 )return false;return oui (db[3 ], db[2 ], db[1 ]) ==HDMI_IEEE_OUI ; --Quoted 1 line
2.31.1
--
Ville Syrjälä
Intel
Quoted 19 lines · Lee Shawn C
According to CEA-861-F chapter 7.5.4. It says "The VSDB shall contain the 3 bytes of the IEEE OUI as well as any additional payload bytes needed." Now DRM driver check HDMI OUI but VSDB payload size at least five bytes. That may caused some HDMI monitors' audio feature can't be enabled. Because of they only have three bytes payload (OUI only) in VSDB.
Cc Ville Syrjälä <[email protected]>Cc Adam Jackson <[email protected]>Cc Dave Airlie <[email protected]>Signed-off-by Lee Shawn C <[email protected]>--- drivers/gpu/drm/drm_edid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/drm_edid.c +0
-0
drivers/gpu/drm/drm_edid.c static bool cea_db_is_hdmi_vsdb(const u8 *db) · line 4209
Quoted 6 lines
drivers/gpu/drm/drm_edid.c +1
-1@@ -4205,7 +4205,7 @@ static bool cea_db_is_hdmi_vsdb(const u8 *db)if (cea_db_tag (db) !=VENDOR_BLOCK )return false; -if (cea_db_payload_len (db) <5 ) +if (cea_db_payload_len (db) <3 )return false;
I was a a bit worried that we are now assuming that we can parse some stuff without further length checks, but looks like that's just the "source physical address" stuff which we do not parse in drm_edid.c, and the other fields we do parse are actually optional and so already have the require length checks. So this seems fine.
Note that there is a second edid parser in cec_get_edid_spa_location() that does parse the source physical address. You may want to double check that it doesn't make any bad assumptions about the length of the vsdb either. I think we should probably get rid of that second parser and just have drm_edid.c extract the source physical address and pass that on directly to the cec code instead. But I guess the cec code still couldn't remove the second parser since some media drivers need it :( Though it could then perhaps be moved into the media code instead of having it as a massive inline function in the cec headers.
Signature · 2 lines
Ville Syrjälä Intel
Quoted 24 lines · Ville Syrjälä
Quoted 23 lines · Lee Shawn C
According to CEA-861-F chapter 7.5.4. It says "The VSDB shall contain the
3 bytes of the IEEE OUI as well as any additional payload bytes needed." Now DRM driver check HDMI OUI but VSDB payload size at least five bytes. That may caused some HDMI monitors' audio feature can't be enabled. Because of they only have three bytes payload (OUI only) in VSDB.Cc Ville Syrjälä <[email protected]>Cc Adam Jackson <[email protected]>Cc Dave Airlie <[email protected]>Signed-off-by Lee Shawn C <[email protected]>--- drivers/gpu/drm/drm_edid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/drm_edid.c +0
-0@@ -4205,7 +4205,7 @@ static bool cea_db_is_hdmi_vsdb(const u8 *db)if (cea_db_tag (db) !=VENDOR_BLOCK )return false;
Quoted 10 lines
drivers/gpu/drm/drm_edid.c static bool cea_db_is_hdmi_vsdb(const u8 *db) · line 4209
Quoted 3 lines
drivers/gpu/drm/drm_edid.c +1
-1-if (cea_db_payload_len (db) <5 ) +if (cea_db_payload_len (db) <3 )return false;I was a a bit worried that we are now assuming that we can parse some stuff without further length checks, but looks like that's just the "source physical address" stuff which we do not parse in
drm_edid.c, and the other fields we do parse are actually optional and so already have the require length checks. So this seems fine.
Thanks for the comments! We will share the information to customer.
Best regards,
Shawn
Quoted 17 lines
Reviewed-by Ville Syrjälä <[email protected]>Note that there is a second edid parser in
cec_get_edid_spa_location()that does parse the source physical address. You may want to double check that it doesn't make any bad assumptions about the length of the vsdb either. I think we should probably get rid of that second parser and just havedrm_edid.cextract the source physical address and pass that on directly to the cec code instead. But I guess the cec code still couldn't remove the second parser since some media drivers need it :( Though it could then perhaps be moved into the media code instead of having it as a massive inline function in the cec headers.--
Ville Syrjälä
Intel