aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil-cisco@xs4all.nl>2021-02-14 14:06:03 +0100
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2021-02-14 14:18:16 +0100
commit7b02132df3e9fb0d947e7097a2f99973662cfe44 (patch)
treeacaec8f568537be4109b8d2198305766fb72d4d5
parent80912aec18f49f097de3d0970ed8f1eab805d4de (diff)
edid-decode: the borders are not part of the front/back porches
Update DMT 4 and 5 accordingly, and add the borders to the horizontal and vertical blanking calculations. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-rw-r--r--edid-decode.cpp34
-rw-r--r--parse-base-block.cpp4
2 files changed, 25 insertions, 13 deletions
diff --git a/edid-decode.cpp b/edid-decode.cpp
index b6ec93f..2b5aafc 100644
--- a/edid-decode.cpp
+++ b/edid-decode.cpp
@@ -242,15 +242,19 @@ static void or_str(std::string &s, const std::string &flag, unsigned &num_flags)
static void print_modeline(unsigned indent, const struct timings *t, double refresh)
{
unsigned offset = (!t->even_vtotal && t->interlaced) ? 1 : 0;
+ unsigned hfp = t->hborder + t->hfp;
+ unsigned hbp = t->hborder + t->hbp;
+ unsigned vfp = t->vborder + t->vfp;
+ unsigned vbp = t->vborder + t->vbp;
printf("%*sModeline \"%ux%u_%.2f%s\" %.3f %u %u %u %u %u %u %u %u %cHSync",
indent, "",
t->hact, t->vact, refresh,
t->interlaced ? "i" : "", t->pixclk_khz / 1000.0,
- t->hact, t->hact + t->hfp, t->hact + t->hfp + t->hsync,
- t->hact + t->hfp + t->hsync + t->hbp,
- t->vact, t->vact + t->vfp, t->vact + t->vfp + t->vsync,
- t->vact + t->vfp + t->vsync + t->vbp + offset,
+ t->hact, t->hact + hfp, t->hact + hfp + t->hsync,
+ t->hact + hfp + t->hsync + hbp,
+ t->vact, t->vact + vfp, t->vact + vfp + t->vsync,
+ t->vact + vfp + t->vsync + vbp + offset,
t->pos_pol_hsync ? '+' : '-');
if (!t->no_pol_vsync)
printf(" %cVSync", t->pos_pol_vsync ? '+' : '-');
@@ -275,10 +279,14 @@ static void print_fbmode(unsigned indent, const struct timings *t,
t->hact, t->vact, t->hact, t->vact);
unsigned mult = t->interlaced ? 2 : 1;
unsigned offset = !t->even_vtotal && t->interlaced;
+ unsigned hfp = t->hborder + t->hfp;
+ unsigned hbp = t->hborder + t->hbp;
+ unsigned vfp = t->vborder + t->vfp;
+ unsigned vbp = t->vborder + t->vbp;
printf("%*stimings %llu %d %d %d %u %u %u\n",
indent + 8, "",
(unsigned long long)(1000000000.0 / (double)(t->pixclk_khz) + 0.5),
- t->hbp, t->hfp, mult * t->vbp, mult * t->vfp + offset, t->hsync, mult * t->vsync);
+ hbp, hfp, mult * vbp, mult * vfp + offset, t->hsync, mult * t->vsync);
if (t->interlaced)
printf("%*slaced true\n", indent + 8, "");
if (t->pos_pol_hsync)
@@ -305,12 +313,16 @@ static void print_v4l2_timing(const struct timings *t,
printf("V4L2_DV_HSYNC_POS_POL, \\\n");
else
printf("V4L2_DV_VSYNC_POS_POL, \\\n");
+ unsigned hfp = t->hborder + t->hfp;
+ unsigned hbp = t->hborder + t->hbp;
+ unsigned vfp = t->vborder + t->vfp;
+ unsigned vbp = t->vborder + t->vbp;
printf("\t\t\t%lluULL, %d, %u, %d, %u, %u, %d, %u, %u, %d, \\\n",
- t->pixclk_khz * 1000ULL, t->hfp, t->hsync, t->hbp,
- t->vfp, t->vsync, t->vbp,
- t->interlaced ? t->vfp : 0,
+ t->pixclk_khz * 1000ULL, hfp, t->hsync, hbp,
+ vfp, t->vsync, vbp,
+ t->interlaced ? vfp : 0,
t->interlaced ? t->vsync : 0,
- t->interlaced ? t->vbp + !t->even_vtotal : 0);
+ t->interlaced ? vbp + !t->even_vtotal : 0);
std::string flags;
unsigned num_flags = 0;
@@ -402,8 +414,8 @@ bool edid_state::print_timings(const char *prefix, const struct timings *t,
detailed = true;
unsigned vact = t->vact;
- unsigned hbl = t->hfp + t->hsync + t->hbp;
- unsigned vbl = t->vfp + t->vsync + t->vbp;
+ unsigned hbl = t->hfp + t->hsync + t->hbp + 2 * t->hborder;
+ unsigned vbl = t->vfp + t->vsync + t->vbp + 2 * t->vborder;
unsigned htotal = t->hact + hbl;
double hor_freq_khz = htotal ? (double)t->pixclk_khz / htotal : 0;
diff --git a/parse-base-block.cpp b/parse-base-block.cpp
index 9dbde81..550b622 100644
--- a/parse-base-block.cpp
+++ b/parse-base-block.cpp
@@ -45,9 +45,9 @@ static const struct {
36, 72, 108, false, 1, 3, 42, true } },
{ 0x04, 0x3140, 0x000000, { 640, 480, 4, 3, 25175, 0, false,
- 16, 96, 48, false, 10, 2, 33, false, 8, 8 } },
+ 8, 96, 40, false, 2, 2, 25, false, 8, 8 } },
{ 0x05, 0x314c, 0x000000, { 640, 480, 4, 3, 31500, 0, false,
- 24, 40, 128, false, 9, 3, 28, false, 8, 8 } },
+ 16, 40, 120, false, 1, 3, 20, false, 8, 8 } },
{ 0x06, 0x314f, 0x000000, { 640, 480, 4, 3, 31500, 0, false,
16, 64, 120, false, 1, 3, 16, false } },
{ 0x07, 0x3159, 0x000000, { 640, 480, 4, 3, 36000, 0, false,

Privacy Policy