aboutsummaryrefslogtreecommitdiffstats
path: root/edid-decode.cpp
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil-cisco@xs4all.nl>2021-10-12 11:39:53 +0200
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2021-10-12 11:39:53 +0200
commit985024f0ccb7eb0014397f2d562ecebfdd340c3b (patch)
treed1add05516e6122b60d8c524c33b40b40136228a /edid-decode.cpp
parentb85a0568e388ef51c444de4ccc724eb76b84c967 (diff)
edid-decode: add CVT 2.0 vblank support
With CVT 2.0 you can select the vertical blank time as input parameter to the calculation. Range 460-705 (higher might not work). Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Diffstat (limited to 'edid-decode.cpp')
-rw-r--r--edid-decode.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/edid-decode.cpp b/edid-decode.cpp
index 84a59d3..fcae469 100644
--- a/edid-decode.cpp
+++ b/edid-decode.cpp
@@ -142,7 +142,7 @@ static void usage(void)
" --dmt <dmt> Show the timings for the DMT with the given DMT ID.\n"
" --vic <vic> Show the timings for this VIC.\n"
" --hdmi-vic <hdmivic> Show the timings for this HDMI VIC.\n"
- " --cvt w=<width>,h=<height>,fps=<fps>[,rb=<rb>][,interlaced][,overscan][,alt][,hblank=<hblank][,early-vsync]\n"
+ " --cvt w=<width>,h=<height>,fps=<fps>[,rb=<rb>][,interlaced][,overscan][,alt][,hblank=<hblank][,vblank=<vblank][,early-vsync]\n"
" Calculate the CVT timings for the given format.\n"
" <fps> is frames per second for progressive timings,\n"
" or fields per second for interlaced timings.\n"
@@ -156,6 +156,8 @@ static void usage(void)
" is 160 instead of 80 pixels.\n"
" If 'hblank' is given and <rb>=3, then the horizontal blanking\n"
" is <hblank> pixels (range of 80-200), overriding 'alt'.\n"
+ " If 'vblank' is given and <rb>=3, then the vertical blanking\n"
+ " time is <vblank> microseconds (range of 460-705).\n"
" If 'early-vsync' is given and <rb=3>, then select early vsync.\n"
" --gtf w=<width>,h=<height>[,fps=<fps>][,horfreq=<horfreq>][,pixclk=<pixclk>][,interlaced]\n"
" [,overscan][,secondary][,C=<c>][,M=<m>][,K=<k>][,J=<j>]\n"
@@ -1509,6 +1511,7 @@ enum cvt_opts {
CVT_RB,
CVT_ALT,
CVT_RB_H_BLANK,
+ CVT_RB_V_BLANK,
CVT_EARLY_VSYNC,
};
@@ -1526,6 +1529,7 @@ static int parse_cvt_subopt(char **subopt_str, double *value)
"rb",
"alt",
"hblank",
+ "vblank",
"early-vsync",
nullptr
};
@@ -1556,6 +1560,7 @@ static void parse_cvt(char *optarg)
double fps = 0;
unsigned rb = RB_NONE;
unsigned rb_h_blank = 0;
+ unsigned rb_v_blank = 460;
bool interlaced = false;
bool alt = false;
bool overscan = false;
@@ -1592,6 +1597,15 @@ static void parse_cvt(char *optarg)
case CVT_RB_H_BLANK:
rb_h_blank = opt_val;
break;
+ case CVT_RB_V_BLANK:
+ rb_v_blank = opt_val;
+ if (rb_v_blank < 460) {
+ fprintf(stderr, "vblank must be >= 460, set to 460.\n");
+ rb_v_blank = 460;
+ } else if (rb_v_blank > 705) {
+ fprintf(stderr, "warning: vblank values > 705 might not be supported by RBv3 compliant sources.\n");
+ }
+ break;
case CVT_EARLY_VSYNC:
early_vsync = true;
break;
@@ -1608,7 +1622,7 @@ static void parse_cvt(char *optarg)
if (interlaced)
fps /= 2;
timings t = state.calc_cvt_mode(w, h, fps, rb, interlaced, overscan, alt,
- rb_h_blank, early_vsync);
+ rb_h_blank, rb_v_blank, early_vsync);
state.print_timings("", &t, "CVT", "", true, false);
}

Privacy Policy