drm/edid: Clean up display_info stuff
Subsystems (4)
cover drm/edid: Clean up display_info stuff
From: Ville Syrjälä <[email protected]>
This series aims to clean up the way we fill out the display_info structure a bit. Mainly doing a clean separation of the audio and video related bits.
My aim is getting i915 to respect the HDMI sink TMDS clock limit (currently we respect only the DP++ dongle limit, and the source limit). But while doing that, I noticed that the display_info stuff was a bit of mess, hence it resulted in this bigger series.
Entire series available here:git://github.com/vsyrjala/linux.git hdmi_sink_tmds_limit_3
Ville Syrjälä (10):
drm/edid: Clear old audio latency values before parsing the new EDID drm/edid: Clear old dvi_dual/max_tmds_clock before parsing the new
EDID
drm/edid: Make max_tmds_clock kHz instead of MHz
drm/edid: Move dvi_dual/max_tmds_clock to drm_display_info drm/edid: Don't pass around drm_display_info needlessly drm/edid: Reduce the number of times we parse the CEA extension block drm/edid: Clear the old cea_rev when there's no CEA extension in the
new EDID
drm/edid: Move dvi_dual/max_tmds_clock parsing out from
drm_edid_to_eld()
drm/i915: Replace a bunch of connector->base.display_info with a local
variable
drm/i915: Account for sink max TMDS clock when checking the port clock
drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c | 4 +- drivers/gpu/drm/drm_edid.c | 258 +++++++++++++------------ drivers/gpu/drm/i915/intel_display.c | 14 +- drivers/gpu/drm/i915/intel_hdmi.c | 9 +- drivers/gpu/drm/radeon/radeon_connectors.c | 4 +- include/drm/drm_crtc.h | 7 +- 6 files changed, 152 insertions(+), 144 deletions(-)
Signature · 6 lines
2.7.4 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 1/10 drm/edid: Clear old audio latency values before parsing the new EDID
From: Ville Syrjälä <[email protected]>
Clear out stale audio latency information (potentially from a previous EDID) before constructing the ELD from the EDID.
--- drivers/gpu/drm/drm_edid.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/gpu/drm/drm_edid.c +7 -0
@@ -3353,6 +3353,13 @@ void drm_edid_to_eld(struct drm_connector *connector, struct edid *edid)memset (eld,0 ,sizeof (connector->eld)); + connector->latency_present[0 ] = false; + connector->latency_present[1 ] = false; + connector->video_latency[0 ] =0 ; + connector->audio_latency[0 ] =0 ; + connector->video_latency[1 ] =0 ; + connector->audio_latency[1 ] =0 ; + cea =drm_find_cea_extension (edid);if (!cea) {DRM_DEBUG_KMS ("ELD: no CEA Extension found\n" );
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 2/10 drm/edid: Clear old dvi_dual/max_tmds_clock before parsing the new EDID
In reply to [email protected]From: Ville Syrjälä <[email protected]>
Clear out old max_tmds_clock and dvi_dual information (possibly from a previous EDID) before parsing the current EDID. Tne current EDID might not even have these in its HDMI VSDB, which would mean that we'd leave the old stale values in place.
--- drivers/gpu/drm/drm_edid.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/drm_edid.c +3 -0
@@ -3360,6 +3360,9 @@ void drm_edid_to_eld(struct drm_connector *connector, struct edid *edid) connector->video_latency[1 ] =0 ; connector->audio_latency[1 ] =0 ; + connector->max_tmds_clock =0 ; + connector->dvi_dual = false; + cea =drm_find_cea_extension (edid);if (!cea) {DRM_DEBUG_KMS ("ELD: no CEA Extension found\n" );
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 3/10 drm/edid: Make max_tmds_clock kHz instead of MHz
In reply to [email protected]From: Ville Syrjälä <[email protected]>
We generally store clocks in kHz, so let's do that for the HDMI max TMDS clock value as well. Less surpising.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c | 2 +- drivers/gpu/drm/drm_edid.c | 2 +- drivers/gpu/drm/radeon/radeon_connectors.c | 2 +- include/drm/drm_crtc.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c +1 -1
@@ -173,7 +173,7 @@ int amdgpu_connector_get_monitor_bpc(struct drm_connector *connector) mode_clock = amdgpu_connector->pixelclock_for_modeset;/* Maximum allowable input clock in kHz */ - max_tmds_clock = connector->max_tmds_clock *1000 ; + max_tmds_clock = connector->max_tmds_clock;DRM_DEBUG ("%s: hdmi mode dotclock %d kHz, max tmds input clock %d kHz.\n" , connector->name, mode_clock, max_tmds_clock);
drivers/gpu/drm/drm_edid.c +1 -1
@@ -3257,7 +3257,7 @@ parse_hdmi_vsdb(struct drm_connector *connector, const u8 *db) connector->dvi_dual = db[6 ] &1 ; }if (len >=7 ) - connector->max_tmds_clock = db[7 ] *5 ; + connector->max_tmds_clock = db[7 ] *5000 ;if (len >=8 ) { connector->latency_present[0 ] = db[8 ] >>7 ; connector->latency_present[1 ] = (db[8 ] >>6 ) &1 ;
drivers/gpu/drm/radeon/radeon_connectors.c +1 -1
@@ -203,7 +203,7 @@ int radeon_get_monitor_bpc(struct drm_connector *connector) mode_clock = radeon_connector->pixelclock_for_modeset;/* Maximum allowable input clock in kHz */ - max_tmds_clock = connector->max_tmds_clock *1000 ; + max_tmds_clock = connector->max_tmds_clock;DRM_DEBUG ("%s: hdmi mode dotclock %d kHz, max tmds input clock %d kHz.\n" , connector->name, mode_clock, max_tmds_clock);
include/drm/drm_crtc.h +1 -1
@@ -1366,7 +1366,7 @@ struct drm_connector {/* EDID bits */ uint8_t eld[MAX_ELD_BYTES ];bool dvi_dual; -int max_tmds_clock;/* in MHz */ +int max_tmds_clock;/* in kHz */ bool latency_present[2 ];int video_latency[2 ];/* [0]: progressive, [1]: interlaced */ int audio_latency[2 ];
Signature · 6 lines
2.7.4 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 4/10 drm/edid: Move dvi_dual/max_tmds_clock to drm_display_info
In reply to [email protected]From: Ville Syrjälä <[email protected]>
We have the drm_display_info for storing information about the sink, so let's move dvi_dual and max_tmds_clock in there.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c | 4 ++-- drivers/gpu/drm/drm_edid.c | 14 ++++++++------ drivers/gpu/drm/radeon/radeon_connectors.c | 4 ++-- include/drm/drm_crtc.h | 7 +++---- 4 files changed, 15 insertions(+), 14 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c +2 -2
@@ -168,12 +168,12 @@ int amdgpu_connector_get_monitor_bpc(struct drm_connector *connector) }/* Any defined maximum tmds clock limit we must not exceed? */ -if (connector->max_tmds_clock >0 ) { +if (connector->display_info.max_tmds_clock >0 ) {/* mode_clock is clock in kHz for mode to be modeset on this connector */ mode_clock = amdgpu_connector->pixelclock_for_modeset;/* Maximum allowable input clock in kHz */ - max_tmds_clock = connector->max_tmds_clock; + max_tmds_clock = connector->display_info.max_tmds_clock;DRM_DEBUG ("%s: hdmi mode dotclock %d kHz, max tmds input clock %d kHz.\n" , connector->name, mode_clock, max_tmds_clock);
drivers/gpu/drm/drm_edid.c +8 -6
@@ -3250,14 +3250,15 @@ static void fixup_detailed_cea_mode_clock(struct drm_display_mode *mode)static void parse_hdmi_vsdb (struct drm_connector *connector,const u8 *db) { +struct drm_display_info *info = &connector->display_info;u8 len =cea_db_payload_len (db);if (len >=6 ) { connector->eld[5 ] |= (db[6 ] >>7 ) <<1 ;/* Supports_AI */ - connector->dvi_dual = db[6 ] &1 ; + info->dvi_dual = db[6 ] &1 ; }if (len >=7 ) - connector->max_tmds_clock = db[7 ] *5000 ; + info->max_tmds_clock = db[7 ] *5000 ;if (len >=8 ) { connector->latency_present[0 ] = db[8 ] >>7 ; connector->latency_present[1 ] = (db[8 ] >>6 ) &1 ;
@@ -3276,8 +3277,8 @@ parse_hdmi_vsdb(struct drm_connector *connector, const u8 *db)"latency present %d %d, " "video latency %d %d, " "audio latency %d %d\n" , - connector->dvi_dual, - connector->max_tmds_clock, + info->dvi_dual, + info->max_tmds_clock, (int ) connector->latency_present[0 ], (int ) connector->latency_present[1 ], connector->video_latency[0],
@@ -3344,6 +3345,7 @@ EXPORT_SYMBOL(drm_edid_get_monitor_name);*/ void drm_edid_to_eld (struct drm_connector *connector,struct edid *edid) { +struct drm_display_info *info = &connector->display_info;uint8_t *eld = connector->eld;u8 *cea;u8 *db;
@@ -3360,8 +3362,8 @@ void drm_edid_to_eld(struct drm_connector *connector, struct edid *edid) connector->video_latency[1 ] =0 ; connector->audio_latency[1 ] =0 ; - connector->max_tmds_clock =0 ; - connector->dvi_dual = false; + info->max_tmds_clock =0 ; + info->dvi_dual = false; cea =drm_find_cea_extension (edid);if (!cea) {
drivers/gpu/drm/radeon/radeon_connectors.c +2 -2
@@ -198,12 +198,12 @@ int radeon_get_monitor_bpc(struct drm_connector *connector) }/* Any defined maximum tmds clock limit we must not exceed? */ -if (connector->max_tmds_clock >0 ) { +if (connector->display_info.max_tmds_clock >0 ) {/* mode_clock is clock in kHz for mode to be modeset on this connector */ mode_clock = radeon_connector->pixelclock_for_modeset;/* Maximum allowable input clock in kHz */ - max_tmds_clock = connector->max_tmds_clock; + max_tmds_clock = connector->display_info.max_tmds_clock;DRM_DEBUG ("%s: hdmi mode dotclock %d kHz, max tmds input clock %d kHz.\n" , connector->name, mode_clock, max_tmds_clock);
include/drm/drm_crtc.h +3 -4
@@ -150,6 +150,9 @@ struct drm_display_info {unsigned int num_bus_formats;u32 bus_flags; +int max_tmds_clock;/* in kHz */ +bool dvi_dual; +/* Mask of supported hdmi deep color modes */ u8 edid_hdmi_dc_modes;
@@ -1268,8 +1271,6 @@ struct drm_encoder {* @encoder_ids: valid encoders for this connector * @encoder: encoder driving this connector, if any * @eld: EDID-like data, if present -* @dvi_dual: dual link DVI, if found -* @max_tmds_clock: max clock rate, if found * @latency_present: AV delay info from ELD, if found * @video_latency: video latency info from ELD, if found * @audio_latency: audio latency info from ELD, if found
@@ -1365,8 +1366,6 @@ struct drm_connector {/* EDID bits */ uint8_t eld[MAX_ELD_BYTES ]; -bool dvi_dual; -int max_tmds_clock;/* in kHz */ bool latency_present[2 ];int video_latency[2 ];/* [0]: progressive, [1]: interlaced */ int audio_latency[2 ];
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 5/10 drm/edid: Don't pass around drm_display_info needlessly
In reply to [email protected]From: Ville Syrjälä <[email protected]>
We already pass the connector to drm_add_display_info() and drm_assign_hdmi_deep_color_info(), so passing the connector->display_info also is pointless.
--- drivers/gpu/drm/drm_edid.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-)
drivers/gpu/drm/drm_edid.c +4 -7
@@ -3732,17 +3732,15 @@ EXPORT_SYMBOL(drm_rgb_quant_range_selectable);* drm_assign_hdmi_deep_color_info - detect whether monitor supports * hdmi deep color modes and update drm_display_info if so. * @edid: monitor EDID information -* @info: Updated with maximum supported deep color bpc and color format -* if deep color supported. * @connector: DRM connector, used only for debug output * * Parse the CEA extension according to CEA-861-B. * Return true if HDMI deep color supported, false if not or unknown. */ static bool drm_assign_hdmi_deep_color_info (struct edid *edid, -struct drm_display_info *info,struct drm_connector *connector) { +struct drm_display_info *info = &connector->display_info;u8 *edid_ext, *hdmi;int i;int start_offset, end_offset;
@@ -3832,7 +3830,6 @@ static bool drm_assign_hdmi_deep_color_info(struct edid *edid,/** * drm_add_display_info - pull display info out if present * @edid: EDID data -* @info: display info (attached to connector) * @connector: connector whose edid is used to build display info * * Grab any available display info and stuff it into the drm_display_info
@@ -3840,9 +3837,9 @@ static bool drm_assign_hdmi_deep_color_info(struct edid *edid,* color spaces. */ static void drm_add_display_info (struct edid *edid, -struct drm_display_info *info,struct drm_connector *connector) { +struct drm_display_info *info = &connector->display_info;u8 *edid_ext; info->width_mm = edid->width_cm *10 ;
@@ -3872,7 +3869,7 @@ static void drm_add_display_info(struct edid *edid, }/* HDMI deep color modes supported? Assign to info, if so */ -drm_assign_hdmi_deep_color_info (edid, info, connector); +drm_assign_hdmi_deep_color_info (edid, connector);/* Only defined for 1.4 with digital displays */ if (edid->revision <4 )
@@ -4092,7 +4089,7 @@ int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid)if (quirks & (EDID_QUIRK_PREFER_LARGE_60 |EDID_QUIRK_PREFER_LARGE_75 ))edid_fixup_preferred (connector, quirks); -drm_add_display_info (edid, &connector->display_info, connector); +drm_add_display_info (edid, connector);if (quirks &EDID_QUIRK_FORCE_8BPC ) connector->display_info.bpc =8 ;
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 6/10 drm/edid: Reduce the number of times we parse the CEA extension block
In reply to [email protected]From: Ville Syrjälä <[email protected]>
Instead of parsing parts of the CEA extension block in two places to determine supported color formats and whatnot, let's just consolidate it to one function. This also makes it possible to neatly flatten drm_assign_hdmi_deep_color_info().
--- drivers/gpu/drm/drm_edid.c | 192 +++++++++++++++++++++------------------------ 1 file changed, 89 insertions(+), 103 deletions(-)
drivers/gpu/drm/drm_edid.c +89 -103
@@ -3728,119 +3728,119 @@ bool drm_rgb_quant_range_selectable(struct edid *edid) }EXPORT_SYMBOL (drm_rgb_quant_range_selectable); -/** -* drm_assign_hdmi_deep_color_info - detect whether monitor supports -* hdmi deep color modes and update drm_display_info if so. -* @edid: monitor EDID information -* @connector: DRM connector, used only for debug output -* -* Parse the CEA extension according to CEA-861-B. -* Return true if HDMI deep color supported, false if not or unknown. -*/ -static bool drm_assign_hdmi_deep_color_info (struct edid *edid, -struct drm_connector *connector) +static void drm_parse_hdmi_deep_color_info (struct drm_connector *connector, +const u8 *hdmi) {struct drm_display_info *info = &connector->display_info; -u8 *edid_ext, *hdmi; -int i; -int start_offset, end_offset;unsigned int dc_bpc =0 ; - edid_ext =drm_find_cea_extension (edid); -if (!edid_ext) -return false; +/* HDMI supports at least 8 bpc */ + info->bpc =8 ; -if (cea_db_offsets (edid_ext, &start_offset, &end_offset)) -return false; +if (cea_db_payload_len (hdmi) <6 ) +return ; + +if (hdmi[6 ] &DRM_EDID_HDMI_DC_30 ) { + dc_bpc =10 ; + info->edid_hdmi_dc_modes |=DRM_EDID_HDMI_DC_30 ; +DRM_DEBUG ("%s: HDMI sink does deep color 30.\n" , + connector->name); + } + +if (hdmi[6 ] &DRM_EDID_HDMI_DC_36 ) { + dc_bpc =12 ; + info->edid_hdmi_dc_modes |=DRM_EDID_HDMI_DC_36 ; +DRM_DEBUG ("%s: HDMI sink does deep color 36.\n" , + connector->name); + } + +if (hdmi[6 ] &DRM_EDID_HDMI_DC_48 ) { + dc_bpc =16 ; + info->edid_hdmi_dc_modes |=DRM_EDID_HDMI_DC_48 ; +DRM_DEBUG ("%s: HDMI sink does deep color 48.\n" , + connector->name); + } + +if (dc_bpc ==0 ) { +DRM_DEBUG ("%s: No deep color support on this HDMI sink.\n" , + connector->name); +return ; + } + +DRM_DEBUG ("%s: Assigning HDMI sink color depth as %d bpc.\n" , + connector->name, dc_bpc); + info->bpc = dc_bpc;/* -* Because HDMI identifier is in Vendor Specific Block, -* search it from all data blocks of CEA extension. +* Deep color support mandates RGB444 support for all video +* modes and forbids YCRCB422 support for all video modes per +* HDMI 1.3 spec. */ -for_each_cea_db (edid_ext, i, start_offset, end_offset) { -if (cea_db_is_hdmi_vsdb (&edid_ext[i])) { -/* HDMI supports at least 8 bpc */ - info->bpc =8 ; - - hdmi = &edid_ext[i]; -if (cea_db_payload_len (hdmi) <6 ) -return false; - -if (hdmi[6 ] &DRM_EDID_HDMI_DC_30 ) { - dc_bpc =10 ; - info->edid_hdmi_dc_modes |=DRM_EDID_HDMI_DC_30 ; -DRM_DEBUG ("%s: HDMI sink does deep color 30.\n" , - connector->name); - } + info->color_formats =DRM_COLOR_FORMAT_RGB444 ; -if (hdmi[6 ] &DRM_EDID_HDMI_DC_36 ) { - dc_bpc =12 ; - info->edid_hdmi_dc_modes |=DRM_EDID_HDMI_DC_36 ; -DRM_DEBUG ("%s: HDMI sink does deep color 36.\n" , - connector->name); - } +/* YCRCB444 is optional according to spec. */ +if (hdmi[6 ] &DRM_EDID_HDMI_DC_Y444 ) { + info->color_formats |=DRM_COLOR_FORMAT_YCRCB444 ; +DRM_DEBUG ("%s: HDMI sink does YCRCB444 in deep color.\n" , + connector->name); + } -if (hdmi[6 ] &DRM_EDID_HDMI_DC_48 ) { - dc_bpc =16 ; - info->edid_hdmi_dc_modes |=DRM_EDID_HDMI_DC_48 ; -DRM_DEBUG ("%s: HDMI sink does deep color 48.\n" , - connector->name); - } +/* +* Spec says that if any deep color mode is supported at all, +* then deep color 36 bit must be supported. +*/ +if (!(hdmi[6 ] &DRM_EDID_HDMI_DC_36 )) { +DRM_DEBUG ("%s: HDMI sink should do DC_36, but does not!\n" , + connector->name); + } +} -if (dc_bpc >0 ) { -DRM_DEBUG ("%s: Assigning HDMI sink color depth as %d bpc.\n" , - connector->name, dc_bpc); - info->bpc = dc_bpc; - -/* -* Deep color support mandates RGB444 support for all video -* modes and forbids YCRCB422 support for all video modes per -* HDMI 1.3 spec. -*/ - info->color_formats =DRM_COLOR_FORMAT_RGB444 ; - -/* YCRCB444 is optional according to spec. */ -if (hdmi[6 ] &DRM_EDID_HDMI_DC_Y444 ) { - info->color_formats |=DRM_COLOR_FORMAT_YCRCB444 ; -DRM_DEBUG ("%s: HDMI sink does YCRCB444 in deep color.\n" , - connector->name); - } +static void drm_parse_cea_ext (struct drm_connector *connector, +struct edid *edid) +{ +struct drm_display_info *info = &connector->display_info; +const u8 *edid_ext; +int i, start, end; -/* -* Spec says that if any deep color mode is supported at all, -* then deep color 36 bit must be supported. -*/ -if (!(hdmi[6 ] &DRM_EDID_HDMI_DC_36 )) { -DRM_DEBUG ("%s: HDMI sink should do DC_36, but does not!\n" , - connector->name); - } + edid_ext =drm_find_cea_extension (edid); +if (!edid_ext) +return ; -return true; - } -else { -DRM_DEBUG ("%s: No deep color support on this HDMI sink.\n" , - connector->name); - } - } - } + info->cea_rev = edid_ext[1 ]; -return false; +/* The existence of a CEA block should imply RGB support */ + info->color_formats =DRM_COLOR_FORMAT_RGB444 ; +if (edid_ext[3 ] &EDID_CEA_YCRCB444 ) + info->color_formats |=DRM_COLOR_FORMAT_YCRCB444 ; +if (edid_ext[3 ] &EDID_CEA_YCRCB422 ) + info->color_formats |=DRM_COLOR_FORMAT_YCRCB422 ; + +if (cea_db_offsets (edid_ext, &start, &end)) +return ; + +for_each_cea_db (edid_ext, i, start, end) { +const u8 *db = &edid_ext[i]; + +if (!cea_db_is_hdmi_vsdb (db)) +continue ; + +drm_parse_hdmi_deep_color_info (connector, db); + } }/** * drm_add_display_info - pull display info out if present -* @edid: EDID data * @connector: connector whose edid is used to build display info +* @edid: EDID data * * Grab any available display info and stuff it into the drm_display_info * structure that's part of the connector. Useful for tracking bpp and * color spaces. */ -static void drm_add_display_info (struct edid *edid, -struct drm_connector *connector) +static void drm_add_display_info (struct drm_connector *connector, +struct edid *edid) {struct drm_display_info *info = &connector->display_info; -u8 *edid_ext; info->width_mm = edid->width_cm *10 ; info->height_mm = edid->height_cm *10 ;
@@ -3855,21 +3855,7 @@ static void drm_add_display_info(struct edid *edid,if (!(edid->input &DRM_EDID_INPUT_DIGITAL ))return ; -/* Get data from CEA blocks if present */ - edid_ext =drm_find_cea_extension (edid); -if (edid_ext) { - info->cea_rev = edid_ext[1 ]; - -/* The existence of a CEA block should imply RGB support */ - info->color_formats =DRM_COLOR_FORMAT_RGB444 ; -if (edid_ext[3 ] &EDID_CEA_YCRCB444 ) - info->color_formats |=DRM_COLOR_FORMAT_YCRCB444 ; -if (edid_ext[3 ] &EDID_CEA_YCRCB422 ) - info->color_formats |=DRM_COLOR_FORMAT_YCRCB422 ; - } - -/* HDMI deep color modes supported? Assign to info, if so */ -drm_assign_hdmi_deep_color_info (edid, connector); +drm_parse_cea_ext (connector, edid);/* Only defined for 1.4 with digital displays */ if (edid->revision <4 )
@@ -4089,7 +4075,7 @@ int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid)if (quirks & (EDID_QUIRK_PREFER_LARGE_60 |EDID_QUIRK_PREFER_LARGE_75 ))edid_fixup_preferred (connector, quirks); -drm_add_display_info (edid, connector); +drm_add_display_info (connector, edid);if (quirks &EDID_QUIRK_FORCE_8BPC ) connector->display_info.bpc =8 ;
Signature · 6 lines
2.7.4 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 7/10 drm/edid: Clear the old cea_rev when there's no CEA extension in the new EDID
In reply to [email protected]From: Ville Syrjälä <[email protected]>
It's not a good idea to leave stale cea_rev in the drm_display_info. The current EDID might not even have a CEA ext block in which case we'd end up leaving the stale value in place.
--- drivers/gpu/drm/drm_edid.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/drm_edid.c +1 -0
@@ -3848,6 +3848,7 @@ static void drm_add_display_info(struct drm_connector *connector,/* driver figures it out in this case */ info->bpc =0 ; info->color_formats =0 ; + info->cea_rev =0 ;if (edid->revision <3 )return ;
Signature · 6 lines
2.7.4 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 8/10 drm/edid: Move dvi_dual/max_tmds_clock parsing out from drm_edid_to_eld()
In reply to [email protected]From: Ville Syrjälä <[email protected]>
drm_edid_to_eld() is just mean to cook up the ELD for the audio driver, so having it parse non-audio related stuff seems just wrong, and potentially could lead to that information not being even filled out if the function doesn't even get called. Let's move that stuff to the place where we parse the color formats and whatnot from the CEA ext block.
--- drivers/gpu/drm/drm_edid.c | 64 +++++++++++++++++++++++++--------------------- 1 file changed, 35 insertions(+), 29 deletions(-)
drivers/gpu/drm/drm_edid.c +35 -29
@@ -3248,17 +3248,12 @@ static void fixup_detailed_cea_mode_clock(struct drm_display_mode *mode) }static void -parse_hdmi_vsdb (struct drm_connector *connector,const u8 *db) +drm_parse_hdmi_vsdb_audio (struct drm_connector *connector,const u8 *db) { -struct drm_display_info *info = &connector->display_info;u8 len =cea_db_payload_len (db); -if (len >=6 ) { +if (len >=6 ) connector->eld[5 ] |= (db[6 ] >>7 ) <<1 ;/* Supports_AI */ - info->dvi_dual = db[6 ] &1 ; - } -if (len >=7 ) - info->max_tmds_clock = db[7 ] *5000 ;if (len >=8 ) { connector->latency_present[0 ] = db[8 ] >>7 ; connector->latency_present[1 ] = (db[8 ] >>6 ) &1 ;
@@ -3272,19 +3267,15 @@ parse_hdmi_vsdb(struct drm_connector *connector, const u8 *db)if (len >=12 ) connector->audio_latency[1 ] = db[12 ]; -DRM_DEBUG_KMS ("HDMI: DVI dual %d, " -"max TMDS clock %d, " -"latency present %d %d, " -"video latency %d %d, " -"audio latency %d %d\n" , - info->dvi_dual, - info->max_tmds_clock, - (int ) connector->latency_present[0 ], - (int ) connector->latency_present[1 ], - connector->video_latency[0 ], - connector->video_latency[1 ], - connector->audio_latency[0 ], - connector->audio_latency[1 ]); +DRM_DEBUG_KMS ("HDMI: latency present %d %d, " +"video latency %d %d, " +"audio latency %d %d\n" , + connector->latency_present[0 ], + connector->latency_present[1 ], + connector->video_latency[0 ], + connector->video_latency[1 ], + connector->audio_latency[0 ], + connector->audio_latency[1 ]); } static void
@@ -3345,7 +3336,6 @@ EXPORT_SYMBOL(drm_edid_get_monitor_name);*/ void drm_edid_to_eld (struct drm_connector *connector,struct edid *edid) { -struct drm_display_info *info = &connector->display_info;uint8_t *eld = connector->eld;u8 *cea;u8 *db;
@@ -3362,9 +3352,6 @@ void drm_edid_to_eld(struct drm_connector *connector, struct edid *edid) connector->video_latency[1 ] =0 ; connector->audio_latency[1 ] =0 ; - info->max_tmds_clock =0 ; - info->dvi_dual = false; - cea =drm_find_cea_extension (edid);if (!cea) {DRM_DEBUG_KMS ("ELD: no CEA Extension found\n" );
@@ -3414,7 +3401,7 @@ void drm_edid_to_eld(struct drm_connector *connector, struct edid *edid)case VENDOR_BLOCK :/* HDMI Vendor-Specific Data Block */ if (cea_db_is_hdmi_vsdb (db)) -parse_hdmi_vsdb (connector, db); +drm_parse_hdmi_vsdb_audio (connector, db);break ;default :break ;
@@ -3795,6 +3782,25 @@ static void drm_parse_hdmi_deep_color_info(struct drm_connector *connector, } } +static void +drm_parse_hdmi_vsdb_video (struct drm_connector *connector,const u8 *db) +{ +struct drm_display_info *info = &connector->display_info; +u8 len =cea_db_payload_len (db); + +if (len >=6 ) + info->dvi_dual = db[6 ] &1 ; +if (len >=7 ) + info->max_tmds_clock = db[7 ] *5000 ; + +DRM_DEBUG_KMS ("HDMI: DVI dual %d, " +"max TMDS clock %d kHz\n" , + info->dvi_dual, + info->max_tmds_clock); + +drm_parse_hdmi_deep_color_info (connector, db); +} +static void drm_parse_cea_ext (struct drm_connector *connector,struct edid *edid) {
@@ -3821,10 +3827,8 @@ static void drm_parse_cea_ext(struct drm_connector *connector,for_each_cea_db (edid_ext, i, start, end) {const u8 *db = &edid_ext[i]; -if (!cea_db_is_hdmi_vsdb (db)) -continue ; - -drm_parse_hdmi_deep_color_info (connector, db); +if (cea_db_is_hdmi_vsdb (db)) +drm_parse_hdmi_vsdb_video (connector, db); } }
@@ -3849,6 +3853,8 @@ static void drm_add_display_info(struct drm_connector *connector, info->bpc =0 ; info->color_formats =0 ; info->cea_rev =0 ; + info->max_tmds_clock =0 ; + info->dvi_dual = false;if (edid->revision <3 )return ;
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 9/10 drm/i915: Replace a bunch of connector->base.display_info with a local variable
In reply to [email protected]From: Ville Syrjälä <[email protected]>
Reduce the eyesore with a local variable.
--- drivers/gpu/drm/i915/intel_display.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/gpu/drm/i915/intel_display.c +7 -7
@@ -12090,22 +12090,22 @@ static void connected_sink_compute_bpp(struct intel_connector *connector, struct intel_crtc_state *pipe_config) { + const struct drm_display_info *info = &connector->base.display_info;int bpp = pipe_config->pipe_bpp;DRM_DEBUG_KMS ("[CONNECTOR:%d:%s] checking for sink bpp constrains\n" , - connector->base.base.id, - connector->base.name); + connector->base.base.id, + connector->base.name);/* Don't use an invalid EDID bpc value */ -if (connector->base.display_info.bpc && - connector->base.display_info.bpc *3 < bpp) { +if (info->bpc !=0 && info->bpc *3 < bpp) {DRM_DEBUG_KMS ("clamping display bpp (was %d) to EDID reported max of %d\n" , - bpp, connector->base.display_info.bpc*3 ); - pipe_config->pipe_bpp = connector->base.display_info.bpc*3 ; + bpp, info->bpc *3 ); + pipe_config->pipe_bpp = info->bpc *3 ; }/* Clamp bpp to default limit on screens without EDID 1.4 */ -if (connector->base.display_info.bpc ==0 ) { +if (info->bpc ==0 ) {int type = connector->base.connector_type;int clamp_bpp =24 ;
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 10/10 drm/i915: Account for sink max TMDS clock when checking the port clock
In reply to [email protected]From: Ville Syrjälä <[email protected]>
It's perfectly legal for the sink to support 12bpc only for some lower resolution modes, while the higher resolution modes can only be used with 8bpc. So let's take the sink's max TMDS clock into account before we go and decide that a particular mode can be used with 12bpc.
--- drivers/gpu/drm/i915/intel_hdmi.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_hdmi.c +8 -1
@@ -1204,10 +1204,17 @@ static int hdmi_port_clock_limit(struct intel_hdmi *hdmi,int max_tmds_clock =intel_hdmi_source_max_tmds_clock (to_i915 (dev));if (respect_downstream_limits) { +struct intel_connector *connector = hdmi->attached_connector; +const struct drm_display_info *info = &connector->base.display_info; +if (hdmi->dp_dual_mode.max_tmds_clock) max_tmds_clock =min (max_tmds_clock, hdmi->dp_dual_mode.max_tmds_clock); -if (!hdmi->has_hdmi_sink) + +if (info->max_tmds_clock) + max_tmds_clock =min (max_tmds_clock, + info->max_tmds_clock); +else if (!hdmi->has_hdmi_sink) max_tmds_clock =min (max_tmds_clock,165000 ); }
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Ro.CI.BAT: failure for drm/edid: Clean up display_info stuff
In reply to [email protected]== Series Details ==
== Series Details ==
Series: drm/edid: Clean up display_info stuff
URL : https://patchwork.freedesktop.org/series/10580/
State : failure
== Summary ==
Series 10580v1 drm/edid: Clean up display_info stuff
http://patchwork.freedesktop.org/api/1.0/series/10580/revisions/1/mbox
Test kms_cursor_legacy:
Subgroup basic-flip-vs-cursor-legacy:
fail -> PASS (ro-skl3-i5-6260u)
pass -> FAIL (fi-skl-i7-6700k)
Subgroup basic-flip-vs-cursor-varying-size:
fail -> PASS (ro-bdw-i5-5250u)
Test kms_flip:
Subgroup basic-flip-vs-wf_vblank:
pass -> FAIL (ro-byt-n2820)
Test kms_pipe_crc_basic:
Subgroup suspend-read-crc-pipe-a:
incomplete -> PASS (fi-skl-i7-6700k)
Subgroup suspend-read-crc-pipe-b:
pass -> INCOMPLETE (fi-hsw-i7-4770k)fi-hsw-i7-4770k total:207 pass:186 dwarn:0 dfail:0 fail:0 skip:20 fi-kbl-qkkr total:240 pass:182 dwarn:29 dfail:0 fail:3 skip:26 fi-skl-i5-6260u total:240 pass:224 dwarn:0 dfail:0 fail:2 skip:14 fi-skl-i7-6700k total:240 pass:208 dwarn:0 dfail:0 fail:4 skip:28 fi-snb-i7-2600 total:240 pass:198 dwarn:0 dfail:0 fail:0 skip:42 ro-bdw-i5-5250u total:240 pass:220 dwarn:4 dfail:0 fail:0 skip:16 ro-bdw-i7-5557U total:240 pass:223 dwarn:0 dfail:0 fail:1 skip:16 ro-bdw-i7-5600u total:240 pass:207 dwarn:0 dfail:0 fail:1 skip:32 ro-bsw-n3050 total:240 pass:194 dwarn:0 dfail:0 fail:4 skip:42 ro-byt-n2820 total:240 pass:196 dwarn:0 dfail:0 fail:4 skip:40 ro-hsw-i3-4010u total:240 pass:214 dwarn:0 dfail:0 fail:0 skip:26 ro-ilk-i7-620lm total:240 pass:173 dwarn:1 dfail:0 fail:1 skip:65 ro-ilk1-i5-650 total:235 pass:173 dwarn:0 dfail:0 fail:2 skip:60 ro-ivb-i7-3770 total:240 pass:205 dwarn:0 dfail:0 fail:0 skip:35 ro-ivb2-i7-3770 total:240 pass:209 dwarn:0 dfail:0 fail:0 skip:31 ro-skl3-i5-6260u total:240 pass:223 dwarn:0 dfail:0 fail:3 skip:14 ro-snb-i7-2620M total:240 pass:197 dwarn:0 dfail:0 fail:2 skip:41
ro-hsw-i7-4770r failed to connect after reboot
Results at /archive/results/CI_IGT_test/RO_Patchwork_1674/
aa8628c drm-intel-nightly: 2016y-08m-02d-14h-10m-12s UTC integration manifest 6e847fb drm/i915: Account for sink max TMDS clock when checking the port clock 9a3e409 drm/i915: Replace a bunch of connector->base.display_info with a local variable 762796f drm/edid: Move dvi_dual/max_tmds_clock parsing out from drm_edid_to_eld() e291c32 drm/edid: Clear the old cea_rev when there's no CEA extension in the new EDID dcaed19 drm/edid: Reduce the number of times we parse the CEA extension block dcd4f28 drm/edid: Don't pass around drm_display_info needlessly
0b2bf83 drm/edid: Move dvi_dual/max_tmds_clock to drm_display_info 91e01e3 drm/edid: Make max_tmds_clock kHz instead of MHz
048bb06 drm/edid: Clear old dvi_dual/max_tmds_clock before parsing the new EDID 8d15b3f drm/edid: Clear old audio latency values before parsing the new EDID
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: ✗ Ro.CI.BAT: failure for drm/edid: Clean up display_info stuff
Quoted 8 lines · Patchwork
== Series Details ==
Series: drm/edid: Clean up
display_infostuff
URL : https://patchwork.freedesktop.org/series/10580/
State : failure== Summary ==
Quoted 7 lines
Series 10580v1 drm/edid: Clean up
display_infostuff
http://patchwork.freedesktop.org/api/1.0/series/10580/revisions/1/mboxTest
kms_cursor_legacy:Subgroup basic-flip-vs-cursor-legacy: fail -> PASS (ro-skl3-i5-6260u) pass -> FAIL (fi-skl-i7-6700k)
(kms_cursor_legacy:11679) DEBUG: Test requirement passed: target > 1
(kms_cursor_legacy:11679) DEBUG: Using a target of 128 cursor updates per half-vblank (kms_cursor_legacy:11679) CRITICAL: Test assertion failure function basic_flip_vs_cursor, file kms_cursor_legacy.c:514:
(kms_cursor_legacy:11679) CRITICAL: Failed assertion: get_vblank(display->drm_fd, pipe, 0) == vblank_start (kms_cursor_legacy:11679) CRITICAL: error: 11334 != 11333
https://bugs.freedesktop.org/show_bug.cgi?id=97188
Quoted 5 lines
Subgroup basic-flip-vs-cursor-varying-size:
fail -> PASS (ro-bdw-i5-5250u)
Test kms_flip:
Subgroup basic-flip-vs-wf_vblank:
pass -> FAIL (ro-byt-n2820)(kms_flip:7862) DEBUG: name = fliplast_ts = 518.830009last_received_ts = 518.830101last_seq = 1441current_ts = 519.096530current_received_ts = 519.108069current_seq = 1457
count = 8seq_step = 1
(kms_flip:7862) CRITICAL: Test assertion failure function check_state, file kms_flip.c:706:
(kms_flip:7862) CRITICAL: Failed assertion: fabs((usec_diff - usec_interflip) / usec_interflip) <= 0.005 (kms_flip:7862) CRITICAL: Last errno: 25, Inappropriate ioctl for device (kms_flip:7862) CRITICAL: inter-flip ts jitter: 0.266521, expected 0.166667
Still not 100% sure what's causing this. I suspect we got delayed prior to/while issuing the flip/wait_vblank ioctl, and thus also the event gets delayed.
https://bugs.freedesktop.org/show_bug.cgi?id=95236
Quoted 5 lines
Test
kms_pipe_crc_basic:Subgroup suspend-read-crc-pipe-a: incomplete -> PASS (fi-skl-i7-6700k) Subgroup suspend-read-crc-pipe-b: pass -> INCOMPLETE (fi-hsw-i7-4770k)
Machine died or something. Last thing in dmesg is:
[ 432.932711] kms_pipe_crc_basic: starting subtest suspend-read-crc-pipe-B
Quoted 33 lines
fi-hsw-i7-4770k total:207 pass:186 dwarn:0 dfail:0 fail:0 skip:20 fi-kbl-qkkr total:240 pass:182 dwarn:29 dfail:0 fail:3 skip:26 fi-skl-i5-6260u total:240 pass:224 dwarn:0 dfail:0 fail:2 skip:14 fi-skl-i7-6700k total:240 pass:208 dwarn:0 dfail:0 fail:4 skip:28 fi-snb-i7-2600 total:240 pass:198 dwarn:0 dfail:0 fail:0 skip:42 ro-bdw-i5-5250u total:240 pass:220 dwarn:4 dfail:0 fail:0 skip:16 ro-bdw-i7-5557U total:240 pass:223 dwarn:0 dfail:0 fail:1 skip:16 ro-bdw-i7-5600u total:240 pass:207 dwarn:0 dfail:0 fail:1 skip:32 ro-bsw-n3050 total:240 pass:194 dwarn:0 dfail:0 fail:4 skip:42 ro-byt-n2820 total:240 pass:196 dwarn:0 dfail:0 fail:4 skip:40 ro-hsw-i3-4010u total:240 pass:214 dwarn:0 dfail:0 fail:0 skip:26 ro-ilk-i7-620lm total:240 pass:173 dwarn:1 dfail:0 fail:1 skip:65 ro-ilk1-i5-650 total:235 pass:173 dwarn:0 dfail:0 fail:2 skip:60 ro-ivb-i7-3770 total:240 pass:205 dwarn:0 dfail:0 fail:0 skip:35 ro-ivb2-i7-3770 total:240 pass:209 dwarn:0 dfail:0 fail:0 skip:31 ro-skl3-i5-6260u total:240 pass:223 dwarn:0 dfail:0 fail:3 skip:14 ro-snb-i7-2620M total:240 pass:197 dwarn:0 dfail:0 fail:2 skip:41ro-hsw-i7-4770r failed to connect after reboot
Results at /archive/results/CI_IGT_test/RO_Patchwork_1674/
aa8628c drm-intel-nightly: 2016y-08m-02d-14h-10m-12s UTC integration manifest 6e847fb drm/i915: Account for sink max TMDS clock when checking the port clock 9a3e409 drm/i915: Replace a bunch of
connector->base.display_infowith a local variable 762796f drm/edid: Move dvi_dual/max_tmds_clock parsing out fromdrm_edid_to_eld()e291c32 drm/edid: Clear the oldcea_revwhen there's no CEA extension in the new EDID dcaed19 drm/edid: Reduce the number of times we parse the CEA extension block dcd4f28 drm/edid: Don't pass arounddrm_display_infoneedlessly
0b2bf83 drm/edid: Move dvi_dual/max_tmds_clock todrm_display_info91e01e3 drm/edid: Makemax_tmds_clockkHz instead of MHz
048bb06 drm/edid: Clear old dvi_dual/max_tmds_clock before parsing the new EDID 8d15b3f drm/edid: Clear old audio latency values before parsing the new EDID
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Christian König
maintainerLooks reasonable to me, adding a few more AMD people which probably want to take a look as well.
Patch #3 and #4 are Reviewed-by: Christian König <[email protected]> since they touch the radeon/amdgpu driver.
Patch #1, #2 and #5 - #8 are Acked-by: Christian König <[email protected]>.
Regards,
Christian.
Am 03.08.2016 um 08:33 schrieb [email protected]:
Quoted 30 lines
From: Ville Syrjälä <[email protected]>
This series aims to clean up the way we fill out the
display_infostructure a bit. Mainly doing a clean separation of the audio and video related bits.My aim is getting i915 to respect the HDMI sink TMDS clock limit (currently we respect only the DP++ dongle limit, and the source limit). But while doing that, I noticed that the
display_infostuff was a bit of mess, hence it resulted in this bigger series.Entire series available here:
git://github.com/vsyrjala/linux.githdmi_sink_tmds_limit_3Ville Syrjälä (10):
drm/edid: Clear old audio latency values before parsing the new EDID drm/edid: Clear old dvi_dual/max_tmds_clock before parsing the new
EDID
drm/edid: Makemax_tmds_clockkHz instead of MHz drm/edid: Move dvi_dual/max_tmds_clock todrm_display_infodrm/edid: Don't pass arounddrm_display_infoneedlessly drm/edid: Reduce the number of times we parse the CEA extension block drm/edid: Clear the oldcea_revwhen there's no CEA extension in the
new EDID
drm/edid: Move dvi_dual/max_tmds_clock parsing out fromdrm_edid_to_eld()drm/i915: Replace a bunch of
connector->base.display_infowith a local
variable
drm/i915: Account for sink max TMDS clock when checking the port clock
Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c | 4 +- drivers/gpu/drm/drm_edid.c | 258 +++++++++++++------------ drivers/gpu/drm/i915/intel_display.c | 14 +- drivers/gpu/drm/i915/intel_hdmi.c | 9 +- drivers/gpu/drm/radeon/radeon_connectors.c | 4 +- include/drm/drm_crtc.h | 7 +- 6 files changed, 152 insertions(+), 144 deletions(-)
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel