Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drm/vc4: Limits fkms to modes <= 85Hz #3677

Closed
alanbork opened this issue Jun 18, 2020 · 6 comments
Closed

drm/vc4: Limits fkms to modes <= 85Hz #3677

alanbork opened this issue Jun 18, 2020 · 6 comments

Comments

@alanbork
Copy link

Because of commit 883a1a5, the pi4 now ignores configuration set for refresh rates > 85hz. Why is that a good thing? I want to be able to run at 120hz for a hardware project I'm working on. I can patch the code for my own use, but this artificial limit seems wrong-headed, unless there's some issue with the Pi4 hardware that causes errors or other bad behavior > 85hz.

883a1a5

@6by9
Copy link
Contributor

6by9 commented Jun 19, 2020

It's things like Kodi where running the display at 1080p100 and 1080p120 are valid if supported by the monitor, but just chew up rendering effort for zero gain.
You could say that Kodi should blacklist the higher refresh rates, but it's easier to do it at the platform level.

If you wanted to submit a PR to move that limit to a module parameter or an optional DT parameter of "raspberrypi,rpi-firmware-kms", then it would be considered.

@alanbork
Copy link
Author

That seems like a reasonable compromise, but a little beyond my knowledge of how github works. For my needs I can just patch and recompile locally. But I know I'm not the only one asking for this feature, FYI.

6by9 added a commit to 6by9/linux that referenced this issue Jul 3, 2020
Some people want to use the high refresh rate modes for 1080p100
and 1080p120, but they're currently filtered out as generally
they don't add anything.

Make the filter threshold a module parameter so that it can be
adjusted.

raspberrypi#3677

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
pelwell pushed a commit that referenced this issue Jul 3, 2020
Some people want to use the high refresh rate modes for 1080p100
and 1080p120, but they're currently filtered out as generally
they don't add anything.

Make the filter threshold a module parameter so that it can be
adjusted.

#3677

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
pelwell pushed a commit that referenced this issue Jul 3, 2020
Some people want to use the high refresh rate modes for 1080p100
and 1080p120, but they're currently filtered out as generally
they don't add anything.

Make the filter threshold a module parameter so that it can be
adjusted.

#3677

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
pelwell pushed a commit that referenced this issue Jul 3, 2020
Some people want to use the high refresh rate modes for 1080p100
and 1080p120, but they're currently filtered out as generally
they don't add anything.

Make the filter threshold a module parameter so that it can be
adjusted.

#3677

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Jul 13, 2020
Some people want to use the high refresh rate modes for 1080p100
and 1080p120, but they're currently filtered out as generally
they don't add anything.

Make the filter threshold a module parameter so that it can be
adjusted.

#3677

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Jul 13, 2020
Some people want to use the high refresh rate modes for 1080p100
and 1080p120, but they're currently filtered out as generally
they don't add anything.

Make the filter threshold a module parameter so that it can be
adjusted.

#3677

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Jul 20, 2020
Some people want to use the high refresh rate modes for 1080p100
and 1080p120, but they're currently filtered out as generally
they don't add anything.

Make the filter threshold a module parameter so that it can be
adjusted.

#3677

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Aug 10, 2020
Some people want to use the high refresh rate modes for 1080p100
and 1080p120, but they're currently filtered out as generally
they don't add anything.

Make the filter threshold a module parameter so that it can be
adjusted.

#3677

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
rsglobal pushed a commit to GloDroid/glodroid_forks that referenced this issue Aug 12, 2020
Some people want to use the high refresh rate modes for 1080p100
and 1080p120, but they're currently filtered out as generally
they don't add anything.

Make the filter threshold a module parameter so that it can be
adjusted.

raspberrypi/linux#3677

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Aug 12, 2020
Some people want to use the high refresh rate modes for 1080p100
and 1080p120, but they're currently filtered out as generally
they don't add anything.

Make the filter threshold a module parameter so that it can be
adjusted.

#3677

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Aug 15, 2020
Some people want to use the high refresh rate modes for 1080p100
and 1080p120, but they're currently filtered out as generally
they don't add anything.

Make the filter threshold a module parameter so that it can be
adjusted.

#3677

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Aug 15, 2020
Some people want to use the high refresh rate modes for 1080p100
and 1080p120, but they're currently filtered out as generally
they don't add anything.

Make the filter threshold a module parameter so that it can be
adjusted.

#3677

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
HiassofT pushed a commit to HiassofT/rpi-linux that referenced this issue Aug 17, 2020
Some people want to use the high refresh rate modes for 1080p100
and 1080p120, but they're currently filtered out as generally
they don't add anything.

Make the filter threshold a module parameter so that it can be
adjusted.

raspberrypi#3677

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
HiassofT pushed a commit to HiassofT/rpi-linux that referenced this issue Aug 17, 2020
Some people want to use the high refresh rate modes for 1080p100
and 1080p120, but they're currently filtered out as generally
they don't add anything.

Make the filter threshold a module parameter so that it can be
adjusted.

raspberrypi#3677

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Aug 19, 2020
Some people want to use the high refresh rate modes for 1080p100
and 1080p120, but they're currently filtered out as generally
they don't add anything.

Make the filter threshold a module parameter so that it can be
adjusted.

#3677

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Aug 19, 2020
Some people want to use the high refresh rate modes for 1080p100
and 1080p120, but they're currently filtered out as generally
they don't add anything.

Make the filter threshold a module parameter so that it can be
adjusted.

#3677

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Sep 1, 2020
Some people want to use the high refresh rate modes for 1080p100
and 1080p120, but they're currently filtered out as generally
they don't add anything.

Make the filter threshold a module parameter so that it can be
adjusted.

#3677

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Sep 1, 2020
Some people want to use the high refresh rate modes for 1080p100
and 1080p120, but they're currently filtered out as generally
they don't add anything.

Make the filter threshold a module parameter so that it can be
adjusted.

#3677

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
6by9 added a commit to 6by9/linux that referenced this issue Sep 4, 2020
Some people want to use the high refresh rate modes for 1080p100
and 1080p120, but they're currently filtered out as generally
they don't add anything.

Make the filter threshold a module parameter so that it can be
adjusted.

raspberrypi#3677

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Sep 11, 2020
Some people want to use the high refresh rate modes for 1080p100
and 1080p120, but they're currently filtered out as generally
they don't add anything.

Make the filter threshold a module parameter so that it can be
adjusted.

#3677

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Sep 15, 2020
Some people want to use the high refresh rate modes for 1080p100
and 1080p120, but they're currently filtered out as generally
they don't add anything.

Make the filter threshold a module parameter so that it can be
adjusted.

#3677

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Sep 28, 2020
Some people want to use the high refresh rate modes for 1080p100
and 1080p120, but they're currently filtered out as generally
they don't add anything.

Make the filter threshold a module parameter so that it can be
adjusted.

#3677

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Oct 2, 2020
Some people want to use the high refresh rate modes for 1080p100
and 1080p120, but they're currently filtered out as generally
they don't add anything.

Make the filter threshold a module parameter so that it can be
adjusted.

#3677

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Oct 7, 2020
Some people want to use the high refresh rate modes for 1080p100
and 1080p120, but they're currently filtered out as generally
they don't add anything.

Make the filter threshold a module parameter so that it can be
adjusted.

#3677

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
@alanbork
Copy link
Author

so this works well (BUT shouldn't the syntax be documented somewhere?) but I'm wondering if there's a related regression when it's not enabled?

I was working with a display that supports 120hz but does not advertise that in the edid (it's a CRT). in order to force the refresh rate I used config.txt to set the hdmi mode to cea 13 (same result holds for dmt 20 and 9), and rebooted. The screen initially came up fine but mid-way though boot it went black and never returned. it turned out I had not figured out the syntax for using this feature and so it wasn't enabled . Once I found the syntax it worked fine and I was able to verify 120hz timing.

BUT: what about when the module parameter wasn't enabled and the screen got turned off mid-boot? that seems like a bad bug indeed given that just keeping the requested mode resulted in a working display. I couldn't determine if it actually tried to set the mode to something else or just disabled video output because it didn't respect my refresh rate request

@6by9
Copy link
Contributor

6by9 commented Oct 15, 2020

The max refresh rate has been configurable as a module parameter since July - 8e3b979

The issue of putting an invalid mode on the kernel command line and it resulting in no mode being selected is down to the core DRM code, not the driver. It treats whatever is on the kernel command line as gospel and doesn't fall back to any other mode should the driver reject it. I have had a look at fixing it, but the relevant hooks aren't immediately obvious. I'll ping the contractor who does DRM/KMS stuff for us.

Note you're likely to have issues anyway if you're adding modes not in the EDID. The kernel command line take width, height, refresh rate, and a reduced blanking flag only. It compares w/h/Hz against the EDID advertised modes and selects one of those modes if a match is found, otherwise it uses the CVT algorithm to compute the timings.
CVT generally results in a higher pixel clock from the CEA or DMT modes, and can result in a mode that the monitor can't do.

@alanbork
Copy link
Author

good to know about the timings being computed vs standard CEA/DMT. is that an fkms issue or also true on pre-pi4 hardware using the legacy driver?

I suppose there's no hope of having a safe mode boot option ala windows? hold down shift or whatever to selectively apply a subset of the config.txt options marked in [safe]? probably the usb stack's not up early enough to make that work.

instead of a fallback mode perhaps the driver shouldn't reject modes when being initialize for the first time/at boot? then at least you have a hope of working, rather than a guaranteed failure.

popcornmix pushed a commit that referenced this issue Oct 16, 2020
Some people want to use the high refresh rate modes for 1080p100
and 1080p120, but they're currently filtered out as generally
they don't add anything.

Make the filter threshold a module parameter so that it can be
adjusted.

#3677

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Oct 19, 2020
Some people want to use the high refresh rate modes for 1080p100
and 1080p120, but they're currently filtered out as generally
they don't add anything.

Make the filter threshold a module parameter so that it can be
adjusted.

#3677

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
popcornmix pushed a commit that referenced this issue Nov 4, 2020
Some people want to use the high refresh rate modes for 1080p100
and 1080p120, but they're currently filtered out as generally
they don't add anything.

Make the filter threshold a module parameter so that it can be
adjusted.

#3677

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
@alanbork
Copy link
Author

alanbork commented Jul 3, 2021

in order to apply this (fkms only) change /boot/cmdline.txt to look something like this:

vc4.fkms_max_refresh_rate=240 console=serial0,115200 console=tty1 root=PARTUUID=d3188030-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait drm/debug=0x14

not needed for kms as far as I can tell.

@alanbork alanbork closed this as completed Jul 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants