Skip to contentSkip to conversation

drm: Add DRM_MODE_TYPE_USERDEF flag to probed modes

PATCH RESEND Superseded Hans de Goede 3 participants 8 messages Feb 21, 2020 – May 17, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover drm: Add DRM_MODE_TYPE_USERDEF flag to probed modes

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
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#1 lore raw

PATCH RESEND 1/1 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.

---
 drivers/gpu/drm/drm_probe_helper.c | 2 ++
 include/drm/drm_modes.h            | 3 ++-
 2 files changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/drm_probe_helper.c +2 -0
index 576b4b7dcd89..466dfbba8256 100644
@@ -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;
 	}
 
include/drm/drm_modes.h +2 -1
index e946e20c61d8..c7efb7487e9b 100644
@@ -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.
Signature · 6 lines
2.25.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 1/1
#2 lore raw

Re: [PATCH resend] drm: Add DRM_MODE_TYPE_USERDEF flag to probed modes matching a video= argument

Hi Hans,

Quoted 9 lines · Hans de Goede

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.

Quoted 5 lines

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.

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:

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
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#3 lore raw

Re: [PATCH resend] drm: Add DRM_MODE_TYPE_USERDEF flag to probed modes matching a video= argument

Quoted 21 lines · Emil Velikov

Hi Hans,

Quoted 9 lines · Hans de Goede

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.

Quoted 5 lines

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.

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

Quoted 7 lines

The commit brings extra consistency when dealing with user defined modes, and is:

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.

Signature · 6 lines
Ville Syrjälä
Intel
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#4 lore raw

Re: [PATCH resend] drm: Add DRM_MODE_TYPE_USERDEF flag to probed modes matching a video= argument

Hi,

Quoted 26 lines · Ville Syrjälä
Quoted 25 lines · Emil Velikov

Hi Hans,

Quoted 9 lines · Hans de Goede

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.

Quoted 5 lines

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.

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:

Quoted 6 lines
Quoted 3 lines

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
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#5 lore raw

Re: [PATCH resend] drm: Add DRM_MODE_TYPE_USERDEF flag to probed modes matching a video= argument

Hi Hans,

Quoted 34 lines · Hans de Goede

Hi,

Quoted 30 lines · Ville Syrjälä
Quoted 28 lines · Emil Velikov

Hi Hans,

Quoted 9 lines · Hans de Goede

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.

Quoted 5 lines

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.

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:

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.

Quoted 9 lines
Quoted 2 lines

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
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#6 lore raw

Re: [PATCH resend] drm: Add DRM_MODE_TYPE_USERDEF flag to probed modes matching a video= argument

Hi,

Quoted 44 lines · Emil Velikov

Hi Hans,

Quoted 41 lines · Hans de Goede

Hi,

Quoted 26 lines · Ville Syrjälä
Quoted 25 lines · Emil Velikov

Hi Hans,

Quoted 9 lines · Hans de Goede

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.

Quoted 5 lines

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.

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:

Quoted 6 lines
Quoted 3 lines

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.

Quoted 7 lines
Quoted 2 lines

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
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#7 lore raw

Re: [PATCH resend] drm: Add DRM_MODE_TYPE_USERDEF flag to probed modes matching a video= argument

Quoted 50 lines · Hans de Goede

Hi,

Quoted 46 lines · Emil Velikov

Hi Hans,

Quoted 43 lines · Hans de Goede

Hi,

Quoted 26 lines · Ville Syrjälä
Quoted 25 lines · Emil Velikov

Hi Hans,

Quoted 9 lines · Hans de Goede

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.

Quoted 5 lines

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.

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:

Quoted 6 lines
Quoted 3 lines

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.

Quoted 9 lines
Quoted 5 lines

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
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel