Skip to contentSkip to conversation

drm: Don't generate invalid AVI infoframes for CEA modes

PATCH In review Damien Lespiau 2 participants 6 messages Aug 5, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm: Don't generate invalid AVI infoframes for CEA modes

Quoted 1 line

From CEA-861:

Data Byte 1, bit A0 indicates whether Active Format Data is present in Data Byte 2 bits R3 through R0. A source device shall set A0=1 when any of the AFD bits are set.

ie. if we want to set active_aspect, we need to set the active_info_valid bit to 1 as well.

---
 drivers/gpu/drm/drm_edid.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/drm_edid.c +1 -0
index 95d6f4b..8d1139f 100644
@@ -3107,6 +3107,7 @@ drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame,
 		return 0;
 
 	frame->picture_aspect = HDMI_PICTURE_ASPECT_NONE;
+	frame->active_info_valid = 1;
 	frame->active_aspect = HDMI_ACTIVE_ASPECT_PICTURE;
 
 	return 0;
Signature · 1 line
1.8.3.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Damien Lespiau
Quoted 1 line

From CEA-861:

Data Byte 1, bit A0 indicates whether Active Format Data is present in Data Byte 2 bits R3 through R0. A source device shall set A0=1 when any of the AFD bits are set.

ie. if we want to set active_aspect, we need to set the active_info_valid bit to 1 as well.

But why don't we just kill active_info_valid and instead just check active_aspect in hdmi_avi_infoframe_pack()?

Quoted 23 lines
---
 drivers/gpu/drm/drm_edid.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/drm_edid.c +1 -0
index 95d6f4b..8d1139f 100644
@@ -3107,6 +3107,7 @@ drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame,
 		return 0;
 
 	frame->picture_aspect = HDMI_PICTURE_ASPECT_NONE;
+	frame->active_info_valid = 1;
 	frame->active_aspect = HDMI_ACTIVE_ASPECT_PICTURE;
 
 	return 0;
Signature · 6 lines
1.8.3.1

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 2 lines
Ville Syrjälä
Intel OTC
#2 lore raw
Quoted 10 lines · Ville Syrjälä
Quoted 9 lines · Damien Lespiau
Quoted 1 line

From CEA-861:

Data Byte 1, bit A0 indicates whether Active Format Data is present in Data Byte 2 bits R3 through R0. A source device shall set A0=1 when any of the AFD bits are set.

ie. if we want to set active_aspect, we need to set the active_info_valid bit to 1 as well.

Quoted 7 lines
Quoted 2 lines

But why don't we just kill active_info_valid and instead just check active_aspect in hdmi_avi_infoframe_pack()?

Right, so I thought about that, I'd love to have an API that doesn't allow its user to do something wrong. My reflections so far:

1/ I did not want to depend on a fix that was outside of the drm/ directory for people that pull that directory between different kernels, they will end up missing the patch in video/hdmi.c.

On the other hand, we could just tell people to sync drivers/video/hdmi.c and include/linux/hdmi.h along with drm/.

2/ I was thinking that killing the _valid bits in the hdmi_avi_infoframe struct would not allow an _unpack() function that can check if the infoframe was valid.

Probably thinking too much though...

Signature · 1 line
Damien
#3 lore raw
In reply to Damien Lespiau
Quoted 20 lines · Damien Lespiau
Quoted 1 line

From CEA-861:

Data Byte 1, bit A0 indicates whether Active Format Data is present in Data Byte 2 bits R3 through R0. A source device shall set A0=1 when any of the AFD bits are set.

ie. if we want to set active_aspect, we need to set the active_info_valid bit to 1 as well.

---
 drivers/gpu/drm/drm_edid.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/drm_edid.c +0 -0
index 95d6f4b..8d1139f 100644

drivers/gpu/drm/drm_edid.c drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame, · line 3107

Quoted 1 line
drivers/gpu/drm/drm_edid.c +0 -0
@@ -3107,6 +3107,7 @@ drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame,
 		return 0;

Nothing to do with this patch, but I just spotted this return here. So we're not populating the aspect ratio stuff if VIC=0. Doesn't really make sense to me. Who will tell me what this is trying to achieve?

Quoted 13 lines
drivers/gpu/drm/drm_edid.c +1 -0
 	frame->picture_aspect = HDMI_PICTURE_ASPECT_NONE;
+	frame->active_info_valid = 1;
 	frame->active_aspect = HDMI_ACTIVE_ASPECT_PICTURE;
 
 	return 0;
Signature · 6 lines
1.8.3.1

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 2 lines
Ville Syrjälä
Intel OTC
#4 lore raw
Quoted 16 lines · Ville Syrjälä
Quoted 15 lines · Damien Lespiau
Quoted 1 line

From CEA-861:

Data Byte 1, bit A0 indicates whether Active Format Data is present in Data Byte 2 bits R3 through R0. A source device shall set A0=1 when any of the AFD bits are set.

ie. if we want to set active_aspect, we need to set the active_info_valid bit to 1 as well.

---
 drivers/gpu/drm/drm_edid.c | 1 +
 1 file changed, 1 insertion(+)
Quoted 10 lines

drivers/gpu/drm/drm_edid.c drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame, · line 3107

Quoted 6 lines
drivers/gpu/drm/drm_edid.c +0 -0
index 95d6f4b..8d1139f 100644
@@ -3107,6 +3107,7 @@ drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame,
 		return 0;

Nothing to do with this patch, but I just spotted this return here. So we're not populating the aspect ratio stuff if VIC=0. Doesn't really make sense to me. Who will tell me what this is trying to achieve?

I wondered about that to. The intent seems to not set those bits when we're not setting a CEA mode. I guess the author thought that only CEA modes can understand the infoframes described in CEA-861. I haven't found any evidence of that, but made some sense to me.

Signature · 1 line
Damien
#5 lore raw
Quoted 28 lines · Damien Lespiau
Quoted 16 lines · Ville Syrjälä
Quoted 15 lines · Damien Lespiau
Quoted 1 line

From CEA-861:

Data Byte 1, bit A0 indicates whether Active Format Data is present in Data Byte 2 bits R3 through R0. A source device shall set A0=1 when any of the AFD bits are set.

ie. if we want to set active_aspect, we need to set the active_info_valid bit to 1 as well.

---
 drivers/gpu/drm/drm_edid.c | 1 +
 1 file changed, 1 insertion(+)
Quoted 10 lines

drivers/gpu/drm/drm_edid.c drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame, · line 3107

Quoted 6 lines
drivers/gpu/drm/drm_edid.c +0 -0
index 95d6f4b..8d1139f 100644
@@ -3107,6 +3107,7 @@ drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame,
 		return 0;

Nothing to do with this patch, but I just spotted this return here. So we're not populating the aspect ratio stuff if VIC=0. Doesn't really make sense to me. Who will tell me what this is trying to achieve?

Quoted 4 lines

I wondered about that to. The intent seems to not set those bits when we're not setting a CEA mode. I guess the author thought that only CEA modes can understand the infoframes described in CEA-861. I haven't found any evidence of that, but made some sense to me.

Perhaps. I'm leaning towards just killing that check though.

Signature · 2 lines
Ville Syrjälä
Intel OTC