Skip to content

Commit

Permalink
Allow customization of the low DPI clock
Browse files Browse the repository at this point in the history
  • Loading branch information
amadvance committed Feb 17, 2017
1 parent 79a9375 commit 847462a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
5 changes: 4 additions & 1 deletion advance/linux/vfb.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ enum fb_wait_enum {

struct fb_option_struct {
unsigned hdmi_pclock_low;
unsigned dpi_pclock_low;
};

static struct fb_option_struct fb_option;
Expand Down Expand Up @@ -1014,7 +1015,7 @@ static int fb_raspberry_settiming(const adv_crtc* crtc, unsigned* size_x, unsign
* Note that the Horizontal and Vertical clocks remain the same.
*/
unsigned factor = 0;
while (copy.pixelclock <= 31250000 + 50000) {
while (copy.pixelclock <= fb_option.dpi_pclock_low + 50000) {
++factor;
log_std(("video:fb: adjust DPI modeline to increase by factor %u / 4\n", factor));
copy.hde += crtc->hde / 4;
Expand Down Expand Up @@ -1973,13 +1974,15 @@ void fb_reg(adv_conf* context)
assert(!fb_is_active());

conf_int_register_default(context, "device_hdmi_pclock_low", 0);
conf_int_register_default(context, "device_dpi_pclock_low", 31250000);
}

adv_error fb_load(adv_conf* context)
{
assert(!fb_is_active());

fb_option.hdmi_pclock_low = conf_int_get_default(context, "device_hdmi_pclock_low");
fb_option.dpi_pclock_low = conf_int_get_default(context, "device_dpi_pclock_low");

return 0;
}
Expand Down
10 changes: 6 additions & 4 deletions doc/advdev.d
Original file line number Diff line number Diff line change
Expand Up @@ -765,20 +765,22 @@ Video Drivers Configuration
no - Disable the fast video mode change (default).

fb Configuration Options
device_hdmi_pclock_low
device_hdmi/dpi_pclock_low
Set the minimum pclock frequency used to drive the display. If a lower
value is selected, transparently increases the video mode horizontal size
until it reaches the allowed pixel clock.

This option works only with Raspberry Pi, when using the FrameBuffer and
the HDMI video interface (and not the DPI interface).
the HDMI/DPI video interface.

The use of this option is discouraged, it's present only for testing.

device_hdmi_pclock_low PCLOCK
:device_hdmi_pclock_low PCLOCK
:device_dpi_pclock_low PCLOCK

Options:
PCLOCK - Pixel clock in Hz (default 0).
PCLOCK - Pixel clock in Hz (default 0 for HDMI,
and 31.25 MHz for DPI).

vbeline Configuration Options
The following are the common video configuration options
Expand Down

0 comments on commit 847462a

Please sign in to comment.