diff --git a/hw/xfree86/modes/Makefile.am b/hw/xfree86/modes/Makefile.am index 6eb162a89..35a174b5b 100644 --- a/hw/xfree86/modes/Makefile.am +++ b/hw/xfree86/modes/Makefile.am @@ -8,7 +8,6 @@ libxf86modes_la_SOURCES = \ xf86Crtc.c \ xf86Crtc.h \ xf86Cursors.c \ - xf86cvt.c \ xf86gtf.c \ xf86EdidModes.c \ xf86Modes.c \ diff --git a/hw/xfree86/modes/meson.build b/hw/xfree86/modes/meson.build index 52c7ef9b3..8a40018ca 100644 --- a/hw/xfree86/modes/meson.build +++ b/hw/xfree86/modes/meson.build @@ -1,7 +1,6 @@ srcs_xorg_modes = [ 'xf86Crtc.c', 'xf86Cursors.c', - 'xf86cvt.c', 'xf86gtf.c', 'xf86EdidModes.c', 'xf86Modes.c', diff --git a/hw/xfree86/modes/xf86Modes.c b/hw/xfree86/modes/xf86Modes.c index 5651f1ef8..384996724 100644 --- a/hw/xfree86/modes/xf86Modes.c +++ b/hw/xfree86/modes/xf86Modes.c @@ -29,6 +29,7 @@ #include #endif +#include #include "xf86Modes.h" #include "xf86Priv.h" @@ -792,3 +793,33 @@ xf86PruneDuplicateModes(DisplayModePtr modes) return modes; } + +/* + * Generate a CVT standard mode from HDisplay, VDisplay and VRefresh. + */ +DisplayModePtr +xf86CVTMode(int HDisplay, int VDisplay, float VRefresh, Bool Reduced, + Bool Interlaced) +{ + struct libxcvt_mode_info *libxcvt_mode_info; + DisplayModeRec *Mode = xnfcalloc(1, sizeof(DisplayModeRec)); + + libxcvt_mode_info = + libxcvt_gen_mode_info(HDisplay, VDisplay, VRefresh, Reduced, Interlaced); + + Mode->VDisplay = libxcvt_mode_info->vdisplay; + Mode->HDisplay = libxcvt_mode_info->hdisplay; + Mode->Clock = libxcvt_mode_info->dot_clock; + Mode->HSyncStart = libxcvt_mode_info->hsync_start; + Mode->HSyncEnd = libxcvt_mode_info->hsync_end; + Mode->HTotal = libxcvt_mode_info->htotal; + Mode->VSyncStart = libxcvt_mode_info->vsync_start; + Mode->VSyncEnd = libxcvt_mode_info->vsync_end; + Mode->VTotal = libxcvt_mode_info->vtotal; + Mode->VRefresh = libxcvt_mode_info->vrefresh; + Mode->Flags = libxcvt_mode_info->mode_flags; + + free(libxcvt_mode_info); + + return Mode; +} diff --git a/hw/xfree86/modes/xf86cvt.c b/hw/xfree86/modes/xf86cvt.c deleted file mode 100644 index be5021c89..000000000 --- a/hw/xfree86/modes/xf86cvt.c +++ /dev/null @@ -1,82 +0,0 @@ -/* - * 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. - */ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include "xf86.h" -#include "xf86Modes.h" - -#include -#include - -/* - * 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 - * - */ -DisplayModePtr -xf86CVTMode(int HDisplay, int VDisplay, float VRefresh, Bool Reduced, - Bool Interlaced) -{ - struct libxcvt_mode_info *libxcvt_mode_info; - DisplayModeRec *Mode = xnfcalloc(1, sizeof(DisplayModeRec)); - - libxcvt_mode_info = - libxcvt_gen_mode_info(HDisplay, VDisplay, VRefresh, Reduced, Interlaced); - - Mode->VDisplay = libxcvt_mode_info->vdisplay; - Mode->HDisplay = libxcvt_mode_info->hdisplay; - Mode->Clock = libxcvt_mode_info->dot_clock; - Mode->HSyncStart = libxcvt_mode_info->hsync_start; - Mode->HSyncEnd = libxcvt_mode_info->hsync_end; - Mode->HTotal = libxcvt_mode_info->htotal; - Mode->VSyncStart = libxcvt_mode_info->vsync_start; - Mode->VSyncEnd = libxcvt_mode_info->vsync_end; - Mode->VTotal = libxcvt_mode_info->vtotal; - Mode->VRefresh = libxcvt_mode_info->vrefresh; - Mode->Flags = libxcvt_mode_info->mode_flags; - - free(libxcvt_mode_info); - - return Mode; -}