Skip to content

Commit

Permalink
drm/vc4: Make FKMS max refresh rate a module parameter
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
6by9 authored and pelwell committed Jul 3, 2020
1 parent 85a89eb commit e2ac0c3
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions drivers/gpu/drm/vc4/vc4_firmware_kms.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
* Pi's firmware display stack.
*/

#include <linux/module.h>

#include "drm/drm_atomic_helper.h"
#include "drm/drm_gem_framebuffer_helper.h"
#include "drm/drm_plane_helper.h"
Expand All @@ -32,6 +34,10 @@
#include "vc_image_types.h"
#include <soc/bcm2835/raspberrypi-firmware.h>

int fkms_max_refresh_rate = 85;
module_param(fkms_max_refresh_rate, int, 0644);
MODULE_PARM_DESC(fkms_max_refresh_rate, "Max supported refresh rate");

struct get_display_cfg {
u32 max_pixel_clock[2]; //Max pixel clock for each display
};
Expand Down Expand Up @@ -1052,8 +1058,10 @@ vc4_crtc_mode_valid(struct drm_crtc *crtc, const struct drm_display_mode *mode)
return MODE_NO_DBLESCAN;
}

/* Disable refresh rates > 85Hz as limited gain from them */
if (drm_mode_vrefresh(mode) > 85)
/* Disable refresh rates > defined threshold (default 85Hz) as limited
* gain from them
*/
if (drm_mode_vrefresh(mode) > fkms_max_refresh_rate)
return MODE_BAD_VVALUE;

/* Limit the pixel clock based on the HDMI clock limits from the
Expand Down

0 comments on commit e2ac0c3

Please sign in to comment.