linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH resend 0/1] drm: Add DRM_MODE_TYPE_USERDEF flag to probed modes
@ 2020-02-21 17:22 Hans de Goede
  2020-02-21 17:22 ` [PATCH resend] drm: Add DRM_MODE_TYPE_USERDEF flag to probed modes matching a video= argument Hans de Goede
  2020-02-21 17:26 ` [PATCH resend 0/1] drm: Add DRM_MODE_TYPE_USERDEF flag to probed modes Borislav Petkov
  0 siblings, 2 replies; 3+ messages in thread
From: Hans de Goede @ 2020-02-21 17:22 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, Borislav Petkov, H . Peter Anvin
  Cc: Hans de Goede, x86, linux-kernel

Hi All,

I'm resending this patch since the discussion on it has fallen
silent for a while now.

Last time I posted it, the discussion seemed to be heading towards
agreement that this is the right thing to do, but I never got an
ack or some such.

See here for the discussion from last time:
https://patchwork.freedesktop.org/patch/340140/

Regards,

Hans



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH resend] drm: Add DRM_MODE_TYPE_USERDEF flag to probed modes matching a video= argument
  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
  2020-02-21 17:26 ` [PATCH resend 0/1] drm: Add DRM_MODE_TYPE_USERDEF flag to probed modes Borislav Petkov
  1 sibling, 0 replies; 3+ messages in thread
From: Hans de Goede @ 2020-02-21 17:22 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, Borislav Petkov, H . Peter Anvin
  Cc: Hans de Goede, x86, linux-kernel

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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH resend 0/1] drm: Add DRM_MODE_TYPE_USERDEF flag to probed modes
  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 ` [PATCH resend] drm: Add DRM_MODE_TYPE_USERDEF flag to probed modes matching a video= argument Hans de Goede
@ 2020-02-21 17:26 ` Borislav Petkov
  1 sibling, 0 replies; 3+ messages in thread
From: Borislav Petkov @ 2020-02-21 17:26 UTC (permalink / raw)
  To: Hans de Goede
  Cc: Thomas Gleixner, Ingo Molnar, H . Peter Anvin, x86, linux-kernel

On Fri, Feb 21, 2020 at 06:22:08PM +0100, Hans de Goede wrote:
> Hi All,
> 
> I'm resending this patch since the discussion on it has fallen
> silent for a while now.

Might fall silent this time too with those recipients. :-)

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-02-21 17:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [PATCH resend] drm: Add DRM_MODE_TYPE_USERDEF flag to probed modes matching a video= argument Hans de Goede
2020-02-21 17:26 ` [PATCH resend 0/1] drm: Add DRM_MODE_TYPE_USERDEF flag to probed modes Borislav Petkov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).