Skip to content

Commit ebdc02d

Browse files
jwrdegoedeevelikov
authored andcommitted
drm: Add DRM_MODE_TYPE_USERDEF flag to probed modes matching a video= argument
drm_helper_probe_add_cmdline_mode() prefers using a probed mode matching a video= argument over calculating our own timings for the user specified mode using CVT or GTF. But userspace code which is auto-configuring the mode may want to know that the user has specified that mode on the kernel commandline so that it can pick that mode over the mode which is marked as DRM_MODE_TYPE_PREFERRED. This commit sets the DRM_MODE_TYPE_USERDEF flag on the matching mode, just as we would do on the user-specified mode when no matching probed mode is found. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Link: https://patchwork.freedesktop.org/patch/msgid/20200221173313.510235-2-hdegoede@redhat.com
1 parent a519f6d commit ebdc02d

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

‎drivers/gpu/drm/drm_probe_helper.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,8 @@ static int drm_helper_probe_add_cmdline_mode(struct drm_connector *connector)
159159
continue;
160160
}
161161

162+
/* Mark the matching mode as being preferred by the user */
163+
mode->type |= DRM_MODE_TYPE_USERDEF;
162164
return 0;
163165
}
164166

‎include/drm/drm_modes.h‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,8 @@ struct drm_display_mode {
256256
* - DRM_MODE_TYPE_DRIVER: Mode created by the driver, which is all of
257257
* them really. Drivers must set this bit for all modes they create
258258
* and expose to userspace.
259-
* - DRM_MODE_TYPE_USERDEF: Mode defined via kernel command line
259+
* - DRM_MODE_TYPE_USERDEF: Mode defined or selected via the kernel
260+
* command line.
260261
*
261262
* Plus a big list of flags which shouldn't be used at all, but are
262263
* still around since these flags are also used in the userspace ABI.

0 commit comments

Comments
 (0)