From: Hans de Goede <hdegoede@redhat.com>
To: Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
"H . Peter Anvin" <hpa@zytor.com>
Cc: Hans de Goede <hdegoede@redhat.com>,
x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH resend] drm: Add DRM_MODE_TYPE_USERDEF flag to probed modes matching a video= argument
Date: Fri, 21 Feb 2020 18:22:09 +0100 [thread overview]
Message-ID: <20200221172209.509686-2-hdegoede@redhat.com> (raw)
In-Reply-To: <20200221172209.509686-1-hdegoede@redhat.com>
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>
---
drivers/gpu/drm/drm_probe_helper.c | 2 ++
include/drm/drm_modes.h | 3 ++-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c
index 576b4b7dcd89..466dfbba8256 100644
--- a/drivers/gpu/drm/drm_probe_helper.c
+++ b/drivers/gpu/drm/drm_probe_helper.c
@@ -159,6 +159,8 @@ static int drm_helper_probe_add_cmdline_mode(struct drm_connector *connector)
continue;
}
+ /* Mark the matching mode as being preferred by the user */
+ mode->type |= DRM_MODE_TYPE_USERDEF;
return 0;
}
diff --git a/include/drm/drm_modes.h b/include/drm/drm_modes.h
index e946e20c61d8..c7efb7487e9b 100644
--- a/include/drm/drm_modes.h
+++ b/include/drm/drm_modes.h
@@ -256,7 +256,8 @@ struct drm_display_mode {
* - DRM_MODE_TYPE_DRIVER: Mode created by the driver, which is all of
* them really. Drivers must set this bit for all modes they create
* and expose to userspace.
- * - DRM_MODE_TYPE_USERDEF: Mode defined via kernel command line
+ * - DRM_MODE_TYPE_USERDEF: Mode defined or selected via the kernel
+ * command line.
*
* Plus a big list of flags which shouldn't be used at all, but are
* still around since these flags are also used in the userspace ABI.
--
2.25.0
next prev parent reply other threads:[~2020-02-21 17:22 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-21 17:22 [PATCH resend 0/1] drm: Add DRM_MODE_TYPE_USERDEF flag to probed modes Hans de Goede
2020-02-21 17:22 ` Hans de Goede [this message]
2020-02-21 17:26 ` Borislav Petkov
-- strict thread matches above, loose matches on Subject: below --
2020-02-21 17:33 Hans de Goede
2020-02-21 17:33 ` [PATCH resend] drm: Add DRM_MODE_TYPE_USERDEF flag to probed modes matching a video= argument Hans de Goede
2020-04-30 13:47 ` Emil Velikov
2020-04-30 14:52 ` Ville Syrjälä
2020-04-30 14:55 ` Hans de Goede
2020-05-14 9:53 ` Emil Velikov
2020-05-14 14:35 ` Hans de Goede
2020-05-17 20:59 ` Emil Velikov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200221172209.509686-2-hdegoede@redhat.com \
--to=hdegoede@redhat.com \
--cc=bp@alien8.de \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.