All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH resend 0/1] drm: Add DRM_MODE_TYPE_USERDEF flag to probed modes
@ 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
  0 siblings, 1 reply; 9+ messages in thread
From: Hans de Goede @ 2020-02-21 17:33 UTC (permalink / raw)
  To: Maarten Lankhorst, Maxime Ripard, Sean Paul, Daniel Vetter
  Cc: Hans de Goede, dri-devel

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

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* [PATCH resend] drm: Add DRM_MODE_TYPE_USERDEF flag to probed modes matching a video= argument
  2020-02-21 17:33 [PATCH resend 0/1] drm: Add DRM_MODE_TYPE_USERDEF flag to probed modes Hans de Goede
@ 2020-02-21 17:33 ` Hans de Goede
  2020-04-30 13:47   ` Emil Velikov
  0 siblings, 1 reply; 9+ messages in thread
From: Hans de Goede @ 2020-02-21 17:33 UTC (permalink / raw)
  To: Maarten Lankhorst, Maxime Ripard, Sean Paul, Daniel Vetter
  Cc: Hans de Goede, dri-devel

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

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH resend] drm: Add DRM_MODE_TYPE_USERDEF flag to probed modes matching a video= argument
  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ä
  0 siblings, 1 reply; 9+ messages in thread
From: Emil Velikov @ 2020-04-30 13:47 UTC (permalink / raw)
  To: Hans de Goede, Ville Syrjälä
  Cc: Sean Paul, ML dri-devel, Daniel Vetter

Hi Hans,

On Fri, 21 Feb 2020 at 17:33, Hans de Goede <hdegoede@redhat.com> wrote:
>
> 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>

I was skimming around wrt Ville's compact drm_display_mode series and
noticed that this never landed.

The commit brings extra consistency when dealing with user defined
modes, and is:
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>

Ville this may trivially conflict with your work. I suspect you can do
the honours, and apply on top of your series?
That is if you agree with the patch.

Thanks
Emil
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH resend] drm: Add DRM_MODE_TYPE_USERDEF flag to probed modes matching a video= argument
  2020-04-30 13:47   ` Emil Velikov
@ 2020-04-30 14:52     ` Ville Syrjälä
  2020-04-30 14:55       ` Hans de Goede
  0 siblings, 1 reply; 9+ messages in thread
From: Ville Syrjälä @ 2020-04-30 14:52 UTC (permalink / raw)
  To: Emil Velikov; +Cc: ML dri-devel, Hans de Goede, Sean Paul, Daniel Vetter

On Thu, Apr 30, 2020 at 02:47:00PM +0100, Emil Velikov wrote:
> Hi Hans,
> 
> On Fri, 21 Feb 2020 at 17:33, Hans de Goede <hdegoede@redhat.com> wrote:
> >
> > 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>
> 
> I was skimming around wrt Ville's compact drm_display_mode series and
> noticed that this never landed.
> 
> The commit brings extra consistency when dealing with user defined
> modes, and is:
> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
> 
> Ville this may trivially conflict with your work. I suspect you can do
> the honours, and apply on top of your series?
> That is if you agree with the patch.

Quick glance at the original thread says maybe there were still some
userspace issues unresolved? Not sure.

-- 
Ville Syrjälä
Intel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH resend] drm: Add DRM_MODE_TYPE_USERDEF flag to probed modes matching a video= argument
  2020-04-30 14:52     ` Ville Syrjälä
@ 2020-04-30 14:55       ` Hans de Goede
  2020-05-14  9:53         ` Emil Velikov
  0 siblings, 1 reply; 9+ messages in thread
From: Hans de Goede @ 2020-04-30 14:55 UTC (permalink / raw)
  To: Ville Syrjälä, Emil Velikov
  Cc: Sean Paul, ML dri-devel, Daniel Vetter

Hi,

On 4/30/20 4:52 PM, Ville Syrjälä wrote:
> On Thu, Apr 30, 2020 at 02:47:00PM +0100, Emil Velikov wrote:
>> Hi Hans,
>>
>> On Fri, 21 Feb 2020 at 17:33, Hans de Goede <hdegoede@redhat.com> wrote:
>>>
>>> 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>
>>
>> I was skimming around wrt Ville's compact drm_display_mode series and
>> noticed that this never landed.
>>
>> The commit brings extra consistency when dealing with user defined
>> modes, and is:
>> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
>>
>> Ville this may trivially conflict with your work. I suspect you can do
>> the honours, and apply on top of your series?
>> That is if you agree with the patch.
> 
> Quick glance at the original thread says maybe there were still some
> userspace issues unresolved? Not sure.

IIRC the thread ended with Daniel agreeing on the userspace interface,
but asking for some docs and me pointing out that the patch already
updated/clarified the existing docs. After that things got quiet.

So I believe that this is (still) ready to go upstream.

Regards,

Hans

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH resend] drm: Add DRM_MODE_TYPE_USERDEF flag to probed modes matching a video= argument
  2020-04-30 14:55       ` Hans de Goede
@ 2020-05-14  9:53         ` Emil Velikov
  2020-05-14 14:35           ` Hans de Goede
  0 siblings, 1 reply; 9+ messages in thread
From: Emil Velikov @ 2020-05-14  9:53 UTC (permalink / raw)
  To: Hans de Goede, Daniel Vetter, Daniel Vetter; +Cc: Sean Paul, ML dri-devel

Hi Hans,

On Thu, 30 Apr 2020 at 15:55, Hans de Goede <hdegoede@redhat.com> wrote:
>
> Hi,
>
> On 4/30/20 4:52 PM, Ville Syrjälä wrote:
> > On Thu, Apr 30, 2020 at 02:47:00PM +0100, Emil Velikov wrote:
> >> Hi Hans,
> >>
> >> On Fri, 21 Feb 2020 at 17:33, Hans de Goede <hdegoede@redhat.com> wrote:
> >>>
> >>> 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>
> >>
> >> I was skimming around wrt Ville's compact drm_display_mode series and
> >> noticed that this never landed.
> >>
> >> The commit brings extra consistency when dealing with user defined
> >> modes, and is:
> >> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
> >>
> >> Ville this may trivially conflict with your work. I suspect you can do
> >> the honours, and apply on top of your series?
> >> That is if you agree with the patch.
> >
> > Quick glance at the original thread says maybe there were still some
> > userspace issues unresolved? Not sure.
>
> IIRC the thread ended with Daniel agreeing on the userspace interface,
> but asking for some docs and me pointing out that the patch already
> updated/clarified the existing docs. After that things got quiet.
>
> So I believe that this is (still) ready to go upstream.
>
Having read through the full discussion, couple of times, I believe
you're spot on.

Daniel requested documentation, which the patch provides. I'd say
let's poke him on IRC a few times, if he doesn't object let's push it?

-Emil
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH resend] drm: Add DRM_MODE_TYPE_USERDEF flag to probed modes matching a video= argument
  2020-05-14  9:53         ` Emil Velikov
@ 2020-05-14 14:35           ` Hans de Goede
  2020-05-17 20:59             ` Emil Velikov
  0 siblings, 1 reply; 9+ messages in thread
From: Hans de Goede @ 2020-05-14 14:35 UTC (permalink / raw)
  To: Emil Velikov, Daniel Vetter, Daniel Vetter; +Cc: Sean Paul, ML dri-devel

Hi,

On 5/14/20 11:53 AM, Emil Velikov wrote:
> Hi Hans,
> 
> On Thu, 30 Apr 2020 at 15:55, Hans de Goede <hdegoede@redhat.com> wrote:
>>
>> Hi,
>>
>> On 4/30/20 4:52 PM, Ville Syrjälä wrote:
>>> On Thu, Apr 30, 2020 at 02:47:00PM +0100, Emil Velikov wrote:
>>>> Hi Hans,
>>>>
>>>> On Fri, 21 Feb 2020 at 17:33, Hans de Goede <hdegoede@redhat.com> wrote:
>>>>>
>>>>> 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>
>>>>
>>>> I was skimming around wrt Ville's compact drm_display_mode series and
>>>> noticed that this never landed.
>>>>
>>>> The commit brings extra consistency when dealing with user defined
>>>> modes, and is:
>>>> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
>>>>
>>>> Ville this may trivially conflict with your work. I suspect you can do
>>>> the honours, and apply on top of your series?
>>>> That is if you agree with the patch.
>>>
>>> Quick glance at the original thread says maybe there were still some
>>> userspace issues unresolved? Not sure.
>>
>> IIRC the thread ended with Daniel agreeing on the userspace interface,
>> but asking for some docs and me pointing out that the patch already
>> updated/clarified the existing docs. After that things got quiet.
>>
>> So I believe that this is (still) ready to go upstream.
>>
> Having read through the full discussion, couple of times, I believe
> you're spot on.
> 
> Daniel requested documentation, which the patch provides. I'd say
> let's poke him on IRC a few times, if he doesn't object let's push it?

Sounds good to me, I'm usually not on IRC (too distracting for me), canyou
ping Daniel about this on IRC?

Regards,

Hans

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH resend] drm: Add DRM_MODE_TYPE_USERDEF flag to probed modes matching a video= argument
  2020-05-14 14:35           ` Hans de Goede
@ 2020-05-17 20:59             ` Emil Velikov
  0 siblings, 0 replies; 9+ messages in thread
From: Emil Velikov @ 2020-05-17 20:59 UTC (permalink / raw)
  To: Hans de Goede; +Cc: Sean Paul, ML dri-devel, Daniel Vetter

On Thu, 14 May 2020 at 15:35, Hans de Goede <hdegoede@redhat.com> wrote:
>
> Hi,
>
> On 5/14/20 11:53 AM, Emil Velikov wrote:
> > Hi Hans,
> >
> > On Thu, 30 Apr 2020 at 15:55, Hans de Goede <hdegoede@redhat.com> wrote:
> >>
> >> Hi,
> >>
> >> On 4/30/20 4:52 PM, Ville Syrjälä wrote:
> >>> On Thu, Apr 30, 2020 at 02:47:00PM +0100, Emil Velikov wrote:
> >>>> Hi Hans,
> >>>>
> >>>> On Fri, 21 Feb 2020 at 17:33, Hans de Goede <hdegoede@redhat.com> wrote:
> >>>>>
> >>>>> 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>
> >>>>
> >>>> I was skimming around wrt Ville's compact drm_display_mode series and
> >>>> noticed that this never landed.
> >>>>
> >>>> The commit brings extra consistency when dealing with user defined
> >>>> modes, and is:
> >>>> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
> >>>>
> >>>> Ville this may trivially conflict with your work. I suspect you can do
> >>>> the honours, and apply on top of your series?
> >>>> That is if you agree with the patch.
> >>>
> >>> Quick glance at the original thread says maybe there were still some
> >>> userspace issues unresolved? Not sure.
> >>
> >> IIRC the thread ended with Daniel agreeing on the userspace interface,
> >> but asking for some docs and me pointing out that the patch already
> >> updated/clarified the existing docs. After that things got quiet.
> >>
> >> So I believe that this is (still) ready to go upstream.
> >>
> > Having read through the full discussion, couple of times, I believe
> > you're spot on.
> >
> > Daniel requested documentation, which the patch provides. I'd say
> > let's poke him on IRC a few times, if he doesn't object let's push it?
>
> Sounds good to me, I'm usually not on IRC (too distracting for me), canyou
> ping Daniel about this on IRC?
>
I did a few minutes after posting my reply - 11:45. Few minutes later
(12:09) he seemed OK with it [1].
Merged to drm-misc-next.

Thanks
Emil
[1] https://people.freedesktop.org/~cbrill/dri-log/?channel=dri-devel&date=2020-05-14
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 9+ 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
  0 siblings, 0 replies; 9+ 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] 9+ messages in thread

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

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-21 17:33 [PATCH resend 0/1] drm: Add DRM_MODE_TYPE_USERDEF flag to probed modes 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
  -- strict thread matches above, loose matches on Subject: below --
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

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.