drm: Reverse override_edid vs. firmware EDID priority and docs
Subsystems (2)
cover drm: Reverse override_edid vs. firmware EDID priority and docs
From: Ville Syrjälä <[email protected]>
Daniel wanted me to slap some more docs on the probe helper, so I tried (and mostly failed). And while doing that I realized that the priority between the firmware EDID and override_edid didn't make much sense so I went ahead and flipped it over.
Ville Syrjälä (2):
drm: Allow override_edid to override the firmware EDID
drm: Expand the drm_helper_probe_single_connector_modes() docs
drivers/gpu/drm/drm_probe_helper.c | 62 ++++++++++++++++++++++++++------------ 1 file changed, 43 insertions(+), 19 deletions(-)
Signature · 6 lines
2.4.10 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 1/2 drm: Allow override_edid to override the firmware EDID
From: Ville Syrjälä <[email protected]>
IMO the override_edid should override any default EDID for the connector, whether that came in via the connector helper ->get_modes() vfunc or via the firmware EDID mechanism.
--- drivers/gpu/drm/drm_probe_helper.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-)
drivers/gpu/drm/drm_probe_helper.c +8 -9
@@ -233,17 +233,16 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector, goto prune; } +if (connector->override_edid) { +struct edid *edid = (struct edid *) connector->edid_blob_ptr->data; + + count =drm_add_edid_modes (connector, edid); +drm_edid_to_eld (connector, edid); + }else {#ifdef CONFIG_DRM_LOAD_EDID_FIRMWARE - count =drm_load_edid_firmware (connector); - if (count == 0) + count =drm_load_edid_firmware (connector); + if (count == 0)#endif - { -if (connector->override_edid) { -struct edid *edid = (struct edid *) connector->edid_blob_ptr->data; - - count =drm_add_edid_modes (connector, edid); -drm_edid_to_eld (connector, edid); - }else count = (*connector_funcs->get_modes)(connector); }
Signature · 6 lines
2.4.10 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 1/2] drm: Allow override_edid to override the firmware EDID
Quoted 8 lines · On Thu, Dec 10, 2015 at 11:13:56PM +0200, [email protected] wrote:
From: Ville Syrjälä <[email protected]>
IMO the
override_edidshould override any default EDID for the connector, whether that came in via the connector helper ->get_modes() vfunc or via the firmware EDID mechanism.Cc Thomas Wood <[email protected]>Signed-off-by Ville Syrjälä <[email protected]>
Yeah makes sense. And the kerneldoc one looks great, so pulled both into drm-misc.
-Daniel
Quoted 41 lines
--- drivers/gpu/drm/drm_probe_helper.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-)drivers/gpu/drm/drm_probe_helper.c +8
-9@@ -233,17 +233,16 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector, goto prune; } +if (connector->override_edid) { +struct edid *edid = (struct edid *) connector->edid_blob_ptr->data; + + count =drm_add_edid_modes (connector, edid); +drm_edid_to_eld (connector, edid); + }else {#ifdef CONFIG_DRM_LOAD_EDID_FIRMWARE - count =drm_load_edid_firmware (connector); - if (count == 0) + count =drm_load_edid_firmware (connector); + if (count == 0)#endif - { -if (connector->override_edid) { -struct edid *edid = (struct edid *) connector->edid_blob_ptr->data; - - count =drm_add_edid_modes (connector, edid); -drm_edid_to_eld (connector, edid); - }else count = (*connector_funcs->get_modes)(connector); }Signature · 6 lines
2.4.10 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 2/2 drm: Expand the drm_helper_probe_single_connector_modes() docs
In reply to [email protected]From: Ville Syrjälä <[email protected]>
Describe the procedure that drm_helper_probe_single_connector_modes() uses to do it's work in the kernel-doc comment.
Caveat: Looks like crap and trying to reverse engineer the documentation tools is not something I want to do.
--- drivers/gpu/drm/drm_probe_helper.c | 49 ++++++++++++++++++++++++++++---------- 1 file changed, 37 insertions(+), 12 deletions(-)
drivers/gpu/drm/drm_probe_helper.c +37 -12
@@ -144,18 +144,43 @@ EXPORT_SYMBOL(drm_kms_helper_poll_enable_locked);* @connector vfunc for drivers that use the CRTC helpers for output mode * filtering and detection. * -* If the helper operation returns no mode, and if the connector status is -* connector_status_connected, standard VESA DMT modes up to 1024x768 are -* automatically added to the modes list by a call to -* drm_add_modes_noedid(). -* -* The function then filters out modes larger than @maxX and maxY if specified. -* It finally calls the optional connector ->mode_valid() helper operation for each -* mode in the probed list to check whether the mode is valid for the connector. -* -* Compared to drm_helper_probe_single_connector_modes_nomerge() this function -* merged the mode bits for the preferred mode, as a hack to work around some -* quirky issues on funky hardware. +* The basic procedure is as follows +* +* 1. All modes currently on the connector's modes list are marked as stale +* +* 2. New modes are added to the connector's probed_modes list with +* drm_mode_probed_add(). New modes start their life with status as OK. +* Modes are added from a single source using the following priority order. +* +* - debugfs 'override_edid' (used for testing only) +* - firmware EDID (drm_load_edid_firmware()) +* - connector helper ->get_modes() vfunc +* - if the connector status is connector_status_connected, standard +* VESA DMT modes up to 1024x768 are automatically added +* (drm_add_modes_noedid()) +* +* Finally modes specified via the kernel command line (video=...) are +* added in addition to what the earlier probes produced +* (drm_helper_probe_add_cmdline_mode()). These modes are generated +* using the VESA GTF/CVT formulas. +* +* 3. Modes are moved from the probed_modes list to the modes list. Potential +* duplicates are merged together (see drm_mode_connector_list_update()). +* After this step the probed_modes list will be empty again. +* +* 4. Any non-stale mode on the modes list then undergoes validation +* +* - drm_mode_validate_basic() performs basic sanity checks +* - drm_mode_validate_size() filters out modes larger than @maxX and @maxY +* (if specified) +* - drm_mode_validate_flag() checks the modes againt basic connector +* capabilites (interlace_allowed,doublescan_allowed,stereo_allowed) +* - the optional connector ->mode_valid() helper can perform driver and/or +* hardware specific checks +* +* 5. Any mode whose status is not OK is pruned from the connector's modes list, +* accompanied by a debug message indicating the reason for the mode's +* rejection (see drm_mode_prune_invalid()). * * Returns: * The number of modes found on @connector.
Signature · 6 lines
2.4.10 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel