Skip to content

Commit

Permalink
Restrict some multiplier options
Browse files Browse the repository at this point in the history
  • Loading branch information
IanSB committed Nov 5, 2020
1 parent a5b95f4 commit 5c53cd0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/cpld_rgb.c
Expand Up @@ -276,6 +276,10 @@ static int get_adjusted_divider_index() {
if (supports_odd_even && config->rate != RGB_RATE_3 && config->rate != RGB_RATE_9LO && config->rate != RGB_RATE_9HI && config->rate != RGB_RATE_12 && divider_index > 1) {
divider_index = 1;
}
if (config->rate >= RGB_RATE_9V && config->rate <= RGB_RATE_12 && divider_index >= 6) {
divider_index = 0;
}

return divider_index;
}

Expand Down Expand Up @@ -1529,6 +1533,8 @@ static void cpld_set_value(int num, int value) {
char msg[64];
if (supports_odd_even && config->rate != RGB_RATE_3 && config->rate != RGB_RATE_9LO && config->rate != RGB_RATE_9HI && config->rate != RGB_RATE_12){
sprintf(msg, "1 Bit, 6 Bit & 9 Bit(V) Limited to %s", divider_names[actual_value]);
} else if (config->rate >= RGB_RATE_9V && config->rate <= RGB_RATE_12 && value >= 6) {
sprintf(msg, "Can't use %s with 9 or 12 BPP, using %s", divider_names[value], divider_names[actual_value]);
} else {
sprintf(msg, "Clock > 192MHz: Limited to %s", divider_names[actual_value]);
}
Expand Down
1 change: 1 addition & 0 deletions src/rgb_to_hdmi.c
Expand Up @@ -791,6 +791,7 @@ static int calibrate_sampling_clock(int profile_changed) {
new_clock = (new_clock << 1) / 3;
}
}
new_clock = new_clock * cpld->get_divider() / 6;
} else {
log_warn("PPM error too large, using nominal clock");
new_clock = nominal_cpld_clock;
Expand Down

0 comments on commit 5c53cd0

Please sign in to comment.