Skip to content

Commit 01e6b1f

Browse files
vsyrjalasashalevin
authored andcommitted
drm: Don't overwrite UNVERFIED mode status to OK
[ Upstream commit be8719a ] The way the mode probing works is this: 1. All modes currently on the mode list are marked as UNVERIFIED 2. New modes are on the probed_modes list (they start with status OK) 3. Modes are moved from the probed_modes list to the actual mode list. If a mode already on the mode list is deemed to match one of the probed modes, the duplicate is dropped and the mode status updated to OK. After this the probed_modes list will be empty. 4. All modes on the mode list are verified to not violate any constraints. Any that do are marked as such. 5. Any mode left with a non-OK status is pruned from the list, with an appropriate debug message. What all this means is that any mode on the original list that didn't have a duplicate on the probed_modes list, should be left with status UNVERFIED (or previously could have been left with some other status, but never OK). I broke that in commit 05acaec ("drm: Reorganize probed mode validation") by always assigning something to the mode->status during the validation step. So any mode from the old list that still passed the validation would be left on the list with status OK in the end. Fix this by not doing the basic mode validation unless the mode already has status OK (meaning it came from the probed_modes list, or at least a duplicate of it was on that list). This way we will correctly prune away any mode from the old mode list that didn't appear on the probed_modes list. Cc: [email protected] Cc: Adam Jackson <[email protected]> Fixes: 05acaec ("drm: Reorganize probed mode validation") Signed-off-by: Ville Syrjälä <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected] Testcase: igt/kms_force_connector_basic/prune-stale-modes Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93332 [danvet: Also applying to drm-misc to avoid too much conflict hell - there's a big pile of patches from Ville on top of this one.] Signed-off-by: Daniel Vetter <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 1387929 commit 01e6b1f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/gpu/drm/drm_probe_helper.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,8 @@ static int drm_helper_probe_single_connector_modes_merge_bits(struct drm_connect
195195
mode_flags |= DRM_MODE_FLAG_3D_MASK;
196196

197197
list_for_each_entry(mode, &connector->modes, head) {
198-
mode->status = drm_mode_validate_basic(mode);
198+
if (mode->status == MODE_OK)
199+
mode->status = drm_mode_validate_basic(mode);
199200

200201
if (mode->status == MODE_OK)
201202
mode->status = drm_mode_validate_size(mode, maxX, maxY);

0 commit comments

Comments
 (0)