|
@@ -1525,6 +1525,7 @@ static void adv7842_fill_optional_dv_timings_fields(struct v4l2_subdev *sd,
|
|
|
v4l2_find_dv_timings_cap(timings, adv7842_get_dv_timings_cap(sd),
|
|
|
is_digital_input(sd) ? 250000 : 1000000,
|
|
|
adv7842_check_dv_timings, NULL);
|
|
|
+ timings->bt.flags |= V4L2_DV_FL_CAN_DETECT_REDUCED_FPS;
|
|
|
}
|
|
|
|
|
|
static int adv7842_query_dv_timings(struct v4l2_subdev *sd,
|
|
@@ -1596,6 +1597,14 @@ static int adv7842_query_dv_timings(struct v4l2_subdev *sd,
|
|
|
bt->il_vbackporch = 0;
|
|
|
}
|
|
|
adv7842_fill_optional_dv_timings_fields(sd, timings);
|
|
|
+ if ((timings->bt.flags & V4L2_DV_FL_CAN_REDUCE_FPS) &&
|
|
|
+ freq < bt->pixelclock) {
|
|
|
+ u32 reduced_freq = ((u32)bt->pixelclock / 1001) * 1000;
|
|
|
+ u32 delta_freq = abs(freq - reduced_freq);
|
|
|
+
|
|
|
+ if (delta_freq < ((u32)bt->pixelclock - reduced_freq) / 2)
|
|
|
+ timings->bt.flags |= V4L2_DV_FL_REDUCED_FPS;
|
|
|
+ }
|
|
|
} else {
|
|
|
/* find format
|
|
|
* Since LCVS values are inaccurate [REF_03, p. 339-340],
|