Commit 81747a3d authored by Olivier Fourdan's avatar Olivier Fourdan
Browse files

Initial commit

parents
Copyright 2005-2006 Luc Verhaegen.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
Copyright 2005-2006 Luc Verhaegen.
Copyright © 2021 Red Hat, Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
Copyright © 2000 Compaq Computer Corporation
Copyright © 2002 Hewlett Packard Company
Copyright © 2006 Intel Corporation
Copyright © 2008, 2021 Red Hat, Inc.
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that copyright
notice and this permission notice appear in supporting documentation, and
that the name of the copyright holders not be used in advertising or
publicity pertaining to distribution of the software without specific,
written prior permission. The copyright holders make no representations
about the suitability of this software for any purpose. It is provided "as
is" without express or implied warranty.
THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
OF THIS SOFTWARE.
libxcvt
=======
`libxcvt` is a library providing a standalone version of the X server
implementation of the VESA CVT standard timing modelines generator.
`libxcvt` also provides a standalone version of the command line tool
`cvt` copied from the Xorg implementation and is meant to be a direct
replacement to the version provided by the `Xorg` server.
An example output is:
```
$ $ cvt --verbose 1920 1200 75
# 1920x1200 74.93 Hz (CVT 2.30MA) hsync: 94.04 kHz; pclk: 245.25 MHz
Modeline "1920x1200_75.00" 245.25 1920 2064 2264 2608 1200 1203 1209 1255 -hsync +vsync
```
Building
========
`libxcvt` is built using [Meson](https://mesonbuild.com/)
$ git clone https://gitlab.freedesktop.org/ofourdan/libxcvt.git
$ cd libxcvt
$ meson build/ --prefix=...
$ ninja -C build/ install
$ cd ..
Credit
======
The code base of `libxcvt` is identical to `xf86CVTMode()` therefore
all credits for `libxcvt` go to the author (Luc Verhaegen) and
contributors of `xf86CVTMode()` and the `cvt` utility as found in the
[xserver](https://gitlab.freedesktop.org/xorg/xserver/) repository.
/*
* Copyright 2005-2006 Luc Verhaegen.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
*/
/* Standalone VESA CVT standard timing modelines generator. */
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <libxcvt/libxcvt.h>
bool
cvt_is_standard(int hdisplay, int vdisplay, float vrefresh, bool reduced, bool verbose)
{
bool is_cvt = true;
if ((!(vdisplay % 3) && ((vdisplay * 4 / 3) == hdisplay)) ||
(!(vdisplay % 9) && ((vdisplay * 16 / 9) == hdisplay)) ||
(!(vdisplay % 10) && ((vdisplay * 16 / 10) == hdisplay)) ||
(!(vdisplay % 4) && ((vdisplay * 5 / 4) == hdisplay)) ||
(!(vdisplay % 9) && ((vdisplay * 15 / 9) == hdisplay)));
else {
if (verbose)
fprintf(stderr, "Warning: Aspect Ratio is not CVT standard.\n");
is_cvt = false;
}
if ((vrefresh != 50.0) && (vrefresh != 60.0) &&
(vrefresh != 75.0) && (vrefresh != 85.0)) {
if (verbose)
fprintf(stderr, "Warning: Refresh Rate %.2f is not CVT standard "
"(50, 60, 75 or 85Hz).\n", vrefresh);
is_cvt = false;
}
return is_cvt;
}
/*
* I'm not documenting --interlaced for obvious reasons, even though I did
* implement it. I also can't deny having looked at gtf here.
*/
static void
print_usage(char *Name)
{
fprintf(stderr, "\n");
fprintf(stderr, "usage: %s [-v|--verbose] [-r|--reduced] X Y [refresh]\n",
Name);
fprintf(stderr, "\n");
fprintf(stderr, " -v|--verbose : Warn about CVT standard adherence.\n");
fprintf(stderr, " -r|--reduced : Create a mode with reduced blanking "
"(default: normal blanking).\n");
fprintf(stderr, " X : Desired horizontal resolution "
"(multiple of 8, required).\n");
fprintf(stderr,
" Y : Desired vertical resolution (required).\n");
fprintf(stderr,
" refresh : Desired refresh rate (default: 60.0Hz).\n");
fprintf(stderr, "\n");
fprintf(stderr, "Calculates VESA CVT (Coordinated Video Timing) modelines"
" for use with X.\n");
}
/*
*
*/
static void
print_comment(struct libxcvt_mode_info *mode_info, bool is_cvt, bool reduced)
{
printf("# %dx%d %.2f Hz ", mode_info->hdisplay, mode_info->vdisplay, mode_info->vrefresh);
if (is_cvt) {
printf("(CVT %.2fM",
((float) mode_info->hdisplay * mode_info->vdisplay) / 1000000.0);
if (!(mode_info->vdisplay % 3) &&
((mode_info->vdisplay * 4 / 3) == mode_info->hdisplay))
printf("3");
else if (!(mode_info->vdisplay % 9) &&
((mode_info->vdisplay * 16 / 9) == mode_info->hdisplay))
printf("9");
else if (!(mode_info->vdisplay % 10) &&
((mode_info->vdisplay * 16 / 10) == mode_info->hdisplay))
printf("A");
else if (!(mode_info->vdisplay % 4) &&
((mode_info->vdisplay * 5 / 4) == mode_info->hdisplay))
printf("4");
else if (!(mode_info->vdisplay % 9) &&
((mode_info->vdisplay * 15 / 9) == mode_info->hdisplay))
printf("9");
if (reduced)
printf("-R");
printf(") ");
}
else
printf("(CVT) ");
printf("hsync: %.2f kHz; ", mode_info->hsync);
printf("pclk: %.2f MHz", ((float) mode_info->dot_clock) / 1000.0);
printf("\n");
}
/*
* Originally grabbed from xf86Mode.c.
*
* Ignoring the actual mode_info->name, as the user will want something solid
* to grab hold of.
*/
static void
print_mode_line(struct libxcvt_mode_info *mode_info, int hdisplay, int vdisplay, float vrefresh,
bool reduced)
{
if (reduced)
printf("Modeline \"%dx%dR\" ", hdisplay, vdisplay);
else
printf("Modeline \"%dx%d_%.2f\" ", hdisplay, vdisplay, vrefresh);
printf("%6.2f %i %i %i %i %i %i %i %i", mode_info->dot_clock / 1000.,
mode_info->hdisplay, mode_info->hsync_start, mode_info->hsync_end, mode_info->htotal,
mode_info->vdisplay, mode_info->vsync_start, mode_info->vsync_end, mode_info->vtotal);
if (mode_info->mode_flags & LIBXCVT_MODE_FLAG_INTERLACE)
printf(" interlace");
if (mode_info->mode_flags & LIBXCVT_MODE_FLAG_HSYNC_POSITIVE)
printf(" +hsync");
if (mode_info->mode_flags & LIBXCVT_MODE_FLAG_HSYNC_NEGATIVE)
printf(" -hsync");
if (mode_info->mode_flags & LIBXCVT_MODE_FLAG_VSYNC_POSITIVE)
printf(" +vsync");
if (mode_info->mode_flags & LIBXCVT_MODE_FLAG_VSYNC_NEGATIVE)
printf(" -vsync");
printf("\n");
}
/*
*
*/
int
main(int argc, char *argv[])
{
struct libxcvt_mode_info *mode_info;
int hdisplay = 0, vdisplay = 0;
float vrefresh = 0.0;
bool reduced = false, verbose = false, is_cvt;
bool interlaced = false;
int n;
if ((argc < 3) || (argc > 7)) {
print_usage(argv[0]);
return 1;
}
/* This doesn't filter out bad flags properly. Bad flags get passed down
* to atoi/atof, which then return 0, so that these variables can get
* filled next time round. So this is just a cosmetic problem.
*/
for (n = 1; n < argc; n++) {
if (!strcmp(argv[n], "-r") || !strcmp(argv[n], "--reduced"))
reduced = true;
else if (!strcmp(argv[n], "-i") || !strcmp(argv[n], "--interlaced"))
interlaced = true;
else if (!strcmp(argv[n], "-v") || !strcmp(argv[n], "--verbose"))
verbose = true;
else if (!strcmp(argv[n], "-h") || !strcmp(argv[n], "--help")) {
print_usage(argv[0]);
return 0;
}
else if (!hdisplay) {
hdisplay = atoi(argv[n]);
if (!hdisplay) {
print_usage(argv[0]);
return 1;
}
}
else if (!vdisplay) {
vdisplay = atoi(argv[n]);
if (!vdisplay) {
print_usage(argv[0]);
return 1;
}
}
else if (!vrefresh) {
vrefresh = atof(argv[n]);
if (!vrefresh) {
print_usage(argv[0]);
return 1;
}
}
else {
print_usage(argv[0]);
return 1;
}
}
if (!hdisplay || !vdisplay) {
print_usage(argv[0]);
return 0;
}
/* Default to 60.0Hz */
if (!vrefresh)
vrefresh = 60.0;
/* Horizontal timing is always a multiple of 8: round up. */
if (hdisplay & 0x07) {
hdisplay &= ~0x07;
hdisplay += 8;
}
if (reduced) {
if ((vrefresh / 60.0) != floor(vrefresh / 60.0)) {
fprintf(stderr,
"\nERROR: Multiple of 60Hz refresh rate required for "
" reduced blanking.\n");
print_usage(argv[0]);
return 0;
}
}
mode_info = libxcvt_gen_mode_info(hdisplay, vdisplay, vrefresh, reduced, interlaced);
if (!mode_info) {
fprintf(stderr, "Out of memory!\n");
return 0;
}
is_cvt = cvt_is_standard(hdisplay, vdisplay, vrefresh, reduced, verbose);
print_comment(mode_info, is_cvt, reduced);
print_mode_line(mode_info, hdisplay, vdisplay, vrefresh, reduced);
free(mode_info);
return 0;
}
cvt_src = [
'cvt.c',
]
executable('cvt',
cvt_src,
include_directories : inc,
link_with : libxcvt,
dependencies: mdep,
install : true)
/*
* Copyright 2005-2006 Luc Verhaegen.
* Copyright © 2021 Red Hat, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
*/
#ifndef _LIBCVT_H_
#define _LIBCVT_H_
#include <stdbool.h>
#include <libxcvt/libxcvt_mode.h>
struct libxcvt_mode_info *
libxcvt_gen_mode_info(int hdisplay,
int vdisplay,
float vrefresh,
bool reduced,
bool interlaced);
#endif /* _LIBCVT_H_ */
/*
* Copyright © 2000 Compaq Computer Corporation
* Copyright © 2002 Hewlett Packard Company
* Copyright © 2006 Intel Corporation
* Copyright © 2008, 2021 Red Hat, Inc.
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that copyright
* notice and this permission notice appear in supporting documentation, and
* that the name of the copyright holders not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. The copyright holders make no representations
* about the suitability of this software for any purpose. It is provided "as
* is" without express or implied warranty.
*
* THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
* EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
* OF THIS SOFTWARE.
*
*/
#ifndef _LIBXCVT_MODE_H_
#define _LIBXCVT_MODE_H_
#include <stdint.h>
/* Conveniently chosen to match the RandR definitions */
enum libxcvt_mode_flags {
LIBXCVT_MODE_FLAG_HSYNC_POSITIVE = (1 << 0),
LIBXCVT_MODE_FLAG_HSYNC_NEGATIVE = (1 << 1),
LIBXCVT_MODE_FLAG_VSYNC_POSITIVE = (1 << 2),
LIBXCVT_MODE_FLAG_VSYNC_NEGATIVE = (1 << 3),
LIBXCVT_MODE_FLAG_INTERLACE = (1 << 4),
};
struct libxcvt_mode_info {
uint32_t hdisplay;
uint32_t vdisplay;
float vrefresh;
float hsync;
uint64_t dot_clock;
uint16_t hsync_start;
uint16_t hsync_end;
uint16_t htotal;
uint16_t vsync_start;
uint16_t vsync_end;
uint16_t vtotal;
enum libxcvt_mode_flags mode_flags;
};
#endif /* _LIBXCVT_MODE_H_ */
install_headers('libxcvt.h','libxcvt_mode.h', subdir: 'libxcvt')
subdir('libxcvt')
/*
* Copyright 2005-2006 Luc Verhaegen.
* Copyright © 2021 Red Hat, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
*/
/* Standalone VESA CVT standard timing modelines generator. */
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <libxcvt/libxcvt.h>
/*
* Generate a CVT standard mode from hdisplay, vdisplay and vrefresh.
*
* These calculations are stolen from the CVT calculation spreadsheet written
* by Graham Loveridge. He seems to be claiming no copyright and there seems to
* be no license attached to this. He apparently just wants to see his name
* mentioned.
*
* This file can be found at http://www.vesa.org/Public/CVT/CVTd6r1.xls
*
* Comments and structure corresponds to the comments and structure of the xls.
* This should ease importing of future changes to the standard (not very
* likely though).
*
* About margins; i'm sure that they are to be the bit between HDisplay and
* HBlankStart, HBlankEnd and HTotal, VDisplay and VBlankStart, VBlankEnd and
* VTotal, where the overscan colour is shown. FB seems to call _all_ blanking
* outside sync "margin" for some reason. Since we prefer seeing proper
* blanking instead of the overscan colour, and since the Crtc* values will
* probably get altered after us, we will disable margins altogether. With
* these calculations, Margins will plainly expand H/VDisplay, and we don't
* want that. -- libv
*
*/
struct libxcvt_mode_info *
libxcvt_gen_mode_info(int hdisplay, int vdisplay, float vrefresh, bool reduced, bool interlaced)
{
bool margins = false;
float vfield_rate, hperiod;
int hdisplay_rnd, hmargin;
int vdisplay_rnd, vmargin, vsync;
float interlace; /* Please rename this */
struct libxcvt_mode_info *mode_info;
mode_info = calloc(1, sizeof *mode_info);
if (!mode_info)
return NULL;
mode_info->hdisplay = hdisplay;
mode_info->vdisplay = vdisplay;
mode_info->vrefresh = vrefresh;
/* 1) top/bottom margin size (% of height) - default: 1.8 */
#define CVT_MARGIN_PERCENTAGE 1.8
/* 2) character cell horizontal granularity (pixels) - default 8 */
#define CVT_H_GRANULARITY 8
/* 4) Minimum vertical porch (lines) - default 3 */
#define CVT_MIN_V_PORCH 3
/* 4) Minimum number of vertical back porch lines - default 6 */
#define CVT_MIN_V_BPORCH 6
/* Pixel Clock step (kHz) */
#define CVT_CLOCK_STEP 250
/* CVT default is 60.0Hz */
if (!mode_info->vrefresh)
mode_info->vrefresh = 60.0;
/* 1. Required field rate */
if (interlaced)
vfield_rate = mode_info->vrefresh * 2;
else
vfield_rate = mode_info->vrefresh;
/* 2. Horizontal pixels */
hdisplay_rnd = mode_info->hdisplay - (mode_info->hdisplay % CVT_H_GRANULARITY);
/* 3. Determine left and right borders */
if (margins) {
/* right margin is actually exactly the same as left */
hmargin = (((float) hdisplay_rnd) * CVT_MARGIN_PERCENTAGE / 100.0);
hmargin -= hmargin % CVT_H_GRANULARITY;
}
else {
hmargin = 0;
}
/* 4. Find total active pixels */
mode_info->hdisplay = hdisplay_rnd + 2 * hmargin;
/* 5. Find number of lines per field */
if (interlaced)
vdisplay_rnd = mode_info->vdisplay / 2;
else
vdisplay_rnd = mode_info->vdisplay;
/* 6. Find top and bottom margins */
/* nope. */
if (margins)
/* top and bottom margins are equal again. */
vmargin = (((float) vdisplay_rnd) * CVT_MARGIN_PERCENTAGE / 100.0);
else
vmargin = 0;
mode_info->vdisplay = mode_info->vdisplay + 2 * vmargin;
/* 7. interlace */
if (interlaced)
interlace = 0.5;
else
interlace = 0.0;
/* Determine vsync Width from aspect ratio */
if (!(mode_info->vdisplay % 3) && ((mode_info->vdisplay * 4 / 3) == mode_info->hdisplay))
vsync = 4;
else if (!(mode_info->vdisplay % 9) && ((mode_info->vdisplay * 16 / 9) == mode_info->hdisplay))
vsync = 5;
else if (!(mode_info->vdisplay % 10) && ((mode_info->vdisplay * 16 / 10) == mode_info->hdisplay))
vsync = 6;
else if (!(mode_info->vdisplay % 4) && ((mode_info->vdisplay * 5 / 4) == mode_info->hdisplay))
vsync = 7;
else if (!(mode_info->vdisplay % 9) && ((mode_info->vdisplay * 15 / 9) == mode_info->hdisplay))
vsync = 7;
else /* Custom */
vsync = 10;
if (!reduced) { /* simplified GTF calculation */
/* 4) Minimum time of vertical sync + back porch interval (µs)
* default 550.0 */
#define CVT_MIN_VSYNC_BP 550.0