sync code with last improvements from OpenBSD

This commit is contained in:
purplerain 2023-08-28 05:57:34 +00:00
commit 88965415ff
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
26235 changed files with 29195616 additions and 0 deletions

View file

@ -0,0 +1,46 @@
/*
* 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>
#ifdef __cplusplus
extern "C" {
#endif
struct libxcvt_mode_info *
libxcvt_gen_mode_info(int hdisplay,
int vdisplay,
float vrefresh,
bool reduced,
bool interlaced);
#ifdef __cplusplus
}
#endif
#endif /* _LIBCVT_H_ */

View file

@ -0,0 +1,56 @@
/*
* 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_ */

View file

@ -0,0 +1 @@
install_headers('libxcvt.h','libxcvt_mode.h', subdir: 'libxcvt')

View file

@ -0,0 +1 @@
subdir('libxcvt')