Relicense Sortix to the ISC license.
I hereby relicense all my work on Sortix under the ISC license as below.
All Sortix contributions by other people are already under this license,
are not substantial enough to be copyrightable, or have been removed.
All imported code from other projects is compatible with this license.
All GPL licensed code from other projects had previously been removed.
Copyright 2011-2016 Jonas 'Sortie' Termansen and contributors.
Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, 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.
2016-03-02 17:38:16 -05:00
|
|
|
/*
|
2016-08-26 09:38:21 -04:00
|
|
|
* Copyright (c) 2012, 2014, 2016 Jonas 'Sortie' Termansen.
|
Relicense Sortix to the ISC license.
I hereby relicense all my work on Sortix under the ISC license as below.
All Sortix contributions by other people are already under this license,
are not substantial enough to be copyrightable, or have been removed.
All imported code from other projects is compatible with this license.
All GPL licensed code from other projects had previously been removed.
Copyright 2011-2016 Jonas 'Sortie' Termansen and contributors.
Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, 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.
2016-03-02 17:38:16 -05:00
|
|
|
*
|
|
|
|
* Permission to use, copy, modify, and distribute this software for any
|
|
|
|
* purpose with or without fee is hereby granted, provided that the above
|
|
|
|
* copyright notice and this permission notice appear in all copies.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
|
|
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
|
|
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
|
|
* ANY SPECIAL, DIRECT, 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.
|
|
|
|
*
|
|
|
|
* sortix/display.h
|
|
|
|
* Display message declarations.
|
|
|
|
*/
|
2012-12-15 20:10:19 -05:00
|
|
|
|
2022-07-07 19:09:15 -04:00
|
|
|
#ifndef _INCLUDE_SORTIX_DISPLAY_H
|
|
|
|
#define _INCLUDE_SORTIX_DISPLAY_H
|
2012-12-15 20:10:19 -05:00
|
|
|
|
2013-10-13 07:04:27 -04:00
|
|
|
#include <sys/cdefs.h>
|
2013-09-23 10:37:33 -04:00
|
|
|
|
2013-12-29 17:56:09 -05:00
|
|
|
#include <stddef.h>
|
2012-12-15 20:10:19 -05:00
|
|
|
#include <stdint.h>
|
|
|
|
|
2015-05-13 12:11:02 -04:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
2012-12-15 20:10:19 -05:00
|
|
|
|
2016-02-28 06:11:02 -05:00
|
|
|
static const uint32_t DISPMSG_CONTROL_VALID = 1 << 0;
|
|
|
|
static const uint32_t DISPMSG_CONTROL_VGA = 1 << 1;
|
|
|
|
static const uint32_t DISPMSG_CONTROL_OTHER_RESOLUTIONS = 1 << 2;
|
2016-08-26 09:38:21 -04:00
|
|
|
static const uint32_t DISPMSG_CONTROL_FALLBACK = 1 << 3;
|
2016-09-03 17:46:10 -04:00
|
|
|
static const uint32_t DISPMSG_CONTROL_DEFAULT = 1 << 4;
|
|
|
|
static const uint32_t DISPMSG_CONTROL_GOOD_DEFAULT = 1 << 5;
|
|
|
|
static const uint32_t DISPMSG_CONTROL_VM_AUTO_SCALE = 1 << 6;
|
2014-03-25 15:28:51 -04:00
|
|
|
|
2012-12-15 20:10:19 -05:00
|
|
|
struct dispmsg_string
|
|
|
|
{
|
2017-07-10 07:37:46 -04:00
|
|
|
size_t byte_size; /* Including the terminating NUL-byte. */
|
2012-12-15 20:10:19 -05:00
|
|
|
char* str;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct dispmsg_crtc_mode
|
|
|
|
{
|
|
|
|
uint64_t driver_index;
|
|
|
|
uint64_t magic;
|
|
|
|
uint32_t control;
|
|
|
|
uint32_t fb_format;
|
|
|
|
uint32_t view_xres;
|
|
|
|
uint32_t view_yres;
|
|
|
|
uint64_t fb_location;
|
|
|
|
uint64_t pitch;
|
|
|
|
uint32_t surf_off_x;
|
|
|
|
uint32_t surf_off_y;
|
|
|
|
uint32_t start_x;
|
|
|
|
uint32_t start_y;
|
|
|
|
uint32_t end_x;
|
|
|
|
uint32_t end_y;
|
|
|
|
uint32_t desktop_height;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct dispmsg_header
|
|
|
|
{
|
2017-07-10 07:37:46 -04:00
|
|
|
uint64_t msgid; /* in */
|
2012-12-15 20:10:19 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
#define DISPMSG_ENUMERATE_DEVICES 0x00
|
|
|
|
struct dispmsg_enumerate_devices
|
|
|
|
{
|
2017-07-10 07:37:46 -04:00
|
|
|
uint64_t msgid; /* in */
|
|
|
|
size_t devices_length; /* in, out */
|
|
|
|
uint64_t* devices; /* in, *out */
|
2012-12-15 20:10:19 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
#define DISPMSG_GET_DRIVER_COUNT 0x01
|
|
|
|
struct dispmsg_get_driver_count
|
|
|
|
{
|
2017-07-10 07:37:46 -04:00
|
|
|
uint64_t msgid; /* in */
|
|
|
|
uint64_t device; /* in */
|
|
|
|
uint64_t driver_count; /* out */
|
2012-12-15 20:10:19 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
#define DISPMSG_GET_DRIVER_NAME 0x02
|
|
|
|
struct dispmsg_get_driver_name
|
|
|
|
{
|
2017-07-10 07:37:46 -04:00
|
|
|
uint64_t msgid; /* in */
|
|
|
|
uint64_t device; /* in */
|
|
|
|
uint64_t driver_index; /* in */
|
|
|
|
struct dispmsg_string name; /* out */
|
2012-12-15 20:10:19 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
#define DISPMSG_GET_DRIVER 0x03
|
|
|
|
struct dispmsg_get_driver
|
|
|
|
{
|
2017-07-10 07:37:46 -04:00
|
|
|
uint64_t msgid; /* in */
|
|
|
|
uint64_t device; /* in */
|
|
|
|
uint64_t driver_index; /* out */
|
2012-12-15 20:10:19 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
#define DISPMSG_SET_DRIVER 0x04
|
|
|
|
struct dispmsg_set_driver
|
|
|
|
{
|
2017-07-10 07:37:46 -04:00
|
|
|
uint64_t msgid; /* in */
|
|
|
|
uint64_t device; /* in */
|
|
|
|
uint64_t driver_index; /* in */
|
2012-12-15 20:10:19 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
#define DISPMSG_SET_CRTC_MODE 0x05
|
|
|
|
struct dispmsg_set_crtc_mode
|
|
|
|
{
|
2017-07-10 07:37:46 -04:00
|
|
|
uint64_t msgid; /* in */
|
|
|
|
uint64_t device; /* in */
|
|
|
|
uint64_t connector; /* in */
|
|
|
|
struct dispmsg_crtc_mode mode; /* in */
|
2012-12-15 20:10:19 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
#define DISPMSG_GET_CRTC_MODE 0x06
|
|
|
|
struct dispmsg_get_crtc_mode
|
|
|
|
{
|
2017-07-10 07:37:46 -04:00
|
|
|
uint64_t msgid; /* in */
|
|
|
|
uint64_t device; /* in */
|
|
|
|
uint64_t connector; /* in */
|
|
|
|
struct dispmsg_crtc_mode mode; /* out */
|
2012-12-15 20:10:19 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
#define DISPMSG_GET_CRTC_MODES 0x07
|
|
|
|
struct dispmsg_get_crtc_modes
|
|
|
|
{
|
2017-07-10 07:37:46 -04:00
|
|
|
uint64_t msgid; /* in */
|
|
|
|
uint64_t device; /* in */
|
|
|
|
uint64_t connector; /* in */
|
|
|
|
size_t modes_length; /* in, out */
|
|
|
|
struct dispmsg_crtc_mode* modes; /* in, *out */
|
2012-12-15 20:10:19 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
#define DISPMSG_GET_MEMORY_SIZE 0x08
|
|
|
|
struct dispmsg_get_memory_size
|
|
|
|
{
|
2017-07-10 07:37:46 -04:00
|
|
|
uint64_t msgid; /* in */
|
|
|
|
uint64_t device; /* in */
|
|
|
|
uint64_t memory_size; /* out */
|
2012-12-15 20:10:19 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
#define DISPMSG_WRITE_MEMORY 0x09
|
|
|
|
struct dispmsg_write_memory
|
|
|
|
{
|
2017-07-10 07:37:46 -04:00
|
|
|
uint64_t msgid; /* in */
|
|
|
|
uint64_t device; /* in */
|
|
|
|
uint64_t offset; /* in */
|
|
|
|
size_t size; /* in */
|
|
|
|
uint8_t* src; /* in, *in */
|
2012-12-15 20:10:19 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
#define DISPMSG_READ_MEMORY 0x0A
|
|
|
|
struct dispmsg_read_memory
|
|
|
|
{
|
2017-07-10 07:37:46 -04:00
|
|
|
uint64_t msgid; /* in */
|
|
|
|
uint64_t device; /* in */
|
|
|
|
uint64_t offset; /* in */
|
|
|
|
size_t size; /* in */
|
|
|
|
uint8_t* dst; /* in, *out */
|
2012-12-15 20:10:19 -05:00
|
|
|
};
|
|
|
|
|
2016-11-19 10:44:35 -05:00
|
|
|
struct tiocgdisplay
|
|
|
|
{
|
|
|
|
uint64_t device;
|
|
|
|
uint64_t connector;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct tiocgdisplays
|
|
|
|
{
|
2017-07-10 07:37:46 -04:00
|
|
|
size_t count; /* in, out */
|
|
|
|
struct tiocgdisplay* displays; /* in, *out */
|
2016-11-19 10:44:35 -05:00
|
|
|
};
|
|
|
|
|
2015-05-13 12:11:02 -04:00
|
|
|
#ifdef __cplusplus
|
|
|
|
} /* extern "C" */
|
|
|
|
#endif
|
2012-12-15 20:10:19 -05:00
|
|
|
|
|
|
|
#endif
|