Skip to content

Commit cd7ea23

Browse files
6by9popcornmix
authored andcommitted
drm/vc4: Make FKMS max refresh rate a module parameter
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>
1 parent 584ac5b commit cd7ea23

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

‎drivers/gpu/drm/vc4/vc4_firmware_kms.c‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
* Pi's firmware display stack.
1515
*/
1616

17+
#include <linux/module.h>
18+
1719
#include "drm/drm_atomic_helper.h"
1820
#include "drm/drm_gem_framebuffer_helper.h"
1921
#include "drm/drm_plane_helper.h"
@@ -32,6 +34,10 @@
3234
#include "vc_image_types.h"
3335
#include <soc/bcm2835/raspberrypi-firmware.h>
3436

37+
int fkms_max_refresh_rate = 85;
38+
module_param(fkms_max_refresh_rate, int, 0644);
39+
MODULE_PARM_DESC(fkms_max_refresh_rate, "Max supported refresh rate");
40+
3541
struct get_display_cfg {
3642
u32 max_pixel_clock[2]; //Max pixel clock for each display
3743
};
@@ -1052,8 +1058,10 @@ vc4_crtc_mode_valid(struct drm_crtc *crtc, const struct drm_display_mode *mode)
10521058
return MODE_NO_DBLESCAN;
10531059
}
10541060

1055-
/* Disable refresh rates > 85Hz as limited gain from them */
1056-
if (drm_mode_vrefresh(mode) > 85)
1061+
/* Disable refresh rates > defined threshold (default 85Hz) as limited
1062+
* gain from them
1063+
*/
1064+
if (drm_mode_vrefresh(mode) > fkms_max_refresh_rate)
10571065
return MODE_BAD_VVALUE;
10581066

10591067
/* Limit the pixel clock based on the HDMI clock limits from the

0 commit comments

Comments
 (0)