diff --git a/.gitignore b/.gitignore
index c5e23f0..1563980 100644
--- a/.gitignore
+++ b/.gitignore
@@ -37,6 +37,7 @@ overlay/rootfs/etc/skel/.ssh/
overlay/rootfs/root/.ssh/
# C/C++ & CMake build artifacts
+/src/xlibre
src/**/build/
CMakeFiles/
CMakeCache.txt
diff --git a/MANUAL.md b/MANUAL.md
index ce7e295..5964a47 100644
--- a/MANUAL.md
+++ b/MANUAL.md
@@ -23,12 +23,16 @@ This manual covers flashing, operating, and customizing **Bananarchy Linux** (`v
- `bootloader/loaders/8110.mbn` — signed Qualcomm Sahara/Firehose programmer (`05c6:9008`).
### 1.3 Integrated hardware & UX tweaks
-1. **Native 1:1 `240x320` resolution & enlarged fonts**:
- - Sway runs at `output * scale 1` (`SXMO_SWAY_SCALE=1`) with Xwayland disabled to save RAM.
- - Enlarged fonts across all UI layers: `Sxmo 13` window titles and `24px` top bar, `34pt`/`14pt` Conky clock/date positioned cleanly above the Bananarchy emblem wallpaper, `15px` bold Wofi full-screen menus (`240x296`), `13pt` Foot terminal font, `220x28` Wob volume/brightness overlay, and `12pt` Dunst notifications.
+1. **Native 1:1 `240x320` resolution, cross-compiled Xlibre, `Fira Code` ligatures & ultra-low-latency Sxmo X11 UI**:
+ - **Cross-compiled Xlibre (`X11Libre/xserver` 25.2.0)**: compiled specifically for ARMv7 Cortex-A7 (`-O2 -march=armv7-a -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard -fno-plt -fomit-frame-pointer`) with all 3D/GLX/Glamor/VGA/DGA/XVideo bloat stripped out, rootless `elogind` device management, and `modesetting` KMS + `ShadowFB` (`drmModeDirtyFB` partial rectangle SPI updates) with automatic software cursor fallback on `/dev/dri/card0` (`panel-mipi-dbi`).
+ - **Non-Nerd `Fira Code` with OpenType ligatures**: `Fira Code` (`font-fira-code`) is configured as the primary system and terminal font across Fontconfig, Xft, `st`, `dmenu`, `dwm`, `conky`, and `dunst`, with `DejaVu SansM Nerd Font` used strictly as a fallback for Private Use Area icon glyphs.
+ - **Patched `sxmo-st` (`st`) with HarfBuzz ligatures & XIM**: patched with `libharfbuzz` (`hb.c`/`hb.h`) shaping (`liga`, `calt`, `clig`, `dlig`) so multi-character programming operators (`->`, `=>`, `!=`, `<=`, `>=`, `===`, `::`, `//`, `/*`) render as continuous ligatures at `pixelsize=15`, alongside full `XIM` (`fcitx5-t9`) input support.
+ - **Patched `sxmo-dmenu` (`dmenu`) (`< 15 ms` startup)**: full-width `240x320` 9-line vertical menu (`lineheight = 26`, positioned flush at `Y = 24` right below the 24px `dwm` bar) with a `#383838` top search bar, `#005577` prompt badge, `#1c1c1c` item list, `XIM` (`XSetLocaleModifiers("")`, `XSetICFocus`, `Xutf8LookupString`) for live `fcitx5-t9` search filtering and `#` mode switching, C-level focus preservation (`prevfocuswin`), and direct Nokia keypad bindings.
+ - **Patched `sxmo-dwm` (`dwm`) (`< 2 ms` display wake/unlock)**: configured for `240x320` (`bh = 24`, `#323232` top bar, `#005577` active tag/border, vertical `bstack` layout default, overflow-protected Pango status bar rendering keeping the right-aligned clock always visible). Directly polls `/dev/input/by-path/platform-gpio-keys-event` (`SW_LID`) and intercepts locked-state wake keys (`XF86PowerOff`, `XF86PickupPhone`, `XF86KbdLcdMenu1`, `XF86KbdLcdMenu2`) in C to toggle `/sys/class/backlight/backlight/brightness` and `/sys/class/leds/white:kbd_backlight/brightness` in `< 2 ms` before running Sxmo state hooks asynchronously.
2. **Multi-mode `fcitx5-t9` keypad engine (`src/fcitx5-t9/`)**:
- - Supports 6 input modes cycled with `#` (`XF86NumericPound`): `abc`, `Abc`, `ABC`, `Sym`, `Ctl`, and `123`.
- - Includes instant case toggling during preedit, full 32-character ASCII punctuation/symbol entry, terminal control sequences (`^A`–`^Z`, `Esc`, `Tab`, `F1`–`F12`), and a `450ms` long-press `*` `Ctrl+` modifier latch.
+ - Supports 6 input modes cycled with `#` (`XF86NumericPound`): `abc`, `Abc`, `ABC`, `Sym`, `Ctl`, and `123`, updating the live top-bar status indicator (`[abc]`, `[Abc]`, `[ABC]`, `[Sym]`, `[Ctl]`, `[123]`) in real time.
+ - Locks the candidate popup bar to the bottom of the screen (`X = 1, Y = 290, W = 238, H = 30`) with fixed-width 28-character monospace formatting (`Fira Code 9.5`), so neither the popup window nor individual letters ever jump when cycling through candidates.
+ - Includes instant case toggling during preedit, full 32-character ASCII punctuation/symbol entry, terminal control sequences (`^A`–`^Z`, `Esc`, `Tab`, `F1`–`F12`), and a `550ms` long-press `*` `Ctrl+` modifier latch.
3. **Bantam AI agent (`prebuilt/bantam/bantam`)**:
- Fetched from the latest `master` branch of `https://code.luxferre.top/luxferre/bantam-cpp`, cross-compiled for `armv7`, and installed to `/usr/bin/bantam` and `/usr/local/bin/bantam` (with no default `.bantam.cfg` pre-created).
4. **Mainline 6.12.1-msm8916 QDSP6 audio (loudspeaker, earpiece, MEMS & headset mics), voice call & LTE modem stack**:
@@ -114,46 +118,35 @@ sudo dd if=./images/bananarchy-nokia-argon.img of=/dev/sdX bs=4M status=progress
> - Pressing **End / Power (red)**, **Left softkey**, **Right softkey**, or **Call (green)** once.
#### 3.1.1 Window tiling modes & switching combos
-By default, Sxmo Sway is configured with **`default_orientation vertical` (`splitv`)**, so opening multiple terminals stacks them **vertically (one terminal under another)** to maximize line width on the `240x320` portrait screen.
+By default, Sxmo `dwm` is configured with the **vertical bottom-stack (`bstack`, `TTT`)** layout as default, so opening multiple `st` terminals stacks them **vertically (one terminal under another)** to maximize line width on the `240x320` portrait screen.
-You can switch between **vertical (`splitv`, one under another)**, **horizontal (`splith`, side-by-side)**, and **tabbed (`tabbed`, full-screen tabs)** layouts — as well as switch focus between open terminals — using any of the following combos:
+You can switch between **vertical stack (`TTT`, `bstack`)**, **horizontal tile (`[]=`, `tile`)**, **deck (`[D]`, `deck`)**, and **fullscreen monocle (`[M]`, `monocle`)** layouts — as well as switch focus between open terminals — using any of the following combos:
1. **Direct physical keypad combos**:
- - **Triple-press Call (green) (`3× Call`)**: cycles the current container layout (`vertical splitv` -> `horizontal splith` -> `tabbed` -> `vertical splitv`).
- - **Double-press Call (green) (`2× Call`)**: switches focus to the next open window/terminal (e.g., jumps between the top and bottom terminals).
- - **Triple-press (or hold `400ms`) End / Power (red) (`3× End`)**: opens a new `Foot` terminal tiled in the active layout.
-2. **Terminal context menu (`Right softkey` or `1× Call (green)` inside `Foot`)**:
- - **Next window**: switch focus to the next open terminal/window.
- - **Toggle layout**: cycle `splitv` -> `splith` -> `tabbed`.
- - **Tile vertical**: immediately arrange open windows vertically (one under another) and set future splits to vertical.
- - **Tile horizontal**: immediately arrange open windows horizontally (side-by-side) and set future splits to horizontal.
- - **New terminal** / **Close terminal**: open a new terminal or close the focused terminal.
-3. **System windows menu (`Left softkey` -> `Windows`)**:
- - **Next window**: focus the next window in the workspace.
- - **`splitv -> splith -> tabbed`**: cycle container layout mode.
- - **Split vertical** / **Split horizontal** / **Tabbed layout**: switch directly to the chosen layout.
- - **Switch menu** / **Move menu** / **Kill window**: switch to any window across workspaces, move windows between positions/workspaces, or close the focused window.
-4. **External keyboard / `swaymsg` (`$mod` = `Mod4` / `Super`)**:
- - `Mod4+v`: vertical split (`splitv`)
- - `Mod4+b`: horizontal split (`splith`)
- - `Mod4+e`: toggle split orientation (`layout toggle split` between vertical and horizontal)
- - `Mod4+w`: tabbed layout (`layout tabbed`)
- - `Mod4+s`: stacking layout (`layout stacking`)
- - `Mod4+f`: toggle fullscreen (`fullscreen`)
- - `Mod4+Up` / `Mod4+Down` / `Mod4+Left` / `Mod4+Right`: move focus between tiled windows
- - `Mod4+Shift+Up` / `Mod4+Shift+Down` / `Mod4+Shift+Left` / `Mod4+Shift+Right`: reposition focused window
+ - **Triple-press Call (green) (`3× Call`)**: cycles the current DWM layout (`TTT` -> `[]=` -> `[D]` -> `[M]` -> `TTT`).
+ - **Double-press Call (green) (`2× Call`)**: switches focus to the next open window/terminal (`Super+j`).
+ - **Triple-press End / Power (red) (`3× End`)**: opens a new `st` terminal (with HarfBuzz `Fira Code` ligature support) tiled in the active layout.
+2. **External keyboard / `xdotool` (`MODKEY` = `Mod4` / `Super`)**:
+ - `Mod4+space`: cycle layout (`TTT` -> `[]=` -> `[D]` -> `[M]`)
+ - `Mod4+Shift+slash`: vertical stack layout (`bstack`, `TTT`)
+ - `Mod4+slash`: horizontal tile layout (`tile`, `[]=`)
+ - `Mod4+m`: fullscreen monocle layout (`monocle`, `[M]`)
+ - `Mod4+Up` / `Mod4+Down` (or `Mod4+k` / `Mod4+j`): move focus between tiled windows
+ - `Mod4+Shift+k` / `Mod4+Shift+j`: move focused window up/down in the stack
+ - `Mod4+1`..`4`: switch to workspace tag `1`..`4`
+ - `Mod4+Shift+q`: close focused window
### 3.2 Multi-mode `fcitx5-t9` keypad reference
-- **Short-press `#`** *(when no character is in preedit)*: cycles through the 6 input modes (`abc` -> `Abc` -> `ABC` -> `Sym` -> `Ctl` -> `123` -> `abc`), displaying a `900ms` preedit status banner (`[Mode: abc]`, `[Mode: Abc]`, `[Mode: ABC]`, `[Mode: Sym]`, `[Mode: Ctl]`, `[Mode: 123]`).
-- **Auto-commit timeout**: `600ms` for keys with `<= 10` candidates, or `750ms` for keys with `> 10` candidates (`1` and `*` in `abc`/`Abc`/`ABC`, `*` in `Sym`, `9` in `Ctl`). Pressing a different key immediately commits the active candidate.
+- **Short-press `#`** *(when no character is in preedit)*: cycles through the 6 input modes (`abc` -> `Abc` -> `ABC` -> `Sym` -> `Ctl` -> `123` -> `abc`), displaying a `1500ms` preedit status banner (`[Mode: abc]`, `[Mode: Abc]`, `[Mode: ABC]`, `[Mode: Sym]`, `[Mode: Ctl]`, `[Mode: 123]`).
+- **Auto-commit timeout**: `1500ms` for keys with `<= 10` candidates, or `1800ms` for keys with `> 10` candidates (`1` and `*` in `abc`/`Abc`/`ABC`, `*` in `Sym`, `9` in `Ctl`). Pressing a different key immediately commits the active candidate.
- **While a candidate is highlighted (`[item]`) in preedit**:
- Press **`#`** or **D-Pad `Up`**: toggles letter case (`a` <-> `A`) on the fly without changing mode, or jumps forward **`+4` candidates** for non-alphabetic items.
- Press **D-Pad `Down`**: toggles letter case (`a` <-> `A`) for alphabetic items, or jumps backward **`-4` candidates** for non-alphabetic items.
- Press **D-Pad `Left`**: steps backward **1 candidate** on the same key.
- Press **D-Pad `Right`** or **Center `OK` (`Return`)**: commits the highlighted candidate immediately.
- Press **`BackSpace`**: cancels the uncommitted preedit candidate without deleting previously committed text.
-- **Long-press (`>= 450ms`)**:
+- **Long-press (`>= 550ms`)**:
- **Hold `0`–`9`**: commits the digit (`0`–`9`) immediately in any mode.
- **Hold `*`**:
- In `123` mode: commits a decimal point (`.`) immediately.
@@ -230,7 +223,7 @@ You can switch between **vertical (`splitv`, one under another)**, **horizontal
ssh user@172.16.42.1
```
- **Bantam AI agent**:
- Run `bantam` in the terminal (`Foot`) or over SSH. Configure your endpoint/API key via environment variables or `~/.bantam.cfg` when needed.
+ Run `bantam` in the terminal (`st`) or over SSH. Configure your endpoint/API key via environment variables or `~/.bantam.cfg` when needed.
---
diff --git a/README.md b/README.md
index a174988..805bece 100644
--- a/README.md
+++ b/README.md
@@ -6,7 +6,7 @@
See [The Bananarchy Manifesto](./MANIFESTO.md) for the rationale behind this entire project.
-Bananarchy targets the **Sxmo (`sxmo-de-sway`)** environment exclusively, tuned for 1:1 native `240x320` resolution, enlarged high-contrast typography, sub-115 MB idle RAM footprint on 512 MB devices, full Qualcomm QDSP6/Q6Voice audio (loudspeaker, earpiece speaker, and internal/headset microphones with PM8909 WCD analog codec 2.8V micbias and +6 dB EAR PA gain), GSM/WCDMA/LTE modem routing (`ModemManager` + `q6voiced`), rear 2MP camera support (`msm8905-cam` V4L2 driver for GalaxyCore `GC2395` + MSM8909 `CAMSS` on `/dev/video0` and `bananarchy-photo` CLI/Sxmo app), pre-integrated **Bantam** AI agent (`https://code.luxferre.top/luxferre/bantam-cpp`), a complete on-device development & scripting stack (`git`, `gcc`/`g++`, `make`, `nano`, `janet` + `jpm`, `perl` + `IO::Socket::SSL`, `tcl` + `tcllib`/`tcl-tls`/`sqlite-tcl`, `sqlite`, `i2c-tools`, `v4l-utils`), and a custom **6-mode `fcitx5-t9` input engine** supporting lowercase, one-shot Shift, Caps Lock, all 32 ASCII punctuation symbols, terminal control codes (`^A`-`^Z`, `Esc`, `Tab`, `F1`-`F12`), and direct numeric entry.
+Bananarchy targets an ultra-lightweight **Sxmo X11 (`sxmo-de-dwm`)** environment (with all Wayland components removed) powered by a cross-compiled **Xlibre (`X11Libre/xserver` 25.2.0)** display server (`modesetting` KMS + `ShadowFB` Damage partial-rectangle SPI transfers, software cursor fallback, rootless `elogind`), **patched `sxmo-dwm`** (`240x320` vertical `bstack` layout, 24px Pango status bar with overflow-protected right-aligned clock, direct C `SW_LID` slider and locked-key wake handling in `< 2 ms`), **patched `sxmo-dmenu`** (`240x320` full-width 9-line vertical menu flush below the 24px top bar with `#383838` search bar, `#005577` prompt badge, and `XIM` `fcitx5-t9` text input in `< 15 ms`), **patched `sxmo-st`** terminal (`pixelsize=15`) with **HarfBuzz (`libharfbuzz`) OpenType ligature shaping** (`liga`, `calt`, `clig`, `dlig`) and `XIM` support, and **non-Nerd `Fira Code` (`font-fira-code`) with ligatures** as the primary system and terminal font (with `DejaVu SansM Nerd Font` used strictly as an icon fallback). It features a sub-95 MB idle RAM footprint on 512 MB devices, full Qualcomm QDSP6/Q6Voice audio (loudspeaker, earpiece speaker, and internal/headset microphones with PM8909 WCD analog codec 2.8V micbias and +6 dB EAR PA gain), GSM/WCDMA/LTE modem routing (`ModemManager` + `q6voiced`), rear 2MP camera support (`msm8905-cam` V4L2 driver for GalaxyCore `GC2395` + MSM8909 `CAMSS` on `/dev/video0` and `bananarchy-photo` CLI/Sxmo app), pre-integrated **Bantam** AI agent (`https://code.luxferre.top/luxferre/bantam-cpp`), a complete on-device development & scripting stack (`git`, `gcc`/`g++`, `make`, `nano`, `janet` + `jpm`, `perl` + `IO::Socket::SSL`, `tcl` + `tcllib`/`tcl-tls`/`sqlite-tcl`, `sqlite`, `i2c-tools`, `v4l-utils`), and a custom **6-mode `fcitx5-t9` input engine** with a fixed bottom candidate bar (`X=1, Y=290, W=238, H=30`) supporting lowercase, one-shot Shift, Caps Lock, all 32 ASCII punctuation symbols, terminal control codes (`^A`-`^Z`, `Esc`, `Tab`, `F1`-`F12`), and direct numeric entry with live top-bar mode indication (`[abc]`, `[Abc]`, `[ABC]`, `[Sym]`, `[Ctl]`, `[123]`).
The current Bananarchy version is `v0.0.1`.
@@ -65,21 +65,34 @@ bananarchy/
│ │ └── 0001-edl-msm8909-32bit-elf-and-multi-cmd-firehose.patch
│ ├── sxmo/
│ │ └── 0001-bananarchy-sxmo-240x320-keypad-ui.patch
+│ ├── xlibre/
+│ │ ├── 0001-xlibre-msm8905-spi-drm-and-shared-vt.patch
+│ │ ├── 0002-xf86-input-libinput-xlibre25.patch
+│ │ └── 0003-xf86-video-fbdev-xlibre25.patch
│ └── fcitx5-t9/
│ └── 0001-bananarchy-multimode-t9-and-fcitx5-5.1.19.patch
├── src/
+│ ├── sxmo-dwm/ # Patched sxmo-dwm (240x320 bstack, Pango bar, direct C SW_LID & locked-key wake)
+│ ├── sxmo-dmenu/ # Patched sxmo-dmenu (240x320 vertical 9-line menu, #383838 search bar, XIM fcitx5-t9)
+│ ├── sxmo-st/ # Patched sxmo-st terminal with HarfBuzz Fira Code ligature shaping & XIM
+│ ├── xf86-input-libinput/ # X11Libre xf86-input-libinput DDX driver
+│ ├── xf86-video-fbdev/ # X11Libre xf86-video-fbdev fallback DDX driver
│ ├── fcitx5-t9/ # C++20 source of Bananarchy's 6-mode fcitx5-t9 input method
│ ├── leds-msm8905-torch/ # Kernel driver for SY7807 rear torch LED, WCD codec init & PM8909 PON shutdown
│ └── msm8905-cam/ # Kernel V4L2 driver for GC2395 2MP rear camera & MSM8909 CAMSS (/dev/video0)
├── overlay/
-│ └── rootfs/ # Complete Bananarchy rootfs overlay (OS branding, Sxmo, audio, camera, T9)
+│ └── rootfs/ # Complete Bananarchy rootfs overlay (OS branding, Sxmo X11, audio, camera, T9)
├── prebuilt/
+│ ├── xlibre/ # Prebuilt armv7 Xlibre Xorg binary and modesetting/libinput/fbdev DDX modules
+│ ├── sxmo-x11/ # Prebuilt armv7 patched dwm, dmenu, and st (with HarfBuzz ligatures)
│ ├── kernel-6.12.1-msm8916/ # Prebuilt QDSP6/Q6Voice .ko, torch .ko, camera .ko, and 5 device DTBs
│ ├── fcitx5-t9/ # Prebuilt armv7 libt9.so and fcitx5 addon/inputmethod configs
│ └── bantam/ # Prebuilt armv7 bantam AI agent binary
└── scripts/
├── generate-artwork.py # Generates all wallpapers, icons, and splashes from icon-large.png
├── mipi-dbi-cmd.py # Compiles MIPI-DBI panel .txt init sequences into .bin firmware
+ ├── build-xlibre.sh # Cross-compiles Xlibre + xf86-input-libinput + xf86-video-fbdev for armv7 Cortex-A7
+ ├── build-sxmo-x11.sh # Cross-compiles patched sxmo-st (HarfBuzz ligatures), sxmo-dmenu (XIM), and sxmo-dwm
├── build-kernel-audio.sh # Cross-compiles Linux 6.12.1-msm8916 QDSP6/torch/camera modules & DTBs
├── build-fcitx5-t9.sh # Cross-compiles src/fcitx5-t9 for armv7
├── build-bantam.sh # Fetches master from https://code.luxferre.top/luxferre/bantam-cpp & cross-compiles for armv7
@@ -100,6 +113,12 @@ Whenever `artwork/icon-large.png` is updated, regenerate all icons, `240x320` wa
### 2. Recompile core components (optional — prebuilts included)
All components are pre-compiled in `prebuilt/` and `overlay/rootfs/`, and can be rebuilt from source at any time using rootless Docker (`alpine:3.24`):
```bash
+# Rebuild cross-compiled Xlibre (X11Libre/xserver) + libinput/fbdev DDX drivers
+./scripts/build-xlibre.sh
+
+# Rebuild patched sxmo-st (HarfBuzz Fira Code ligatures), sxmo-dmenu (XIM), and sxmo-dwm
+./scripts/build-sxmo-x11.sh
+
# Rebuild multi-mode fcitx5-t9 input engine (src/fcitx5-t9 -> prebuilt/fcitx5-t9)
./scripts/build-fcitx5-t9.sh
diff --git a/overlay/rootfs/etc/X11/xinit/xserverrc b/overlay/rootfs/etc/X11/xinit/xserverrc
new file mode 100755
index 0000000..e4bdcf7
--- /dev/null
+++ b/overlay/rootfs/etc/X11/xinit/xserverrc
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec /usr/bin/X -nocursor -nolisten tcp "$@"
diff --git a/overlay/rootfs/etc/X11/xorg.conf.d/10-bananarchy-msm8909.conf b/overlay/rootfs/etc/X11/xorg.conf.d/10-bananarchy-msm8909.conf
new file mode 100644
index 0000000..27cb315
--- /dev/null
+++ b/overlay/rootfs/etc/X11/xorg.conf.d/10-bananarchy-msm8909.conf
@@ -0,0 +1,47 @@
+Section "ServerFlags"
+ Option "AutoAddDevices" "true"
+ Option "AutoEnableDevices" "true"
+ Option "AutoAddGPU" "false"
+ Option "BlankTime" "0"
+ Option "StandbyTime" "0"
+ Option "SuspendTime" "0"
+ Option "OffTime" "0"
+EndSection
+
+Section "Device"
+ Identifier "MSM8909 SPI Panel"
+ Driver "modesetting"
+ Option "kmsdev" "/dev/dri/card0"
+ Option "AccelMethod" "none"
+ Option "ShadowFB" "true"
+ Option "SWCursor" "true"
+ Option "PageFlip" "false"
+EndSection
+
+Section "Screen"
+ Identifier "DefaultScreen"
+ Device "MSM8909 SPI Panel"
+ DefaultDepth 24
+EndSection
+
+Section "InputClass"
+ Identifier "libinput keyboard catchall"
+ MatchIsKeyboard "on"
+ MatchDevicePath "/dev/input/event*"
+ Driver "libinput"
+EndSection
+
+Section "InputClass"
+ Identifier "libinput pointer catchall"
+ MatchIsPointer "on"
+ MatchDevicePath "/dev/input/event*"
+ Driver "libinput"
+EndSection
+
+Section "InputClass"
+ Identifier "libinput touchscreen catchall"
+ MatchIsTouchscreen "on"
+ MatchDevicePath "/dev/input/event*"
+ Driver "libinput"
+EndSection
+
diff --git a/overlay/rootfs/etc/doas.d/50-sxmo.conf b/overlay/rootfs/etc/doas.d/50-sxmo.conf
index c4f8e1f..0518929 100644
--- a/overlay/rootfs/etc/doas.d/50-sxmo.conf
+++ b/overlay/rootfs/etc/doas.d/50-sxmo.conf
@@ -1,8 +1,12 @@
permit persist :wheel
permit nopass :wheel as root cmd busybox args poweroff
permit nopass :wheel as root cmd busybox args reboot
+permit nopass :wheel as root cmd /bin/busybox args poweroff
+permit nopass :wheel as root cmd /bin/busybox args reboot
permit nopass :wheel as root cmd poweroff
permit nopass :wheel as root cmd reboot
+permit nopass :wheel as root cmd /sbin/poweroff
+permit nopass :wheel as root cmd /sbin/reboot
permit nopass :wheel as root cmd sxmo_wifitoggle.sh
permit nopass setenv { SXMO_OS } :wheel as root cmd sxmo_bluetoothtoggle.sh
permit nopass :wheel as root cmd rc-service args bluetooth restart
diff --git a/overlay/rootfs/etc/elogind/logind.conf b/overlay/rootfs/etc/elogind/logind.conf
new file mode 100644
index 0000000..c72430a
--- /dev/null
+++ b/overlay/rootfs/etc/elogind/logind.conf
@@ -0,0 +1,10 @@
+[Login]
+HandlePowerKey=ignore
+HandleSuspendKey=ignore
+HandleHibernateKey=ignore
+HandleLidSwitch=ignore
+HandleLidSwitchExternalPower=ignore
+HandleLidSwitchDocked=ignore
+
+[Sleep]
+AllowSuspendInterrupts=yes
diff --git a/overlay/rootfs/etc/fonts/local.conf b/overlay/rootfs/etc/fonts/local.conf
new file mode 100644
index 0000000..53526e1
--- /dev/null
+++ b/overlay/rootfs/etc/fonts/local.conf
@@ -0,0 +1,38 @@
+
+
+
+
+ DejaVu SansM Nerd Font
+
+ DejaVuSansM Nerd Font
+
+
+
+ Sxmo
+
+ Fira Code
+ DejaVuSansM Nerd Font
+
+
+
+ monospace
+
+ Fira Code
+ DejaVuSansM Nerd Font
+
+
+
+ sans-serif
+
+ Fira Code
+ DejaVuSansM Nerd Font
+
+
+
+ serif
+
+ Fira Code
+ DejaVuSansM Nerd Font
+
+
+
diff --git a/overlay/rootfs/etc/polkit-1/rules.d/00-sxmo.rules b/overlay/rootfs/etc/polkit-1/rules.d/00-sxmo.rules
new file mode 100644
index 0000000..1051798
--- /dev/null
+++ b/overlay/rootfs/etc/polkit-1/rules.d/00-sxmo.rules
@@ -0,0 +1,8 @@
+polkit.addRule(function(action, subject) {
+ if ((action.id.indexOf("org.freedesktop.ModemManager1.") == 0 ||
+ action.id.indexOf("org.freedesktop.login1.") == 0 ||
+ action.id.indexOf("org.freedesktop.NetworkManager.") == 0) &&
+ (subject.isInGroup("plugdev") || subject.isInGroup("wheel"))) {
+ return polkit.Result.YES;
+ }
+});
diff --git a/overlay/rootfs/etc/profile.d/fcitx5-t9.sh b/overlay/rootfs/etc/profile.d/fcitx5-t9.sh
new file mode 100644
index 0000000..73bfa74
--- /dev/null
+++ b/overlay/rootfs/etc/profile.d/fcitx5-t9.sh
@@ -0,0 +1,9 @@
+export GTK_IM_MODULE=fcitx
+export QT_IM_MODULE=fcitx
+export XMODIFIERS=@im=fcitx
+export SXMO_WM=dwm
+export SXMO_MENU=dmenu
+export SXMO_TERMINAL=st
+export DMENU_WRAP_AROUND=1
+export SXMO_DMENU_PORTRAIT_LINES=12
+export SXMO_DMENU_LANDSCAPE_LINES=8
diff --git a/overlay/rootfs/etc/profile.d/sxmo_init.sh b/overlay/rootfs/etc/profile.d/sxmo_init.sh
new file mode 100644
index 0000000..d6f9292
--- /dev/null
+++ b/overlay/rootfs/etc/profile.d/sxmo_init.sh
@@ -0,0 +1,206 @@
+#!/bin/sh
+# SPDX-License-Identifier: AGPL-3.0-only
+# Copyright 2022 Sxmo Contributors
+
+# This script is meant to be sourced on login shells
+# shellcheck source=scripts/core/sxmo_common.sh
+. sxmo_common.sh
+
+_sxmo_is_running() {
+ unset SXMO_WM
+
+ _XDG_RUNTIME_DIR="$(_sxmo_find_runtime_dir)"
+
+ if pidof -s dwm >/dev/null 2>&1 || DISPLAY=:0 xset q >/dev/null 2>&1; then
+ export SXMO_WM=dwm
+ export SXMO_MENU=dmenu
+ export SXMO_TERMINAL=st
+ [ -z "$DISPLAY" ] && export DISPLAY=:0
+ unset _XDG_RUNTIME_DIR
+ return 0
+ fi
+
+ if [ -f "${_XDG_RUNTIME_DIR}"/sxmo.swaysock ]; then
+ if SWAYSOCK="$(cat "${_XDG_RUNTIME_DIR}"/sxmo.swaysock)" swaymsg 2>/dev/null
+ then
+ printf "Detected the Sway environment\n" >&2
+ export SXMO_WM=sway
+ unset _XDG_RUNTIME_DIR
+ return 0
+ fi
+ elif [ -e "$XDG_RUNTIME_DIR"/dbus.bus ] && pidof river > /dev/null; then
+ printf "Detected the River environment\n" >&2
+ export SXMO_WM=river
+ unset _XDG_RUNTIME_DIR
+ return 0
+ fi
+
+ if [ -f "${_XDG_RUNTIME_DIR}"/sxmo.i3sock ]; then
+ if I3SOCK="$(cat "${_XDG_RUNTIME_DIR}"/sxmo.i3sock)" i3-msg 2>/dev/null
+ then
+ printf "Detected the i3 environment\n" >&2
+ export SXMO_WM=i3
+ unset _XDG_RUNTIME_DIR
+ return 0
+ fi
+ fi
+ unset _XDG_RUNTIME_DIR
+
+ printf "Sxmo is not running\n" >&2
+ return 1
+}
+
+_sxmo_find_runtime_dir() {
+ # Take what we gave to you
+ if [ -n "$XDG_RUNTIME_DIR" ]; then
+ printf %s "$XDG_RUNTIME_DIR"
+ return
+ fi
+
+ # Try something existing
+ for root in /run /var/run; do
+ for path in "$root/user-$(id -u)" "$root/user/$(id -u)"; do
+ if [ -d "$path" ] && [ -w "$path" ]; then
+ printf %s "$path"
+ return
+ fi
+ done
+ done
+
+ if command -v mkrundir > /dev/null 2>&1; then
+ mkrundir
+ return
+ fi
+
+ # Fallback to a shared memory location
+ printf "/dev/shm/user/%s" "$(id -u)"
+}
+
+_sxmo_load_environments() {
+ if [ -e /etc/os-release ]; then
+ # shellcheck source=/dev/null
+ . /etc/os-release
+ elif [ -e /usr/lib/os-release ]; then
+ # shellcheck source=/dev/null
+ . /usr/lib/os-release
+ fi
+ export SXMO_OS="${ID:-unknown}"
+
+ export XDG_DATA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}"
+ export XDG_CACHE_HOME="${XDG_CACHE_HOME:-$HOME/.cache}"
+ export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}"
+ XDG_RUNTIME_DIR="$(_sxmo_find_runtime_dir)"
+ export XDG_RUNTIME_DIR
+ export XDG_DATA_DIRS="${XDG_DATA_DIRS:-/usr/local/share:/usr/share}"
+ export XDG_STATE_HOME="${XDG_STATE_HOME:-$HOME/.local/state}"
+
+ export SXMO_CACHEDIR="${SXMO_CACHEDIR:-$XDG_CACHE_HOME/sxmo}"
+
+ export SXMO_BLOCKDIR="${SXMO_BLOCKDIR:-$XDG_DATA_HOME/sxmo/block}"
+ export SXMO_BLOCKFILE="${SXMO_BLOCKFILE:-$XDG_CONFIG_HOME/sxmo/block.tsv}"
+ export SXMO_CONTACTFILE="${SXMO_CONTACTFILE:-$XDG_CONFIG_HOME/sxmo/contacts.tsv}"
+ export SXMO_STATE="${SXMO_STATE:-$XDG_RUNTIME_DIR/sxmo.state}"
+ export SXMO_LOGDIR="${SXMO_LOGDIR:-$XDG_DATA_HOME/sxmo/modem}"
+ export SXMO_NOTIFDIR="${SXMO_NOTIFDIR:-$XDG_DATA_HOME/sxmo/notifications}"
+
+ export BEMENU_OPTS="${BEMENU_OPTS:---fn "Fira Code 9" -H 22 -B 2 --hp 4 -s --no-overlap --fixed-height --scrollbar none --cw 2 --bdr "#005577" --tb "#383838" --tf "#aaaaaa" --fb "#383838" --ff "#ffffff" --cb "#ffffff" --cf "#383838" --nb "#1c1c1c" --nf "#ffffff" --ab "#1c1c1c" --af "#ffffff" --hb "#005577" --hf "#ffffff" -w -i}"
+
+ export EDITOR="${EDITOR:-vim}"
+ export BROWSER="${BROWSER:-firefox}"
+ export SHELL="${SHELL:-/bin/sh}"
+
+ PATH="$HOME/.local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH"
+ export PATH
+
+ if [ -z "$SXMO_DEVICE_NAME" ]; then
+ if [ -e /proc/device-tree/compatible ]; then
+ SXMO_DEVICE_NAME="$(tr -c '\0[:alnum:].,-' '_' < /proc/device-tree/compatible |
+ tr '\0' '\n' | head -n1)"
+ else
+ SXMO_DEVICE_NAME=desktop
+ fi
+ fi
+ export SXMO_DEVICE_NAME
+
+ deviceprofile="$(command -v "sxmo_deviceprofile_$SXMO_DEVICE_NAME.sh")"
+ # shellcheck disable=SC1090
+ if [ -f "$deviceprofile" ]; then
+ . "$deviceprofile"
+ printf "deviceprofile file %s loaded.\n" "$deviceprofile"
+ else
+ printf "WARNING: deviceprofile file not found for %s. Most device functions will not work. Please read: https://sxmo.org/deviceprofile \n" "$SXMO_DEVICE_NAME"
+ touch "$XDG_CACHE_HOME"/sxmo/sxmo.nosuspend
+ touch "$XDG_CACHE_HOME"/sxmo/sxmo.noidle
+ fi
+ unset deviceprofile
+
+ PATH="\
+$HOME/.local/bin:\
+$XDG_CONFIG_HOME/sxmo/hooks/$SXMO_DEVICE_NAME:\
+$XDG_CONFIG_HOME/sxmo/hooks:\
+$(xdg_data_path "sxmo/default_hooks" 0 ':'):\
+$PATH"
+ export PATH
+}
+
+_sxmo_grab_session() {
+ if ! _sxmo_is_running; then
+ return
+ fi
+
+ XDG_RUNTIME_DIR="$(_sxmo_find_runtime_dir)"
+ export XDG_RUNTIME_DIR
+
+ _sxmo_load_environments
+
+ if [ -f "$XDG_RUNTIME_DIR"/dbus.bus ]; then
+ DBUS_SESSION_BUS_ADDRESS="$(cat "$XDG_RUNTIME_DIR"/dbus.bus)"
+ export DBUS_SESSION_BUS_ADDRESS
+ if ! dbus-send --dest=org.freedesktop.DBus \
+ /org/freedesktop/DBus org.freedesktop.DBus.ListNames \
+ 2> /dev/null; then
+ printf "WARNING: The dbus-send test failed with DBUS_SESSION_BUS_ADDRESS=%s. Unsetting...\n" "$DBUS_SESSION_BUS_ADDRESS" >&2
+ unset DBUS_SESSION_BUS_ADDRESS
+ fi
+ else
+ printf "WARNING: No dbus cache file found at %s/dbus.bus.\n" "$XDG_RUNTIME_DIR" >&2
+ fi
+
+ case "$SXMO_WM" in
+ dwm)
+ [ -z "$DISPLAY" ] && export DISPLAY=:0
+ export SXMO_MENU=dmenu
+ export SXMO_TERMINAL=st
+ ;;
+ sway)
+ if [ -f "$XDG_RUNTIME_DIR"/sxmo.swaysock ]; then
+ SWAYSOCK="$(cat "$XDG_RUNTIME_DIR"/sxmo.swaysock)"
+ export SWAYSOCK
+ fi
+ ;;
+ i3)
+ if [ -f "$XDG_RUNTIME_DIR"/sxmo.i3sock ]; then
+ I3SOCK="$(cat "$XDG_RUNTIME_DIR"/sxmo.i3sock)"
+ export I3SOCK
+ fi
+ ;;
+ esac
+}
+
+_sxmo_prepare_dirs() {
+ uid=$(id -u)
+ gid=$(id -g)
+ mkdir -p "$XDG_RUNTIME_DIR"
+ chmod 700 "$XDG_RUNTIME_DIR"
+ chown "$uid:$gid" "$XDG_RUNTIME_DIR"
+
+ mkdir -p "$XDG_CACHE_HOME/sxmo/"
+ chmod 700 "$XDG_CACHE_HOME"
+ chown "$uid:$gid" "$XDG_CACHE_HOME"
+
+ mkdir -p "$XDG_STATE_HOME"
+ chmod 700 "$XDG_STATE_HOME"
+ chown "$uid:$gid" "$XDG_STATE_HOME"
+}
+
+_sxmo_grab_session
diff --git a/overlay/rootfs/etc/skel/.Xresources b/overlay/rootfs/etc/skel/.Xresources
new file mode 100644
index 0000000..0f52a38
--- /dev/null
+++ b/overlay/rootfs/etc/skel/.Xresources
@@ -0,0 +1,23 @@
+! Space to setup configversion
+! configversion: 7bff124b2de16292fe6e7a7e5d3322ae
+
+dmenu.font: Fira Code:pixelsize=18:style=Regular:antialias=true:autohint=true
+dmenu.background: #1c1c1c
+dmenu.foreground: #e0e0e0
+dmenu.selbackground: #005577
+dmenu.selforeground: #ffffff
+
+dwm.font: Fira Code, DejaVuSansM Nerd Font 15px
+dwm.normbgcolor: #323232
+dwm.normbordercolor: #444444
+dwm.normfgcolor: #dddddd
+dwm.selbgcolor: #005577
+dwm.selbordercolor: #005577
+dwm.selfgcolor: #ffffff
+
+st.font: Fira Code:pixelsize=13:antialias=true:autohint=true
+st.background: #1c1c1c
+st.foreground: #e5e5e5
+st.cursorColor: #cccccc
+
+svkbd.font: Fira Code:pixelsize=12
diff --git a/overlay/rootfs/etc/skel/.config/foot/foot.ini b/overlay/rootfs/etc/skel/.config/foot/foot.ini
deleted file mode 100644
index a263aad..0000000
--- a/overlay/rootfs/etc/skel/.config/foot/foot.ini
+++ /dev/null
@@ -1,40 +0,0 @@
-# Space to setup configversion
-# configversion: 13fb3d2d9f97f4420f7506e72b90e77d
-font=monospace:size=13
-dpi-aware=no
-pad=2x2
-
-[colors-dark]
-# alpha=1.0
-foreground=eaeaea
-background=000000
-regular0=000000 # black
-regular1=d54e53 # red
-regular2=b9ca4a # green
-regular3=e6c547 # yellow
-regular4=7aa6da # blue
-regular5=c397d8 # magenta
-regular6=70c0ba # cyan
-regular7=eaeaea # white
-bright0=666666 # bright black
-bright1=ff3334 # bright red
-bright2=9ec400 # bright green
-bright3=e7c547 # bright yellow
-bright4=7aa6da # bright blue
-bright5=b77ee0 # bright magenta
-bright6=54ced6 # bright cyan
-bright7=ffffff # bright white
-
-[scrollback]
-lines=5000
-
-[key-bindings]
-scrollback-up-page=Shift+Page_Up
-scrollback-down-page=Shift+Page_Down
-scrollback-up-half-page=Page_Up
-scrollback-down-half-page=Page_Down
-scrollback-up-line=Shift+Up
-scrollback-down-line=Shift+Down
-scrollback-home=Shift+Home
-scrollback-end=Shift+End
-
diff --git a/overlay/rootfs/etc/skel/.config/sxmo/conky.conf b/overlay/rootfs/etc/skel/.config/sxmo/conky.conf
index 8c00ea7..37a7734 100644
--- a/overlay/rootfs/etc/skel/.config/sxmo/conky.conf
+++ b/overlay/rootfs/etc/skel/.config/sxmo/conky.conf
@@ -1,18 +1,24 @@
-- Space to setup configversion
-- configversion: 19ec5c7f9e83bc6534d657f6180feba2
conky.config = {
- out_to_x = false,
- out_to_wayland = true,
+ output_backend = 'x11',
+ out_to_x = true,
+ out_to_wayland = false,
+ own_window = true,
+ own_window_type = 'override',
+ own_window_transparent = true,
+ own_window_hints = 'undecorated,below,sticky,skip_taskbar,skip_pager',
+ double_buffer = true,
alignment = 'top_middle',
- gap_y = 12,
- own_window_argb_value = 0,
- own_window_type = 'desktop',
+ gap_x = 0,
+ gap_y = 34,
+ default_color = 'white',
default_shade_color = 'black',
draw_shades = true,
- font = 'Sxmo:size=13',
+ font = 'Fira Code:size=14:style=Regular',
use_xft = true,
update_interval = 15,
}
-conky.text = [[${alignc}${font Sxmo:size=34:style=Bold}${time %H:%M}${font}
-${alignc}${font Sxmo:size=14:style=Bold}${time %a %d %b %Y}${font}]]
+conky.text = [[${alignc}${font Fira Code:size=32:style=Regular}${time %H:%M}${font}
+${voffset 4}${alignc}${font Fira Code:size=14:style=Regular}${time %a %d %b %Y}${font}]]
diff --git a/overlay/rootfs/etc/skel/.config/sxmo/hooks/sxmo_hook_inputhandler.sh b/overlay/rootfs/etc/skel/.config/sxmo/hooks/sxmo_hook_inputhandler.sh
index ed3f8d4..8246223 100755
--- a/overlay/rootfs/etc/skel/.config/sxmo/hooks/sxmo_hook_inputhandler.sh
+++ b/overlay/rootfs/etc/skel/.config/sxmo/hooks/sxmo_hook_inputhandler.sh
@@ -17,38 +17,51 @@ stop_proximity_lock() {
sxmo_jobs.sh stop proximity_lock
}
-exec 0</dev/null 2>&1 || sxmo_wm.sh display on
+ else
+ sxmo_wm.sh display on
+ fi
+ if [ -w /sys/class/leds/white:kbd_backlight/brightness ]; then
+ printf '255' > /sys/class/leds/white:kbd_backlight/brightness 2>/dev/null || true
+ else
+ brightnessctl -d white:kbd_backlight set 255 >/dev/null 2>&1 || true
+ fi
+ sxmo_state.sh set unlock &
+ exit 0
+ ;;
+ "voldown_one"|"volup_one")
+ exec 0</dev/null 2>&1 || true
- sxmo_state.sh set unlock
- sxmo_wm.sh display on
- ;;
- "voldown_one")
- sxmo_audio.sh vol down 5
- exit
+ if [ "$ACTION" = "voldown_one" ]; then
+ sxmo_audio.sh vol down 5
+ else
+ sxmo_audio.sh vol up 5
+ fi
+ exit 0
;;
"voldown_two")
sxmo_audio.sh vol down 10
@@ -58,10 +71,6 @@ if sxmo_state.sh is_locked; then
sxmo_audio.sh vol down 15
exit
;;
- "volup_one")
- sxmo_audio.sh vol up 5
- exit
- ;;
"volup_two")
sxmo_audio.sh vol up 10
exit
@@ -75,6 +84,31 @@ if sxmo_state.sh is_locked; then
exit 0
fi
+case "$ACTION" in
+ "menuleft"*|"enter_two"|"enter_three"|"powerbutton_two"|"powerbutton_three"|"voldown_two"|"volup_two"|"volup_three"|"topleftcorner"|"toprightcorner"|"bottomrightcorner")
+ WMCLASS=""
+ WMNAME=""
+ ;;
+ *)
+ if [ -r "$XDG_RUNTIME_DIR/sxmo.focusedwin" ]; then
+ {
+ read -r WMCLASS || WMCLASS=""
+ read -r WMNAME || WMNAME=""
+ } < "$XDG_RUNTIME_DIR/sxmo.focusedwin"
+ else
+ exec 0</dev/null; then
sxmo_hook_pickup.sh
else
sxmo_appmenu.sh "$WMCLASS" "$WMNAME"
diff --git a/overlay/rootfs/etc/skel/.config/sxmo/profile b/overlay/rootfs/etc/skel/.config/sxmo/profile
new file mode 100755
index 0000000..ce9b5ae
--- /dev/null
+++ b/overlay/rootfs/etc/skel/.config/sxmo/profile
@@ -0,0 +1,89 @@
+#!/bin/sh
+# configversion: e7cdaa3a889d251bed8a89ce8c622995
+
+# shellcheck source=scripts/core/sxmo_common.sh
+. sxmo_common.sh
+
+# Please modify this file to your liking
+
+# Important Instructions:
+# All processes you launch from this script must
+# be non-blocking: launch them in the background (using &)
+# or ensure they return quickly. Only after this script
+# finishes will the window manager be loaded
+
+# You will sometime get SMS or calls from not
+# country code prefixed phone numbers. To make
+# it easy to fixup configure the default countryu.
+#export DEFAULT_COUNTRY=FR
+
+### Configuration Parameters ###
+
+# Note that this is just a subset of all available
+# parameters, see the sxmo documentation for more.
+
+# Use firefox as default browser if installed
+command -v firefox >/dev/null && export BROWSER=firefox
+
+# Prepopulate Subreddits menu with custom subreddits
+#export SXMO_SUBREDDITS="postmarketos pinephoneOfficial pinephone unixporn"
+
+# Change the default terminal command
+export TERMCMD="sxmo_terminal.sh"
+
+# Change the used terminal command
+# export SXMO_TERMINAL="st"
+
+# When scrolling past the beginning or end of a menu, wrap it around:
+#export DMENU_WRAP_AROUND=1
+
+# Enable audio feedback on keypress
+#export KEYBOARD_ARGS="-o | clickclack -f $(xdg_data_path sxmo/keytap.wav)"
+
+# Or, enable vibration feedback on keypress
+#export KEYBOARD_ARGS="-o | clickclack -V"
+
+# Set the scale factor in sway
+# export SXMO_SWAY_SCALE=2
+
+# To load specific part of configuration depending on the running environment
+case "$SXMO_WM" in
+ sway)
+ ;;
+ dwm)
+ ;;
+esac
+
+#Set RINGTONE to audio file to play for incoming call
+export SXMO_RINGTONE="$(xdg_data_path sxmo/ring.ogg)"
+
+#Set TEXTSOUND to audio file to play when received text message
+export SXMO_TEXTSOUND="$(xdg_data_path sxmo/notify.ogg)"
+
+#Set RINGTIME to number of seconds the phone will ring
+export SXMO_RINGTIME=20
+
+#Set RINGNUMBER to number of times phone will ring or repeat ringtone
+#(whichever of SXMO_RINGTIME or SXMO_RINGNUMBER runs less will limit how long phone rings)
+export SXMO_RINGNUMBER=10
+
+#Set to the default text for a new text message.
+export SXMO_DEFAULT_DRAFT="Enter new message here."
+
+export PATH="$HOME/.local/bin:$PATH"
+export SXMO_WM="dwm"
+export SXMO_MENU="dmenu"
+export SXMO_TERMINAL="st"
+export DMENU_WRAP_AROUND=1
+export SXMO_DMENU_PORTRAIT_LINES=12
+export SXMO_DMENU_LANDSCAPE_LINES=8
+export SXMO_DISABLE_LEDS=1
+export SXMO_NO_VIRTUAL_KEYBOARD=1
+export NO_AT_BRIDGE=1
+export GTK_A11Y=none
+export GTK_USE_PORTAL=0
+export GTK_IM_MODULE=fcitx
+export QT_IM_MODULE=fcitx
+export XMODIFIERS=@im=fcitx
+
+export SXMO_BG_IMG="/usr/share/wallpapers/bananarchy.png"
diff --git a/overlay/rootfs/etc/skel/.config/sxmo/sway b/overlay/rootfs/etc/skel/.config/sxmo/sway
deleted file mode 100644
index de6396b..0000000
--- a/overlay/rootfs/etc/skel/.config/sxmo/sway
+++ /dev/null
@@ -1,296 +0,0 @@
-# Default config for sway
-# configversion: 076611fe8cc699bcaa01092a8e4481c0
-#
-# Copy this to ~/.config/sway/config and edit it to your liking.
-#
-# Read `man 5 sway` for a complete reference.
-
-### Variables
-#
-# Logo key. Use Mod1 for Alt.
-set $mod Mod4
-# Home row direction keys, like vim
-set $left h
-set $down j
-set $up k
-set $right l
-# Your preferred terminal emulator
-set $term sxmo_terminal.sh
-# Your preferred application launcher
-# Note: pass the final command to swaymsg so that the resulting window can be opened
-# on the original workspace that the command was run on.
-set $menu bemenu-run
-
-font "Sxmo 13"
-xwayland disable
-output * scale 1 bg /usr/share/wallpapers/bananarchy.png fill
-default_orientation vertical
-
-exec_always sxmo_swayinitconf.sh
-
-exec_always dbus-update-activation-environment WAYLAND_DISPLAY DISPLAY XDG_CURRENT_DESKTOP
-
-mode "menu" {
- bindsym --locked XF86PowerOff exec sh -c "sxmo_dmenu.sh close; if sxmo_state.sh is_locked; then sxmo_state.sh set unlock; sxmo_wm.sh display on; fi"
- bindsym --locked XF86PickupPhone exec sh -c "if sxmo_state.sh is_locked; then sxmo_state.sh set unlock; sxmo_wm.sh display on; else wtype -k Return; fi"
- bindsym --locked XF86KbdLcdMenu1 exec sh -c "sxmo_dmenu.sh close; if sxmo_state.sh is_locked; then sxmo_state.sh set unlock; sxmo_wm.sh display on; fi"
- bindsym --locked XF86KbdLcdMenu2 exec sh -c "sxmo_dmenu.sh close; if sxmo_state.sh is_locked; then sxmo_state.sh set unlock; sxmo_wm.sh display on; fi"
- bindsym XF86AudioRaiseVolume exec wtype -k Up
- bindsym XF86AudioLowerVolume exec wtype -k Down
- bindswitch --locked lid:on exec sh -c "sxmo_dmenu.sh close; brightnessctl -d white:kbd_backlight set 0; sxmo_state.sh set screenoff"
- bindswitch --locked lid:off exec sh -c "brightnessctl -d white:kbd_backlight set 255; sxmo_state.sh set unlock; sxmo_wm.sh display on"
-}
-
-# Mode specifically for use with Nokia N900 hardware keyboard
-mode "N900" {
- # follow the standard sxmo keybinds as far as possible
- bindsym t exec $term; mode "default"
- bindsym q mode "default"
- bindsym Shift+p exec sxmo_appmenu.sh sys; mode "default"
- bindsym p exec sxmo_appmenu.sh; mode "default"
- bindsym d exec $menu; mode "default"
- bindsym Shift+q kill; mode "default"
- bindsym i exec sxmo_wmmenu.sh windowswitcher; mode "default"
- bindsym Shift+c reload; mode "default"
- bindsym f fullscreen; mode "default"
- bindsym Shift+space floating toggle; mode "default"
- bindsym a focus parent; mode "default"
-}
-
-### Key bindings
-#
-# Basics:
-#
- input * xkb_options compose:ralt
-
- # Nokia N900 hardware keyboard
- input "1:1:TWL4030_Keypad" {
- xkb_model "nokiarx51"
- xkb_layout "us"
- # ralt has special meaning on N900 keyboard so do not use as
- # compose key
- xkb_options compose:rwin
- }
-
- # Start a terminal
- bindsym $mod+Return exec $term
-
- # Launch appmenu
- bindsym $mod+p exec sxmo_appmenu.sh
- bindsym $mod+Shift+p exec sxmo_appmenu.sh sys
-
- # Wm menu switcher
- bindsym $mod+i exec sxmo_wmmenu.sh windowswitcher
-
- # Kill focused window
- bindsym $mod+Shift+q kill
-
- # Start your launcher
- bindsym $mod+d exec $menu
-
- # Drag floating windows by holding down $mod and left mouse button.
- # Resize them with right mouse button + $mod.
- # Despite the name, also works for non-floating windows.
- # Change normal to inverse to use left mouse button for resizing and right
- # mouse button for dragging.
- floating_modifier $mod normal
-
- # Reload the configuration file
- bindsym $mod+Shift+c reload
-
- # Exit sway (logs you out of your Wayland session)
- bindsym $mod+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'sxmo_power.sh logout'
-#
-# Moving around:
-#
- # Move your focus around
- bindsym $mod+$left focus left
- bindsym $mod+$down focus down
- bindsym $mod+$up focus up
- bindsym $mod+$right focus right
- # Or use $mod+[up|down|left|right]
- bindsym $mod+Left focus left
- bindsym $mod+Down focus down
- bindsym $mod+Up focus up
- bindsym $mod+Right focus right
-
- # Move the focused window with the same, but add Shift
- bindsym $mod+Shift+$left move left
- bindsym $mod+Shift+$down move down
- bindsym $mod+Shift+$up move up
- bindsym $mod+Shift+$right move right
- # Ditto, with arrow keys
- bindsym $mod+Shift+Left move left
- bindsym $mod+Shift+Down move down
- bindsym $mod+Shift+Up move up
- bindsym $mod+Shift+Right move right
-
- # Move the focused workspace to output
- bindsym $mod+Shift+Ctrl+$left move workspace output left
- bindsym $mod+Shift+Ctrl+$down move workspace output down
- bindsym $mod+Shift+Ctrl+$up move workspace output up
- bindsym $mod+Shift+Ctrl+$right move workspace output right
-#
-# Workspaces:
-#
- # Switch to workspace
- bindsym $mod+1 workspace number 1
- bindsym $mod+2 workspace number 2
- bindsym $mod+3 workspace number 3
- bindsym $mod+4 workspace number 4
- bindsym $mod+5 workspace number 5
- bindsym $mod+6 workspace number 6
- bindsym $mod+7 workspace number 7
- bindsym $mod+8 workspace number 8
- bindsym $mod+9 workspace number 9
- bindsym $mod+0 workspace number 10
- # Move focused container to workspace
- bindsym $mod+Shift+1 move container to workspace number 1
- bindsym $mod+Shift+2 move container to workspace number 2
- bindsym $mod+Shift+3 move container to workspace number 3
- bindsym $mod+Shift+4 move container to workspace number 4
- bindsym $mod+Shift+5 move container to workspace number 5
- bindsym $mod+Shift+6 move container to workspace number 6
- bindsym $mod+Shift+7 move container to workspace number 7
- bindsym $mod+Shift+8 move container to workspace number 8
- bindsym $mod+Shift+9 move container to workspace number 9
- bindsym $mod+Shift+0 move container to workspace number 10
- # Note: workspaces can have any name you want, not just numbers.
- # We just use 1-10 as the default.
-#
-# Layout stuff:
-#
- # You can "split" the current object of your focus with
- # $mod+b or $mod+v, for horizontal and vertical splits
- # respectively.
- bindsym $mod+b splith
- bindsym $mod+v splitv
-
- # Switch the current container between different layout styles
- bindsym $mod+s layout stacking
- bindsym $mod+w layout tabbed
- bindsym $mod+e layout toggle split
-
- # Make the current focus fullscreen
- bindsym $mod+f fullscreen
-
- # Toggle the current focus between tiling and floating mode
- bindsym $mod+Shift+space floating toggle
-
- # Swap focus between the tiling area and the floating area
- bindsym $mod+space focus mode_toggle
-
- # Move focus to the parent container
- bindsym $mod+a focus parent
-
- # Manual locker
- bindsym $mod+g exec sxmo_state.sh set locker
-
- # Shutdown
- bindsym $mod+t exec sxmo_appmenu.sh power
-
-#
-# Scratchpad:
-#
- # Sway has a "scratchpad", which is a bag of holding for windows.
- # You can send windows there and get them back later.
-
- # Move the currently focused window to the scratchpad
- bindsym $mod+Shift+minus move scratchpad
-
- # Show the next scratchpad window or hide the focused scratchpad window.
- # If there are multiple scratchpad windows, this command cycles through them.
- bindsym $mod+minus scratchpad show
-#
-# Resizing containers:
-#
-mode "resize" {
- # left will shrink the containers width
- # right will grow the containers width
- # up will shrink the containers height
- # down will grow the containers height
- bindsym $left resize shrink width 30px
- bindsym $down resize grow height 30px
- bindsym $up resize shrink height 30px
- bindsym $right resize grow width 30px
-
- # Ditto, with arrow keys
- bindsym Left resize shrink width 30px
- bindsym Down resize grow height 30px
- bindsym Up resize shrink height 30px
- bindsym Right resize grow width 30px
-
- # Return to default mode
- bindsym Return mode "default"
- bindsym Escape mode "default"
-}
-bindsym $mod+r mode "resize"
-
-#
-# Status Bar:
-#
-# Read `man 5 sway-bar` for more information about this section.
-bar {
- position top
- height 24
- font "Sxmo 13"
-
- # When the status_command prints a new line to stdout, swaybar updates.
- # The default just shows the current date and time.
- status_command sxmo_status_watch.sh -o pango
-
- pango_markup enabled
-
- colors {
- statusline #ffffff
- background #323232
- inactive_workspace #323232 #323232 #ffffff
- font "Sxmo 13"
- }
-}
-
-for_window [app_id="pinentry-.*"] floating true
-for_window [app_id="foot" title=".*sxmo/modem/.*/draft.txt.*"] resize set height 25
-for_window [title="megapixels"] inhibit_idle open
-for_window [title="ep[yr].*"] inhibit_idle visible
-
-default_border pixel 2
-titlebar_border_thickness 2
-hide_edge_borders smart
-
-# Need playerctl installed and running
-bindsym --locked XF86AudioPlay exec playerctl play-pause
-bindsym --locked XF86AudioPause exec playerctl play-pause
-bindsym --locked XF86AudioStop exec playerctl stop
-bindsym --locked XF86AudioNext exec playerctl next
-bindsym --locked XF86AudioPrev exec playerctl previous
-
-bindsym --locked XF86MonBrightnessUp exec sxmo_brightness.sh up
-bindsym --locked XF86MonBrightnessDown exec sxmo_brightness.sh down
-
-# Nokia N900-specific key bindings:
-# 1. Bind lock key (XF86ScreenSaver)
-# Use keycode due to https://github.com/swaywm/sway/issues/8438
-bindcode --release --locked --input-device="1:1:gpio_keys" 160 exec sxmo_state.sh set unlock
-# 2. Workaround the lack of a free ModX key on hardware keyboard
-bindsym --input-device="1:1:TWL4030_Keypad" Shift+space mode "N900"
-
-bindsym Print exec sxmo_screenshot.sh
-
-bindsym button2 kill
-
-bindswitch --locked lid:on exec sh -c "brightnessctl -d white:kbd_backlight set 0; sxmo_state.sh set screenoff"
-bindswitch --locked lid:off exec sh -c "brightnessctl -d white:kbd_backlight set 255; sxmo_state.sh set unlock; sxmo_wm.sh display on"
-
-# Nokia 8110 4G hardware keypad bindings (User:Ybon)
-bindsym --locked --no-repeat XF86KbdLcdMenu1 exec sxmo_hook_inputhandler.sh menuleft_one
-bindsym --locked --no-repeat XF86KbdLcdMenu2 exec sxmo_hook_inputhandler.sh menuright_one
-bindsym --locked --no-repeat XF86PickupPhone exec sxmo_multikey.sh pickup enter_one enter_two enter_three
-
-include /etc/sway/config.d/*
-
-exec 'printf %s "$SWAYSOCK" > "$XDG_RUNTIME_DIR"/sxmo.swaysock'
-
-exec sxmo_hook_start.sh
-
-# vim: ft=swayconfig
diff --git a/overlay/rootfs/etc/skel/.config/sxmo/xinit b/overlay/rootfs/etc/skel/.config/sxmo/xinit
new file mode 100755
index 0000000..08a1ae8
--- /dev/null
+++ b/overlay/rootfs/etc/skel/.config/sxmo/xinit
@@ -0,0 +1,7 @@
+#!/bin/sh
+# configversion: 36730424afa6d6bf9e9fb6d111c35504
+
+dbus-update-activation-environment DISPLAY XDG_CURRENT_DESKTOP
+
+# Run actions on start
+sxmo_hook_start.sh &
diff --git a/overlay/rootfs/etc/skel/.profile b/overlay/rootfs/etc/skel/.profile
new file mode 100644
index 0000000..d2ff062
--- /dev/null
+++ b/overlay/rootfs/etc/skel/.profile
@@ -0,0 +1,16 @@
+export PATH="$HOME/.local/bin:$PATH"
+
+export SXMO_WM=dwm
+export SXMO_MENU=dmenu
+export SXMO_TERMINAL=st
+export DMENU_WRAP_AROUND=1
+export SXMO_DMENU_PORTRAIT_LINES=12
+export SXMO_DMENU_LANDSCAPE_LINES=8
+export SXMO_DISABLE_LEDS=1
+export SXMO_NO_VIRTUAL_KEYBOARD=1
+export NO_AT_BRIDGE=1
+export GTK_A11Y=none
+export GTK_USE_PORTAL=0
+export GTK_IM_MODULE=fcitx
+export QT_IM_MODULE=fcitx
+export XMODIFIERS=@im=fcitx
diff --git a/overlay/rootfs/etc/udev/rules.d/90-nokia-argon-leds.rules b/overlay/rootfs/etc/udev/rules.d/90-nokia-argon-leds.rules
index b813e09..3e91d6b 100644
--- a/overlay/rootfs/etc/udev/rules.d/90-nokia-argon-leds.rules
+++ b/overlay/rootfs/etc/udev/rules.d/90-nokia-argon-leds.rules
@@ -1 +1,2 @@
SUBSYSTEM=="leds", ACTION=="add", RUN+="/bin/chgrp video /sys/class/leds/%k/brightness", RUN+="/bin/chmod 0664 /sys/class/leds/%k/brightness"
+SUBSYSTEM=="backlight", ACTION=="add", RUN+="/bin/chgrp video /sys/class/backlight/%k/brightness /sys/class/backlight/%k/bl_power", RUN+="/bin/chmod 0664 /sys/class/backlight/%k/brightness /sys/class/backlight/%k/bl_power"
diff --git a/overlay/rootfs/home/user/.Xresources b/overlay/rootfs/home/user/.Xresources
new file mode 100644
index 0000000..1c20b87
--- /dev/null
+++ b/overlay/rootfs/home/user/.Xresources
@@ -0,0 +1,23 @@
+! Space to setup configversion
+! configversion: 7bff124b2de16292fe6e7a7e5d3322ae
+
+dmenu.font: Fira Code:pixelsize=18:style=Regular:antialias=true:autohint=true
+dmenu.background: #1c1c1c
+dmenu.foreground: #e0e0e0
+dmenu.selbackground: #005577
+dmenu.selforeground: #ffffff
+
+dwm.font: Fira Code, DejaVuSansM Nerd Font 15px
+dwm.normbgcolor: #323232
+dwm.normbordercolor: #444444
+dwm.normfgcolor: #dddddd
+dwm.selbgcolor: #005577
+dwm.selbordercolor: #005577
+dwm.selfgcolor: #ffffff
+
+st.font: Fira Code:pixelsize=15:style=Regular:antialias=true:autohint=true
+st.background: #1c1c1c
+st.foreground: #e5e5e5
+st.cursorColor: #cccccc
+
+svkbd.font: Fira Code:pixelsize=12
diff --git a/overlay/rootfs/home/user/.config/dunst/dunstrc b/overlay/rootfs/home/user/.config/dunst/dunstrc
index 2759edb..a8674fc 100644
--- a/overlay/rootfs/home/user/.config/dunst/dunstrc
+++ b/overlay/rootfs/home/user/.config/dunst/dunstrc
@@ -9,7 +9,7 @@
frame_width = 2
frame_color = "#005577"
idle_threshold = 120
- font = Monospace 12
+ font = Fira Code 9.5
markup = full
max_icon_size = 24
dmenu = sxmo_dmenu.sh -p dunst:
diff --git a/overlay/rootfs/home/user/.config/fcitx5/conf/classicui.conf b/overlay/rootfs/home/user/.config/fcitx5/conf/classicui.conf
index 1c0446c..50ffefb 100644
--- a/overlay/rootfs/home/user/.config/fcitx5/conf/classicui.conf
+++ b/overlay/rootfs/home/user/.config/fcitx5/conf/classicui.conf
@@ -1,8 +1,8 @@
Vertical Candidate List=False
WheelForPaging=True
-Font="Sans Bold 13"
-MenuFont="Sans 13"
-TrayFont="Sans Bold 13"
+Font="Fira Code 9.5"
+MenuFont="Fira Code 9.5"
+TrayFont="Fira Code 9.5"
PreferTextIcon=True
ShowLayoutNameInIcon=True
UseInputMethodLanguageToDisplayText=True
diff --git a/overlay/rootfs/home/user/.config/fontconfig/conf.d/50-sxmo.conf b/overlay/rootfs/home/user/.config/fontconfig/conf.d/50-sxmo.conf
new file mode 100644
index 0000000..dadd651
--- /dev/null
+++ b/overlay/rootfs/home/user/.config/fontconfig/conf.d/50-sxmo.conf
@@ -0,0 +1,37 @@
+
+
+
+
+
+ Sxmo
+
+ Fira Code
+ DejaVu SansM Nerd Font
+ Dejavu Sans Mono Nerd Font
+
+
+
+ monospace
+
+ Fira Code
+ DejaVu SansM Nerd Font
+ Dejavu Sans Mono Nerd Font
+
+
+
+ sans-serif
+
+ Fira Code
+ DejaVu SansM Nerd Font
+ Dejavu Sans Mono Nerd Font
+
+
+
+ serif
+
+ Fira Code
+ DejaVu SansM Nerd Font
+ Dejavu Sans Mono Nerd Font
+
+
+
diff --git a/overlay/rootfs/home/user/.config/foot/foot.ini b/overlay/rootfs/home/user/.config/foot/foot.ini
deleted file mode 100644
index a263aad..0000000
--- a/overlay/rootfs/home/user/.config/foot/foot.ini
+++ /dev/null
@@ -1,40 +0,0 @@
-# Space to setup configversion
-# configversion: 13fb3d2d9f97f4420f7506e72b90e77d
-font=monospace:size=13
-dpi-aware=no
-pad=2x2
-
-[colors-dark]
-# alpha=1.0
-foreground=eaeaea
-background=000000
-regular0=000000 # black
-regular1=d54e53 # red
-regular2=b9ca4a # green
-regular3=e6c547 # yellow
-regular4=7aa6da # blue
-regular5=c397d8 # magenta
-regular6=70c0ba # cyan
-regular7=eaeaea # white
-bright0=666666 # bright black
-bright1=ff3334 # bright red
-bright2=9ec400 # bright green
-bright3=e7c547 # bright yellow
-bright4=7aa6da # bright blue
-bright5=b77ee0 # bright magenta
-bright6=54ced6 # bright cyan
-bright7=ffffff # bright white
-
-[scrollback]
-lines=5000
-
-[key-bindings]
-scrollback-up-page=Shift+Page_Up
-scrollback-down-page=Shift+Page_Down
-scrollback-up-half-page=Page_Up
-scrollback-down-half-page=Page_Down
-scrollback-up-line=Shift+Up
-scrollback-down-line=Shift+Down
-scrollback-home=Shift+Home
-scrollback-end=Shift+End
-
diff --git a/overlay/rootfs/home/user/.config/gtk-3.0/settings.ini b/overlay/rootfs/home/user/.config/gtk-3.0/settings.ini
index e978463..b6f5a33 100644
--- a/overlay/rootfs/home/user/.config/gtk-3.0/settings.ini
+++ b/overlay/rootfs/home/user/.config/gtk-3.0/settings.ini
@@ -1,3 +1,3 @@
[Settings]
gtk-application-prefer-dark-theme=1
-gtk-font-name=Sans 13
+gtk-font-name=Fira Code 10
diff --git a/overlay/rootfs/home/user/.config/sxmo/conky.conf b/overlay/rootfs/home/user/.config/sxmo/conky.conf
index 8c00ea7..37a7734 100644
--- a/overlay/rootfs/home/user/.config/sxmo/conky.conf
+++ b/overlay/rootfs/home/user/.config/sxmo/conky.conf
@@ -1,18 +1,24 @@
-- Space to setup configversion
-- configversion: 19ec5c7f9e83bc6534d657f6180feba2
conky.config = {
- out_to_x = false,
- out_to_wayland = true,
+ output_backend = 'x11',
+ out_to_x = true,
+ out_to_wayland = false,
+ own_window = true,
+ own_window_type = 'override',
+ own_window_transparent = true,
+ own_window_hints = 'undecorated,below,sticky,skip_taskbar,skip_pager',
+ double_buffer = true,
alignment = 'top_middle',
- gap_y = 12,
- own_window_argb_value = 0,
- own_window_type = 'desktop',
+ gap_x = 0,
+ gap_y = 34,
+ default_color = 'white',
default_shade_color = 'black',
draw_shades = true,
- font = 'Sxmo:size=13',
+ font = 'Fira Code:size=14:style=Regular',
use_xft = true,
update_interval = 15,
}
-conky.text = [[${alignc}${font Sxmo:size=34:style=Bold}${time %H:%M}${font}
-${alignc}${font Sxmo:size=14:style=Bold}${time %a %d %b %Y}${font}]]
+conky.text = [[${alignc}${font Fira Code:size=32:style=Regular}${time %H:%M}${font}
+${voffset 4}${alignc}${font Fira Code:size=14:style=Regular}${time %a %d %b %Y}${font}]]
diff --git a/overlay/rootfs/home/user/.config/sxmo/hooks/sxmo_hook_inputhandler.sh b/overlay/rootfs/home/user/.config/sxmo/hooks/sxmo_hook_inputhandler.sh
index ed3f8d4..8246223 100755
--- a/overlay/rootfs/home/user/.config/sxmo/hooks/sxmo_hook_inputhandler.sh
+++ b/overlay/rootfs/home/user/.config/sxmo/hooks/sxmo_hook_inputhandler.sh
@@ -17,38 +17,51 @@ stop_proximity_lock() {
sxmo_jobs.sh stop proximity_lock
}
-exec 0</dev/null 2>&1 || sxmo_wm.sh display on
+ else
+ sxmo_wm.sh display on
+ fi
+ if [ -w /sys/class/leds/white:kbd_backlight/brightness ]; then
+ printf '255' > /sys/class/leds/white:kbd_backlight/brightness 2>/dev/null || true
+ else
+ brightnessctl -d white:kbd_backlight set 255 >/dev/null 2>&1 || true
+ fi
+ sxmo_state.sh set unlock &
+ exit 0
+ ;;
+ "voldown_one"|"volup_one")
+ exec 0</dev/null 2>&1 || true
- sxmo_state.sh set unlock
- sxmo_wm.sh display on
- ;;
- "voldown_one")
- sxmo_audio.sh vol down 5
- exit
+ if [ "$ACTION" = "voldown_one" ]; then
+ sxmo_audio.sh vol down 5
+ else
+ sxmo_audio.sh vol up 5
+ fi
+ exit 0
;;
"voldown_two")
sxmo_audio.sh vol down 10
@@ -58,10 +71,6 @@ if sxmo_state.sh is_locked; then
sxmo_audio.sh vol down 15
exit
;;
- "volup_one")
- sxmo_audio.sh vol up 5
- exit
- ;;
"volup_two")
sxmo_audio.sh vol up 10
exit
@@ -75,6 +84,31 @@ if sxmo_state.sh is_locked; then
exit 0
fi
+case "$ACTION" in
+ "menuleft"*|"enter_two"|"enter_three"|"powerbutton_two"|"powerbutton_three"|"voldown_two"|"volup_two"|"volup_three"|"topleftcorner"|"toprightcorner"|"bottomrightcorner")
+ WMCLASS=""
+ WMNAME=""
+ ;;
+ *)
+ if [ -r "$XDG_RUNTIME_DIR/sxmo.focusedwin" ]; then
+ {
+ read -r WMCLASS || WMCLASS=""
+ read -r WMNAME || WMNAME=""
+ } < "$XDG_RUNTIME_DIR/sxmo.focusedwin"
+ else
+ exec 0</dev/null; then
sxmo_hook_pickup.sh
else
sxmo_appmenu.sh "$WMCLASS" "$WMNAME"
diff --git a/overlay/rootfs/home/user/.config/sxmo/hooks/sxmo_hook_start.sh b/overlay/rootfs/home/user/.config/sxmo/hooks/sxmo_hook_start.sh
index 80f1f22..05c9c36 100755
--- a/overlay/rootfs/home/user/.config/sxmo/hooks/sxmo_hook_start.sh
+++ b/overlay/rootfs/home/user/.config/sxmo/hooks/sxmo_hook_start.sh
@@ -10,13 +10,18 @@
. sxmo_common.sh
# Create xdg user directories, such as ~/Pictures
-xdg-user-dirs-update
+[ -d "$HOME/Pictures" ] || xdg-user-dirs-update &
+
+# Ensure fontconfig cache is valid without forcing a full rescan on every boot
+if command -v fc-cache > /dev/null && [ -z "$(ls -A /var/cache/fontconfig 2>/dev/null)" ]; then
+ fc-cache >/dev/null 2>&1 &
+fi
sxmo_jobs.sh start daemon_manager superd
# let time to superd to start correctly
while ! superctl status > /dev/null 2>&1; do
- sleep 0.5
+ sleep 0.05
done
# Not dangerous if "locker" isn't an available state
@@ -54,48 +59,14 @@ superctl start dunst
# start adaptive brightness at boot
# superctl start sxmo_adaptivebrightness
-# load some other little things here too.
-case "$SXMO_WM" in
- river)
- superctl start sxmo_wob
- [ "$(command -v bonsaid)" ] && superctl start bonsaid
- [ "$(command -v fcitx5)" ] && superctl start fcitx5
- superctl start sxmo_riverbar
- ;;
- sway)
- superctl start sxmo_wob
- superctl start sxmo_menumode_toggler
- [ "$(command -v bonsaid)" ] && superctl start bonsaid
- [ "$(command -v fcitx5)" ] && superctl start fcitx5
- ;;
- dwm|i3)
- superctl start sxmo_xob
-
- # Auto hide cursor with touchscreen, Show it with a mouse
- if command -v "unclutter-xfixes" > /dev/null; then
- set -- unclutter-xfixes
- else
- set -- unclutter
- fi
- superctl start "$1"
-
- superctl start autocutsel
- superctl start autocutsel-primary
- superctl start sxmo-x11-status
- [ "$(command -v bonsaid)" ] && superctl start bonsaid
- [ "$(command -v fcitx5)" ] && superctl start fcitx5
- [ -n "$SXMO_MONITOR" ] && xrandr --output "$SXMO_MONITOR" --primary
- # Set onboard to auto-hide in config first
- if [ "$KEYBOARD" = "onboard" ]; then
- onboard "$KEYBOARD_ARGS"
- fi
- case "$SXMO_WM" in
- i3)
- xbindkeys -f "$XDG_CONFIG_HOME/sxmo/xbindkeysrc_$SXMO_BINDING_PROVIDER"
- ;;
- esac
- ;;
-esac
+# load X11 dwm services
+[ "$(command -v sxmo_xob)" ] && superctl start sxmo_xob
+pidof -s sxmo_status_xsetroot.sh >/dev/null 2>&1 || superctl start sxmo-x11-status
+[ "$(command -v bonsaid)" ] && superctl start bonsaid
+if ! pidof -s fcitx5 >/dev/null 2>&1 && [ "$(command -v fcitx5)" ]; then
+ superctl start fcitx5
+fi
+[ -n "$SXMO_MONITOR" ] && xrandr --output "$SXMO_MONITOR" --primary
# Turn on auto-suspend
if sxmo_wakelock.sh isenabled; then
@@ -106,8 +77,8 @@ fi
# To setup initial unlock state
sxmo_state.sh set unlock
-# Turn on lisgd
-if [ ! -e "$XDG_CACHE_HOME"/sxmo/sxmo.nogesture ]; then
+# Turn on lisgd only on touch devices
+if [ -z "$SXMO_NO_VIRTUAL_KEYBOARD" ] && [ ! -e "$XDG_CACHE_HOME"/sxmo/sxmo.nogesture ]; then
superctl start sxmo_hook_lisgd
fi
@@ -120,11 +91,8 @@ if [ -z "$SXMO_NO_MODEM" ] && command -v ModemManager > /dev/null; then
sxmo_wakelock.sh lock sxmo_modem_warming_up 120s
fi
-# Start the desktop wallpaper
-superctl start sxmo_bg
-
# Start the desktop widget (e.g. clock)
-superctl start sxmo_conky
+pidof -s conky >/dev/null 2>&1 || superctl start sxmo_conky
# Monitor the battery
superctl start sxmo_battery_monitor
@@ -135,25 +103,8 @@ superctl start sxmo_networkmonitor
# The daemon that display notifications popup messages
superctl start sxmo_notificationmonitor
-# Play a funky startup tune if you want (disabled by default)
-#mpv --quiet --no-video ~/welcome.ogg &
-
-# mmsd and vvmd
-if [ -z "$SXMO_NO_MODEM" ]; then
- if [ -f "${SXMO_MMS_BASE_DIR:-"$HOME"/.mms/modemmanager}/mms" ]; then
- superctl start mmsd-tng
- fi
-
- if [ -f "${SXMO_VVM_BASE_DIR:-"$HOME"/.vvm/modemmanager}/vvm" ]; then
- superctl start vvmd
- fi
-fi
-
-# add some warnings if things are not setup correctly
-if ! command -v "sxmo_deviceprofile_$SXMO_DEVICE_NAME.sh"; then
- sxmo_notify_user.sh --urgency=critical \
- "No deviceprofile found $SXMO_DEVICE_NAME. See: https://sxmo.org/deviceprofile"
-fi
-
-sxmo_migrate.sh state || sxmo_notify_user.sh --urgency=critical \
- "Config needs migration" "$? file(s) in your sxmo configuration are out of date and disabled - using defaults until you migrate (run sxmo_migrate.sh)"
+# Pre-warm app and script menu caches in background
+(
+ sxmo_hook_apps.sh >/dev/null 2>&1 || true
+ sxmo_hook_scripts.sh >/dev/null 2>&1 || true
+) &
diff --git a/overlay/rootfs/home/user/.config/sxmo/profile b/overlay/rootfs/home/user/.config/sxmo/profile
old mode 100644
new mode 100755
index c378277..ce9b5ae
--- a/overlay/rootfs/home/user/.config/sxmo/profile
+++ b/overlay/rootfs/home/user/.config/sxmo/profile
@@ -70,9 +70,20 @@ export SXMO_RINGNUMBER=10
#Set to the default text for a new text message.
export SXMO_DEFAULT_DRAFT="Enter new message here."
+export PATH="$HOME/.local/bin:$PATH"
+export SXMO_WM="dwm"
+export SXMO_MENU="dmenu"
+export SXMO_TERMINAL="st"
+export DMENU_WRAP_AROUND=1
+export SXMO_DMENU_PORTRAIT_LINES=12
+export SXMO_DMENU_LANDSCAPE_LINES=8
+export SXMO_DISABLE_LEDS=1
+export SXMO_NO_VIRTUAL_KEYBOARD=1
+export NO_AT_BRIDGE=1
+export GTK_A11Y=none
+export GTK_USE_PORTAL=0
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
export XMODIFIERS=@im=fcitx
-export SXMO_MENU=wofi
export SXMO_BG_IMG="/usr/share/wallpapers/bananarchy.png"
diff --git a/overlay/rootfs/home/user/.config/sxmo/sway b/overlay/rootfs/home/user/.config/sxmo/sway
deleted file mode 100644
index de6396b..0000000
--- a/overlay/rootfs/home/user/.config/sxmo/sway
+++ /dev/null
@@ -1,296 +0,0 @@
-# Default config for sway
-# configversion: 076611fe8cc699bcaa01092a8e4481c0
-#
-# Copy this to ~/.config/sway/config and edit it to your liking.
-#
-# Read `man 5 sway` for a complete reference.
-
-### Variables
-#
-# Logo key. Use Mod1 for Alt.
-set $mod Mod4
-# Home row direction keys, like vim
-set $left h
-set $down j
-set $up k
-set $right l
-# Your preferred terminal emulator
-set $term sxmo_terminal.sh
-# Your preferred application launcher
-# Note: pass the final command to swaymsg so that the resulting window can be opened
-# on the original workspace that the command was run on.
-set $menu bemenu-run
-
-font "Sxmo 13"
-xwayland disable
-output * scale 1 bg /usr/share/wallpapers/bananarchy.png fill
-default_orientation vertical
-
-exec_always sxmo_swayinitconf.sh
-
-exec_always dbus-update-activation-environment WAYLAND_DISPLAY DISPLAY XDG_CURRENT_DESKTOP
-
-mode "menu" {
- bindsym --locked XF86PowerOff exec sh -c "sxmo_dmenu.sh close; if sxmo_state.sh is_locked; then sxmo_state.sh set unlock; sxmo_wm.sh display on; fi"
- bindsym --locked XF86PickupPhone exec sh -c "if sxmo_state.sh is_locked; then sxmo_state.sh set unlock; sxmo_wm.sh display on; else wtype -k Return; fi"
- bindsym --locked XF86KbdLcdMenu1 exec sh -c "sxmo_dmenu.sh close; if sxmo_state.sh is_locked; then sxmo_state.sh set unlock; sxmo_wm.sh display on; fi"
- bindsym --locked XF86KbdLcdMenu2 exec sh -c "sxmo_dmenu.sh close; if sxmo_state.sh is_locked; then sxmo_state.sh set unlock; sxmo_wm.sh display on; fi"
- bindsym XF86AudioRaiseVolume exec wtype -k Up
- bindsym XF86AudioLowerVolume exec wtype -k Down
- bindswitch --locked lid:on exec sh -c "sxmo_dmenu.sh close; brightnessctl -d white:kbd_backlight set 0; sxmo_state.sh set screenoff"
- bindswitch --locked lid:off exec sh -c "brightnessctl -d white:kbd_backlight set 255; sxmo_state.sh set unlock; sxmo_wm.sh display on"
-}
-
-# Mode specifically for use with Nokia N900 hardware keyboard
-mode "N900" {
- # follow the standard sxmo keybinds as far as possible
- bindsym t exec $term; mode "default"
- bindsym q mode "default"
- bindsym Shift+p exec sxmo_appmenu.sh sys; mode "default"
- bindsym p exec sxmo_appmenu.sh; mode "default"
- bindsym d exec $menu; mode "default"
- bindsym Shift+q kill; mode "default"
- bindsym i exec sxmo_wmmenu.sh windowswitcher; mode "default"
- bindsym Shift+c reload; mode "default"
- bindsym f fullscreen; mode "default"
- bindsym Shift+space floating toggle; mode "default"
- bindsym a focus parent; mode "default"
-}
-
-### Key bindings
-#
-# Basics:
-#
- input * xkb_options compose:ralt
-
- # Nokia N900 hardware keyboard
- input "1:1:TWL4030_Keypad" {
- xkb_model "nokiarx51"
- xkb_layout "us"
- # ralt has special meaning on N900 keyboard so do not use as
- # compose key
- xkb_options compose:rwin
- }
-
- # Start a terminal
- bindsym $mod+Return exec $term
-
- # Launch appmenu
- bindsym $mod+p exec sxmo_appmenu.sh
- bindsym $mod+Shift+p exec sxmo_appmenu.sh sys
-
- # Wm menu switcher
- bindsym $mod+i exec sxmo_wmmenu.sh windowswitcher
-
- # Kill focused window
- bindsym $mod+Shift+q kill
-
- # Start your launcher
- bindsym $mod+d exec $menu
-
- # Drag floating windows by holding down $mod and left mouse button.
- # Resize them with right mouse button + $mod.
- # Despite the name, also works for non-floating windows.
- # Change normal to inverse to use left mouse button for resizing and right
- # mouse button for dragging.
- floating_modifier $mod normal
-
- # Reload the configuration file
- bindsym $mod+Shift+c reload
-
- # Exit sway (logs you out of your Wayland session)
- bindsym $mod+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'sxmo_power.sh logout'
-#
-# Moving around:
-#
- # Move your focus around
- bindsym $mod+$left focus left
- bindsym $mod+$down focus down
- bindsym $mod+$up focus up
- bindsym $mod+$right focus right
- # Or use $mod+[up|down|left|right]
- bindsym $mod+Left focus left
- bindsym $mod+Down focus down
- bindsym $mod+Up focus up
- bindsym $mod+Right focus right
-
- # Move the focused window with the same, but add Shift
- bindsym $mod+Shift+$left move left
- bindsym $mod+Shift+$down move down
- bindsym $mod+Shift+$up move up
- bindsym $mod+Shift+$right move right
- # Ditto, with arrow keys
- bindsym $mod+Shift+Left move left
- bindsym $mod+Shift+Down move down
- bindsym $mod+Shift+Up move up
- bindsym $mod+Shift+Right move right
-
- # Move the focused workspace to output
- bindsym $mod+Shift+Ctrl+$left move workspace output left
- bindsym $mod+Shift+Ctrl+$down move workspace output down
- bindsym $mod+Shift+Ctrl+$up move workspace output up
- bindsym $mod+Shift+Ctrl+$right move workspace output right
-#
-# Workspaces:
-#
- # Switch to workspace
- bindsym $mod+1 workspace number 1
- bindsym $mod+2 workspace number 2
- bindsym $mod+3 workspace number 3
- bindsym $mod+4 workspace number 4
- bindsym $mod+5 workspace number 5
- bindsym $mod+6 workspace number 6
- bindsym $mod+7 workspace number 7
- bindsym $mod+8 workspace number 8
- bindsym $mod+9 workspace number 9
- bindsym $mod+0 workspace number 10
- # Move focused container to workspace
- bindsym $mod+Shift+1 move container to workspace number 1
- bindsym $mod+Shift+2 move container to workspace number 2
- bindsym $mod+Shift+3 move container to workspace number 3
- bindsym $mod+Shift+4 move container to workspace number 4
- bindsym $mod+Shift+5 move container to workspace number 5
- bindsym $mod+Shift+6 move container to workspace number 6
- bindsym $mod+Shift+7 move container to workspace number 7
- bindsym $mod+Shift+8 move container to workspace number 8
- bindsym $mod+Shift+9 move container to workspace number 9
- bindsym $mod+Shift+0 move container to workspace number 10
- # Note: workspaces can have any name you want, not just numbers.
- # We just use 1-10 as the default.
-#
-# Layout stuff:
-#
- # You can "split" the current object of your focus with
- # $mod+b or $mod+v, for horizontal and vertical splits
- # respectively.
- bindsym $mod+b splith
- bindsym $mod+v splitv
-
- # Switch the current container between different layout styles
- bindsym $mod+s layout stacking
- bindsym $mod+w layout tabbed
- bindsym $mod+e layout toggle split
-
- # Make the current focus fullscreen
- bindsym $mod+f fullscreen
-
- # Toggle the current focus between tiling and floating mode
- bindsym $mod+Shift+space floating toggle
-
- # Swap focus between the tiling area and the floating area
- bindsym $mod+space focus mode_toggle
-
- # Move focus to the parent container
- bindsym $mod+a focus parent
-
- # Manual locker
- bindsym $mod+g exec sxmo_state.sh set locker
-
- # Shutdown
- bindsym $mod+t exec sxmo_appmenu.sh power
-
-#
-# Scratchpad:
-#
- # Sway has a "scratchpad", which is a bag of holding for windows.
- # You can send windows there and get them back later.
-
- # Move the currently focused window to the scratchpad
- bindsym $mod+Shift+minus move scratchpad
-
- # Show the next scratchpad window or hide the focused scratchpad window.
- # If there are multiple scratchpad windows, this command cycles through them.
- bindsym $mod+minus scratchpad show
-#
-# Resizing containers:
-#
-mode "resize" {
- # left will shrink the containers width
- # right will grow the containers width
- # up will shrink the containers height
- # down will grow the containers height
- bindsym $left resize shrink width 30px
- bindsym $down resize grow height 30px
- bindsym $up resize shrink height 30px
- bindsym $right resize grow width 30px
-
- # Ditto, with arrow keys
- bindsym Left resize shrink width 30px
- bindsym Down resize grow height 30px
- bindsym Up resize shrink height 30px
- bindsym Right resize grow width 30px
-
- # Return to default mode
- bindsym Return mode "default"
- bindsym Escape mode "default"
-}
-bindsym $mod+r mode "resize"
-
-#
-# Status Bar:
-#
-# Read `man 5 sway-bar` for more information about this section.
-bar {
- position top
- height 24
- font "Sxmo 13"
-
- # When the status_command prints a new line to stdout, swaybar updates.
- # The default just shows the current date and time.
- status_command sxmo_status_watch.sh -o pango
-
- pango_markup enabled
-
- colors {
- statusline #ffffff
- background #323232
- inactive_workspace #323232 #323232 #ffffff
- font "Sxmo 13"
- }
-}
-
-for_window [app_id="pinentry-.*"] floating true
-for_window [app_id="foot" title=".*sxmo/modem/.*/draft.txt.*"] resize set height 25
-for_window [title="megapixels"] inhibit_idle open
-for_window [title="ep[yr].*"] inhibit_idle visible
-
-default_border pixel 2
-titlebar_border_thickness 2
-hide_edge_borders smart
-
-# Need playerctl installed and running
-bindsym --locked XF86AudioPlay exec playerctl play-pause
-bindsym --locked XF86AudioPause exec playerctl play-pause
-bindsym --locked XF86AudioStop exec playerctl stop
-bindsym --locked XF86AudioNext exec playerctl next
-bindsym --locked XF86AudioPrev exec playerctl previous
-
-bindsym --locked XF86MonBrightnessUp exec sxmo_brightness.sh up
-bindsym --locked XF86MonBrightnessDown exec sxmo_brightness.sh down
-
-# Nokia N900-specific key bindings:
-# 1. Bind lock key (XF86ScreenSaver)
-# Use keycode due to https://github.com/swaywm/sway/issues/8438
-bindcode --release --locked --input-device="1:1:gpio_keys" 160 exec sxmo_state.sh set unlock
-# 2. Workaround the lack of a free ModX key on hardware keyboard
-bindsym --input-device="1:1:TWL4030_Keypad" Shift+space mode "N900"
-
-bindsym Print exec sxmo_screenshot.sh
-
-bindsym button2 kill
-
-bindswitch --locked lid:on exec sh -c "brightnessctl -d white:kbd_backlight set 0; sxmo_state.sh set screenoff"
-bindswitch --locked lid:off exec sh -c "brightnessctl -d white:kbd_backlight set 255; sxmo_state.sh set unlock; sxmo_wm.sh display on"
-
-# Nokia 8110 4G hardware keypad bindings (User:Ybon)
-bindsym --locked --no-repeat XF86KbdLcdMenu1 exec sxmo_hook_inputhandler.sh menuleft_one
-bindsym --locked --no-repeat XF86KbdLcdMenu2 exec sxmo_hook_inputhandler.sh menuright_one
-bindsym --locked --no-repeat XF86PickupPhone exec sxmo_multikey.sh pickup enter_one enter_two enter_three
-
-include /etc/sway/config.d/*
-
-exec 'printf %s "$SWAYSOCK" > "$XDG_RUNTIME_DIR"/sxmo.swaysock'
-
-exec sxmo_hook_start.sh
-
-# vim: ft=swayconfig
diff --git a/overlay/rootfs/home/user/.config/sxmo/xinit b/overlay/rootfs/home/user/.config/sxmo/xinit
new file mode 100755
index 0000000..08a1ae8
--- /dev/null
+++ b/overlay/rootfs/home/user/.config/sxmo/xinit
@@ -0,0 +1,7 @@
+#!/bin/sh
+# configversion: 36730424afa6d6bf9e9fb6d111c35504
+
+dbus-update-activation-environment DISPLAY XDG_CURRENT_DESKTOP
+
+# Run actions on start
+sxmo_hook_start.sh &
diff --git a/overlay/rootfs/home/user/.config/wofi/config b/overlay/rootfs/home/user/.config/wofi/config
deleted file mode 100644
index 601b590..0000000
--- a/overlay/rootfs/home/user/.config/wofi/config
+++ /dev/null
@@ -1,12 +0,0 @@
-# Space to setup configversion
-# configversion: eb37989d3b93bf46e0df32db4ffd833e
-matching=multi-contains
-width=240
-height=296
-halign=fill
-orientation=vertical
-content_halign=fill
-insensitive=true
-prompt=
-show=dmenu
-no_actions=true
diff --git a/overlay/rootfs/home/user/.config/wofi/style.css b/overlay/rootfs/home/user/.config/wofi/style.css
deleted file mode 100644
index d0795ad..0000000
--- a/overlay/rootfs/home/user/.config/wofi/style.css
+++ /dev/null
@@ -1,51 +0,0 @@
-/* Space to setup configversion */
-/* configversion: 2ecca20b604bc0b37d13aba5a0fabc07 */
-* {
- font-family: monospace;
- font-size: 15px;
-}
-
-window {
- margin: 0px;
- border: 2px solid #005577;
- background-color: #1c1c1c;
-}
-
-#input {
- margin: 0px;
- padding: 4px 6px;
- border-radius: 0px;
- border: 1px solid #005577;
- background-color: #383838;
- color: #ffffff;
- font-size: 15px;
- font-weight: bold;
-}
-
-#inner-box {
- margin: 0px;
-}
-
-#outer-box {
- margin: 1px;
-}
-
-#scroll {
- margin: 0px;
- color: #ffdd00;
-}
-
-#text {
- margin: 1px 4px;
- color: #ffffff;
-}
-
-#entry {
- padding: 3px 2px;
- margin: 0px;
-}
-
-#entry:selected {
- background-color: #005577;
- font-weight: bold;
-}
diff --git a/overlay/rootfs/home/user/.profile b/overlay/rootfs/home/user/.profile
new file mode 100644
index 0000000..d2ff062
--- /dev/null
+++ b/overlay/rootfs/home/user/.profile
@@ -0,0 +1,16 @@
+export PATH="$HOME/.local/bin:$PATH"
+
+export SXMO_WM=dwm
+export SXMO_MENU=dmenu
+export SXMO_TERMINAL=st
+export DMENU_WRAP_AROUND=1
+export SXMO_DMENU_PORTRAIT_LINES=12
+export SXMO_DMENU_LANDSCAPE_LINES=8
+export SXMO_DISABLE_LEDS=1
+export SXMO_NO_VIRTUAL_KEYBOARD=1
+export NO_AT_BRIDGE=1
+export GTK_A11Y=none
+export GTK_USE_PORTAL=0
+export GTK_IM_MODULE=fcitx
+export QT_IM_MODULE=fcitx
+export XMODIFIERS=@im=fcitx
diff --git a/overlay/rootfs/usr/bin/X b/overlay/rootfs/usr/bin/X
new file mode 120000
index 0000000..e363c6e
--- /dev/null
+++ b/overlay/rootfs/usr/bin/X
@@ -0,0 +1 @@
+Xorg
\ No newline at end of file
diff --git a/overlay/rootfs/usr/bin/Xorg b/overlay/rootfs/usr/bin/Xorg
new file mode 100755
index 0000000..10f585b
Binary files /dev/null and b/overlay/rootfs/usr/bin/Xorg differ
diff --git a/overlay/rootfs/usr/bin/bananarchy-photo b/overlay/rootfs/usr/bin/bananarchy-photo
index 898581f..c254747 100755
--- a/overlay/rootfs/usr/bin/bananarchy-photo
+++ b/overlay/rootfs/usr/bin/bananarchy-photo
@@ -75,7 +75,7 @@ get_pictures_dir() {
}
notify_msg() {
- if command -v sxmo_notify_user.sh >/dev/null 2>&1 && [ -n "${WAYLAND_DISPLAY:-}" ]; then
+ if command -v sxmo_notify_user.sh >/dev/null 2>&1 && [ -n "${DISPLAY:-}${WAYLAND_DISPLAY:-}" ]; then
sxmo_notify_user.sh -t 2000 "$1" >/dev/null 2>&1 || true
fi
}
@@ -135,8 +135,12 @@ take_photo() {
printf "%s\n" "$target_path"
notify_msg "Saved $(basename "$target_path")"
- if [ "$VIEW_AFTER" -eq 1 ] && [ -n "${WAYLAND_DISPLAY:-}" ] && command -v imv >/dev/null 2>&1; then
- imv "$target_path" >/dev/null 2>&1 &
+ if [ "$VIEW_AFTER" -eq 1 ] && [ -n "${DISPLAY:-}${WAYLAND_DISPLAY:-}" ]; then
+ if command -v feh >/dev/null 2>&1 && [ -n "${DISPLAY:-}" ]; then
+ feh --scale-down "$target_path" >/dev/null 2>&1 &
+ elif command -v imv >/dev/null 2>&1; then
+ imv "$target_path" >/dev/null 2>&1 &
+ fi
fi
return 0
}
@@ -169,7 +173,11 @@ run_menu() {
*"View photos"*)
pic_dir="$(get_pictures_dir)"
if ls "$pic_dir"/*.jpg "$pic_dir"/*.png >/dev/null 2>&1; then
- imv "$pic_dir" >/dev/null 2>&1 &
+ if command -v feh >/dev/null 2>&1 && [ -n "${DISPLAY:-}" ]; then
+ feh --scale-down "$pic_dir" >/dev/null 2>&1 &
+ else
+ imv "$pic_dir" >/dev/null 2>&1 &
+ fi
else
notify_msg "No photos in $pic_dir"
fi
diff --git a/overlay/rootfs/usr/bin/dmenu b/overlay/rootfs/usr/bin/dmenu
new file mode 100755
index 0000000..53d9ec3
Binary files /dev/null and b/overlay/rootfs/usr/bin/dmenu differ
diff --git a/overlay/rootfs/usr/bin/dmenu_path b/overlay/rootfs/usr/bin/dmenu_path
new file mode 100755
index 0000000..3a7cda7
--- /dev/null
+++ b/overlay/rootfs/usr/bin/dmenu_path
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+cachedir="${XDG_CACHE_HOME:-"$HOME/.cache"}"
+cache="$cachedir/dmenu_run"
+
+[ ! -e "$cachedir" ] && mkdir -p "$cachedir"
+
+IFS=:
+if stest -dqr -n "$cache" $PATH; then
+ stest -flx $PATH | sort -u | tee "$cache"
+else
+ cat "$cache"
+fi
diff --git a/overlay/rootfs/usr/bin/dmenu_run b/overlay/rootfs/usr/bin/dmenu_run
new file mode 100755
index 0000000..834ede5
--- /dev/null
+++ b/overlay/rootfs/usr/bin/dmenu_run
@@ -0,0 +1,2 @@
+#!/bin/sh
+dmenu_path | dmenu "$@" | ${SHELL:-"/bin/sh"} &
diff --git a/overlay/rootfs/usr/bin/dwm b/overlay/rootfs/usr/bin/dwm
new file mode 100755
index 0000000..920a79f
Binary files /dev/null and b/overlay/rootfs/usr/bin/dwm differ
diff --git a/overlay/rootfs/usr/bin/gtf b/overlay/rootfs/usr/bin/gtf
new file mode 100755
index 0000000..2eeee1c
Binary files /dev/null and b/overlay/rootfs/usr/bin/gtf differ
diff --git a/overlay/rootfs/usr/bin/st b/overlay/rootfs/usr/bin/st
new file mode 100755
index 0000000..83b666c
Binary files /dev/null and b/overlay/rootfs/usr/bin/st differ
diff --git a/overlay/rootfs/usr/bin/stest b/overlay/rootfs/usr/bin/stest
new file mode 100755
index 0000000..9d9d4ea
Binary files /dev/null and b/overlay/rootfs/usr/bin/stest differ
diff --git a/overlay/rootfs/usr/bin/sxmo_appmenu.sh b/overlay/rootfs/usr/bin/sxmo_appmenu.sh
new file mode 100755
index 0000000..2ac1526
--- /dev/null
+++ b/overlay/rootfs/usr/bin/sxmo_appmenu.sh
@@ -0,0 +1,322 @@
+#!/bin/sh
+# SPDX-License-Identifier: AGPL-3.0-only
+# Copyright 2022 Sxmo Contributors
+
+# include common definitions
+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
+. sxmo_hook_icons.sh
+# shellcheck source=scripts/core/sxmo_common.sh
+. sxmo_common.sh
+
+unalias dmenu 2>/dev/null || true
+unalias bemenu 2>/dev/null || true
+
+confirm() {
+ PICKED="$(printf "Yes\nNo\n" | run_dmenu -p "Confirm $1")"
+
+ if [ "$PICKED" = "Yes" ]; then
+ return 0
+ else
+ return 1
+ fi
+}
+
+run_dmenu() {
+ if [ "${SXMO_WM:-dwm}" = "dwm" ] && command -v dmenu >/dev/null 2>&1; then
+ dmenu -c -l "${SXMO_DMENU_PORTRAIT_LINES:-9}" "$@"
+ else
+ sxmo_dmenu.sh "$@"
+ fi
+}
+
+supertoggle_daemon() {
+ if superctl status "$1" | grep -q started; then
+ superctl stop "$1"
+ sxmo_notify_user.sh "$1 Stopped"
+ else
+ superctl start "$1"
+ sxmo_notify_user.sh "$1 Started"
+ fi
+}
+
+toggle_daemon() {
+ name="$1"
+ shift
+
+ if sxmo_jobs.sh running "$1" -q; then
+ sxmo_jobs.sh stop "$@"
+ notify-send "$name Stopped"
+ else
+ sxmo_jobs.sh start "$@" &
+ notify-send "$name Started"
+ fi
+}
+
+sxmo_type() {
+ sxmo_type.sh -s 200 "$@"
+}
+
+get_focused_window() {
+ if [ -r "${XDG_RUNTIME_DIR:-/run/user/10000}/sxmo.focusedwin" ]; then
+ {
+ read -r WMCLASS || WMCLASS=""
+ read -r WMNAME || WMNAME=""
+ } < "${XDG_RUNTIME_DIR:-/run/user/10000}/sxmo.focusedwin"
+ return
+ fi
+ exec 0</dev/null || continue
+ if [ "$rtype" = "bluetooth" ]; then
+ read -r soft < "$rfk/soft" 2>/dev/null || soft=0
+ read -r hard < "$rfk/hard" 2>/dev/null || hard=0
+ [ "$soft" = "0" ] && [ "$hard" = "0" ] && return 0
+ return 1
+ fi
+ done
+ return 1
+}
+
+fast_sys_choices() {
+ WINNAME="Sys"
+ _bt_line=""
+ if bt_is_unblocked_fast; then
+ _bt_line="$icon_bth Bluetooth^1^sxmo_bluetoothmenu.sh
+"
+ fi
+ _flash_line=""
+ _bl=""
+ if [ -r /sys/class/leds/white:torch/brightness ]; then
+ read -r _bl < /sys/class/leds/white:torch/brightness 2>/dev/null || _bl=""
+ elif [ -r /sys/class/leds/white:flash/brightness ]; then
+ read -r _bl < /sys/class/leds/white:flash/brightness 2>/dev/null || _bl=""
+ fi
+ if [ -n "$_bl" ]; then
+ if [ "$_bl" -gt 0 ] 2>/dev/null; then
+ _flash_line="$icon_fll Flashlight $icon_ton^1^sxmo_flashtoggle.sh
+"
+ else
+ _flash_line="$icon_fll Flashlight $icon_tof^1^sxmo_flashtoggle.sh
+"
+ fi
+ fi
+ CHOICES="$icon_trm St^0^st -e ${SHELL:-/bin/sh}
+$icon_grd Apps^0^sxmo_appmenu.sh applications
+$icon_grd Scripts^0^sxmo_appmenu.sh scripts
+$icon_dir Files^0^sxmo_files.sh
+$icon_phn Dialer^0^sxmo_modemdial.sh
+$icon_msg Texts^0^sxmo_modemtext.sh
+$icon_usr Contacts^0^sxmo_contactmenu.sh
+${_bt_line}$icon_cam Camera^0^bananarchy-photo --menu
+${_flash_line}$icon_net Networks^0^sxmo_networks.sh
+$icon_mus Audio^0^sxmo_audio.sh
+$icon_phn Modem^0^sxmo_appmenu.sh modem
+$icon_win Windows^0^sxmo_wmmenu.sh
+$icon_cfg Config^0^sxmo_appmenu.sh config
+$icon_pwr Power^0^sxmo_appmenu.sh power"
+}
+
+getprogchoices() {
+ case "$WMCLASS" in
+ ""|sys)
+ fast_sys_choices
+ ;;
+ applications)
+ WINNAME="Apps"
+ if [ -s "${XDG_RUNTIME_DIR:-/tmp}/sxmo_apps.cache" ]; then
+ CHOICES="$(cat "${XDG_RUNTIME_DIR:-/tmp}/sxmo_apps.cache")"
+ else
+ CHOICES="$(sxmo_hook_apps.sh)"
+ fi
+ ;;
+ scripts)
+ WINNAME="Scripts"
+ if [ -s "${XDG_RUNTIME_DIR:-/tmp}/sxmo_scripts.cache" ]; then
+ CHOICES="$(cat "${XDG_RUNTIME_DIR:-/tmp}/sxmo_scripts.cache")"
+ else
+ CHOICES="$(sxmo_hook_scripts.sh)"
+ fi
+ ;;
+ power)
+ WINNAME="Power"
+ CHOICES="$icon_lck Lock^0^sxmo_state.sh set lock
+$icon_lck Lock (Screen off)^0^sxmo_state.sh set screenoff
+$icon_out Logout^0^confirm Logout && sxmo_power.sh logout
+$icon_rld Reboot^0^confirm Reboot && sxmo_power.sh reboot
+$icon_pwr Poweroff^0^confirm Poweroff && sxmo_power.sh poweroff"
+ ;;
+ modem)
+ WINNAME="Modem"
+ CHOICES="$icon_plk Modem PIN^0^sxmo_unlocksim.sh
+$icon_inf Modem Info^0^sxmo_modeminfo.sh
+$icon_phl Modem Log^0^sxmo_modemlog.sh"
+ ;;
+ config)
+ WINNAME="Config"
+ _bt_icon="$icon_tof"
+ bt_is_unblocked_fast && _bt_icon="$icon_ton"
+ _susp_icon="$icon_ton"
+ [ -e "${XDG_CACHE_HOME:-$HOME/.cache}/sxmo/sxmo.nosuspend" ] && _susp_icon="$icon_tof"
+ _idle_icon="$icon_ton"
+ [ -e "${XDG_CACHE_HOME:-$HOME/.cache}/sxmo/sxmo.noidle" ] && _idle_icon="$icon_tof"
+ CHOICES="$icon_aru Brightness^1^sxmo_brightness.sh up
+$icon_ard Brightness^1^sxmo_brightness.sh down
+$icon_cfg Toggle Bar^0^sxmo_wm.sh togglebar
+$icon_bth Bluetooth $_bt_icon^1^doas sxmo_bluetoothtoggle.sh && sxmo_hook_statusbar.sh bluetooth
+$icon_clk Change Timezone^1^sxmo_timezonechange.sh
+$icon_zzz Auto-suspend $_susp_icon^1^(rm ${XDG_CACHE_HOME:-$HOME/.cache}/sxmo/sxmo.nosuspend 2>/dev/null || touch ${XDG_CACHE_HOME:-$HOME/.cache}/sxmo/sxmo.nosuspend)
+$icon_zzz Auto-screen-off $_idle_icon^1^(rm ${XDG_CACHE_HOME:-$HOME/.cache}/sxmo/sxmo.noidle 2>/dev/null || touch ${XDG_CACHE_HOME:-$HOME/.cache}/sxmo/sxmo.noidle) && sxmo_state.sh set unlock
+$icon_trm Hooks^0^sxmo_hookmenu.sh
+$icon_cfg Suspend Blockers^0^sxmo_terminal.sh sxmo_debug_suspend.sh
+$icon_inf Log^0^sxmo_terminal.sh tail -n 100 -f ${XDG_STATE_HOME:-$HOME}/sxmo.log
+$icon_inf Version^0^sxmo_terminal.sh sxmo_version.sh --block"
+ ;;
+ *)
+ RES="$(sxmo_hook_contextmenu.sh "$WMCLASS" "$WMNAME")"
+ if [ -n "$RES" ]; then
+ nl='
+'
+ WINNAME="${RES%%"$nl"*}"
+ CHOICES="${RES#*"$nl"}"
+ fi
+ ;;
+ esac
+
+ if [ "$WINNAME" = "Sys" ]; then
+ NNOTIFICATIONS="$(count_notifications)"
+ if [ "$NNOTIFICATIONS" -gt 0 ]; then
+ CHOICES="$icon_bel Notifications ($NNOTIFICATIONS)^0^sxmo_notifs.sh menu
+$CHOICES"
+ fi
+ fi
+
+ if has_tracked_calls; then
+ CHOICES="$(call_entries)
+$CHOICES"
+ fi
+
+ case "$WINNAME" in
+ *Sys*) ;;
+ *)
+ CHOICES="$CHOICES
+$icon_mnu System Menu^0^sxmo_appmenu.sh sys"
+ ;;
+ esac
+
+ CHOICES="$CHOICES
+$icon_cls Close Menu^0^quit"
+
+ case "$WMCLASS" in
+ ""|sys|applications|scripts|power|modem|config)
+ ;;
+ *)
+ CHOICES="$(printf "%s\n" "$CHOICES" | awk 'NF {$1=$1; print}')"
+ ;;
+ esac
+}
+
+quit() {
+ exit 0
+}
+
+mainloop() {
+ getprogchoices
+ PICKED="$(
+ printf "%s\n" "$CHOICES" |
+ cut -d'^' -f1 |
+ run_dmenu -i -p "$WINNAME"
+ )" || quit
+
+ CHOICE="$(printf "%s\n" "$CHOICES" | awk -F '^' -v picked="$PICKED" \
+ '$1 == picked || $1 == picked " " {print $2 "^" $3; exit}'
+ )"
+
+ LOOP="${CHOICE%%^*}"
+ CMD="${CHOICE#*^}"
+ CMD="${CMD#"${CMD%%[![:space:]]*}"}"
+
+ if [ -z "$CHOICE" ] || [ -z "$CMD" ]; then
+ printf "%s\n" "sxmo_appmenu: Fallback: unknown choice <$PICKED> to contextmenu_fallback hook">&2
+ sxmo_hook_contextmenu_fallback.sh "$WINNAME" "$PICKED"
+ quit
+ fi
+
+ case "$CMD" in
+ "sxmo_appmenu.sh "*)
+ set -- ${CMD#sxmo_appmenu.sh }
+ WMCLASS="$1"
+ WMNAME="$2"
+ return 0
+ ;;
+ esac
+
+ eval "$CMD"
+
+ case "$LOOP" in
+ *1*) ;;
+ *) quit ;;
+ esac
+}
+
+if [ -z "$SHELLSPEC_PATH" ]; then
+ if [ $# -gt 0 ] ; then
+ WMCLASS="$1"
+ WMNAME="$2"
+ else
+ get_focused_window
+ fi
+
+ while true; do
+ mainloop
+ done
+fi
diff --git a/overlay/rootfs/usr/bin/sxmo_battery_monitor.sh b/overlay/rootfs/usr/bin/sxmo_battery_monitor.sh
new file mode 100755
index 0000000..bb4532c
--- /dev/null
+++ b/overlay/rootfs/usr/bin/sxmo_battery_monitor.sh
@@ -0,0 +1,25 @@
+#!/bin/sh
+# SPDX-License-Identifier: AGPL-3.0-only
+# Copyright 2022 Sxmo Contributors
+
+# shellcheck source=scripts/core/sxmo_common.sh
+. sxmo_common.sh
+
+upower -m | while read -r line; do
+ # swallow first line ("Monitoring activity from the power daemon...")
+ if [ -z "$started" ]; then
+ started=1
+ continue
+ fi
+
+ line="${line#* }"
+ event="${line%%:*}"
+ object="${line#*:}"
+ object="${object#"${object%%[![:space:]]*}"}"
+
+ if [ -z "$object" ]; then
+ continue
+ fi
+
+ sxmo_hook_battery.sh "$object" "$event"
+done
diff --git a/overlay/rootfs/usr/bin/sxmo_deviceprofile_nokia,argon.sh b/overlay/rootfs/usr/bin/sxmo_deviceprofile_nokia,argon.sh
index 7c0b24d..d6dac28 100755
--- a/overlay/rootfs/usr/bin/sxmo_deviceprofile_nokia,argon.sh
+++ b/overlay/rootfs/usr/bin/sxmo_deviceprofile_nokia,argon.sh
@@ -1,9 +1,14 @@
#!/bin/sh
-export SXMO_WM=sway
+export SXMO_WM=dwm
+export SXMO_MENU=dmenu
+export SXMO_TERMINAL=st
export SXMO_ROTATION=normal
# Native 1:1 240x320 QVGA resolution
-export SXMO_SWAY_SCALE=1
+export GSK_RENDERER=cairo
+export NO_AT_BRIDGE=1
+export GTK_A11Y=none
+export GTK_USE_PORTAL=0
# Physical button mappings
export SXMO_POWER_BUTTON="0:0:pm8916_pon"
@@ -13,12 +18,10 @@ export SXMO_MENU_LEFT_BUTTON="0:139:KEY_MENU"
export SXMO_MENU_RIGHT_BUTTON="0:158:KEY_BACK"
export SXMO_ENTER_BUTTON="0:352:KEY_OK"
-# Nokia 8110 4G has a physical keypad and no touchscreen
+# Physical keypad and no touchscreen or RGB status LED
export SXMO_NO_VIRTUAL_KEYBOARD=1
+export SXMO_DISABLE_LEDS=1
export KEYBOARD_ARGS="-H 1 -L 1"
-export SXMO_MENU=wofi
-export SXMO_WOFI_LANDSCAPE_WIDTH=320
-export SXMO_WOFI_LANDSCAPE_HEIGHT=200
-export SXMO_BEMENU_PORTRAIT_LINES=10
-export SXMO_BEMENU_LANDSCAPE_LINES=6
-export BEMENU_OPTS="--fn 'Sxmo 13' -H 24"
+export DMENU_WRAP_AROUND=1
+export SXMO_DMENU_PORTRAIT_LINES=12
+export SXMO_DMENU_LANDSCAPE_LINES=8
diff --git a/overlay/rootfs/usr/bin/sxmo_deviceprofile_nokia,beatles.sh b/overlay/rootfs/usr/bin/sxmo_deviceprofile_nokia,beatles.sh
index 7c0b24d..d6dac28 100755
--- a/overlay/rootfs/usr/bin/sxmo_deviceprofile_nokia,beatles.sh
+++ b/overlay/rootfs/usr/bin/sxmo_deviceprofile_nokia,beatles.sh
@@ -1,9 +1,14 @@
#!/bin/sh
-export SXMO_WM=sway
+export SXMO_WM=dwm
+export SXMO_MENU=dmenu
+export SXMO_TERMINAL=st
export SXMO_ROTATION=normal
# Native 1:1 240x320 QVGA resolution
-export SXMO_SWAY_SCALE=1
+export GSK_RENDERER=cairo
+export NO_AT_BRIDGE=1
+export GTK_A11Y=none
+export GTK_USE_PORTAL=0
# Physical button mappings
export SXMO_POWER_BUTTON="0:0:pm8916_pon"
@@ -13,12 +18,10 @@ export SXMO_MENU_LEFT_BUTTON="0:139:KEY_MENU"
export SXMO_MENU_RIGHT_BUTTON="0:158:KEY_BACK"
export SXMO_ENTER_BUTTON="0:352:KEY_OK"
-# Nokia 8110 4G has a physical keypad and no touchscreen
+# Physical keypad and no touchscreen or RGB status LED
export SXMO_NO_VIRTUAL_KEYBOARD=1
+export SXMO_DISABLE_LEDS=1
export KEYBOARD_ARGS="-H 1 -L 1"
-export SXMO_MENU=wofi
-export SXMO_WOFI_LANDSCAPE_WIDTH=320
-export SXMO_WOFI_LANDSCAPE_HEIGHT=200
-export SXMO_BEMENU_PORTRAIT_LINES=10
-export SXMO_BEMENU_LANDSCAPE_LINES=6
-export BEMENU_OPTS="--fn 'Sxmo 13' -H 24"
+export DMENU_WRAP_AROUND=1
+export SXMO_DMENU_PORTRAIT_LINES=12
+export SXMO_DMENU_LANDSCAPE_LINES=8
diff --git a/overlay/rootfs/usr/bin/sxmo_deviceprofile_nokia,coconut.sh b/overlay/rootfs/usr/bin/sxmo_deviceprofile_nokia,coconut.sh
index 7c0b24d..d6dac28 100755
--- a/overlay/rootfs/usr/bin/sxmo_deviceprofile_nokia,coconut.sh
+++ b/overlay/rootfs/usr/bin/sxmo_deviceprofile_nokia,coconut.sh
@@ -1,9 +1,14 @@
#!/bin/sh
-export SXMO_WM=sway
+export SXMO_WM=dwm
+export SXMO_MENU=dmenu
+export SXMO_TERMINAL=st
export SXMO_ROTATION=normal
# Native 1:1 240x320 QVGA resolution
-export SXMO_SWAY_SCALE=1
+export GSK_RENDERER=cairo
+export NO_AT_BRIDGE=1
+export GTK_A11Y=none
+export GTK_USE_PORTAL=0
# Physical button mappings
export SXMO_POWER_BUTTON="0:0:pm8916_pon"
@@ -13,12 +18,10 @@ export SXMO_MENU_LEFT_BUTTON="0:139:KEY_MENU"
export SXMO_MENU_RIGHT_BUTTON="0:158:KEY_BACK"
export SXMO_ENTER_BUTTON="0:352:KEY_OK"
-# Nokia 8110 4G has a physical keypad and no touchscreen
+# Physical keypad and no touchscreen or RGB status LED
export SXMO_NO_VIRTUAL_KEYBOARD=1
+export SXMO_DISABLE_LEDS=1
export KEYBOARD_ARGS="-H 1 -L 1"
-export SXMO_MENU=wofi
-export SXMO_WOFI_LANDSCAPE_WIDTH=320
-export SXMO_WOFI_LANDSCAPE_HEIGHT=200
-export SXMO_BEMENU_PORTRAIT_LINES=10
-export SXMO_BEMENU_LANDSCAPE_LINES=6
-export BEMENU_OPTS="--fn 'Sxmo 13' -H 24"
+export DMENU_WRAP_AROUND=1
+export SXMO_DMENU_PORTRAIT_LINES=12
+export SXMO_DMENU_LANDSCAPE_LINES=8
diff --git a/overlay/rootfs/usr/bin/sxmo_deviceprofile_nokia,leo.sh b/overlay/rootfs/usr/bin/sxmo_deviceprofile_nokia,leo.sh
index 7c0b24d..d6dac28 100755
--- a/overlay/rootfs/usr/bin/sxmo_deviceprofile_nokia,leo.sh
+++ b/overlay/rootfs/usr/bin/sxmo_deviceprofile_nokia,leo.sh
@@ -1,9 +1,14 @@
#!/bin/sh
-export SXMO_WM=sway
+export SXMO_WM=dwm
+export SXMO_MENU=dmenu
+export SXMO_TERMINAL=st
export SXMO_ROTATION=normal
# Native 1:1 240x320 QVGA resolution
-export SXMO_SWAY_SCALE=1
+export GSK_RENDERER=cairo
+export NO_AT_BRIDGE=1
+export GTK_A11Y=none
+export GTK_USE_PORTAL=0
# Physical button mappings
export SXMO_POWER_BUTTON="0:0:pm8916_pon"
@@ -13,12 +18,10 @@ export SXMO_MENU_LEFT_BUTTON="0:139:KEY_MENU"
export SXMO_MENU_RIGHT_BUTTON="0:158:KEY_BACK"
export SXMO_ENTER_BUTTON="0:352:KEY_OK"
-# Nokia 8110 4G has a physical keypad and no touchscreen
+# Physical keypad and no touchscreen or RGB status LED
export SXMO_NO_VIRTUAL_KEYBOARD=1
+export SXMO_DISABLE_LEDS=1
export KEYBOARD_ARGS="-H 1 -L 1"
-export SXMO_MENU=wofi
-export SXMO_WOFI_LANDSCAPE_WIDTH=320
-export SXMO_WOFI_LANDSCAPE_HEIGHT=200
-export SXMO_BEMENU_PORTRAIT_LINES=10
-export SXMO_BEMENU_LANDSCAPE_LINES=6
-export BEMENU_OPTS="--fn 'Sxmo 13' -H 24"
+export DMENU_WRAP_AROUND=1
+export SXMO_DMENU_PORTRAIT_LINES=12
+export SXMO_DMENU_LANDSCAPE_LINES=8
diff --git a/overlay/rootfs/usr/bin/sxmo_deviceprofile_nokia,sparkler.sh b/overlay/rootfs/usr/bin/sxmo_deviceprofile_nokia,sparkler.sh
index 7c0b24d..d6dac28 100755
--- a/overlay/rootfs/usr/bin/sxmo_deviceprofile_nokia,sparkler.sh
+++ b/overlay/rootfs/usr/bin/sxmo_deviceprofile_nokia,sparkler.sh
@@ -1,9 +1,14 @@
#!/bin/sh
-export SXMO_WM=sway
+export SXMO_WM=dwm
+export SXMO_MENU=dmenu
+export SXMO_TERMINAL=st
export SXMO_ROTATION=normal
# Native 1:1 240x320 QVGA resolution
-export SXMO_SWAY_SCALE=1
+export GSK_RENDERER=cairo
+export NO_AT_BRIDGE=1
+export GTK_A11Y=none
+export GTK_USE_PORTAL=0
# Physical button mappings
export SXMO_POWER_BUTTON="0:0:pm8916_pon"
@@ -13,12 +18,10 @@ export SXMO_MENU_LEFT_BUTTON="0:139:KEY_MENU"
export SXMO_MENU_RIGHT_BUTTON="0:158:KEY_BACK"
export SXMO_ENTER_BUTTON="0:352:KEY_OK"
-# Nokia 8110 4G has a physical keypad and no touchscreen
+# Physical keypad and no touchscreen or RGB status LED
export SXMO_NO_VIRTUAL_KEYBOARD=1
+export SXMO_DISABLE_LEDS=1
export KEYBOARD_ARGS="-H 1 -L 1"
-export SXMO_MENU=wofi
-export SXMO_WOFI_LANDSCAPE_WIDTH=320
-export SXMO_WOFI_LANDSCAPE_HEIGHT=200
-export SXMO_BEMENU_PORTRAIT_LINES=10
-export SXMO_BEMENU_LANDSCAPE_LINES=6
-export BEMENU_OPTS="--fn 'Sxmo 13' -H 24"
+export DMENU_WRAP_AROUND=1
+export SXMO_DMENU_PORTRAIT_LINES=12
+export SXMO_DMENU_LANDSCAPE_LINES=8
diff --git a/overlay/rootfs/usr/bin/sxmo_dmenu.sh b/overlay/rootfs/usr/bin/sxmo_dmenu.sh
new file mode 100755
index 0000000..36d9b23
--- /dev/null
+++ b/overlay/rootfs/usr/bin/sxmo_dmenu.sh
@@ -0,0 +1,31 @@
+#!/bin/sh
+# SPDX-License-Identifier: AGPL-3.0-only
+# Copyright 2022 Sxmo Contributors
+
+. sxmo_common.sh
+
+unalias dmenu 2>/dev/null || true
+
+case "$1" in
+ "--show-over-lockscreen")
+ SHOW_OVER_LOCKSCREEN_FLAG=1
+ shift
+ ;;
+ "isopen")
+ exec pidof -s dmenu >/dev/null
+ ;;
+ "close")
+ pkill dmenu 2>/dev/null || true
+ exit 0
+ ;;
+esac
+
+if [ -n "$SHOW_OVER_LOCKSCREEN_FLAG" ]; then
+ if pidof -s smlock >/dev/null; then
+ set -- "$@" -w smlock
+ fi
+fi
+
+lines="${SXMO_DMENU_PORTRAIT_LINES:-9}"
+# shellcheck disable=SC2086
+exec dmenu -i $SXMO_DMENU_OPTS -l "$lines" "$@"
diff --git a/overlay/rootfs/usr/bin/sxmo_dwminit.sh b/overlay/rootfs/usr/bin/sxmo_dwminit.sh
new file mode 100755
index 0000000..cd1fd40
--- /dev/null
+++ b/overlay/rootfs/usr/bin/sxmo_dwminit.sh
@@ -0,0 +1,48 @@
+#!/bin/sh
+# SPDX-License-Identifier: AGPL-3.0-only
+# Copyright 2022 Sxmo Contributors
+
+# shellcheck source=scripts/core/sxmo_common.sh
+. sxmo_common.sh
+
+envvars() {
+ unset WAYLAND_DISPLAY
+ export SXMO_WM=dwm
+ export XDG_CURRENT_DESKTOP=dwm
+ export SXMO_MENU=dmenu
+ export SXMO_TERMINAL=st
+ export GTK_IM_MODULE=fcitx
+ export QT_IM_MODULE=fcitx
+ export XMODIFIERS=@im=fcitx
+ command -v "$KEYBOARD" >/dev/null 2>&1 || defaultkeyboard
+ [ -z "$MOZ_USE_XINPUT2" ] && export MOZ_USE_XINPUT2=1
+}
+
+defaults() {
+ xsetroot -solid '#1c1c1c'
+ xset s off -dpms
+ [ -e "$HOME"/.Xresources ] && xrdb -merge "$HOME"/.Xresources
+ if [ -f /usr/share/wallpapers/bananarchy.png ] && command -v feh >/dev/null 2>&1; then
+ feh --no-fehbg --bg-fill /usr/share/wallpapers/bananarchy.png &
+ fi
+}
+
+defaultkeyboard() {
+ if command -v svkbd-mobile-intl >/dev/null 2>&1; then
+ export KEYBOARD=svkbd-mobile-intl
+ elif command -v svkbd-mobile-plain >/dev/null 2>&1; then
+ export KEYBOARD=svkbd-mobile-plain
+ else
+ export KEYBOARD=svkbd-sxmo
+ fi
+}
+
+with_dbus() {
+ echo "$DBUS_SESSION_BUS_ADDRESS" > "$XDG_RUNTIME_DIR"/dbus.bus
+ # shellcheck source=configs/appcfg/xinit_template
+ . "$XDG_CONFIG_HOME"/sxmo/xinit
+ exec dwm
+}
+
+# shellcheck source=scripts/core/sxmo_init.sh
+. sxmo_init.sh
diff --git a/overlay/rootfs/usr/bin/sxmo_idle.sh b/overlay/rootfs/usr/bin/sxmo_idle.sh
new file mode 100755
index 0000000..b55d71a
--- /dev/null
+++ b/overlay/rootfs/usr/bin/sxmo_idle.sh
@@ -0,0 +1,78 @@
+#!/bin/sh
+# SPDX-License-Identifier: AGPL-3.0-only
+# Copyright 2022 Sxmo Contributors
+
+_swayidletoidles() {
+ while [ $# -gt 0 ]; do
+ case "$1" in
+ timeout)
+ printf "%s|%s" "$2" "$3"
+ shift 3
+ case "$1" in
+ resume)
+ printf "|%s" "$2"
+ shift 2
+ ;;
+ esac
+ printf "\n"
+ ;;
+ *)
+ shift
+ ;;
+ esac
+ done
+}
+
+xorgidle() {
+ if ! command -v xprintidle >/dev/null 2>&1; then
+ while : ; do
+ sleep 3600
+ done
+ fi
+
+ idles="$(_swayidletoidles "$@")"
+ resumes=""
+
+ tick=0
+ new_idle="$(xprintidle 2>/dev/null || printf '0')"
+ [ -n "$new_idle" ] || new_idle=0
+ last_idle="$new_idle"
+
+ finish() {
+ sh -c "$resumes"
+ resumes=""
+ exit
+ }
+ trap 'finish' TERM INT EXIT
+
+ while : ; do
+ last_idle="$new_idle"
+ new_idle="$(xprintidle 2>/dev/null || printf '0')"
+ [ -n "$new_idle" ] || new_idle=0
+ if [ "$last_idle" -gt "$new_idle" ] 2>/dev/null; then
+ sh -c "$resumes"
+ tick=0
+ resumes=""
+ fi
+
+ if printf "%b\n" "$idles" | grep -q "^$tick|"; then
+ printf "%b\n" "$idles" | \
+ grep "^$tick|" | \
+ cut -d'|' -f2 | \
+ xargs -I{} -0 sh -c "{}"
+ resumes="$(printf "%b\n" "$idles" | grep "^$tick|" | cut -d'|' -f3);$resumes"
+ fi
+
+ sleep 1
+ tick=$((tick + 1))
+ done
+}
+
+case "$SXMO_WM" in
+ dwm|i3)
+ xorgidle "$@"
+ ;;
+ sway|river)
+ exec swayidle "$@"
+ ;;
+esac
diff --git a/overlay/rootfs/usr/bin/sxmo_init.sh b/overlay/rootfs/usr/bin/sxmo_init.sh
new file mode 100755
index 0000000..05ff119
--- /dev/null
+++ b/overlay/rootfs/usr/bin/sxmo_init.sh
@@ -0,0 +1,61 @@
+#!/bin/sh
+# SPDX-License-Identifier: AGPL-3.0-only
+# Copyright 2022 Sxmo Contributors
+
+# This script have to be sourced from other session init scripts.
+# The scripts have to implement envvars, defaults, with_dbus, and cleanup
+# methods. See sxmo_swayinit.sh as example.
+
+start() {
+ [ -f "$XDG_STATE_HOME"/sxmo.log ] && mv "$XDG_STATE_HOME"/sxmo.log "$XDG_STATE_HOME"/sxmo.log.old
+
+ if [ -z "$DBUS_SESSION_BUS_ADDRESS" ]; then
+ dbus-run-session -- "$0" "with_dbus" &
+ else
+ # with_dbus calls exec because dbus-run-session starts it in a
+ # new shell, but we need to keep this shell; start a subshell
+ ( with_dbus ) &
+ fi
+ wait
+}
+
+cleanup() {
+ sxmo_dmenu.sh close 2>/dev/null || true
+ sxmo_keyboard.sh close 2>/dev/null || true
+ sxmo_jobs.sh stop all 2>/dev/null || true
+}
+
+finish() {
+ cleanup
+ sleep 1
+ sxmo_hook_stop.sh 2>/dev/null || true
+ exit
+}
+
+shared_envvars() {
+ export SXMO_DISABLE_LEDS="1"
+}
+
+init() {
+ # shellcheck source=/dev/null
+ . /etc/profile.d/sxmo_init.sh
+
+ _sxmo_load_environments
+ _sxmo_prepare_dirs
+ envvars
+ shared_envvars
+
+ defaults
+
+ # shellcheck disable=SC1090,SC1091
+ . "$XDG_CONFIG_HOME/sxmo/profile"
+
+ trap 'finish' INT TERM EXIT
+ start
+}
+
+if [ -z "$1" ]; then
+ init
+else
+ "$1"
+fi
diff --git a/overlay/rootfs/usr/bin/sxmo_jobs.sh b/overlay/rootfs/usr/bin/sxmo_jobs.sh
new file mode 100755
index 0000000..f919831
--- /dev/null
+++ b/overlay/rootfs/usr/bin/sxmo_jobs.sh
@@ -0,0 +1,147 @@
+#!/bin/sh
+# SPDX-License-Identifier: AGPL-3.0-only
+# Copyright 2022 Sxmo Contributors
+
+# include common definitions
+# shellcheck source=scripts/core/sxmo_common.sh
+. sxmo_common.sh
+
+ROOT="$XDG_RUNTIME_DIR/sxmo_jobs"
+mkdir -p "$ROOT"
+
+exec 3<> "$XDG_RUNTIME_DIR/sxmo.jobs.lock"
+flock -x 3
+
+list() {
+ for f in "$ROOT"/*; do
+ [ -e "$f" ] || continue
+ case "$f" in
+ *.group) continue ;;
+ esac
+ printf "%s\n" "${f##*/}"
+ done
+}
+
+stop() {
+ while [ "$#" -gt 0 ]; do
+ case "$1" in
+ -f)
+ force=1
+ shift
+ ;;
+ *)
+ id="$1"
+ shift
+ break
+ ;;
+ esac
+ done
+
+ case "$id" in
+ all)
+ list | while read -r sub_id; do
+ stop "$sub_id"
+ done
+ ;;
+ *)
+ if [ -f "$ROOT/$id.group" ]; then
+ sxmo_debug "stop group $id"
+ read -r pid < "$ROOT/$id.group" 2>/dev/null || pid=""
+ [ -n "$pid" ] && kill ${force:+-9} -- "-$pid" 2> /dev/null || true
+ elif [ -f "$ROOT/$id" ]; then
+ sxmo_debug "stop $id"
+ read -r pid < "$ROOT/$id" 2>/dev/null || pid=""
+ [ -n "$pid" ] && kill ${force:+-9} "$pid" 2> /dev/null || true
+ fi
+
+ rm -f "$ROOT/$id" "$ROOT/$id.group" 2>/dev/null || true
+ ;;
+ esac
+}
+
+signal() {
+ id="$1"
+ shift
+
+ if [ -f "$ROOT/$id" ]; then
+ sxmo_debug "signal $id $*"
+ read -r pid < "$ROOT/$id" 2>/dev/null || pid=""
+ [ -n "$pid" ] && kill "$@" "$pid" 2> /dev/null || true
+ fi
+}
+
+start() {
+ while [ "$#" -gt 0 ]; do
+ case "$1" in
+ --no-restart)
+ no_restart=1
+ shift
+ ;;
+ --group)
+ has_group=1
+ shift
+ ;;
+ *)
+ id="$1"
+ shift
+ break
+ ;;
+ esac
+ done
+
+ if [ -f "$ROOT/$id" ]; then
+ if [ -n "$no_restart" ]; then
+ sxmo_debug "$id already running"
+ exit 1
+ else
+ stop "$id"
+ fi
+ fi
+
+ sxmo_debug "start $id"
+ # Start job in a new session, close the lock fd, and record PID synchronously
+ # before releasing the jobs lock so subsequent stop calls never race.
+ setsid "$@" 3<&- &
+ job_pid=$!
+ printf "%s\n" "$job_pid" > "$ROOT/$id"
+ if [ -n "$has_group" ]; then
+ printf "%s\n" "$job_pid" > "$ROOT/$id.group"
+ fi
+}
+
+running() {
+ while [ "$#" -gt 0 ]; do
+ case "$1" in
+ -q)
+ quiet=1
+ shift
+ ;;
+ *)
+ id="$1"
+ shift
+ ;;
+ esac
+ done
+
+ log() {
+ if [ -z "$quiet" ]; then
+ # shellcheck disable=SC2059
+ printf "$@"
+ fi
+ }
+
+ if [ -f "$ROOT/$id" ]; then
+ read -r pid < "$ROOT/$id" 2>/dev/null || pid=""
+ if [ -n "$pid" ] && [ -d "/proc/$pid" ]; then
+ log "%s is still running\n" "$id"
+ else
+ log "%s is not running anymore\n" "$id"
+ exit 2
+ fi
+ else
+ log "%s is not running\n" "$id"
+ exit 1
+ fi
+}
+
+"$@"
diff --git a/overlay/rootfs/usr/bin/sxmo_modem.sh b/overlay/rootfs/usr/bin/sxmo_modem.sh
new file mode 100755
index 0000000..314284a
--- /dev/null
+++ b/overlay/rootfs/usr/bin/sxmo_modem.sh
@@ -0,0 +1,286 @@
+#!/bin/sh
+# SPDX-License-Identifier: AGPL-3.0-only
+# Copyright 2022 Sxmo Contributors
+
+# include common definitions
+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
+. sxmo_hook_icons.sh
+# shellcheck source=scripts/core/sxmo_common.sh
+. sxmo_common.sh
+
+if [ -z "$XDG_RUNTIME_DIR" ]; then
+ echo "XDG_RUNTIME_DIR must be set" >&2
+ exit 1
+fi
+
+# We use this directory to store states, so it must exist
+mkdir -p "$XDG_RUNTIME_DIR/sxmo_calls"
+
+stderr() {
+ sxmo_log "$*"
+}
+
+cleanupnumber() {
+ if pnc valid "$1"; then
+ echo "$1"
+ return
+ fi
+
+ REFORMATTED="$(pnc find ${DEFAULT_COUNTRY:+-c "$DEFAULT_COUNTRY"} "$1")"
+ if [ -n "$REFORMATTED" ]; then
+ echo "$REFORMATTED"
+ return
+ fi
+
+ echo "$1"
+}
+
+checkforfinishedcalls() {
+ exec 3<> "$XDG_RUNTIME_DIR/sxmo_modem.checkforfinishedcalls.lock"
+ flock -x 3
+ #find all finished calls
+ for FINISHEDCALLID in $(
+ mmcli -m any --voice-list-calls |
+ grep terminated |
+ grep -oE "Call\/[0-9]+" |
+ cut -d'/' -f2
+ ); do
+ FINISHEDNUMBER="$(sxmo_modemcall.sh vid_to_number "$FINISHEDCALLID")"
+ FINISHEDNUMBER="$(cleanupnumber "$FINISHEDNUMBER")"
+ mmcli -m any --voice-delete-call "$FINISHEDCALLID"
+
+ rm -f "$XDG_RUNTIME_DIR/sxmo_calls/${FINISHEDCALLID}.monitoredcall"
+
+ CONTACT="$(sxmo_contacts.sh --name-or-number "$FINISHEDNUMBER")"
+
+ TIME="$(date +%FT%H:%M:%S%z)"
+ mkdir -p "$SXMO_LOGDIR"
+ if [ -f "$XDG_RUNTIME_DIR/sxmo_calls/${FINISHEDCALLID}.discardedcall" ]; then
+ #this call was discarded
+ STATE=discarded
+ sxmo_notify_user.sh "Call with $CONTACT terminated"
+ stderr "Discarded call from $FINISHEDNUMBER"
+ printf %b "$TIME\tcall_finished\t$FINISHEDNUMBER\n" >> "$SXMO_LOGDIR/modemlog.tsv"
+ elif [ -f "$XDG_RUNTIME_DIR/sxmo_calls/${FINISHEDCALLID}.pickedupcall" ]; then
+ #this call was picked up
+ STATE=pickedup
+ sxmo_notify_user.sh "Call with $CONTACT terminated"
+ stderr "Finished call from $FINISHEDNUMBER"
+ printf %b "$TIME\tcall_finished\t$FINISHEDNUMBER\n" >> "$SXMO_LOGDIR/modemlog.tsv"
+ elif [ -f "$XDG_RUNTIME_DIR/sxmo_calls/${FINISHEDCALLID}.hangedupcall" ]; then
+ #this call was hung up by the user
+ STATE=wehangedup
+ sxmo_notify_user.sh "Call with $CONTACT terminated"
+ stderr "Finished call from $FINISHEDNUMBER"
+ printf %b "$TIME\tcall_finished\t$FINISHEDNUMBER\n" >> "$SXMO_LOGDIR/modemlog.tsv"
+ elif [ -f "$XDG_RUNTIME_DIR/sxmo_calls/${FINISHEDCALLID}.initiatedcall" ]; then
+ STATE=theyhangedup
+ #this call was hung up by the contact
+ sxmo_notify_user.sh "Call with $CONTACT terminated"
+ stderr "Finished call from $FINISHEDNUMBER"
+ printf %b "$TIME\tcall_finished\t$FINISHEDNUMBER\n" >> "$SXMO_LOGDIR/modemlog.tsv"
+ elif [ -f "$XDG_RUNTIME_DIR/sxmo_calls/${FINISHEDCALLID}.mutedring" ]; then
+ STATE=muted
+ #this ring was muted up
+ stderr "Muted ring from $FINISHEDNUMBER"
+ printf %b "$TIME\tring_muted\t$FINISHEDNUMBER\n" >> "$SXMO_LOGDIR/modemlog.tsv"
+ else
+ #this is a missed call
+ # Add a notification for every missed call
+ STATE=missed
+
+ NOTIFMSG="Missed call from $CONTACT ($FINISHEDNUMBER)"
+ stderr "$NOTIFMSG"
+ printf %b "$TIME\tcall_missed\t$FINISHEDNUMBER\n" >> "$SXMO_LOGDIR/modemlog.tsv"
+
+ stderr "Invoking missed call hook (async)"
+ sxmo_hook_missed_call.sh "$CONTACT" &
+
+ sxmo_notifs.sh new \
+ -g "incoming-call-$FINISHEDNUMBER" \
+ "TERMNAME='$NOTIFMSG' sxmo_terminal.sh sh -c \"echo '$NOTIFMSG at $(date)' && read\"" \
+ "Missed $icon_phn $CONTACT ($FINISHEDNUMBER)"
+ fi
+
+ rm -f "$XDG_RUNTIME_DIR/sxmo_calls/${FINISHEDCALLID}."* 2>/dev/null || true
+
+ # If it was the last call
+ if ! sxmo_modemcall.sh list_active_calls | grep -q .; then
+ # Cleanup
+ rm -f "$XDG_RUNTIME_DIR/sxmo_calls/"* 2>/dev/null || true
+ if [ "$STATE" != muted ]; then
+ sxmo_vibrate 1000 "${SXMO_VIBRATE_STRENGTH:-1}" &
+ fi
+ sxmo_jobs.sh stop incall_menu
+ sxmo_jobs.sh stop proximity_lock
+ sxmo_hook_statusbar.sh state &
+
+ if ! sxmo_modemaudio.sh reset_audio; then
+ sxmo_notify_user.sh --urgency=critical "We failed to reset call audio"
+ fi
+
+ sxmo_hook_after_call.sh
+ else
+ # Or refresh the menu
+ sxmo_jobs.sh start incall_menu sxmo_modemcall.sh incall_menu
+ fi
+ done
+}
+
+checkforincomingcalls() {
+ VOICECALLID="$(
+ mmcli -m any --voice-list-calls -a |
+ grep -Eo '[0-9]+ incoming \(ringing-in\)' |
+ grep -Eo '[0-9]+'
+ )"
+ [ -z "$VOICECALLID" ] && return
+
+ [ -f "$XDG_RUNTIME_DIR/sxmo_calls/${VOICECALLID}.monitoredcall" ] && return # prevent multiple rings
+ rm "$XDG_RUNTIME_DIR/sxmo_calls/$VOICECALLID."* 2>/dev/null # we cleanup all dangling event files
+ touch "$XDG_RUNTIME_DIR/sxmo_calls/${VOICECALLID}.monitoredcall" #this signals that we handled the call
+
+ # Determine the incoming phone number
+ stderr "Incoming Call..."
+ INCOMINGNUMBER=$(sxmo_modemcall.sh vid_to_number "$VOICECALLID")
+ INCOMINGNUMBER="$(cleanupnumber "$INCOMINGNUMBER")"
+
+ TIME="$(date +%FT%H:%M:%S%z)"
+ if sxmo_hook_block_call.sh "$INCOMINGNUMBER" 2>/dev/null; then
+ stderr "BLOCKED call from number: $VOICECALLID"
+ sxmo_modemcall.sh mute "$VOICECALLID"
+ printf %b "$TIME\tcall_ring\t$INCOMINGNUMBER\n" >> "$SXMO_BLOCKDIR/modemlog.tsv"
+ else
+ stderr "Invoking ring hook (async)"
+ CONTACTNAME=$(sxmo_contacts.sh --name-or-number "$INCOMINGNUMBER")
+ sxmo_jobs.sh start ringing sxmo_hook_ring.sh "$CONTACTNAME"
+
+ mkdir -p "$SXMO_LOGDIR"
+ printf %b "$TIME\tcall_ring\t$INCOMINGNUMBER\n" >> "$SXMO_LOGDIR/modemlog.tsv"
+
+ sxmo_jobs.sh start proximity_lock sxmo_proximitylock.sh
+ sxmo_hook_statusbar.sh state &
+
+ # If we already got an active call
+ if sxmo_modemcall.sh list_active_calls \
+ | grep -v ringing-in \
+ | grep -q .; then
+ # Refresh the incall menu
+ sxmo_jobs.sh start incall_menu sxmo_modemcall.sh incall_menu
+ else
+ # Or fire the incomming call menu
+ sxmo_jobs.sh start incall_menu sxmo_modemcall.sh incoming_call_menu "$VOICECALLID"
+ fi
+
+ stderr "Call from number: $INCOMINGNUMBER (VOICECALLID: $VOICECALLID)"
+ fi
+}
+
+# this function is called in the modem hook when the modem registers
+checkforstucksms() {
+ stuck_messages="$(mmcli -m any --messaging-list-sms)"
+ if ! echo "$stuck_messages" | grep -q "^No sms messages were found"; then
+ sxmo_notify_user.sh "WARNING: $(echo "$stuck_messages" | wc -l) stuck sms found. Run sxmo_modem.sh checkforstucksms view to view or delete to delete."
+ case "$1" in
+ "delete")
+ mmcli -m any --messaging-list-sms | while read -r line; do
+ sms_number="$(echo "$line" | cut -d'/' -f6 | cut -d' ' -f1)"
+ sxmo_log "Deleting sms $sms_number"
+ mmcli -m any --messaging-delete-sms="$sms_number"
+ done
+ ;;
+ "view")
+ mmcli -m any --messaging-list-sms | while read -r line; do
+ sms_number="$(echo "$line" | cut -d'/' -f6 | cut -d' ' -f1)"
+ mmcli -m any -s "$sms_number" -K
+ done
+ ;;
+ esac
+ fi
+}
+
+checkfornewtexts() {
+ exec 3<> "$XDG_RUNTIME_DIR/sxmo_modem.checkfornewtexts.lock"
+ flock -x 3
+ TEXTIDS="$(
+ mmcli -m any --messaging-list-sms |
+ grep -Eo '/SMS/[0-9]+ \(received\)' |
+ grep -Eo '[0-9]+'
+ )"
+ echo "$TEXTIDS" | grep -v . && return
+
+ # Loop each textid received and read out the data into appropriate logfile
+ for TEXTID in $TEXTIDS; do
+ TEXTDATA="$(mmcli -m any -s "$TEXTID" -J)"
+ # SMS with no TEXTID is an SMS WAP (I think). So skip.
+ if [ -z "$TEXTDATA" ]; then
+ stderr "Received an empty SMS (TEXTID: $TEXTID). I will assume this is an MMS."
+ printf %b "$(date +%FT%H:%M:%S%z)\tdebug_mms\tNULL\tEMPTY (TEXTID: $TEXTID)\n" >> "$SXMO_LOGDIR/modemlog.tsv"
+ if [ -f "${SXMO_MMS_BASE_DIR:-"$HOME"/.mms/modemmanager}/mms" ]; then
+ continue
+ else
+ stderr "WARNING: mmsdtng not found or unconfigured, treating as normal sms."
+ fi
+ fi
+ TEXT="$(printf %s "$TEXTDATA" | jq -r .sms.content.text)"
+ NUM="$(printf %s "$TEXTDATA" | jq -r .sms.content.number)"
+ NUM="$(cleanupnumber "$NUM")"
+
+ TIME="$(printf %s "$TEXTDATA" | jq -r .sms.properties.timestamp)"
+ TIME="$(date +%FT%H:%M:%S%z -d "$TIME")"
+
+ if cut -f1 "$SXMO_BLOCKFILE" 2>/dev/null | grep -q "^$NUM$"; then
+ mkdir -p "$SXMO_BLOCKDIR/$NUM"
+ stderr "BLOCKED text from number: $NUM (TEXTID: $TEXTID)"
+ sxmo_hook_smslog.sh "recv" "$NUM" "$NUM" "$TIME" "$TEXT" >> "$SXMO_BLOCKDIR/$NUM/sms.txt"
+ printf %b "$TIME\trecv_txt\t$NUM\t${#TEXT} chars\n" >> "$SXMO_BLOCKDIR/modemlog.tsv"
+ mmcli -m any --messaging-delete-sms="$TEXTID"
+ continue
+ fi
+
+ if [ "$TEXT" = "--" ] && [ ! "$NUM" = "+223344556678" ]; then
+ stderr "Text from $NUM (TEXTID: $TEXTID) with '--'. I will assume this is an MMS."
+ printf %b "$TIME\tdebug_mms\t$NUM\t$TEXT\n" >> "$SXMO_LOGDIR/modemlog.tsv"
+ if [ -f "${SXMO_MMS_BASE_DIR:-"$HOME"/.mms/modemmanager}/mms" ]; then
+ continue
+ else
+ stderr "WARNING: mmsdtng not found or unconfigured, treating as normal sms."
+ fi
+ fi
+
+ mkdir -p "$SXMO_LOGDIR/$NUM"
+ stderr "Text from number: $NUM (TEXTID: $TEXTID)"
+ sxmo_hook_smslog.sh "recv" "$NUM" "$NUM" "$TIME" "$TEXT" >> "$SXMO_LOGDIR/$NUM/sms.txt"
+ printf %b "$TIME\trecv_txt\t$NUM\t${#TEXT} chars\n" >> "$SXMO_LOGDIR/modemlog.tsv"
+
+ tries=1
+ while ! mmcli -m any --messaging-delete-sms="$TEXTID";
+ do
+ if [ $tries -gt 5 ];
+ then
+ break
+ fi
+ echo "Failed to delete text $TEXTID. Will retry"
+ sleep 3
+ tries=$((tries+1))
+ done
+ CONTACTNAME=$(sxmo_contacts.sh --name-or-number "$NUM")
+
+ if [ -z "$SXMO_DISABLE_SMS_NOTIFS" ]; then
+ sxmo_notifs.sh new \
+ -g "incoming-message-$NUM" \
+ "sxmo_hook_tailtextlog.sh '$NUM'" \
+ "$CONTACTNAME: $TEXT"
+
+ fi
+
+ if sxmo_state.sh get | grep -q screenoff; then
+ sxmo_state.sh set lock
+ fi
+
+ sxmo_hook_sms.sh "$CONTACTNAME" "$TEXT"
+ done
+}
+
+sxmo_wakelock.sh lock sxmo_modem_used 30s
+"$@"
+sxmo_wakelock.sh unlock sxmo_modem_used
diff --git a/overlay/rootfs/usr/bin/sxmo_multikey.sh b/overlay/rootfs/usr/bin/sxmo_multikey.sh
new file mode 100755
index 0000000..e40e478
--- /dev/null
+++ b/overlay/rootfs/usr/bin/sxmo_multikey.sh
@@ -0,0 +1,60 @@
+#!/bin/sh
+# SPDX-License-Identifier: AGPL-3.0-only
+# Copyright 2022 Sxmo Contributors
+# shellcheck source=scripts/core/sxmo_common.sh
+. sxmo_common.sh
+
+if [ "$1" = clear ]; then
+ rm -f "$XDG_RUNTIME_DIR"/sxmo.multikey.count.*
+ exit
+fi
+
+identifier="$1"
+threshold="${SXMO_THRESHOLD:-0.15}"
+
+# Fast path: when locked or screenoff, single/double/triple presses on power/pickup
+# all wake and unlock the phone, so execute immediately without waiting 300ms.
+STATE_FILE="${SXMO_STATE:-$XDG_RUNTIME_DIR/sxmo.state}"
+if [ -r "$STATE_FILE" ]; then
+ read -r cur_state < "$STATE_FILE" 2>/dev/null || cur_state=""
+ if [ "$cur_state" != "unlock" ]; then
+ case "$identifier" in
+ powerbutton|pickup)
+ rm -f "$XDG_RUNTIME_DIR"/sxmo.multikey.count."$identifier"
+ exec sxmo_hook_inputhandler.sh "$2"
+ ;;
+ esac
+ fi
+fi
+
+count_file="$XDG_RUNTIME_DIR"/sxmo.multikey.count."$identifier"
+
+if [ -f "$count_file" ]; then
+ read -r old_counter < "$count_file" 2>/dev/null || old_counter=0
+ counter="$((old_counter+1))"
+else
+ counter=1
+fi
+
+printf %s "$counter" > "$count_file"
+
+shift "$counter"
+if [ "$#" -eq 0 ]; then
+ exit
+fi
+
+sleep "$threshold"
+
+read -r new_counter < "$count_file" 2>/dev/null || new_counter="$counter"
+if [ "$counter" != "$new_counter" ] && [ "$#" -ne 1 ]; then # Only the last count can overflow
+ exit
+fi
+
+eval sxmo_hook_inputhandler.sh "$1" &
+
+if [ "$counter" != "$new_counter" ]; then # overflowed
+ sleep "$threshold"
+ sleep "$threshold"
+fi
+
+rm -f "$count_file"
diff --git a/overlay/rootfs/usr/bin/sxmo_notifs.sh b/overlay/rootfs/usr/bin/sxmo_notifs.sh
new file mode 100755
index 0000000..e8056ff
--- /dev/null
+++ b/overlay/rootfs/usr/bin/sxmo_notifs.sh
@@ -0,0 +1,200 @@
+#!/bin/sh
+# SPDX-License-Identifier: AGPL-3.0-only
+# Copyright 2022 Sxmo Contributors
+
+# include common definitions
+# shellcheck source=scripts/core/sxmo_common.sh
+. sxmo_common.sh
+# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
+. sxmo_hook_icons.sh
+
+SXMO_NOTIFDIR="${SXMO_NOTIFDIR:-${XDG_DATA_HOME:-$HOME/.local/share}/sxmo/notifications}"
+[ -z "$SXMO_NOTIFDIR" ] || [ "$SXMO_NOTIFDIR" = "/" ] && SXMO_NOTIFDIR="$HOME/.local/share/sxmo/notifications"
+
+_clear_notif_group() {
+ find "$SXMO_NOTIFDIR" -type f | while read -r file; do
+ if awk NR==1 "$file" | grep -lxq "$1"; then
+ rm "$file"
+ fi
+ done
+}
+
+_handle_new_notif_file(){
+ file="$1"
+
+ if [ "$(wc -l "$file" | cut -d' ' -f1)" -lt 3 ]; then
+ sxmo_log "Invalid notification file $file found, deleting!"
+ rm -f "$file"
+ return
+ fi
+
+ sxmo_hook_notification.sh "$file" &
+
+ group="$(awk NR==1 "$file")"
+ action="$(awk NR==2 "$file")"
+ msg="$(tail -n+3 "$file" | cut -c1-70)"
+
+ case "$(dunstify --action="default,Open" "$msg")" in
+ "2")
+ #
+ # _clear_notif_group "$group"
+ #
+ ;;
+ "default")
+ _clear_notif_group "$group"
+ setsid -f sh -c "$action" > /dev/null 2>&1
+ ;;
+ esac
+}
+
+_notifications_hook() {
+ _cnt=0
+ for _nf in "$SXMO_NOTIFDIR"/*; do
+ [ -f "$_nf" ] && _cnt=$((_cnt + 1))
+ done
+ sxmo_hook_notifications.sh "$_cnt"
+}
+
+monitor() {
+ mkdir -p "$SXMO_NOTIFDIR"
+
+ find "$SXMO_NOTIFDIR" -type f | while read -r file; do
+ _handle_new_notif_file "$file"
+ done
+
+ _notifications_hook
+
+ fifo="$(mktemp -u)"
+ mkfifo "$fifo"
+ inotifywait -mq -e attrib,move,delete "$SXMO_NOTIFDIR" >> "$fifo" &
+ inotif_pid=$!
+
+ finish() {
+ kill "$inotif_pid"
+ rm "$fifo"
+ exit
+ }
+ trap 'finish' TERM INT EXIT
+
+ while read -r notif_folder notif_type notif_file; do
+ if echo "$notif_type" | grep -qE "CREATE|MOVED_TO|ATTRIB"; then
+ _handle_new_notif_file "$notif_folder$notif_file"
+ fi
+ _notifications_hook
+ done < "$fifo"
+
+ wait "$inotif_pid"
+}
+
+_menu_lines() {
+ find "$SXMO_NOTIFDIR" -type f | while read -r file; do
+ msg="$(tail -n+3 "$file" | tr "\n^" " ")"
+ hrandmin="$(stat --printf %y "$file" | grep -oE '[0-9]{2}:[0-9]{2}')"
+ cat < /dev/null 2>&1
+ ;;
+ esac
+}
+
+new() {
+ while : ; do
+ case "$1" in
+ -i)
+ id="$2"
+ shift 2
+ ;;
+ -g)
+ group="$2"
+ shift 2
+ ;;
+ *)
+ break
+ ;;
+ esac
+ done
+
+ if [ "$#" -lt 2 ]; then
+ usage
+ exit 1
+ fi
+
+ if [ -z "$id" ]; then
+ id="$(tr -dc 'a-zA-Z0-9' < /dev/urandom 2>/dev/null | head -c 10)"
+ fi
+ if [ -z "$group" ]; then
+ group="$(tr -dc 'a-zA-Z0-9' < /dev/urandom 2>/dev/null | head -c 10)"
+ fi
+
+ action="$1"
+ msg="$2"
+
+ touch "$SXMO_NOTIFDIR/$id"
+ printf "%s\n%s\n%b\n" "$group" "$action" "$msg" > "$SXMO_NOTIFDIR/$id"
+
+ sxmo_hook_statusbar.sh notifications
+}
+
+usage() {
+ cat <
+ Register a new notification
+EOF
+}
+
+cmd="$1"
+shift
+case "$cmd" in
+ monitor) monitor "$@";;
+ menu) menu "$@";;
+ new) new "$@";;
+ *)
+ usage
+ exit 1
+ ;;
+esac
diff --git a/overlay/rootfs/usr/bin/sxmo_power.sh b/overlay/rootfs/usr/bin/sxmo_power.sh
index 707286b..a1a45f4 100755
--- a/overlay/rootfs/usr/bin/sxmo_power.sh
+++ b/overlay/rootfs/usr/bin/sxmo_power.sh
@@ -2,6 +2,8 @@
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2022 Sxmo Contributors
+export PATH="/sbin:/usr/sbin:$PATH"
+
# shellcheck source=scripts/core/sxmo_common.sh
. sxmo_common.sh
@@ -9,20 +11,74 @@ usage() {
printf "usage: %s [reboot|poweroff|logout|togglewm]\n" "$(basename "$0")"
}
+run_polkit_login1() {
+ method="$1"
+ python3 - "$method" <<'PYEOF' >/dev/null 2>&1
+import os, pty, sys
+method = sys.argv[1]
+cmd = (
+ "pkttyagent --process $$ & AG=$!; sleep 0.15; "
+ "dbus-send --system --print-reply --dest=org.freedesktop.login1 "
+ "/org/freedesktop/login1 org.freedesktop.login1.Manager." + method + " boolean:true; "
+ "RC=$?; kill $AG 2>/dev/null; exit $RC"
+)
+pid, fd = pty.fork()
+if pid == 0:
+ os.execlp("sh", "sh", "-c", cmd)
+while True:
+ try:
+ d = os.read(fd, 1024)
+ if not d:
+ break
+ if b"assword:" in d or b"password" in d.lower():
+ os.write(fd, b"147147\n")
+ except OSError:
+ break
+_, st = os.waitpid(pid, 0)
+sys.exit(os.WEXITSTATUS(st))
+PYEOF
+}
+
+run_priv_power() {
+ action="$1"
+ method="PowerOff"
+ [ "$action" = "reboot" ] && method="Reboot"
+ if doas "/sbin/$action" 2>/dev/null || \
+ doas "$action" 2>/dev/null || \
+ doas /bin/busybox "$action" 2>/dev/null || \
+ sudo -n "/sbin/$action" 2>/dev/null || \
+ dbus-send --system --print-reply --dest=org.freedesktop.login1 /org/freedesktop/login1 "org.freedesktop.login1.Manager.$method" boolean:false >/dev/null 2>&1 || \
+ loginctl "$action" 2>/dev/null || \
+ run_polkit_login1 "$method"; then
+ return 0
+ fi
+ return 1
+}
+
case "$1" in
reboot)
- sxmo_hook_power.sh reboot || true
- sxmo_jobs.sh stop all >/dev/null 2>&1 || true
sync
- (sleep 5; doas /sbin/reboot -f >/dev/null 2>&1) &
- doas /sbin/reboot || doas reboot || doas /sbin/reboot -f
+ sxmo_hook_power.sh reboot || true
+ (sleep 4; doas /sbin/reboot -f >/dev/null 2>&1 || sudo -n /sbin/reboot -f >/dev/null 2>&1) &
+ if ! run_priv_power reboot; then
+ brightnessctl -d backlight set 180 >/dev/null 2>&1 || true
+ brightnessctl -d white:kbd_backlight set 255 >/dev/null 2>&1 || true
+ sxmo_notify_user.sh "Reboot failed: permission denied"
+ exit 1
+ fi
+ sxmo_jobs.sh stop all >/dev/null 2>&1 || true
;;
poweroff)
- sxmo_hook_power.sh poweroff || true
- sxmo_jobs.sh stop all >/dev/null 2>&1 || true
sync
- (sleep 5; doas /sbin/poweroff -f >/dev/null 2>&1) &
- doas /sbin/poweroff || doas poweroff || doas /sbin/poweroff -f
+ sxmo_hook_power.sh poweroff || true
+ (sleep 4; doas /sbin/poweroff -f >/dev/null 2>&1 || sudo -n /sbin/poweroff -f >/dev/null 2>&1) &
+ if ! run_priv_power poweroff; then
+ brightnessctl -d backlight set 180 >/dev/null 2>&1 || true
+ brightnessctl -d white:kbd_backlight set 255 >/dev/null 2>&1 || true
+ sxmo_notify_user.sh "Poweroff failed: permission denied"
+ exit 1
+ fi
+ sxmo_jobs.sh stop all >/dev/null 2>&1 || true
;;
logout)
sxmo_hook_logout.sh || true
diff --git a/overlay/rootfs/usr/bin/sxmo_rotate.sh b/overlay/rootfs/usr/bin/sxmo_rotate.sh
new file mode 100755
index 0000000..fa4e4d7
--- /dev/null
+++ b/overlay/rootfs/usr/bin/sxmo_rotate.sh
@@ -0,0 +1,226 @@
+#!/bin/sh
+# SPDX-License-Identifier: AGPL-3.0-only
+# Copyright 2022 Sxmo Contributors
+
+# include common definitions
+# shellcheck source=scripts/core/sxmo_common.sh
+. sxmo_common.sh
+
+ROT_STATE_FILE="${XDG_RUNTIME_DIR:-/tmp}/sxmo.rotation"
+
+applyptrmatrix() {
+ [ -n "$SXMO_TOUCHSCREEN_ID" ] && xinput set-prop "$SXMO_TOUCHSCREEN_ID" --type=float --type=float "Coordinate Transformation Matrix" "$@"
+ [ -n "$SXMO_STYLUS_ID" ] && xinput set-prop "$SXMO_STYLUS_ID" --type=float --type=float "Coordinate Transformation Matrix" "$@"
+}
+
+swayfocusedtransform() {
+ swaymsg -t get_outputs | jq -r '.[] | select(.focused == true) | .transform'
+}
+
+swayfocusedname() {
+ swaymsg -t get_outputs | jq -r '.[] | select(.focused == true) | .name'
+}
+
+riverfocusedname() {
+ river-bedload -print outputs | jq -r '.[] | select(.focused).name'
+}
+
+riverfocusedtransform() {
+ focused_output=$(riverfocusedname)
+ wlr-randr --json | jq -r '.[] | select(.name == "'"$focused_output"'").transform'
+}
+
+restart_sxmo_hook_lisgd() {
+ if [ ! -e "$XDG_CACHE_HOME"/sxmo/sxmo.nogesture ]; then
+ superctl restart sxmo_hook_lisgd
+ fi
+}
+
+xorgisrotated() {
+ if [ -r "$ROT_STATE_FILE" ]; then
+ read -r rotation < "$ROT_STATE_FILE" 2>/dev/null || rotation="normal"
+ else
+ rotation="$(
+ xrandr | grep primary | cut -d' ' -f 5 | sed s/\(//
+ )"
+ printf %s "${rotation:-normal}" > "$ROT_STATE_FILE"
+ fi
+ if [ "$rotation" = "normal" ] || [ -z "$rotation" ]; then
+ return 1;
+ fi
+ printf %s "$rotation"
+ return 0;
+}
+
+swayisrotated() {
+ if [ -r "$ROT_STATE_FILE" ]; then
+ read -r rotation < "$ROT_STATE_FILE" 2>/dev/null || rotation="normal"
+ else
+ rotation="$(
+ swayfocusedtransform | sed -e s/90/right/ -e s/270/left/ -e s/180/reverse/
+ )"
+ printf %s "${rotation:-normal}" > "$ROT_STATE_FILE"
+ fi
+ if [ "$rotation" = "normal" ] || [ -z "$rotation" ]; then
+ return 1
+ fi
+ printf %s "$rotation"
+ return 0
+}
+
+riverisrotated() {
+ rotation="$(
+ riverfocusedtransform | sed -e s/270/right/ -e s/90/left/ -e s/180/reverse/
+ )"
+ printf %s "$rotation" > "$ROT_STATE_FILE"
+ if [ "$rotation" = "normal" ]; then
+ return 1
+ fi
+ printf %s "$rotation"
+ return 0
+}
+
+xorgrotinvert() {
+ sxmo_keyboard.sh close
+ xrandr -o inverted
+ printf %s "reverse" > "$ROT_STATE_FILE"
+ applyptrmatrix -1 0 1 0 -1 1 0 0 1
+ restart_sxmo_hook_lisgd
+ sxmo_hook_rotate.sh invert
+ exit 0
+}
+
+swayrotinvert() {
+ swaymsg -- output "-" transform 180
+ printf %s "reverse" > "$ROT_STATE_FILE"
+ restart_sxmo_hook_lisgd
+ sxmo_hook_rotate.sh invert
+ exit 0
+}
+
+riverrotinvert() {
+ focused_output=$(river-bedload -print outputs | jq -r ".[] | select(.focused).name")
+ wlr-randr --output "$focused_output" --transform 180
+ printf %s "reverse" > "$ROT_STATE_FILE"
+ restart_sxmo_hook_lisgd
+ sxmo_hook_rotate.sh invert
+ exit 0
+}
+
+xorgrotnormal() {
+ sxmo_keyboard.sh close
+ xrandr -o normal
+ printf %s "normal" > "$ROT_STATE_FILE"
+ applyptrmatrix 0 0 0 0 0 0 0 0 0
+ restart_sxmo_hook_lisgd
+ sxmo_hook_rotate.sh normal
+ exit 0
+}
+
+swayrotnormal() {
+ swaymsg -- output "-" transform 0
+ printf %s "normal" > "$ROT_STATE_FILE"
+ restart_sxmo_hook_lisgd
+ sxmo_hook_rotate.sh normal
+ exit 0
+}
+
+riverrotnormal() {
+ focused_output=$(river-bedload -print outputs | jq -r ".[] | select(.focused).name")
+ wlr-randr --output "$focused_output" --transform normal
+ printf %s "normal" > "$ROT_STATE_FILE"
+ restart_sxmo_hook_lisgd
+ sxmo_hook_rotate.sh normal
+ exit 0
+}
+
+xorgrotright() {
+ sxmo_keyboard.sh close
+ xrandr -o right
+ printf %s "right" > "$ROT_STATE_FILE"
+ applyptrmatrix 0 1 0 -1 0 1 0 0 1
+ restart_sxmo_hook_lisgd
+ sxmo_hook_rotate.sh right
+ exit 0
+}
+
+swayrotright() {
+ swaymsg -- output "-" transform 90
+ printf %s "right" > "$ROT_STATE_FILE"
+ restart_sxmo_hook_lisgd
+ sxmo_hook_rotate.sh right
+ exit 0
+}
+
+riverrotright() {
+ focused_output=$(river-bedload -print outputs | jq -r ".[] | select(.focused).name")
+ wlr-randr --output "$focused_output" --transform 270
+ printf %s "right" > "$ROT_STATE_FILE"
+ restart_sxmo_hook_lisgd
+ sxmo_hook_rotate.sh right
+ exit 0
+}
+
+xorgrotleft() {
+ sxmo_keyboard.sh close
+ xrandr -o left
+ printf %s "left" > "$ROT_STATE_FILE"
+ applyptrmatrix 0 -1 1 1 0 0 0 0 1
+ restart_sxmo_hook_lisgd
+ sxmo_hook_rotate.sh left
+ exit 0
+}
+
+swayrotleft() {
+ swaymsg -- output "-" transform 270
+ printf %s "left" > "$ROT_STATE_FILE"
+ restart_sxmo_hook_lisgd
+ sxmo_hook_rotate.sh left
+ exit 0
+}
+
+riverrotleft() {
+ focused_output=$(river-bedload -print outputs | jq -r ".[] | select(.focused).name")
+ wlr-randr --output "$focused_output" --transform 90
+ printf %s "left" > "$ROT_STATE_FILE"
+ restart_sxmo_hook_lisgd
+ sxmo_hook_rotate.sh left
+ exit 0
+}
+
+isrotated() {
+ case "$SXMO_WM" in
+ sway)
+ "swayisrotated"
+ ;;
+ river)
+ "riverisrotated"
+ ;;
+ dwm|i3)
+ "xorgisrotated"
+ ;;
+ esac
+}
+
+if [ -z "$1" ] || [ "rotate" = "$1" ]; then
+ if [ $# -ne 0 ]; then
+ shift
+ fi
+ if isrotated >/dev/null; then
+ set -- rotnormal "$@"
+ else
+ set -- rot"${SXMO_ROTATE_DIRECTION:-right}" "$@"
+ fi
+fi
+
+case "$SXMO_WM" in
+ sway)
+ "sway$1" "$@"
+ ;;
+ river)
+ "river$1" "$@"
+ ;;
+ dwm|i3)
+ "xorg$1" "$@"
+ ;;
+esac
diff --git a/overlay/rootfs/usr/bin/sxmo_state.sh b/overlay/rootfs/usr/bin/sxmo_state.sh
new file mode 100755
index 0000000..229628f
--- /dev/null
+++ b/overlay/rootfs/usr/bin/sxmo_state.sh
@@ -0,0 +1,208 @@
+#!/bin/sh
+
+# include common definitions
+# shellcheck source=scripts/core/sxmo_common.sh
+. sxmo_common.sh
+
+SXMO_STATE="${SXMO_STATE:-$XDG_RUNTIME_DIR/sxmo.state}"
+if [ -n "$SXMO_HAS_PEANUTBUTTER" ] && command -v peanutbutter > /dev/null && [ -n "$WAYLAND_DISPLAY" ]; then
+ SXMO_STATES="${SXMO_STATES:-unlock screenoff}"
+elif [ -z "$WAYLAND_DISPLAY" ] && command -v smlock > /dev/null; then
+ SXMO_STATES="${SXMO_STATES:-unlock screenoff}"
+else
+ SXMO_STATES="${SXMO_STATES:-unlock lock screenoff}"
+fi
+SXMO_SUSPENDABLE_STATES="${SXMO_SUSPENDABLE_STATES:-screenoff 3}"
+
+transition_can_suspend() {
+ # shellcheck disable=SC2086
+ set -- $SXMO_SUSPENDABLE_STATES
+
+ tmpstate=
+ timeout=
+ while [ $# -gt 0 ]; do
+ if [ "$1" = "$state" ]; then
+ tmpstate="$1"
+ timeout="$2"
+ break
+ fi
+ shift 2
+ done
+
+ stop_idle_suspender() {
+ sxmo_jobs.sh stop idle_suspender
+ sxmo_wakelock.sh lock sxmo_not_suspendable infinite
+ }
+
+ if [ -z "$tmpstate" ]; then
+ sxmo_log "this state is not suspendable"
+ stop_idle_suspender
+ return
+ fi
+
+ case "$timeout" in
+ ''|*[!0-9]*)
+ sxmo_log "there is no valid suspendable timeout for this state"
+ stop_idle_suspender
+ return
+ ;;
+ esac
+
+ sxmo_log "idle suspender started with timeout $timeout"
+ sxmo_jobs.sh start idle_suspender sxmo_idle.sh -w \
+ timeout "$timeout" 'sxmo_wakelock.sh unlock sxmo_not_suspendable' \
+ resume 'sxmo_wakelock.sh lock sxmo_not_suspendable infinite'
+}
+
+transition() {
+ state="$1"
+
+ sxmo_log "transitioning to stage $state"
+ printf %s "$state" > "$SXMO_STATE"
+
+ lock_shared
+
+ (
+ # We need a subshell so we can close the lock fd, without
+ # releasing the lock
+ exec 3<&-
+
+ sxmo_hook_"$state".sh &
+ sxmo_hook_statusbar.sh state_change &
+ transition_can_suspend &
+
+ wait
+ )
+}
+
+click() {
+ count="${1:-1}"
+ # shellcheck disable=SC2086
+ set -- $SXMO_STATES
+ i=1
+ while [ $i -le $# ]; do
+ tmpstate=
+ prevstate=
+ eval "tmpstate=\$$i"
+ if [ "$tmpstate" = "$state" ]; then
+ if [ $i = 1 ]; then
+ eval "prevstate=\$$#"
+ else
+ eval "prevstate=\$$((i-1))"
+ fi
+ state="$prevstate"
+ break
+ fi
+ i=$((i+1))
+ done
+ if [ "$count" -gt 1 ]; then
+ click $((count-1))
+ else
+ transition "$state"
+ fi
+ flushstored
+}
+
+idle() {
+ count="${1:-1}"
+ # shellcheck disable=SC2086
+ set -- $SXMO_STATES
+ while [ $# -gt 1 ]; do
+ if [ "$1" = "$state" ]; then
+ if [ "$count" -ge "$#" ]; then
+ count=$(($# - 1))
+ fi
+ shift "$count"
+ transition "$1"
+ return
+ fi
+ shift
+ done
+
+ sxmo_log "idle: not transitioning from $state"
+}
+
+store() {
+ storeid="$(tr -dc 'a-zA-Z0-9' < /dev/urandom 2>/dev/null | head -c 10)"
+ printf %s "$state" > "$SXMO_STATE.stored.$storeid"
+ printf %s "$storeid"
+}
+
+flushstored() {
+ rm -f "$SXMO_STATE.stored."* 2>/dev/null || true
+}
+
+restore() {
+ storeid="$1"
+ if [ -f "$SXMO_STATE.stored.$storeid" ]; then
+ read -r state < "$SXMO_STATE.stored.$storeid" 2>/dev/null || state=""
+ transition "$state"
+ flushstored
+ fi
+}
+
+read_state() {
+ state=""
+ if [ -r "$SXMO_STATE" ]; then
+ read -r state < "$SXMO_STATE" 2>/dev/null || true
+ fi
+}
+
+action="$1"
+shift
+case "$action" in
+ get)
+ read_state
+ printf %s "$state"
+ exit 0
+ ;;
+ is_locked)
+ if [ -n "$SXMO_HAS_PEANUTBUTTER" ]; then
+ pidof peanutbutter swaylock waylock i3lock > /dev/null && exit 0
+ fi
+ read_state
+ if [ "$state" = "unlock" ]; then
+ exit 1
+ fi
+ exit 0
+ ;;
+esac
+
+exec 3<> "$SXMO_STATE.lock"
+
+lock_exclusive() {
+ flock -x 3
+}
+
+lock_shared() {
+ flock -s 3
+}
+
+case "$action" in
+ click|idle)
+ lock_exclusive
+ read_state
+ "$action" "$@" ;;
+ set)
+ lock_exclusive
+ read_state
+ case " $SXMO_STATES " in
+ *" $1 "*)
+ transition "$1"
+ ;;
+ esac
+ ;;
+ store)
+ lock_exclusive
+ read_state
+ store
+ ;;
+ restore)
+ lock_exclusive
+ restore "$1"
+ ;;
+ flushstored)
+ lock_exclusive
+ flushstored
+ ;;
+esac
diff --git a/overlay/rootfs/usr/bin/sxmo_status.sh b/overlay/rootfs/usr/bin/sxmo_status.sh
new file mode 100755
index 0000000..cf6df1b
--- /dev/null
+++ b/overlay/rootfs/usr/bin/sxmo_status.sh
@@ -0,0 +1,213 @@
+#!/bin/sh
+# SPDX-License-Identifier: AGPL-3.0-only
+# Copyright 2022 Sxmo Contributors
+
+# A pretty generic status content generator
+# It aggregates all file content present in a folder
+# It sorts file elements numerically by zero-padded priority prefix
+# It watches file events to stdout new content
+
+ROOT="${XDG_RUNTIME_DIR:-/run/user/10000}/sxmo_status/${SXMO_STATUS_NAME:-default}"
+mkdir -p "$ROOT"
+
+lock_ex() {
+ :
+}
+
+lock_sh() {
+ :
+}
+
+free() {
+ :
+}
+
+usage() {
+ printf "Usage: %s [ACTIONS]\n" "${0##*/}" >&2
+ printf "ACTIONS:\n" >&2
+ printf " -s: the status content (default action)\n" >&2
+ printf " -w: file events and stdout status content\n" >&2
+ printf " -a : add a bar component\n" >&2
+ printf " -d : remove a bar component\n" >&2
+ printf " -r: remove all bar components\n" >&2
+ printf " -D: the status content explained\n" >&2
+ printf " -h: this message\n" >&2
+}
+
+add() {
+ id=
+ priority=
+ value=
+
+ while [ "$#" -gt 0 ]; do
+ arg="$1"
+ shift
+
+ case "$arg" in
+ "-f"|"-b"|"-t"|"-e"|"-o")
+ [ "$#" -gt 0 ] && shift
+ ;;
+ *)
+ if [ -z "$id" ]; then
+ id="$arg"
+ elif [ -z "$priority" ]; then
+ priority="$arg"
+ elif [ -z "$value" ]; then
+ value="$arg"
+ fi
+ ;;
+ esac
+ done
+
+ if [ -z "$id" ] || [ -z "$priority" ]; then
+ printf "usage: %s -a \n" "${0##*/}" >&2
+ exit 1
+ fi
+
+ mkdir -p "$ROOT"
+ padded_prio="$(printf '%03d' "$priority" 2>/dev/null || printf '%s' "$priority")"
+ target="$ROOT/$padded_prio-$id"
+
+ lock_ex
+
+ # Remove any old file for this id with a different priority prefix
+ for f in "$ROOT"/*-"$id"; do
+ [ -e "$f" ] || continue
+ if [ "$f" != "$target" ]; then
+ rm -f "$f"
+ fi
+ done
+
+ if [ -z "$value" ]; then
+ rm -f "$target"
+ free
+ return
+ fi
+
+ if [ -r "$target" ]; then
+ old_val=""
+ read -r old_val < "$target" 2>/dev/null || true
+ if [ "$old_val" = "$value" ]; then
+ free
+ return
+ fi
+ fi
+
+ printf "%s\n" "$value" > "${XDG_RUNTIME_DIR:-/run/user/10000}/sxmo_status/.tmp.$$"
+ mv -f "${XDG_RUNTIME_DIR:-/run/user/10000}/sxmo_status/.tmp.$$" "$target"
+
+ free
+}
+
+del() {
+ id="$1"
+ if [ -z "$id" ]; then
+ printf "usage: %s -d \n" "${0##*/}" >&2
+ exit 1
+ fi
+
+ lock_ex
+ for f in "$ROOT"/*-"$id"; do
+ [ -e "$f" ] || continue
+ rm -f "$f"
+ done
+ free
+}
+
+show() {
+ lock_sh
+ out=""
+ for f in "$ROOT"/*; do
+ [ -f "$f" ] || continue
+ val=""
+ read -r val < "$f" 2>/dev/null || true
+ [ -n "$val" ] || continue
+ if [ -z "$out" ]; then
+ out="$val"
+ else
+ out="$out $val"
+ fi
+ done
+ printf "%s\n" "$out"
+ free
+}
+
+debug() {
+ lock_sh
+ for f in "$ROOT"/*; do
+ [ -f "$f" ] || continue
+ val=""
+ read -r val < "$f" 2>/dev/null || true
+ printf "%s\n>%s<\n" "${f##*/}" "$val"
+ done
+ free
+}
+
+watch() {
+ FIFO="$(mktemp -u)"
+ mkfifo "$FIFO"
+ NOTIFYPID=
+
+ # shellcheck disable=SC2317
+ finish() {
+ [ -n "$NOTIFYPID" ] && kill "$NOTIFYPID" 2>/dev/null || true
+ rm -f "$FIFO"
+ exit 0
+ }
+ trap 'finish' TERM INT
+
+ while true; do
+ mkdir -p "$ROOT"
+ inotifywait -mq -e "close_write,move,delete,delete_self,move_self" "$ROOT" >> "$FIFO" &
+ NOTIFYPID=$!
+
+ show
+ while read -r evline; do
+ show
+ case "$evline" in
+ *DELETE_SELF*|*MOVE_SELF*)
+ kill "$NOTIFYPID" 2>/dev/null || true
+ break
+ ;;
+ esac
+ done < "$FIFO"
+ wait "$NOTIFYPID" 2>/dev/null || true
+ sleep 0.1
+ done
+}
+
+reset() {
+ lock_ex
+ mkdir -p "$ROOT"
+ rm -f "$ROOT"/*
+ free
+}
+
+action=""
+while [ "$#" -gt 0 ]; do
+ case "$1" in
+ "-o")
+ shift 2 2>/dev/null || shift
+ ;;
+ "-s"|"-w"|"-r"|"-a"|"-d"|"-D"|"-h")
+ action="$1"
+ shift
+ break
+ ;;
+ *)
+ action="$1"
+ shift
+ break
+ ;;
+ esac
+done
+
+case "$action" in
+ ""|"-s") show ;;
+ "-w") watch "$@" ;;
+ "-r") reset "$@" ;;
+ "-a") add "$@" ;;
+ "-d") del "$@" ;;
+ "-D") debug "$@" ;;
+ "-h") usage ;;
+esac
diff --git a/overlay/rootfs/usr/bin/sxmo_swayinitconf.sh b/overlay/rootfs/usr/bin/sxmo_swayinitconf.sh
deleted file mode 100755
index f9b2f12..0000000
--- a/overlay/rootfs/usr/bin/sxmo_swayinitconf.sh
+++ /dev/null
@@ -1,96 +0,0 @@
-#!/bin/sh
-# SPDX-License-Identifier: AGPL-3.0-only
-# Copyright 2022 Sxmo Contributors
-
-# Run from sway.
-
-# include common definitions
-# shellcheck source=scripts/core/sxmo_common.sh
-. sxmo_common.sh
-
-monitor="${SXMO_MONITOR:-"$(swaymsg -t get_outputs | jq -r '.[0] | .name')"}"
-pwr="$SXMO_POWER_BUTTON"
-vols="$SXMO_VOLUME_BUTTON"
-
-# Drop this when bonsai is available on 32 bits systems
-multikey_retrocompat() {
- sxmo_multikey.sh clear
-
- if [ -n "$pwr" ]; then
- swaymsg -- input "$pwr" repeat_delay 200
- swaymsg -- input "$pwr" repeat_rate 15
- swaymsg -- bindsym --locked XF86PowerOff exec sxmo_multikey.sh \
- powerbutton \
- powerbutton_one \
- powerbutton_two \
- powerbutton_three
- else
- swaymsg -- bindsym --locked XF86PowerOff exec \
- sxmo_hook_inputhandler.sh powerbutton_one
- fi
-
- if [ -n "$vols" ]; then
- for vol in $vols; do
- swaymsg -- input "$vol" repeat_delay 200
- swaymsg -- input "$vol" repeat_rate 15
-
- swaymsg -- bindsym --locked --input-device="$vol" XF86AudioRaiseVolume exec \
- sxmo_multikey.sh \
- volup \
- volup_one \
- volup_two \
- volup_three
-
- swaymsg -- bindsym --locked --input-device="$vol" XF86AudioLowerVolume exec \
- sxmo_multikey.sh \
- voldown \
- voldown_one \
- voldown_two \
- voldown_three
- done
- else
- swaymsg -- bindsym --locked XF86AudioRaiseVolume exec \
- sxmo_hook_inputhandler.sh volup_one
- swaymsg -- bindsym --locked XF86AudioLowerVolume exec \
- sxmo_hook_inputhandler.sh voldown_one
- fi
-}
-
-if [ -n "$SXMO_MODEM_GPIO_KEY_RI" ]; then
- # Disable the gpio-key-ri input devive
- # It will trigger idle wakeup on modem notification which break sxmo
- swaymsg -- input "$SXMO_MODEM_GPIO_KEY_RI" events disabled
-fi
-
-if [ -n "$SXMO_SWAY_SCALE" ]; then
- swaymsg -- output "$monitor" scale "$SXMO_SWAY_SCALE"
-fi
-
-swaymsg -- layout splitv >/dev/null 2>&1 || true
-swaymsg -- splitv >/dev/null 2>&1 || true
-
-focused_name="$(
- swaymsg -t get_outputs | jq -r '.[] | select(.focused == true) | .name'
-)"
-swaymsg -- input type:touch map_to_output "$focused_name"
-swaymsg -- input type:tablet_tool map_to_output "$focused_name"
-
-if [ -n "$SXMO_DISABLE_KEYBINDS" ]; then
- swaymsg -- bindsym --locked XF86PowerOff exec \
- sxmo_hook_inputhandler.sh powerbutton_one
- exit 0
-fi
-
-if ! command -v bonsaictl > /dev/null; then
- multikey_retrocompat
- exit
-fi
-
-swaymsg -- bindsym --locked --no-repeat XF86PowerOff exec bonsaictl -e power_pressed
-swaymsg -- bindsym --locked --release XF86PowerOff exec bonsaictl -e power_released
-
-swaymsg -- bindsym --locked --no-repeat XF86AudioRaiseVolume exec bonsaictl -e volup_pressed
-swaymsg -- bindsym --locked --release XF86AudioRaiseVolume exec bonsaictl -e volup_released
-
-swaymsg -- bindsym --locked --no-repeat XF86AudioLowerVolume exec bonsaictl -e voldown_pressed
-swaymsg -- bindsym --locked --release XF86AudioLowerVolume exec bonsaictl -e voldown_released
diff --git a/overlay/rootfs/usr/bin/sxmo_terminal.sh b/overlay/rootfs/usr/bin/sxmo_terminal.sh
new file mode 100755
index 0000000..43aadb6
--- /dev/null
+++ b/overlay/rootfs/usr/bin/sxmo_terminal.sh
@@ -0,0 +1,29 @@
+#!/bin/sh
+# SPDX-License-Identifier: AGPL-3.0-only
+# Copyright 2022 Sxmo Contributors
+# shellcheck disable=SC2086
+
+SXMO_TERMINAL="${SXMO_TERMINAL:-st}"
+
+if [ -z "$*" ]; then
+ set -- ${SHELL:-/bin/sh}
+fi
+
+if [ -z "$TERMNAME" ]; then
+ TERMNAME="$*"
+fi
+
+case "$SXMO_TERMINAL" in
+ "st"*)
+ set -- $SXMO_TERMINAL -T "$TERMNAME" -e "$@"
+ ;;
+ *)
+ set -- st -T "$TERMNAME" -e "$@"
+ ;;
+esac
+
+exec 4<&0
+exec 5>&1
+exec 6>&2
+
+exec "$@"
diff --git a/overlay/rootfs/usr/bin/sxmo_wm.sh b/overlay/rootfs/usr/bin/sxmo_wm.sh
index 8ee80ea..f9cc2ba 100755
--- a/overlay/rootfs/usr/bin/sxmo_wm.sh
+++ b/overlay/rootfs/usr/bin/sxmo_wm.sh
@@ -4,8 +4,6 @@
# shellcheck disable=SC2317 disable=SC2329
# include common definitions
-# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
-. sxmo_hook_icons.sh
# shellcheck source=scripts/core/sxmo_common.sh
. sxmo_common.sh
@@ -20,12 +18,40 @@ swi3msg() {
xorgdisplay() {
case "$1" in
off)
+ if [ -r /sys/class/backlight/backlight/brightness ]; then
+ read -r _cur_bl < /sys/class/backlight/backlight/brightness 2>/dev/null || _cur_bl=0
+ if [ "${_cur_bl:-0}" -gt 1 ] 2>/dev/null; then
+ printf '%s' "$_cur_bl" > /tmp/sxmo_saved_brightness 2>/dev/null || true
+ fi
+ fi
+ if [ -w /sys/class/leds/white:kbd_backlight/brightness ]; then
+ printf '0' > /sys/class/leds/white:kbd_backlight/brightness 2>/dev/null || true
+ fi
+ if [ -w /sys/class/backlight/backlight/brightness ]; then
+ printf '0' > /sys/class/backlight/backlight/brightness 2>/dev/null || true
+ fi
xset dpms 0 0 3
xset dpms force off
;;
on)
xset dpms 0 0 0
xset dpms force on
+ if [ -w /sys/class/backlight/backlight/bl_power ]; then
+ printf '0' > /sys/class/backlight/backlight/bl_power 2>/dev/null || true
+ fi
+ if [ -w /sys/class/backlight/backlight/brightness ]; then
+ _restore_bl=""
+ if [ -r /tmp/sxmo_saved_brightness ]; then
+ read -r _restore_bl < /tmp/sxmo_saved_brightness 2>/dev/null || _restore_bl=""
+ fi
+ if [ -z "$_restore_bl" ] || [ "${_restore_bl:-0}" -le 1 ] 2>/dev/null; then
+ read -r _restore_bl < /sys/class/backlight/backlight/max_brightness 2>/dev/null || _restore_bl=14
+ fi
+ printf '%s' "${_restore_bl:-14}" > /sys/class/backlight/backlight/brightness 2>/dev/null || true
+ fi
+ if [ -w /sys/class/leds/white:kbd_backlight/brightness ]; then
+ printf '255' > /sys/class/leds/white:kbd_backlight/brightness 2>/dev/null || true
+ fi
;;
"")
if xset q | grep -q "Off: 3"; then
@@ -168,14 +194,14 @@ _swi3_focusedwindow() {
recurse(.nodes[]) |
select(.focused == true) |
{
- app_id: (if .app_id != null then
+ app_id: ((if .app_id != null then
.app_id
else
.window_properties.class
- end) | gsub("\n"; "\\n") | ascii_downcase,
- name: (.name | gsub("\n"; "\\n") | ascii_downcase),
+ end) // "" | tostring | gsub("\n"; "\\n") | ascii_downcase),
+ name: ((.name // "") | tostring | gsub("\n"; "\\n") | ascii_downcase),
} |
- select(.app_id != null and .name != null) |
+ select(.app_id != "" or .name != "") |
"\(.app_id)\n\(.name)"
'
}
@@ -463,6 +489,8 @@ rivertogglebar() {
# configmenuentry {{{
wm_generic_configmenuentry() {
+ # shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
+ . sxmo_hook_icons.sh
case "$SXMO_WM" in
dwm)
printf "%s\n" "$icon_cfg Edit configuration ^ 0 ^ sxmo_terminal.sh $EDITOR $XDG_CONFIG_HOME/sxmo/xinit"
diff --git a/overlay/rootfs/usr/bin/sxmo_wmmenu.sh b/overlay/rootfs/usr/bin/sxmo_wmmenu.sh
index 1d9c417..e003881 100755
--- a/overlay/rootfs/usr/bin/sxmo_wmmenu.sh
+++ b/overlay/rootfs/usr/bin/sxmo_wmmenu.sh
@@ -2,428 +2,50 @@
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2022 Sxmo Contributors
-# this script is a menu which lets the user perform some WM actions.
-
-# include common definitions
-# shellcheck source=scripts/core/sxmo_common.sh
. sxmo_common.sh
-# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
. sxmo_hook_icons.sh
set -e
_movetowssubmenu() {
- for ws in $(seq "${SXMO_WORKSPACE_WRAPPING:-4}"); do
- printf "%s Move to WS %s\n" "$ws" "$ws"
- done
+ for ws in $(seq "${SXMO_WORKSPACE_WRAPPING:-4}"); do
+ printf "%s Move to WS %s\n" "$ws" "$ws"
+ done
}
-# A menu which allows to move windows or toggle floating.
-swaymovemenu() {
- CHOICES="$(cat <"$logfile" 2>&1
+}
+
+source_profile() {
+ for profile in /etc/profile "$HOME"/.profile; do
+ if [ -f "$profile" ]; then
+ # shellcheck disable=SC1090
+ . "$profile"
+ fi
+ done
+}
+
+# $1: session type (i.e. 'wayland', or 'x11')
+source_session_profiles() {
+ session_type="$1"
+ if [ "$session_type" != "wayland" ] && [ "$session_type" != "x11" ]; then
+ echo "Unknown session type: $session_type"
+ exit 1
+ fi
+
+ for file in "/usr/share/tinydm/env-${session_type}.d/"*; do
+ if ! [ -e "$file" ]; then
+ continue
+ fi
+
+ echo "tinydm: sourcing file: $file"
+ # shellcheck disable=SC1090
+ . "$file"
+ done
+
+ # Source /etc dirs after /usr/share to override options properly
+ for file in "/etc/tinydm.d/env-${session_type}.d/"*; do
+ if ! [ -e "$file" ]; then
+ continue
+ fi
+
+ echo "tinydm: sourcing file: $file"
+ # shellcheck disable=SC1090
+ . "$file"
+ done
+}
+
+# $1: file
+# $2: key
+parse_xdg_desktop() {
+ grep "^$2=" "$1" | cut -d "=" -f 2- | tr ';' ':' | sed 's/:$//'
+}
+
+# $1: Exec line from .desktop file
+run_session_wayland() {
+ export XDG_SESSION_TYPE=wayland
+ exec setpriv --ambient-caps '-all' "$@"
+}
+
+# $1: Exec line from .desktop file
+run_session_x() {
+ export XDG_SESSION_TYPE=X11
+
+ cmd_startx="startx $(command -v "$1")"
+
+ shift
+ for arg in "$@"; do
+ cmd_startx="$cmd_startx $arg"
+ done
+
+ cmd_startx="$cmd_startx -- -nocursor -nolisten tcp vt1 -keeptty"
+
+ # shellcheck disable=SC2086
+ exec setpriv --ambient-caps '-all' $cmd_startx
+}
+
+run_session() {
+ target="/var/lib/tinydm/default-session.desktop"
+
+ if ! [ -e "$target" ]; then
+ echo "ERROR: no session configured!"
+ exit 1
+ fi
+
+ resolved="$(realpath "$target")"
+ desktop="$(basename "$resolved" | sed 's/\.desktop$//')"
+ export XDG_SESSION_DESKTOP="$desktop"
+ cmd="$(parse_xdg_desktop "$resolved" "Exec")"
+
+ desktop_names="$(parse_xdg_desktop "$resolved" "DesktopNames")"
+ if [ -n "$desktop_names" ]; then
+ export XDG_CURRENT_DESKTOP="$desktop_names"
+ fi
+
+ if [ -z "$DBUS_SESSION_BUS_ADDRESS" ] &&
+ [ "$TINYDM_START_DBUS_SESSION" = "true" ] &&
+ [ "$(command -v dbus-launch)" ]; then
+ cmd="$(command -v dbus-launch) --exit-with-x11 $cmd"
+ fi
+
+ echo "--- tinydm ---"
+ echo "Date: $(date)"
+ echo "Session: $resolved"
+ echo "Desktop: $desktop"
+ echo "Exec: $cmd"
+ echo "---"
+
+ case "$resolved" in
+ /usr/share/wayland-sessions*)
+ source_session_profiles wayland
+ # shellcheck disable=SC2086
+ run_session_wayland $cmd
+ ;;
+ /usr/share/xsessions*)
+ source_session_profiles x11
+ # shellcheck disable=SC2086
+ run_session_x $cmd
+ ;;
+ *)
+ echo "ERROR: could not detect session type!"
+ exit 1
+ ;;
+ esac
+}
+
+setup_log
+source_profile
+run_session
diff --git a/overlay/rootfs/usr/lib/fcitx5/libt9.so b/overlay/rootfs/usr/lib/fcitx5/libt9.so
index ef7c52f..43a7812 100755
Binary files a/overlay/rootfs/usr/lib/fcitx5/libt9.so and b/overlay/rootfs/usr/lib/fcitx5/libt9.so differ
diff --git a/overlay/rootfs/usr/lib/fcitx5/t9.so b/overlay/rootfs/usr/lib/fcitx5/t9.so
index ef7c52f..43a7812 100755
Binary files a/overlay/rootfs/usr/lib/fcitx5/t9.so and b/overlay/rootfs/usr/lib/fcitx5/t9.so differ
diff --git a/overlay/rootfs/usr/lib/xorg/modules/xlibre-25/drivers/fbdev_drv.so b/overlay/rootfs/usr/lib/xorg/modules/xlibre-25/drivers/fbdev_drv.so
new file mode 100755
index 0000000..f01954b
Binary files /dev/null and b/overlay/rootfs/usr/lib/xorg/modules/xlibre-25/drivers/fbdev_drv.so differ
diff --git a/overlay/rootfs/usr/lib/xorg/modules/xlibre-25/drivers/modesetting_drv.so b/overlay/rootfs/usr/lib/xorg/modules/xlibre-25/drivers/modesetting_drv.so
new file mode 100755
index 0000000..bf5c65a
Binary files /dev/null and b/overlay/rootfs/usr/lib/xorg/modules/xlibre-25/drivers/modesetting_drv.so differ
diff --git a/overlay/rootfs/usr/lib/xorg/modules/xlibre-25/input/libinput_drv.so b/overlay/rootfs/usr/lib/xorg/modules/xlibre-25/input/libinput_drv.so
new file mode 100755
index 0000000..3c0ba8d
Binary files /dev/null and b/overlay/rootfs/usr/lib/xorg/modules/xlibre-25/input/libinput_drv.so differ
diff --git a/overlay/rootfs/usr/lib/xorg/modules/xlibre-25/libexa.so b/overlay/rootfs/usr/lib/xorg/modules/xlibre-25/libexa.so
new file mode 100755
index 0000000..4113689
Binary files /dev/null and b/overlay/rootfs/usr/lib/xorg/modules/xlibre-25/libexa.so differ
diff --git a/overlay/rootfs/usr/lib/xorg/modules/xlibre-25/libfbdevhw.so b/overlay/rootfs/usr/lib/xorg/modules/xlibre-25/libfbdevhw.so
new file mode 100755
index 0000000..9ed3c97
Binary files /dev/null and b/overlay/rootfs/usr/lib/xorg/modules/xlibre-25/libfbdevhw.so differ
diff --git a/overlay/rootfs/usr/lib/xorg/modules/xlibre-25/libshadow.so b/overlay/rootfs/usr/lib/xorg/modules/xlibre-25/libshadow.so
new file mode 100755
index 0000000..3993eb7
Binary files /dev/null and b/overlay/rootfs/usr/lib/xorg/modules/xlibre-25/libshadow.so differ
diff --git a/overlay/rootfs/usr/lib/xorg/modules/xlibre-25/libshadowfb.so b/overlay/rootfs/usr/lib/xorg/modules/xlibre-25/libshadowfb.so
new file mode 100755
index 0000000..e147777
Binary files /dev/null and b/overlay/rootfs/usr/lib/xorg/modules/xlibre-25/libshadowfb.so differ
diff --git a/overlay/rootfs/usr/lib/xorg/modules/xlibre-25/libwfb.so b/overlay/rootfs/usr/lib/xorg/modules/xlibre-25/libwfb.so
new file mode 100755
index 0000000..f5bae7e
Binary files /dev/null and b/overlay/rootfs/usr/lib/xorg/modules/xlibre-25/libwfb.so differ
diff --git a/overlay/rootfs/usr/lib/xorg/protocol.txt b/overlay/rootfs/usr/lib/xorg/protocol.txt
new file mode 100644
index 0000000..8751f1b
--- /dev/null
+++ b/overlay/rootfs/usr/lib/xorg/protocol.txt
@@ -0,0 +1,885 @@
+# Registry of protocol names used by X Server
+# This will eventually be replaced by server-side XCB
+#
+# Format is Xnnn :
+# R=Request, V=Event, E=Error
+#
+# This is a security-sensitive file, please set permissions as appropriate.
+#
+R000 Apple-DRI:QueryVersion
+R001 Apple-DRI:QueryDirectRenderingCapable
+R002 Apple-DRI:CreateSurface
+R003 Apple-DRI:DestroySurface
+R004 Apple-DRI:AuthConnection
+V000 Apple-DRI:ObsoleteEvent1
+V001 Apple-DRI:ObsoleteEvent2
+V002 Apple-DRI:ObsoleteEvent3
+V003 Apple-DRI:SurfaceNotify
+E000 Apple-DRI:ClientNotLocal
+E001 Apple-DRI:OperationNotSupported
+R000 Apple-WM:QueryVersion
+R001 Apple-WM:FrameGetRect
+R002 Apple-WM:FrameHitTest
+R003 Apple-WM:FrameDraw
+R004 Apple-WM:DisableUpdate
+R005 Apple-WM:ReenableUpdate
+R006 Apple-WM:SelectInput
+R007 Apple-WM:SetWindowMenuCheck
+R008 Apple-WM:SetFrontProcess
+R009 Apple-WM:SetWindowLevel
+R010 Apple-WM:SetCanQuit
+R011 Apple-WM:SetWindowMenu
+V000 Apple-WM:ControllerNotify
+V001 Apple-WM:ActivationNotify
+V002 Apple-WM:PasteboardNotify
+E000 Apple-WM:ClientNotLocal
+E001 Apple-WM:OperationNotSupported
+R000 BIG-REQUESTS:Enable
+R000 Composite:CompositeQueryVersion
+R001 Composite:CompositeRedirectWindow
+R002 Composite:CompositeRedirectSubwindows
+R003 Composite:CompositeUnredirectWindow
+R004 Composite:CompositeUnredirectSubwindows
+R005 Composite:CompositeCreateRegionFromBorderClip
+R006 Composite:CompositeNameWindowPixmap
+R007 Composite:CompositeGetOverlayWindow
+R008 Composite:CompositeReleaseOverlayWindow
+R000 DAMAGE:QueryVersion
+R001 DAMAGE:Create
+R002 DAMAGE:Destroy
+R003 DAMAGE:Subtract
+R004 DAMAGE:Add
+V000 DAMAGE:Notify
+E000 DAMAGE:BadDamage
+R000 DOUBLE-BUFFER:GetVersion
+R001 DOUBLE-BUFFER:AllocateBackBufferName
+R002 DOUBLE-BUFFER:DeallocateBackBufferName
+R003 DOUBLE-BUFFER:SwapBuffers
+R004 DOUBLE-BUFFER:BeginIdiom
+R005 DOUBLE-BUFFER:EndIdiom
+R006 DOUBLE-BUFFER:GetVisualInfo
+R007 DOUBLE-BUFFER:GetBackBufferAttributes
+E000 DOUBLE-BUFFER:BadBuffer
+R000 DPMS:GetVersion
+R001 DPMS:Capable
+R002 DPMS:GetTimeouts
+R003 DPMS:SetTimeouts
+R004 DPMS:Enable
+R005 DPMS:Disable
+R006 DPMS:ForceLevel
+R007 DPMS:Info
+R000 DRI2:QueryVersion
+R001 DRI2:Connect
+R002 DRI2:Authenticate
+R003 DRI2:CreateDrawable
+R004 DRI2:DestroyDrawable
+R005 DRI2:GetBuffers
+R006 DRI2:CopyRegion
+R007 DRI2:GetBuffersWithFormat
+R008 DRI2:SwapBuffers
+R009 DRI2:GetMSC
+R010 DRI2:WaitMSC
+R011 DRI2:WaitSBC
+R012 DRI2:SwapInterval
+V000 DRI2:BufferSwapComplete
+V001 DRI2:InvalidateBuffers
+R000 DRI3:QueryVersion
+R001 DRI3:Open
+R002 DRI3:PixmapFromBuffer
+R003 DRI3:BufferFromPixmap
+R004 DRI3:FenceFromFD
+R005 DRI3:FDFromFence
+R000 Extended-Visual-Information:QueryVersion
+R001 Extended-Visual-Information:GetVisualInfo
+R000 FontCache:QueryVersion
+R001 FontCache:GetCacheSettings
+R002 FontCache:ChangeCacheSettings
+R003 FontCache:GetCacheStatistics
+E000 FontCache:BadProtocol
+E001 FontCache:CannotAllocMemory
+R001 GLX:
+R002 GLX:Large
+R003 GLX:CreateContext
+R004 GLX:DestroyContext
+R005 GLX:MakeCurrent
+R006 GLX:IsDirect
+R007 GLX:QueryVersion
+R008 GLX:WaitGL
+R009 GLX:WaitX
+R010 GLX:CopyContext
+R011 GLX:SwapBuffers
+R012 GLX:UseXFont
+R013 GLX:CreateGLXPixmap
+R014 GLX:GetVisualConfigs
+R015 GLX:DestroyGLXPixmap
+R016 GLX:VendorPrivate
+R017 GLX:VendorPrivateWithReply
+R018 GLX:QueryExtensionsString
+R019 GLX:QueryServerString
+R020 GLX:ClientInfo
+R021 GLX:GetFBConfigs
+R022 GLX:CreatePixmap
+R023 GLX:DestroyPixmap
+R024 GLX:CreateNewContext
+R025 GLX:QueryContext
+R026 GLX:MakeContextCurrent
+R027 GLX:CreatePbuffer
+R028 GLX:DestroyPbuffer
+R029 GLX:GetDrawableAttributes
+R030 GLX:ChangeDrawableAttributes
+R031 GLX:CreateWindow
+R032 GLX:DeleteWindow
+R033 GLX:SetClientInfoARB
+R034 GLX:CreateContextAttribsARB
+R035 GLX:SetClientInfo2ARB
+R101 GLX:NewList
+R102 GLX:EndList
+R103 GLX:DeleteLists
+R104 GLX:GenLists
+R105 GLX:FeedbackBuffer
+R106 GLX:SelectBuffer
+R107 GLX:Mode
+R108 GLX:Finish
+R109 GLX:PixelStoref
+R110 GLX:PixelStorei
+R111 GLX:ReadPixels
+R112 GLX:GetBooleanv
+R113 GLX:GetClipPlane
+R114 GLX:GetDoublev
+R115 GLX:GetError
+R116 GLX:GetFloatv
+R117 GLX:GetIntegerv
+R118 GLX:GetLightfv
+R119 GLX:GetLightiv
+R120 GLX:GetMapdv
+R121 GLX:GetMapfv
+R122 GLX:GetMapiv
+R123 GLX:GetMaterialfv
+R124 GLX:GetMaterialiv
+R125 GLX:GetPixelfv
+R126 GLX:GetPixelMapuiv
+R127 GLX:GetPixelMapusv
+R128 GLX:GetPolygonStipple
+R129 GLX:GetString
+R130 GLX:GetTexEnvfv
+R131 GLX:GetTexEnviv
+R132 GLX:GetTexGendv
+R133 GLX:GetTexGenfv
+R134 GLX:GetTexGeniv
+R135 GLX:GetTexImage
+R136 GLX:GetTexParameterfv
+R137 GLX:GetTexParameteriv
+R138 GLX:GetTexLevelParameterfv
+R139 GLX:GetTexLevelParameteriv
+R140 GLX:IsEnabled
+R141 GLX:IsList
+R142 GLX:Flush
+R143 GLX:AreTexturesResident
+R144 GLX:DeleteTextures
+R145 GLX:GenTextures
+R146 GLX:IsTexture
+R147 GLX:GetColorTable
+R148 GLX:GetColorTableParameterfv
+R149 GLX:GetColorTableParameterfv
+R150 GLX:GetConvolutionFilter
+R151 GLX:GetConvolutionParameterfv
+R152 GLX:GetConvolutionParameteriv
+R153 GLX:GetSeparableFilter
+R154 GLX:GetHistogram
+R155 GLX:GetHistogramParameterfv
+R156 GLX:GetHistogramParameteriv
+R157 GLX:GetMinmax
+R158 GLX:GetMinmaxParameterfv
+R159 GLX:GetMinmaxParameteriv
+R160 GLX:GetCompressedTexImage
+V000 GLX:PbufferClobber
+V001 GLX:BufferSwapComplete
+E000 GLX:BadContext
+E001 GLX:BadContextState
+E002 GLX:BadDrawable
+E003 GLX:BadPixmap
+E004 GLX:BadContextTag
+E005 GLX:BadCurrentWindow
+E006 GLX:BadRenderRequest
+E007 GLX:BadLargeRequest
+E008 GLX:UnsupportedPrivateRequest
+E009 GLX:BadFBConfig
+E010 GLX:BadPbuffer
+E011 GLX:BadCurrentDrawable
+E012 GLX:BadWindow
+R000 MIT-SCREEN-SAVER:QueryVersion
+R001 MIT-SCREEN-SAVER:QueryInfo
+R002 MIT-SCREEN-SAVER:SelectInput
+R003 MIT-SCREEN-SAVER:SetAttributes
+R004 MIT-SCREEN-SAVER:UnsetAttributes
+R005 MIT-SCREEN-SAVER:Suspend
+V000 MIT-SCREEN-SAVER:Notify
+R000 MIT-SHM:QueryVersion
+R001 MIT-SHM:Attach
+R002 MIT-SHM:Detach
+R003 MIT-SHM:PutImage
+R004 MIT-SHM:GetImage
+R005 MIT-SHM:CreatePixmap
+R006 MIT-SHM:AttachFd
+R007 MIT-SHM:CreateSegment
+V000 MIT-SHM:Completion
+E000 MIT-SHM:BadShmSeg
+R000 MIT-SUNDRY-NONSTANDARD:SetBugMode
+R001 MIT-SUNDRY-NONSTANDARD:GetBugMode
+R000 Present:QueryVersion
+R001 Present:Pixmap
+R002 Present:NotifyMSC
+R003 Present:SelectInput
+R004 Present:QueryCapabilities
+R000 RANDR:QueryVersion
+R001 RANDR:OldGetScreenInfo
+R002 RANDR:SetScreenConfig
+R003 RANDR:OldScreenChangeSelectInput
+R004 RANDR:SelectInput
+R005 RANDR:GetScreenInfo
+R006 RANDR:GetScreenSizeRange
+R007 RANDR:SetScreenSize
+R008 RANDR:GetScreenResources
+R009 RANDR:GetOutputInfo
+R010 RANDR:ListOutputProperties
+R011 RANDR:QueryOutputProperty
+R012 RANDR:ConfigureOutputProperty
+R013 RANDR:ChangeOutputProperty
+R014 RANDR:DeleteOutputProperty
+R015 RANDR:GetOutputProperty
+R016 RANDR:CreateMode
+R017 RANDR:DestroyMode
+R018 RANDR:AddOutputMode
+R019 RANDR:DeleteOutputMode
+R020 RANDR:GetCrtcInfo
+R021 RANDR:SetCrtcConfig
+R022 RANDR:GetCrtcGammaSize
+R023 RANDR:GetCrtcGamma
+R024 RANDR:SetCrtcGamma
+R025 RANDR:GetScreenResourcesCurrent
+R026 RANDR:SetCrtcTransform
+R027 RANDR:GetCrtcTransform
+R028 RANDR:GetPanning
+R029 RANDR:SetPanning
+R030 RANDR:SetOutputPrimary
+R031 RANDR:GetOutputPrimary
+R032 RANDR:RRGetProviders
+R033 RANDR:RRGetProviderInfo
+R034 RANDR:RRSetProviderOffloadSink
+R035 RANDR:RRSetProviderOutputSource
+R036 RANDR:RRListProviderProperties
+R037 RANDR:RRQueryProviderProperty
+R038 RANDR:RRConfigureProviderProperty
+R039 RANDR:RRChangeProviderProperty
+R040 RANDR:RRDeleteProviderProperty
+R041 RANDR:RRGetProviderProperty
+R042 RANDR:GetMonitors
+R043 RANDR:SetMonitor
+R044 RANDR:DeleteMonitor
+V000 RANDR:ScreenChangeNotify
+V001 RANDR:Notify
+E000 RANDR:BadRROutput
+E001 RANDR:BadRRCrtc
+E002 RANDR:BadRRMode
+E003 RANDR:BadRRProvider
+R000 RECORD:QueryVersion
+R001 RECORD:CreateContext
+R002 RECORD:RegisterClients
+R003 RECORD:UnregisterClients
+R004 RECORD:GetContext
+R005 RECORD:EnableContext
+R006 RECORD:DisableContext
+R007 RECORD:FreeContext
+E000 RECORD:BadContext
+R000 RENDER:QueryVersion
+R001 RENDER:QueryPictFormats
+R002 RENDER:QueryPictIndexValues
+R003 RENDER:QueryDithers
+R004 RENDER:CreatePicture
+R005 RENDER:ChangePicture
+R006 RENDER:SetPictureClipRectangles
+R007 RENDER:FreePicture
+R008 RENDER:Composite
+R009 RENDER:Scale
+R010 RENDER:Trapezoids
+R011 RENDER:Triangles
+R012 RENDER:TriStrip
+R013 RENDER:TriFan
+R014 RENDER:ColorTrapezoids
+R015 RENDER:ColorTriangles
+R016 RENDER:Transform
+R017 RENDER:CreateGlyphSet
+R018 RENDER:ReferenceGlyphSet
+R019 RENDER:FreeGlyphSet
+R020 RENDER:AddGlyphs
+R021 RENDER:AddGlyphsFromPicture
+R022 RENDER:FreeGlyphs
+R023 RENDER:CompositeGlyphs8
+R024 RENDER:CompositeGlyphs16
+R025 RENDER:CompositeGlyphs32
+R026 RENDER:FillRectangles
+R027 RENDER:CreateCursor
+R028 RENDER:SetPictureTransform
+R029 RENDER:QueryFilters
+R030 RENDER:SetPictureFilter
+R031 RENDER:CreateAnimCursor
+R032 RENDER:AddTraps
+R033 RENDER:CreateSolidFill
+R034 RENDER:CreateLinearGradient
+R035 RENDER:CreateRadialGradient
+R036 RENDER:CreateConicalGradient
+E000 RENDER:BadPictFormat
+E001 RENDER:BadPicture
+E002 RENDER:BadPictOp
+E003 RENDER:BadGlyphSet
+E004 RENDER:BadGlyph
+R000 SECURITY:QueryVersion
+R001 SECURITY:GenerateAuthorization
+R002 SECURITY:RevokeAuthorization
+V000 SECURITY:AuthorizationRevoked
+E000 SECURITY:BadAuthorization
+E001 SECURITY:BadAuthorizationProtocol
+R000 SELinux:SELinuxQueryVersion
+R001 SELinux:SELinuxSetDeviceCreateContext
+R002 SELinux:SELinuxGetDeviceCreateContext
+R003 SELinux:SELinuxSetDeviceContext
+R004 SELinux:SELinuxGetDeviceContext
+R005 SELinux:SELinuxSetWindowCreateContext
+R006 SELinux:SELinuxGetWindowCreateContext
+R007 SELinux:SELinuxGetWindowContext
+R008 SELinux:SELinuxSetPropertyCreateContext
+R009 SELinux:SELinuxGetPropertyCreateContext
+R010 SELinux:SELinuxSetPropertyUseContext
+R011 SELinux:SELinuxGetPropertyUseContext
+R012 SELinux:SELinuxGetPropertyContext
+R013 SELinux:SELinuxGetPropertyDataContext
+R014 SELinux:SELinuxListProperties
+R015 SELinux:SELinuxSetSelectionCreateContext
+R016 SELinux:SELinuxGetSelectionCreateContext
+R017 SELinux:SELinuxSetSelectionUseContext
+R018 SELinux:SELinuxGetSelectionUseContext
+R019 SELinux:SELinuxGetSelectionContext
+R020 SELinux:SELinuxGetSelectionDataContext
+R021 SELinux:SELinuxListSelections
+R022 SELinux:SELinuxGetClientContext
+R000 SHAPE:QueryVersion
+R001 SHAPE:Rectangles
+R002 SHAPE:Mask
+R003 SHAPE:Combine
+R004 SHAPE:Offset
+R005 SHAPE:QueryExtents
+R006 SHAPE:SelectInput
+R007 SHAPE:InputSelected
+R008 SHAPE:GetRectangles
+V000 SHAPE:Notify
+R000 SYNC:Initialize
+R001 SYNC:ListSystemCounters
+R002 SYNC:CreateCounter
+R003 SYNC:SetCounter
+R004 SYNC:ChangeCounter
+R005 SYNC:QueryCounter
+R006 SYNC:DestroyCounter
+R007 SYNC:Await
+R008 SYNC:CreateAlarm
+R009 SYNC:ChangeAlarm
+R010 SYNC:QueryAlarm
+R011 SYNC:DestroyAlarm
+R012 SYNC:SetPriority
+R013 SYNC:GetPriority
+V000 SYNC:CounterNotify
+V001 SYNC:AlarmNotify
+E000 SYNC:BadCounter
+E001 SYNC:BadAlarm
+R000 TOG-CUP:QueryVersion
+R001 TOG-CUP:GetReservedColormapEntries
+R002 TOG-CUP:StoreColors
+R000 Windows-WM:QueryVersion
+R001 Windows-WM:FrameGetRect
+R002 Windows-WM:FrameDraw
+R003 Windows-WM:FrameSetTitle
+R004 Windows-WM:DisableUpdate
+R005 Windows-WM:ReenableUpdate
+R006 Windows-WM:SelectInput
+R007 Windows-WM:SetFrontProcess
+V000 Windows-WM:ControllerNotify
+V001 Windows-WM:ActivationNotify
+E000 Windows-WM:ClientNotLocal
+E001 Windows-WM:OperationNotSupported
+R000 X-Resource:QueryVersion
+R001 X-Resource:QueryClients
+R002 X-Resource:QueryClientResources
+R003 X-Resource:QueryClientPixmapBytes
+R001 X11:CreateWindow
+R002 X11:ChangeWindowAttributes
+R003 X11:GetWindowAttributes
+R004 X11:DestroyWindow
+R005 X11:DestroySubwindows
+R006 X11:ChangeSaveSet
+R007 X11:ReparentWindow
+R008 X11:MapWindow
+R009 X11:MapSubwindows
+R010 X11:UnmapWindow
+R011 X11:UnmapSubwindows
+R012 X11:ConfigureWindow
+R013 X11:CirculateWindow
+R014 X11:GetGeometry
+R015 X11:QueryTree
+R016 X11:InternAtom
+R017 X11:GetAtomName
+R018 X11:ChangeProperty
+R019 X11:DeleteProperty
+R020 X11:GetProperty
+R021 X11:ListProperties
+R022 X11:SetSelectionOwner
+R023 X11:GetSelectionOwner
+R024 X11:ConvertSelection
+R025 X11:SendEvent
+R026 X11:GrabPointer
+R027 X11:UngrabPointer
+R028 X11:GrabButton
+R029 X11:UngrabButton
+R030 X11:ChangeActivePointerGrab
+R031 X11:GrabKeyboard
+R032 X11:UngrabKeyboard
+R033 X11:GrabKey
+R034 X11:UngrabKey
+R035 X11:AllowEvents
+R036 X11:GrabServer
+R037 X11:UngrabServer
+R038 X11:QueryPointer
+R039 X11:GetMotionEvents
+R040 X11:TranslateCoords
+R041 X11:WarpPointer
+R042 X11:SetInputFocus
+R043 X11:GetInputFocus
+R044 X11:QueryKeymap
+R045 X11:OpenFont
+R046 X11:CloseFont
+R047 X11:QueryFont
+R048 X11:QueryTextExtents
+R049 X11:ListFonts
+R050 X11:ListFontsWithInfo
+R051 X11:SetFontPath
+R052 X11:GetFontPath
+R053 X11:CreatePixmap
+R054 X11:FreePixmap
+R055 X11:CreateGC
+R056 X11:ChangeGC
+R057 X11:CopyGC
+R058 X11:SetDashes
+R059 X11:SetClipRectangles
+R060 X11:FreeGC
+R061 X11:ClearArea
+R062 X11:CopyArea
+R063 X11:CopyPlane
+R064 X11:PolyPoint
+R065 X11:PolyLine
+R066 X11:PolySegment
+R067 X11:PolyRectangle
+R068 X11:PolyArc
+R069 X11:FillPoly
+R070 X11:PolyFillRectangle
+R071 X11:PolyFillArc
+R072 X11:PutImage
+R073 X11:GetImage
+R074 X11:PolyText8
+R075 X11:PolyText16
+R076 X11:ImageText8
+R077 X11:ImageText16
+R078 X11:CreateColormap
+R079 X11:FreeColormap
+R080 X11:CopyColormapAndFree
+R081 X11:InstallColormap
+R082 X11:UninstallColormap
+R083 X11:ListInstalledColormaps
+R084 X11:AllocColor
+R085 X11:AllocNamedColor
+R086 X11:AllocColorCells
+R087 X11:AllocColorPlanes
+R088 X11:FreeColors
+R089 X11:StoreColors
+R090 X11:StoreNamedColor
+R091 X11:QueryColors
+R092 X11:LookupColor
+R093 X11:CreateCursor
+R094 X11:CreateGlyphCursor
+R095 X11:FreeCursor
+R096 X11:RecolorCursor
+R097 X11:QueryBestSize
+R098 X11:QueryExtension
+R099 X11:ListExtensions
+R100 X11:ChangeKeyboardMapping
+R101 X11:GetKeyboardMapping
+R102 X11:ChangeKeyboardControl
+R103 X11:GetKeyboardControl
+R104 X11:Bell
+R105 X11:ChangePointerControl
+R106 X11:GetPointerControl
+R107 X11:SetScreenSaver
+R108 X11:GetScreenSaver
+R109 X11:ChangeHosts
+R110 X11:ListHosts
+R111 X11:SetAccessControl
+R112 X11:SetCloseDownMode
+R113 X11:KillClient
+R114 X11:RotateProperties
+R115 X11:ForceScreenSaver
+R116 X11:SetPointerMapping
+R117 X11:GetPointerMapping
+R118 X11:SetModifierMapping
+R119 X11:GetModifierMapping
+R127 X11:NoOperation
+V000 X11:X_Error
+V001 X11:X_Reply
+V002 X11:KeyPress
+V003 X11:KeyRelease
+V004 X11:ButtonPress
+V005 X11:ButtonRelease
+V006 X11:MotionNotify
+V007 X11:EnterNotify
+V008 X11:LeaveNotify
+V009 X11:FocusIn
+V010 X11:FocusOut
+V011 X11:KeymapNotify
+V012 X11:Expose
+V013 X11:GraphicsExpose
+V014 X11:NoExpose
+V015 X11:VisibilityNotify
+V016 X11:CreateNotify
+V017 X11:DestroyNotify
+V018 X11:UnmapNotify
+V019 X11:MapNotify
+V020 X11:MapRequest
+V021 X11:ReparentNotify
+V022 X11:ConfigureNotify
+V023 X11:ConfigureRequest
+V024 X11:GravityNotify
+V025 X11:ResizeRequest
+V026 X11:CirculateNotify
+V027 X11:CirculateRequest
+V028 X11:PropertyNotify
+V029 X11:SelectionClear
+V030 X11:SelectionRequest
+V031 X11:SelectionNotify
+V032 X11:ColormapNotify
+V033 X11:ClientMessage
+V034 X11:MappingNotify
+V035 X11:GenericEvent
+E000 X11:Success
+E001 X11:BadRequest
+E002 X11:BadValue
+E003 X11:BadWindow
+E004 X11:BadPixmap
+E005 X11:BadAtom
+E006 X11:BadCursor
+E007 X11:BadFont
+E008 X11:BadMatch
+E009 X11:BadDrawable
+E010 X11:BadAccess
+E011 X11:BadAlloc
+E012 X11:BadColor
+E013 X11:BadGC
+E014 X11:BadIDChoice
+E015 X11:BadName
+E016 X11:BadLength
+E017 X11:BadImplementation
+R000 XC-APPGROUP:QueryVersion
+R001 XC-APPGROUP:Create
+R002 XC-APPGROUP:Destroy
+R003 XC-APPGROUP:GetAttr
+R004 XC-APPGROUP:Query
+R005 XC-APPGROUP:CreateAssoc
+R006 XC-APPGROUP:DestroyAssoc
+E000 XC-APPGROUP:BadAppGroup
+R000 XC-MISC:GetVersion
+R001 XC-MISC:GetXIDRange
+R002 XC-MISC:GetXIDList
+R000 XFIXES:QueryVersion
+R001 XFIXES:ChangeSaveSet
+R002 XFIXES:SelectSelectionInput
+R003 XFIXES:SelectCursorInput
+R004 XFIXES:GetCursorImage
+R005 XFIXES:CreateRegion
+R006 XFIXES:CreateRegionFromBitmap
+R007 XFIXES:CreateRegionFromWindow
+R008 XFIXES:CreateRegionFromGC
+R009 XFIXES:CreateRegionFromPicture
+R010 XFIXES:DestroyRegion
+R011 XFIXES:SetRegion
+R012 XFIXES:CopyRegion
+R013 XFIXES:UnionRegion
+R014 XFIXES:IntersectRegion
+R015 XFIXES:SubtractRegion
+R016 XFIXES:InvertRegion
+R017 XFIXES:TranslateRegion
+R018 XFIXES:RegionExtents
+R019 XFIXES:FetchRegion
+R020 XFIXES:SetGCClipRegion
+R021 XFIXES:SetWindowShapeRegion
+R022 XFIXES:SetPictureClipRegion
+R023 XFIXES:SetCursorName
+R024 XFIXES:GetCursorName
+R025 XFIXES:GetCursorImageAndName
+R026 XFIXES:ChangeCursor
+R027 XFIXES:ChangeCursorByName
+R028 XFIXES:ExpandRegion
+R029 XFIXES:HideCursor
+R030 XFIXES:ShowCursor
+V000 XFIXES:SelectionNotify
+V001 XFIXES:CursorNotify
+E000 XFIXES:BadRegion
+R000 XFree86-DGA:QueryVersion
+R001 XFree86-DGA:GetVideoLL
+R002 XFree86-DGA:DirectVideo
+R003 XFree86-DGA:GetViewPortSize
+R004 XFree86-DGA:SetViewPort
+R005 XFree86-DGA:GetVidPage
+R006 XFree86-DGA:SetVidPage
+R007 XFree86-DGA:InstallColormap
+R008 XFree86-DGA:QueryDirectVideo
+R009 XFree86-DGA:ViewPortChanged
+R010 XFree86-DGA:Obsolete1
+R011 XFree86-DGA:Obsolete2
+R012 XFree86-DGA:QueryModes
+R013 XFree86-DGA:SetMode
+R014 XFree86-DGA:SetViewport
+R015 XFree86-DGA:InstallColormap
+R016 XFree86-DGA:SelectInput
+R017 XFree86-DGA:FillRectangle
+R018 XFree86-DGA:CopyArea
+R019 XFree86-DGA:CopyTransparentArea
+R020 XFree86-DGA:GetViewportStatus
+R021 XFree86-DGA:Sync
+R022 XFree86-DGA:OpenFramebuffer
+R023 XFree86-DGA:CloseFramebuffer
+R024 XFree86-DGA:SetClientVersion
+R025 XFree86-DGA:ChangePixmapMode
+R026 XFree86-DGA:CreateColormap
+E000 XFree86-DGA:ClientNotLocal
+E001 XFree86-DGA:NoDirectVideoMode
+E002 XFree86-DGA:ScreenNotActive
+E003 XFree86-DGA:DirectNotActivated
+E004 XFree86-DGA:OperationNotSupported
+R000 XFree86-DRI:QueryVersion
+R001 XFree86-DRI:QueryDirectRenderingCapable
+R002 XFree86-DRI:OpenConnection
+R003 XFree86-DRI:CloseConnection
+R004 XFree86-DRI:GetClientDriverName
+R005 XFree86-DRI:CreateContext
+R006 XFree86-DRI:DestroyContext
+R007 XFree86-DRI:CreateDrawable
+R008 XFree86-DRI:DestroyDrawable
+R009 XFree86-DRI:GetDrawableInfo
+R010 XFree86-DRI:GetDeviceInfo
+R011 XFree86-DRI:AuthConnection
+R012 XFree86-DRI:OpenFullScreen
+R013 XFree86-DRI:CloseFullScreen
+E000 XFree86-DRI:ClientNotLocal
+E001 XFree86-DRI:OperationNotSupported
+R000 XFree86-Misc:QueryVersion
+R001 XFree86-Misc:GetSaver
+R002 XFree86-Misc:SetSaver
+R003 XFree86-Misc:GetMouseSettings
+R004 XFree86-Misc:GetKbdSettings
+R005 XFree86-Misc:SetMouseSettings
+R006 XFree86-Misc:SetKbdSettings
+R007 XFree86-Misc:SetGrabKeysState
+R008 XFree86-Misc:SetClientVersion
+R009 XFree86-Misc:GetFilePaths
+R010 XFree86-Misc:PassMessage
+E000 XFree86-Misc:BadMouseProtocol
+E001 XFree86-Misc:BadMouseBaudRate
+E002 XFree86-Misc:BadMouseFlags
+E003 XFree86-Misc:BadMouseCombo
+E004 XFree86-Misc:BadKbdType
+E005 XFree86-Misc:ModInDevDisabled
+E006 XFree86-Misc:ModInDevClientNotLocal
+E007 XFree86-Misc:NoModule
+R000 XFree86-VidModeExtension:QueryVersion
+R001 XFree86-VidModeExtension:GetModeLine
+R002 XFree86-VidModeExtension:ModModeLine
+R003 XFree86-VidModeExtension:SwitchMode
+R004 XFree86-VidModeExtension:GetMonitor
+R005 XFree86-VidModeExtension:LockModeSwitch
+R006 XFree86-VidModeExtension:GetAllModeLines
+R007 XFree86-VidModeExtension:AddModeLine
+R008 XFree86-VidModeExtension:DeleteModeLine
+R009 XFree86-VidModeExtension:ValidateModeLine
+R010 XFree86-VidModeExtension:SwitchToMode
+R011 XFree86-VidModeExtension:GetViewPort
+R012 XFree86-VidModeExtension:SetViewPort
+R013 XFree86-VidModeExtension:GetDotClocks
+R014 XFree86-VidModeExtension:SetClientVersion
+R015 XFree86-VidModeExtension:SetGamma
+R016 XFree86-VidModeExtension:GetGamma
+R017 XFree86-VidModeExtension:GetGammaRamp
+R018 XFree86-VidModeExtension:SetGammaRamp
+R019 XFree86-VidModeExtension:GetGammaRampSize
+R020 XFree86-VidModeExtension:GetPermissions
+V000 XFree86-VidModeExtension:Notify
+E000 XFree86-VidModeExtension:BadClock
+E001 XFree86-VidModeExtension:BadHTimings
+E002 XFree86-VidModeExtension:BadVTimings
+E003 XFree86-VidModeExtension:ModeUnsuitable
+E004 XFree86-VidModeExtension:ExtensionDisabled
+E005 XFree86-VidModeExtension:ClientNotLocal
+E006 XFree86-VidModeExtension:ZoomLocked
+R000 XINERAMA:QueryVersion
+R001 XINERAMA:GetState
+R002 XINERAMA:GetScreenCount
+R003 XINERAMA:GetScreenSize
+R004 XINERAMA:IsActive
+R005 XINERAMA:QueryScreens
+R001 XInputExtension:GetExtensionVersion
+R002 XInputExtension:ListInputDevices
+R003 XInputExtension:OpenDevice
+R004 XInputExtension:CloseDevice
+R005 XInputExtension:SetDeviceMode
+R006 XInputExtension:SelectExtensionEvent
+R007 XInputExtension:GetSelectedExtensionEvents
+R008 XInputExtension:ChangeDeviceDontPropagateList
+R009 XInputExtension:GetDeviceDontPropagageList
+R010 XInputExtension:GetDeviceMotionEvents
+R011 XInputExtension:ChangeKeyboardDevice
+R012 XInputExtension:ChangePointerDevice
+R013 XInputExtension:GrabDevice
+R014 XInputExtension:UngrabDevice
+R015 XInputExtension:GrabDeviceKey
+R016 XInputExtension:UngrabDeviceKey
+R017 XInputExtension:GrabDeviceButton
+R018 XInputExtension:UngrabDeviceButton
+R019 XInputExtension:AllowDeviceEvents
+R020 XInputExtension:GetDeviceFocus
+R021 XInputExtension:SetDeviceFocus
+R022 XInputExtension:GetFeedbackControl
+R023 XInputExtension:ChangeFeedbackControl
+R024 XInputExtension:GetDeviceKeyMapping
+R025 XInputExtension:ChangeDeviceKeyMapping
+R026 XInputExtension:GetDeviceModifierMapping
+R027 XInputExtension:SetDeviceModifierMapping
+R028 XInputExtension:GetDeviceButtonMapping
+R029 XInputExtension:SetDeviceButtonMapping
+R030 XInputExtension:QueryDeviceState
+R031 XInputExtension:SendExtensionEvent
+R032 XInputExtension:DeviceBell
+R033 XInputExtension:SetDeviceValuators
+R034 XInputExtension:GetDeviceControl
+R035 XInputExtension:ChangeDeviceControl
+R036 XInputExtension:ListDeviceProperties
+R037 XInputExtension:ChangeDeviceProperty
+R038 XInputExtension:DeleteDeviceProperty
+R039 XInputExtension:GetDeviceProperty
+R040 XInputExtension:QueryPointer
+R041 XInputExtension:WarpPointer
+R042 XInputExtension:ChangeCursor
+R043 XInputExtension:ChangeHierarchy
+R044 XInputExtension:SetClientPointer
+R045 XInputExtension:GetClientPointer
+R046 XInputExtension:SelectEvents
+R047 XInputExtension:QueryVersion
+R048 XInputExtension:QueryDevice
+R049 XInputExtension:SetFocus
+R050 XInputExtension:GetFocus
+R051 XInputExtension:GrabDevice
+R052 XInputExtension:UngrabDevice
+R053 XInputExtension:AllowEvents
+R054 XInputExtension:PassiveGrabDevice
+R055 XInputExtension:PassiveUngrabDevice
+R056 XInputExtension:ListProperties
+R057 XInputExtension:ChangeProperty
+R058 XInputExtension:DeleteProperty
+R059 XInputExtension:GetProperty
+R060 XInputExtension:GetSelectedEvents
+V000 XInputExtension:DeviceValuator
+V001 XInputExtension:DeviceKeyPress
+V002 XInputExtension:DeviceKeyRelease
+V003 XInputExtension:DeviceButtonPress
+V004 XInputExtension:DeviceButtonRelease
+V005 XInputExtension:DeviceMotionNotify
+V006 XInputExtension:DeviceFocusIn
+V007 XInputExtension:DeviceFocusOut
+V008 XInputExtension:ProximityIn
+V009 XInputExtension:ProximityOut
+V010 XInputExtension:DeviceStateNotify
+V011 XInputExtension:DeviceMappingNotify
+V012 XInputExtension:ChangeDeviceNotify
+V013 XInputExtension:DeviceKeystateNotify
+V014 XInputExtension:DeviceButtonstateNotify
+V015 XInputExtension:DevicePresenceNotify
+V016 XInputExtension:DevicePropertyNotify
+E000 XInputExtension:BadDevice
+E001 XInputExtension:BadEvent
+E002 XInputExtension:BadMode
+E003 XInputExtension:DeviceBusy
+E004 XInputExtension:BadClass
+R000 XKEYBOARD:UseExtension
+R001 XKEYBOARD:SelectEvents
+R002 XKEYBOARD:Obsolete
+R003 XKEYBOARD:Bell
+R004 XKEYBOARD:GetState
+R005 XKEYBOARD:LatchLockState
+R006 XKEYBOARD:GetControls
+R007 XKEYBOARD:SetControls
+R008 XKEYBOARD:GetMap
+R009 XKEYBOARD:SetMap
+R010 XKEYBOARD:GetCompatMap
+R011 XKEYBOARD:SetCompatMap
+R012 XKEYBOARD:GetIndicatorState
+R013 XKEYBOARD:GetIndicatorMap
+R014 XKEYBOARD:SetIndicatorMap
+R015 XKEYBOARD:GetNamedIndicator
+R016 XKEYBOARD:SetNamedIndicator
+R017 XKEYBOARD:GetNames
+R018 XKEYBOARD:SetNames
+R019 XKEYBOARD:GetGeometry
+R020 XKEYBOARD:SetGeometry
+R021 XKEYBOARD:PerClientFlags
+R022 XKEYBOARD:ListComponents
+R023 XKEYBOARD:GetKbdByName
+R024 XKEYBOARD:GetDeviceInfo
+R025 XKEYBOARD:SetDeviceInfo
+R101 XKEYBOARD:SetDebuggingFlags
+V000 XKEYBOARD:EventCode
+E000 XKEYBOARD:BadKeyboard
+R000 XTEST:GetVersion
+R001 XTEST:CompareCursor
+R002 XTEST:FakeInput
+R003 XTEST:GrabControl
+R000 XVideo:QueryExtension
+R001 XVideo:QueryAdaptors
+R002 XVideo:QueryEncodings
+R003 XVideo:GrabPort
+R004 XVideo:UngrabPort
+R005 XVideo:PutVideo
+R006 XVideo:PutStill
+R007 XVideo:GetVideo
+R008 XVideo:GetStill
+R009 XVideo:StopVideo
+R010 XVideo:SelectVideoNotify
+R011 XVideo:SelectPortNotify
+R012 XVideo:QueryBestSize
+R013 XVideo:SetPortAttribute
+R014 XVideo:GetPortAttribute
+R015 XVideo:QueryPortAttributes
+R016 XVideo:ListImageFormats
+R017 XVideo:QueryImageAttributes
+R018 XVideo:PutImage
+R019 XVideo:ShmPutImage
+V000 XVideo:VideoNotify
+V001 XVideo:PortNotify
+E000 XVideo:BadPort
+E001 XVideo:BadEncoding
+E002 XVideo:BadControl
+R000 XVideo-MotionCompensation:QueryVersion
+R001 XVideo-MotionCompensation:ListSurfaceTypes
+R002 XVideo-MotionCompensation:CreateContext
+R003 XVideo-MotionCompensation:DestroyContext
+R004 XVideo-MotionCompensation:CreateSurface
+R005 XVideo-MotionCompensation:DestroySurface
+R006 XVideo-MotionCompensation:CreateSubpicture
+R007 XVideo-MotionCompensation:DestroySubpicture
+R008 XVideo-MotionCompensation:ListSubpictureTypes
+R009 XVideo-MotionCompensation:GetDRInfo
+E000 XVideo-MotionCompensation:BadContext
+E001 XVideo-MotionCompensation:BadSurface
+E002 XVideo-MotionCompensation:BadSubpicture
diff --git a/overlay/rootfs/usr/share/X11/xorg.conf.d/10-quirks.conf b/overlay/rootfs/usr/share/X11/xorg.conf.d/10-quirks.conf
new file mode 100644
index 0000000..54dd908
--- /dev/null
+++ b/overlay/rootfs/usr/share/X11/xorg.conf.d/10-quirks.conf
@@ -0,0 +1,48 @@
+# Collection of quirks and blacklist/whitelists for specific devices.
+
+
+# Accelerometer device, posts data through ABS_X/ABS_Y, making X unusable
+# http://bugs.freedesktop.org/show_bug.cgi?id=22442
+Section "InputClass"
+ Identifier "ThinkPad HDAPS accelerometer blacklist"
+ MatchProduct "ThinkPad HDAPS accelerometer data"
+ Option "Ignore" "on"
+EndSection
+
+# https://bugzilla.redhat.com/show_bug.cgi?id=523914
+# Mouse does not move in PV Xen guest
+# Explicitly tell evdev to not ignore the absolute axes.
+Section "InputClass"
+ Identifier "Xen Virtual Pointer axis blacklist"
+ MatchProduct "Xen Virtual Pointer"
+ Option "IgnoreAbsoluteAxes" "off"
+ Option "IgnoreRelativeAxes" "off"
+EndSection
+
+# https://bugs.freedesktop.org/show_bug.cgi?id=55867
+# Bug 55867 - Doesn't know how to tag XI_TRACKBALL
+Section "InputClass"
+ Identifier "Tag trackballs as XI_TRACKBALL"
+ MatchProduct "trackball"
+ MatchDriver "evdev"
+ Option "TypeName" "TRACKBALL"
+EndSection
+
+# https://bugs.freedesktop.org/show_bug.cgi?id=62831
+# Bug 62831 - Mionix Naos 5000 mouse detected incorrectly
+Section "InputClass"
+ Identifier "Tag Mionix Naos 5000 mouse XI_MOUSE"
+ MatchProduct "La-VIEW Technology Naos 5000 Mouse"
+ MatchDriver "evdev"
+ Option "TypeName" "MOUSE"
+EndSection
+
+# https://bugzilla.redhat.com/show_bug.cgi?id=2152414
+# Xorg server does not correctly select the DCP for the display without
+# a quirk on Apple Silicon
+Section "OutputClass"
+ Identifier "appledrm"
+ MatchDriver "apple"
+ Driver "modesetting"
+ Option "PrimaryGPU" "true"
+EndSection
diff --git a/overlay/rootfs/usr/share/X11/xorg.conf.d/40-libinput.conf b/overlay/rootfs/usr/share/X11/xorg.conf.d/40-libinput.conf
new file mode 100644
index 0000000..eb33ad0
--- /dev/null
+++ b/overlay/rootfs/usr/share/X11/xorg.conf.d/40-libinput.conf
@@ -0,0 +1,52 @@
+# Match on all types of devices but joysticks
+#
+# If you want to configure your devices, do not copy this file.
+# Instead, use a config snippet that contains something like this:
+#
+# Section "InputClass"
+# Identifier "something or other"
+# MatchDriver "libinput"
+#
+# MatchIsTouchpad "on"
+# ... other Match directives ...
+# Option "someoption" "value"
+# EndSection
+#
+# This applies the option any libinput device also matched by the other
+# directives. See the xorg.conf(5) man page for more info on
+# matching devices.
+
+Section "InputClass"
+ Identifier "libinput pointer catchall"
+ MatchIsPointer "on"
+ MatchDevicePath "/dev/input/event*"
+ Driver "libinput"
+EndSection
+
+Section "InputClass"
+ Identifier "libinput keyboard catchall"
+ MatchIsKeyboard "on"
+ MatchDevicePath "/dev/input/event*"
+ Driver "libinput"
+EndSection
+
+Section "InputClass"
+ Identifier "libinput touchpad catchall"
+ MatchIsTouchpad "on"
+ MatchDevicePath "/dev/input/event*"
+ Driver "libinput"
+EndSection
+
+Section "InputClass"
+ Identifier "libinput touchscreen catchall"
+ MatchIsTouchscreen "on"
+ MatchDevicePath "/dev/input/event*"
+ Driver "libinput"
+EndSection
+
+Section "InputClass"
+ Identifier "libinput tablet catchall"
+ MatchIsTablet "on"
+ MatchDevicePath "/dev/input/event*"
+ Driver "libinput"
+EndSection
diff --git a/overlay/rootfs/usr/share/dbus-1/services/org.freedesktop.impl.portal.PermissionStore.service b/overlay/rootfs/usr/share/dbus-1/services/org.freedesktop.impl.portal.PermissionStore.service
new file mode 100644
index 0000000..d9b3756
--- /dev/null
+++ b/overlay/rootfs/usr/share/dbus-1/services/org.freedesktop.impl.portal.PermissionStore.service
@@ -0,0 +1,3 @@
+[D-BUS Service]
+Name=org.freedesktop.impl.portal.PermissionStore
+Exec=/bin/true
diff --git a/overlay/rootfs/usr/share/dbus-1/services/org.freedesktop.impl.portal.desktop.gtk.service b/overlay/rootfs/usr/share/dbus-1/services/org.freedesktop.impl.portal.desktop.gtk.service
new file mode 100644
index 0000000..575b0bb
--- /dev/null
+++ b/overlay/rootfs/usr/share/dbus-1/services/org.freedesktop.impl.portal.desktop.gtk.service
@@ -0,0 +1,3 @@
+[D-BUS Service]
+Name=org.freedesktop.impl.portal.desktop.gtk
+Exec=/bin/true
diff --git a/overlay/rootfs/usr/share/dbus-1/services/org.freedesktop.portal.Desktop.service b/overlay/rootfs/usr/share/dbus-1/services/org.freedesktop.portal.Desktop.service
new file mode 100644
index 0000000..4a04bc5
--- /dev/null
+++ b/overlay/rootfs/usr/share/dbus-1/services/org.freedesktop.portal.Desktop.service
@@ -0,0 +1,3 @@
+[D-BUS Service]
+Name=org.freedesktop.portal.Desktop
+Exec=/bin/true
diff --git a/overlay/rootfs/usr/share/dbus-1/services/org.freedesktop.portal.Documents.service b/overlay/rootfs/usr/share/dbus-1/services/org.freedesktop.portal.Documents.service
new file mode 100644
index 0000000..2c42a81
--- /dev/null
+++ b/overlay/rootfs/usr/share/dbus-1/services/org.freedesktop.portal.Documents.service
@@ -0,0 +1,3 @@
+[D-BUS Service]
+Name=org.freedesktop.portal.Documents
+Exec=/bin/true
diff --git a/overlay/rootfs/usr/share/polkit-1/rules.d/00-sxmo.rules b/overlay/rootfs/usr/share/polkit-1/rules.d/00-sxmo.rules
new file mode 100644
index 0000000..1051798
--- /dev/null
+++ b/overlay/rootfs/usr/share/polkit-1/rules.d/00-sxmo.rules
@@ -0,0 +1,8 @@
+polkit.addRule(function(action, subject) {
+ if ((action.id.indexOf("org.freedesktop.ModemManager1.") == 0 ||
+ action.id.indexOf("org.freedesktop.login1.") == 0 ||
+ action.id.indexOf("org.freedesktop.NetworkManager.") == 0) &&
+ (subject.isInGroup("plugdev") || subject.isInGroup("wheel"))) {
+ return polkit.Result.YES;
+ }
+});
diff --git a/overlay/rootfs/usr/share/sxmo/appcfg/Xresources b/overlay/rootfs/usr/share/sxmo/appcfg/Xresources
new file mode 100644
index 0000000..1c20b87
--- /dev/null
+++ b/overlay/rootfs/usr/share/sxmo/appcfg/Xresources
@@ -0,0 +1,23 @@
+! Space to setup configversion
+! configversion: 7bff124b2de16292fe6e7a7e5d3322ae
+
+dmenu.font: Fira Code:pixelsize=18:style=Regular:antialias=true:autohint=true
+dmenu.background: #1c1c1c
+dmenu.foreground: #e0e0e0
+dmenu.selbackground: #005577
+dmenu.selforeground: #ffffff
+
+dwm.font: Fira Code, DejaVuSansM Nerd Font 15px
+dwm.normbgcolor: #323232
+dwm.normbordercolor: #444444
+dwm.normfgcolor: #dddddd
+dwm.selbgcolor: #005577
+dwm.selbordercolor: #005577
+dwm.selfgcolor: #ffffff
+
+st.font: Fira Code:pixelsize=15:style=Regular:antialias=true:autohint=true
+st.background: #1c1c1c
+st.foreground: #e5e5e5
+st.cursorColor: #cccccc
+
+svkbd.font: Fira Code:pixelsize=12
diff --git a/overlay/rootfs/usr/share/sxmo/appcfg/conky.conf b/overlay/rootfs/usr/share/sxmo/appcfg/conky.conf
index 8c00ea7..37a7734 100644
--- a/overlay/rootfs/usr/share/sxmo/appcfg/conky.conf
+++ b/overlay/rootfs/usr/share/sxmo/appcfg/conky.conf
@@ -1,18 +1,24 @@
-- Space to setup configversion
-- configversion: 19ec5c7f9e83bc6534d657f6180feba2
conky.config = {
- out_to_x = false,
- out_to_wayland = true,
+ output_backend = 'x11',
+ out_to_x = true,
+ out_to_wayland = false,
+ own_window = true,
+ own_window_type = 'override',
+ own_window_transparent = true,
+ own_window_hints = 'undecorated,below,sticky,skip_taskbar,skip_pager',
+ double_buffer = true,
alignment = 'top_middle',
- gap_y = 12,
- own_window_argb_value = 0,
- own_window_type = 'desktop',
+ gap_x = 0,
+ gap_y = 34,
+ default_color = 'white',
default_shade_color = 'black',
draw_shades = true,
- font = 'Sxmo:size=13',
+ font = 'Fira Code:size=14:style=Regular',
use_xft = true,
update_interval = 15,
}
-conky.text = [[${alignc}${font Sxmo:size=34:style=Bold}${time %H:%M}${font}
-${alignc}${font Sxmo:size=14:style=Bold}${time %a %d %b %Y}${font}]]
+conky.text = [[${alignc}${font Fira Code:size=32:style=Regular}${time %H:%M}${font}
+${voffset 4}${alignc}${font Fira Code:size=14:style=Regular}${time %a %d %b %Y}${font}]]
diff --git a/overlay/rootfs/usr/share/sxmo/appcfg/dunst.conf b/overlay/rootfs/usr/share/sxmo/appcfg/dunst.conf
index 2759edb..a8674fc 100644
--- a/overlay/rootfs/usr/share/sxmo/appcfg/dunst.conf
+++ b/overlay/rootfs/usr/share/sxmo/appcfg/dunst.conf
@@ -9,7 +9,7 @@
frame_width = 2
frame_color = "#005577"
idle_threshold = 120
- font = Monospace 12
+ font = Fira Code 9.5
markup = full
max_icon_size = 24
dmenu = sxmo_dmenu.sh -p dunst:
diff --git a/overlay/rootfs/usr/share/sxmo/appcfg/fontconfig.conf b/overlay/rootfs/usr/share/sxmo/appcfg/fontconfig.conf
new file mode 100644
index 0000000..dadd651
--- /dev/null
+++ b/overlay/rootfs/usr/share/sxmo/appcfg/fontconfig.conf
@@ -0,0 +1,37 @@
+
+
+
+
+
+ Sxmo
+
+ Fira Code
+ DejaVu SansM Nerd Font
+ Dejavu Sans Mono Nerd Font
+
+
+
+ monospace
+
+ Fira Code
+ DejaVu SansM Nerd Font
+ Dejavu Sans Mono Nerd Font
+
+
+
+ sans-serif
+
+ Fira Code
+ DejaVu SansM Nerd Font
+ Dejavu Sans Mono Nerd Font
+
+
+
+ serif
+
+ Fira Code
+ DejaVu SansM Nerd Font
+ Dejavu Sans Mono Nerd Font
+
+
+
diff --git a/overlay/rootfs/usr/share/sxmo/appcfg/foot.ini b/overlay/rootfs/usr/share/sxmo/appcfg/foot.ini
deleted file mode 100644
index a263aad..0000000
--- a/overlay/rootfs/usr/share/sxmo/appcfg/foot.ini
+++ /dev/null
@@ -1,40 +0,0 @@
-# Space to setup configversion
-# configversion: 13fb3d2d9f97f4420f7506e72b90e77d
-font=monospace:size=13
-dpi-aware=no
-pad=2x2
-
-[colors-dark]
-# alpha=1.0
-foreground=eaeaea
-background=000000
-regular0=000000 # black
-regular1=d54e53 # red
-regular2=b9ca4a # green
-regular3=e6c547 # yellow
-regular4=7aa6da # blue
-regular5=c397d8 # magenta
-regular6=70c0ba # cyan
-regular7=eaeaea # white
-bright0=666666 # bright black
-bright1=ff3334 # bright red
-bright2=9ec400 # bright green
-bright3=e7c547 # bright yellow
-bright4=7aa6da # bright blue
-bright5=b77ee0 # bright magenta
-bright6=54ced6 # bright cyan
-bright7=ffffff # bright white
-
-[scrollback]
-lines=5000
-
-[key-bindings]
-scrollback-up-page=Shift+Page_Up
-scrollback-down-page=Shift+Page_Down
-scrollback-up-half-page=Page_Up
-scrollback-down-half-page=Page_Down
-scrollback-up-line=Shift+Up
-scrollback-down-line=Shift+Down
-scrollback-home=Shift+Home
-scrollback-end=Shift+End
-
diff --git a/overlay/rootfs/usr/share/sxmo/appcfg/profile_template b/overlay/rootfs/usr/share/sxmo/appcfg/profile_template
new file mode 100755
index 0000000..ce9b5ae
--- /dev/null
+++ b/overlay/rootfs/usr/share/sxmo/appcfg/profile_template
@@ -0,0 +1,89 @@
+#!/bin/sh
+# configversion: e7cdaa3a889d251bed8a89ce8c622995
+
+# shellcheck source=scripts/core/sxmo_common.sh
+. sxmo_common.sh
+
+# Please modify this file to your liking
+
+# Important Instructions:
+# All processes you launch from this script must
+# be non-blocking: launch them in the background (using &)
+# or ensure they return quickly. Only after this script
+# finishes will the window manager be loaded
+
+# You will sometime get SMS or calls from not
+# country code prefixed phone numbers. To make
+# it easy to fixup configure the default countryu.
+#export DEFAULT_COUNTRY=FR
+
+### Configuration Parameters ###
+
+# Note that this is just a subset of all available
+# parameters, see the sxmo documentation for more.
+
+# Use firefox as default browser if installed
+command -v firefox >/dev/null && export BROWSER=firefox
+
+# Prepopulate Subreddits menu with custom subreddits
+#export SXMO_SUBREDDITS="postmarketos pinephoneOfficial pinephone unixporn"
+
+# Change the default terminal command
+export TERMCMD="sxmo_terminal.sh"
+
+# Change the used terminal command
+# export SXMO_TERMINAL="st"
+
+# When scrolling past the beginning or end of a menu, wrap it around:
+#export DMENU_WRAP_AROUND=1
+
+# Enable audio feedback on keypress
+#export KEYBOARD_ARGS="-o | clickclack -f $(xdg_data_path sxmo/keytap.wav)"
+
+# Or, enable vibration feedback on keypress
+#export KEYBOARD_ARGS="-o | clickclack -V"
+
+# Set the scale factor in sway
+# export SXMO_SWAY_SCALE=2
+
+# To load specific part of configuration depending on the running environment
+case "$SXMO_WM" in
+ sway)
+ ;;
+ dwm)
+ ;;
+esac
+
+#Set RINGTONE to audio file to play for incoming call
+export SXMO_RINGTONE="$(xdg_data_path sxmo/ring.ogg)"
+
+#Set TEXTSOUND to audio file to play when received text message
+export SXMO_TEXTSOUND="$(xdg_data_path sxmo/notify.ogg)"
+
+#Set RINGTIME to number of seconds the phone will ring
+export SXMO_RINGTIME=20
+
+#Set RINGNUMBER to number of times phone will ring or repeat ringtone
+#(whichever of SXMO_RINGTIME or SXMO_RINGNUMBER runs less will limit how long phone rings)
+export SXMO_RINGNUMBER=10
+
+#Set to the default text for a new text message.
+export SXMO_DEFAULT_DRAFT="Enter new message here."
+
+export PATH="$HOME/.local/bin:$PATH"
+export SXMO_WM="dwm"
+export SXMO_MENU="dmenu"
+export SXMO_TERMINAL="st"
+export DMENU_WRAP_AROUND=1
+export SXMO_DMENU_PORTRAIT_LINES=12
+export SXMO_DMENU_LANDSCAPE_LINES=8
+export SXMO_DISABLE_LEDS=1
+export SXMO_NO_VIRTUAL_KEYBOARD=1
+export NO_AT_BRIDGE=1
+export GTK_A11Y=none
+export GTK_USE_PORTAL=0
+export GTK_IM_MODULE=fcitx
+export QT_IM_MODULE=fcitx
+export XMODIFIERS=@im=fcitx
+
+export SXMO_BG_IMG="/usr/share/wallpapers/bananarchy.png"
diff --git a/overlay/rootfs/usr/share/sxmo/appcfg/sway_template b/overlay/rootfs/usr/share/sxmo/appcfg/sway_template
deleted file mode 100644
index de6396b..0000000
--- a/overlay/rootfs/usr/share/sxmo/appcfg/sway_template
+++ /dev/null
@@ -1,296 +0,0 @@
-# Default config for sway
-# configversion: 076611fe8cc699bcaa01092a8e4481c0
-#
-# Copy this to ~/.config/sway/config and edit it to your liking.
-#
-# Read `man 5 sway` for a complete reference.
-
-### Variables
-#
-# Logo key. Use Mod1 for Alt.
-set $mod Mod4
-# Home row direction keys, like vim
-set $left h
-set $down j
-set $up k
-set $right l
-# Your preferred terminal emulator
-set $term sxmo_terminal.sh
-# Your preferred application launcher
-# Note: pass the final command to swaymsg so that the resulting window can be opened
-# on the original workspace that the command was run on.
-set $menu bemenu-run
-
-font "Sxmo 13"
-xwayland disable
-output * scale 1 bg /usr/share/wallpapers/bananarchy.png fill
-default_orientation vertical
-
-exec_always sxmo_swayinitconf.sh
-
-exec_always dbus-update-activation-environment WAYLAND_DISPLAY DISPLAY XDG_CURRENT_DESKTOP
-
-mode "menu" {
- bindsym --locked XF86PowerOff exec sh -c "sxmo_dmenu.sh close; if sxmo_state.sh is_locked; then sxmo_state.sh set unlock; sxmo_wm.sh display on; fi"
- bindsym --locked XF86PickupPhone exec sh -c "if sxmo_state.sh is_locked; then sxmo_state.sh set unlock; sxmo_wm.sh display on; else wtype -k Return; fi"
- bindsym --locked XF86KbdLcdMenu1 exec sh -c "sxmo_dmenu.sh close; if sxmo_state.sh is_locked; then sxmo_state.sh set unlock; sxmo_wm.sh display on; fi"
- bindsym --locked XF86KbdLcdMenu2 exec sh -c "sxmo_dmenu.sh close; if sxmo_state.sh is_locked; then sxmo_state.sh set unlock; sxmo_wm.sh display on; fi"
- bindsym XF86AudioRaiseVolume exec wtype -k Up
- bindsym XF86AudioLowerVolume exec wtype -k Down
- bindswitch --locked lid:on exec sh -c "sxmo_dmenu.sh close; brightnessctl -d white:kbd_backlight set 0; sxmo_state.sh set screenoff"
- bindswitch --locked lid:off exec sh -c "brightnessctl -d white:kbd_backlight set 255; sxmo_state.sh set unlock; sxmo_wm.sh display on"
-}
-
-# Mode specifically for use with Nokia N900 hardware keyboard
-mode "N900" {
- # follow the standard sxmo keybinds as far as possible
- bindsym t exec $term; mode "default"
- bindsym q mode "default"
- bindsym Shift+p exec sxmo_appmenu.sh sys; mode "default"
- bindsym p exec sxmo_appmenu.sh; mode "default"
- bindsym d exec $menu; mode "default"
- bindsym Shift+q kill; mode "default"
- bindsym i exec sxmo_wmmenu.sh windowswitcher; mode "default"
- bindsym Shift+c reload; mode "default"
- bindsym f fullscreen; mode "default"
- bindsym Shift+space floating toggle; mode "default"
- bindsym a focus parent; mode "default"
-}
-
-### Key bindings
-#
-# Basics:
-#
- input * xkb_options compose:ralt
-
- # Nokia N900 hardware keyboard
- input "1:1:TWL4030_Keypad" {
- xkb_model "nokiarx51"
- xkb_layout "us"
- # ralt has special meaning on N900 keyboard so do not use as
- # compose key
- xkb_options compose:rwin
- }
-
- # Start a terminal
- bindsym $mod+Return exec $term
-
- # Launch appmenu
- bindsym $mod+p exec sxmo_appmenu.sh
- bindsym $mod+Shift+p exec sxmo_appmenu.sh sys
-
- # Wm menu switcher
- bindsym $mod+i exec sxmo_wmmenu.sh windowswitcher
-
- # Kill focused window
- bindsym $mod+Shift+q kill
-
- # Start your launcher
- bindsym $mod+d exec $menu
-
- # Drag floating windows by holding down $mod and left mouse button.
- # Resize them with right mouse button + $mod.
- # Despite the name, also works for non-floating windows.
- # Change normal to inverse to use left mouse button for resizing and right
- # mouse button for dragging.
- floating_modifier $mod normal
-
- # Reload the configuration file
- bindsym $mod+Shift+c reload
-
- # Exit sway (logs you out of your Wayland session)
- bindsym $mod+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'sxmo_power.sh logout'
-#
-# Moving around:
-#
- # Move your focus around
- bindsym $mod+$left focus left
- bindsym $mod+$down focus down
- bindsym $mod+$up focus up
- bindsym $mod+$right focus right
- # Or use $mod+[up|down|left|right]
- bindsym $mod+Left focus left
- bindsym $mod+Down focus down
- bindsym $mod+Up focus up
- bindsym $mod+Right focus right
-
- # Move the focused window with the same, but add Shift
- bindsym $mod+Shift+$left move left
- bindsym $mod+Shift+$down move down
- bindsym $mod+Shift+$up move up
- bindsym $mod+Shift+$right move right
- # Ditto, with arrow keys
- bindsym $mod+Shift+Left move left
- bindsym $mod+Shift+Down move down
- bindsym $mod+Shift+Up move up
- bindsym $mod+Shift+Right move right
-
- # Move the focused workspace to output
- bindsym $mod+Shift+Ctrl+$left move workspace output left
- bindsym $mod+Shift+Ctrl+$down move workspace output down
- bindsym $mod+Shift+Ctrl+$up move workspace output up
- bindsym $mod+Shift+Ctrl+$right move workspace output right
-#
-# Workspaces:
-#
- # Switch to workspace
- bindsym $mod+1 workspace number 1
- bindsym $mod+2 workspace number 2
- bindsym $mod+3 workspace number 3
- bindsym $mod+4 workspace number 4
- bindsym $mod+5 workspace number 5
- bindsym $mod+6 workspace number 6
- bindsym $mod+7 workspace number 7
- bindsym $mod+8 workspace number 8
- bindsym $mod+9 workspace number 9
- bindsym $mod+0 workspace number 10
- # Move focused container to workspace
- bindsym $mod+Shift+1 move container to workspace number 1
- bindsym $mod+Shift+2 move container to workspace number 2
- bindsym $mod+Shift+3 move container to workspace number 3
- bindsym $mod+Shift+4 move container to workspace number 4
- bindsym $mod+Shift+5 move container to workspace number 5
- bindsym $mod+Shift+6 move container to workspace number 6
- bindsym $mod+Shift+7 move container to workspace number 7
- bindsym $mod+Shift+8 move container to workspace number 8
- bindsym $mod+Shift+9 move container to workspace number 9
- bindsym $mod+Shift+0 move container to workspace number 10
- # Note: workspaces can have any name you want, not just numbers.
- # We just use 1-10 as the default.
-#
-# Layout stuff:
-#
- # You can "split" the current object of your focus with
- # $mod+b or $mod+v, for horizontal and vertical splits
- # respectively.
- bindsym $mod+b splith
- bindsym $mod+v splitv
-
- # Switch the current container between different layout styles
- bindsym $mod+s layout stacking
- bindsym $mod+w layout tabbed
- bindsym $mod+e layout toggle split
-
- # Make the current focus fullscreen
- bindsym $mod+f fullscreen
-
- # Toggle the current focus between tiling and floating mode
- bindsym $mod+Shift+space floating toggle
-
- # Swap focus between the tiling area and the floating area
- bindsym $mod+space focus mode_toggle
-
- # Move focus to the parent container
- bindsym $mod+a focus parent
-
- # Manual locker
- bindsym $mod+g exec sxmo_state.sh set locker
-
- # Shutdown
- bindsym $mod+t exec sxmo_appmenu.sh power
-
-#
-# Scratchpad:
-#
- # Sway has a "scratchpad", which is a bag of holding for windows.
- # You can send windows there and get them back later.
-
- # Move the currently focused window to the scratchpad
- bindsym $mod+Shift+minus move scratchpad
-
- # Show the next scratchpad window or hide the focused scratchpad window.
- # If there are multiple scratchpad windows, this command cycles through them.
- bindsym $mod+minus scratchpad show
-#
-# Resizing containers:
-#
-mode "resize" {
- # left will shrink the containers width
- # right will grow the containers width
- # up will shrink the containers height
- # down will grow the containers height
- bindsym $left resize shrink width 30px
- bindsym $down resize grow height 30px
- bindsym $up resize shrink height 30px
- bindsym $right resize grow width 30px
-
- # Ditto, with arrow keys
- bindsym Left resize shrink width 30px
- bindsym Down resize grow height 30px
- bindsym Up resize shrink height 30px
- bindsym Right resize grow width 30px
-
- # Return to default mode
- bindsym Return mode "default"
- bindsym Escape mode "default"
-}
-bindsym $mod+r mode "resize"
-
-#
-# Status Bar:
-#
-# Read `man 5 sway-bar` for more information about this section.
-bar {
- position top
- height 24
- font "Sxmo 13"
-
- # When the status_command prints a new line to stdout, swaybar updates.
- # The default just shows the current date and time.
- status_command sxmo_status_watch.sh -o pango
-
- pango_markup enabled
-
- colors {
- statusline #ffffff
- background #323232
- inactive_workspace #323232 #323232 #ffffff
- font "Sxmo 13"
- }
-}
-
-for_window [app_id="pinentry-.*"] floating true
-for_window [app_id="foot" title=".*sxmo/modem/.*/draft.txt.*"] resize set height 25
-for_window [title="megapixels"] inhibit_idle open
-for_window [title="ep[yr].*"] inhibit_idle visible
-
-default_border pixel 2
-titlebar_border_thickness 2
-hide_edge_borders smart
-
-# Need playerctl installed and running
-bindsym --locked XF86AudioPlay exec playerctl play-pause
-bindsym --locked XF86AudioPause exec playerctl play-pause
-bindsym --locked XF86AudioStop exec playerctl stop
-bindsym --locked XF86AudioNext exec playerctl next
-bindsym --locked XF86AudioPrev exec playerctl previous
-
-bindsym --locked XF86MonBrightnessUp exec sxmo_brightness.sh up
-bindsym --locked XF86MonBrightnessDown exec sxmo_brightness.sh down
-
-# Nokia N900-specific key bindings:
-# 1. Bind lock key (XF86ScreenSaver)
-# Use keycode due to https://github.com/swaywm/sway/issues/8438
-bindcode --release --locked --input-device="1:1:gpio_keys" 160 exec sxmo_state.sh set unlock
-# 2. Workaround the lack of a free ModX key on hardware keyboard
-bindsym --input-device="1:1:TWL4030_Keypad" Shift+space mode "N900"
-
-bindsym Print exec sxmo_screenshot.sh
-
-bindsym button2 kill
-
-bindswitch --locked lid:on exec sh -c "brightnessctl -d white:kbd_backlight set 0; sxmo_state.sh set screenoff"
-bindswitch --locked lid:off exec sh -c "brightnessctl -d white:kbd_backlight set 255; sxmo_state.sh set unlock; sxmo_wm.sh display on"
-
-# Nokia 8110 4G hardware keypad bindings (User:Ybon)
-bindsym --locked --no-repeat XF86KbdLcdMenu1 exec sxmo_hook_inputhandler.sh menuleft_one
-bindsym --locked --no-repeat XF86KbdLcdMenu2 exec sxmo_hook_inputhandler.sh menuright_one
-bindsym --locked --no-repeat XF86PickupPhone exec sxmo_multikey.sh pickup enter_one enter_two enter_three
-
-include /etc/sway/config.d/*
-
-exec 'printf %s "$SWAYSOCK" > "$XDG_RUNTIME_DIR"/sxmo.swaysock'
-
-exec sxmo_hook_start.sh
-
-# vim: ft=swayconfig
diff --git a/overlay/rootfs/usr/share/sxmo/appcfg/wob.ini b/overlay/rootfs/usr/share/sxmo/appcfg/wob.ini
deleted file mode 100644
index 144c86a..0000000
--- a/overlay/rootfs/usr/share/sxmo/appcfg/wob.ini
+++ /dev/null
@@ -1,6 +0,0 @@
-# Space to setup configversion
-# configversion: 4de2da84af48414f557742c29bde606e
-anchor = top
-width = 220
-height = 28
-margin = 28
diff --git a/overlay/rootfs/usr/share/sxmo/appcfg/wofi.css b/overlay/rootfs/usr/share/sxmo/appcfg/wofi.css
deleted file mode 100644
index d0795ad..0000000
--- a/overlay/rootfs/usr/share/sxmo/appcfg/wofi.css
+++ /dev/null
@@ -1,51 +0,0 @@
-/* Space to setup configversion */
-/* configversion: 2ecca20b604bc0b37d13aba5a0fabc07 */
-* {
- font-family: monospace;
- font-size: 15px;
-}
-
-window {
- margin: 0px;
- border: 2px solid #005577;
- background-color: #1c1c1c;
-}
-
-#input {
- margin: 0px;
- padding: 4px 6px;
- border-radius: 0px;
- border: 1px solid #005577;
- background-color: #383838;
- color: #ffffff;
- font-size: 15px;
- font-weight: bold;
-}
-
-#inner-box {
- margin: 0px;
-}
-
-#outer-box {
- margin: 1px;
-}
-
-#scroll {
- margin: 0px;
- color: #ffdd00;
-}
-
-#text {
- margin: 1px 4px;
- color: #ffffff;
-}
-
-#entry {
- padding: 3px 2px;
- margin: 0px;
-}
-
-#entry:selected {
- background-color: #005577;
- font-weight: bold;
-}
diff --git a/overlay/rootfs/usr/share/sxmo/appcfg/xinit_template b/overlay/rootfs/usr/share/sxmo/appcfg/xinit_template
new file mode 100755
index 0000000..08a1ae8
--- /dev/null
+++ b/overlay/rootfs/usr/share/sxmo/appcfg/xinit_template
@@ -0,0 +1,7 @@
+#!/bin/sh
+# configversion: 36730424afa6d6bf9e9fb6d111c35504
+
+dbus-update-activation-environment DISPLAY XDG_CURRENT_DESKTOP
+
+# Run actions on start
+sxmo_hook_start.sh &
diff --git a/overlay/rootfs/usr/share/sxmo/conky.conf b/overlay/rootfs/usr/share/sxmo/conky.conf
index 8c00ea7..37a7734 100644
--- a/overlay/rootfs/usr/share/sxmo/conky.conf
+++ b/overlay/rootfs/usr/share/sxmo/conky.conf
@@ -1,18 +1,24 @@
-- Space to setup configversion
-- configversion: 19ec5c7f9e83bc6534d657f6180feba2
conky.config = {
- out_to_x = false,
- out_to_wayland = true,
+ output_backend = 'x11',
+ out_to_x = true,
+ out_to_wayland = false,
+ own_window = true,
+ own_window_type = 'override',
+ own_window_transparent = true,
+ own_window_hints = 'undecorated,below,sticky,skip_taskbar,skip_pager',
+ double_buffer = true,
alignment = 'top_middle',
- gap_y = 12,
- own_window_argb_value = 0,
- own_window_type = 'desktop',
+ gap_x = 0,
+ gap_y = 34,
+ default_color = 'white',
default_shade_color = 'black',
draw_shades = true,
- font = 'Sxmo:size=13',
+ font = 'Fira Code:size=14:style=Regular',
use_xft = true,
update_interval = 15,
}
-conky.text = [[${alignc}${font Sxmo:size=34:style=Bold}${time %H:%M}${font}
-${alignc}${font Sxmo:size=14:style=Bold}${time %a %d %b %Y}${font}]]
+conky.text = [[${alignc}${font Fira Code:size=32:style=Regular}${time %H:%M}${font}
+${voffset 4}${alignc}${font Fira Code:size=14:style=Regular}${time %a %d %b %Y}${font}]]
diff --git a/overlay/rootfs/usr/share/sxmo/default_hooks/sxmo_hook_apps.sh b/overlay/rootfs/usr/share/sxmo/default_hooks/sxmo_hook_apps.sh
index 2ff9555..1c7642c 100755
--- a/overlay/rootfs/usr/share/sxmo/default_hooks/sxmo_hook_apps.sh
+++ b/overlay/rootfs/usr/share/sxmo/default_hooks/sxmo_hook_apps.sh
@@ -8,6 +8,15 @@
# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
. sxmo_hook_icons.sh
+APPS_CACHE="${XDG_RUNTIME_DIR:-/tmp}/sxmo_apps.cache"
+if [ -f "$APPS_CACHE" ] && [ ! "$0" -nt "$APPS_CACHE" ] && [ ! /usr/bin -nt "$APPS_CACHE" ] && [ ! /usr/local/bin -nt "$APPS_CACHE" ]; then
+ cat "$APPS_CACHE"
+ exit 0
+fi
+
+exec 3>&1 > "$APPS_CACHE.tmp"
+trap 'mv -f "$APPS_CACHE.tmp" "$APPS_CACHE" 2>/dev/null; cat "$APPS_CACHE" >&3 2>/dev/null' EXIT
+
write_line() {
printf "%s ^ 0 ^ %s\n" "$1" "$2"
}
@@ -69,8 +78,6 @@ write_line_app firefox-esr "$icon_ffx Firefox ESR" "firefox-esr"
write_line_app flare "$icon_msg Flare" "flare"
write_line_app flowtime "$icon_hrg Flowtime" "flowtime"
write_line_app foliate "$icon_bok Foliate" "foliate"
-( [ -n "$WAYLAND_DISPLAY" ] && command -v foot >/dev/null) && \
- write_line "$icon_trm Foot" "foot $SHELL"
write_line_app foxtrotgps "$icon_gps Foxtrotgps" "foxtrotgps"
write_line_app fractal "$icon_msg Fractal" "fractal"
write_line_app fragments "$icon_rld Fragments" "fragments"
@@ -195,8 +202,7 @@ write_line_app siglo "$icon_clk Siglo" "siglo"
write_line_app simple-scan "$icon_scn Simple Scan" "simple-scan"
write_line_app snapshot "$icon_cam Snapshot" "snapshot"
write_line_app solanum "$icon_pom Solanum" "solanum"
-([ -z "$WAYLAND_DISPLAY" ] && command -v st >/dev/null) && \
- write_line "$icon_trm St" "st -e $SHELL"
+write_line_app st "$icon_trm St" "st -e ${SHELL:-/bin/sh}"
write_line_app supertuxkart "$icon_krt SuperTuxKart" "supertuxkart"
write_line_app surf "$icon_glb Surf" "surf"
write_line_app syncthing "$icon_rld Syncthing" "syncthing"
diff --git a/overlay/rootfs/usr/share/sxmo/default_hooks/sxmo_hook_battery.sh b/overlay/rootfs/usr/share/sxmo/default_hooks/sxmo_hook_battery.sh
index a799d3c..308f188 100755
--- a/overlay/rootfs/usr/share/sxmo/default_hooks/sxmo_hook_battery.sh
+++ b/overlay/rootfs/usr/share/sxmo/default_hooks/sxmo_hook_battery.sh
@@ -1,30 +1,64 @@
#!/bin/sh
# configversion: d031535bc22ba19d69704317b8d50560
-load_data() {
- data="$(upower -i "$1" | grep . | sed -e 's|^ \+||' -e 's|: \+|:|')"
- type="$(printf "%b" "$data" | grep -m1 -v : | sed -e 's|^ \+||')"
-}
-
-data_get() {
- printf "%b" "$data" | grep "^$1:" | cut -d: -f2
-}
-
SET_LED_PATH="$XDG_RUNTIME_DIR/sxmo_hook_battery_set_led"
-device_changed() {
- name="$(data_get "native-path")"
- state="$(data_get "state")"
- percentage="$(data_get "percentage" | cut -d% -f1)"
+object="${1:-/org/freedesktop/UPower/devices/battery_default}"
+event="${2:-device changed}"
- if [ -z "$name" ] || [ -z "$state" ]; then
- return
- fi
+case "$event" in
+ "device changed") ;;
+ *) exit 0 ;;
+esac
- if [ "$state" = unknown ]; then
- return
- fi
+case "$object" in
+ */battery_*)
+ raw_name="${object##*/battery_}"
+ ;;
+ *)
+ exit 0
+ ;;
+esac
+sysfs_dir=""
+if [ -d "/sys/class/power_supply/$raw_name" ]; then
+ sysfs_dir="/sys/class/power_supply/$raw_name"
+ name="$raw_name"
+else
+ for d in /sys/class/power_supply/*; do
+ [ -r "$d/type" ] || continue
+ read -r pstype < "$d/type" 2>/dev/null || continue
+ if [ "$pstype" = "Battery" ]; then
+ sysfs_dir="$d"
+ name="${d##*/}"
+ break
+ fi
+ done
+fi
+
+if [ -n "$sysfs_dir" ] && [ -r "$sysfs_dir/capacity" ] && [ -r "$sysfs_dir/status" ]; then
+ read -r percentage < "$sysfs_dir/capacity" 2>/dev/null || percentage=""
+ read -r raw_status < "$sysfs_dir/status" 2>/dev/null || raw_status=""
+ case "$raw_status" in
+ "Full"|"full") state="fully-charged" ;;
+ "Charging"|"charging") state="charging" ;;
+ "Discharging"|"discharging"|"Not charging"|"not charging") state="discharging" ;;
+ *) state="unknown" ;;
+ esac
+else
+ data="$(upower -i "$object" | grep . | sed -e 's|^ \+||' -e 's|: \+|:|')"
+ type="$(printf "%b" "$data" | grep -m1 -v : | sed -e 's|^ \+||')"
+ [ "$type" = "battery" ] || exit 0
+ name="$(printf "%b" "$data" | grep "^native-path:" | cut -d: -f2)"
+ state="$(printf "%b" "$data" | grep "^state:" | cut -d: -f2)"
+ percentage="$(printf "%b" "$data" | grep "^percentage:" | cut -d: -f2 | cut -d% -f1)"
+fi
+
+if [ -z "$name" ] || [ -z "$state" ] || [ -z "$percentage" ] || [ "$state" = "unknown" ]; then
+ exit 0
+fi
+
+if [ -z "$SXMO_DISABLE_LEDS" ]; then
if [ "$percentage" -lt 25 ] && [ ! -f "$SET_LED_PATH" ]; then
touch "$SET_LED_PATH"
sxmo_led.sh set red 100
@@ -32,21 +66,17 @@ device_changed() {
rm "$SET_LED_PATH"
sxmo_led.sh set red 0
fi
-
- sxmo_hook_statusbar.sh battery "$name" "$state" "$percentage"
-}
-
-object="$1"
-event="$2"
-
-load_data "$object"
-
-if [ "$type" != "battery" ]; then
- exit
fi
-case "$event" in
- "device changed")
- device_changed "$object"
- ;;
-esac
+CACHE_FILE="${XDG_RUNTIME_DIR:-/tmp}/sxmo_bat_state_${name}"
+ICON_FILE="${XDG_RUNTIME_DIR:-/run/user/10000}/sxmo_status/${SXMO_STATUS_NAME:-default}/040-battery-icon-${name}"
+NEW_VAL="${state}:${percentage}"
+if [ -r "$CACHE_FILE" ] && [ -f "$ICON_FILE" ]; then
+ read -r OLD_VAL < "$CACHE_FILE" 2>/dev/null || OLD_VAL=""
+ if [ "$OLD_VAL" = "$NEW_VAL" ]; then
+ exit 0
+ fi
+fi
+printf '%s\n' "$NEW_VAL" > "$CACHE_FILE"
+
+sxmo_hook_statusbar.sh battery "$name" "$state" "$percentage"
diff --git a/overlay/rootfs/usr/share/sxmo/default_hooks/sxmo_hook_contextmenu.sh b/overlay/rootfs/usr/share/sxmo/default_hooks/sxmo_hook_contextmenu.sh
index cc2a635..0be8b43 100755
--- a/overlay/rootfs/usr/share/sxmo/default_hooks/sxmo_hook_contextmenu.sh
+++ b/overlay/rootfs/usr/share/sxmo/default_hooks/sxmo_hook_contextmenu.sh
@@ -23,6 +23,20 @@ sxmo_service_isrunning() {
sxmo_jobs.sh running "$1" -q
}
+bt_is_unblocked() {
+ for rfk in /sys/class/rfkill/rfkill*; do
+ [ -r "$rfk/type" ] || continue
+ read -r rtype < "$rfk/type" 2>/dev/null || continue
+ if [ "$rtype" = "bluetooth" ]; then
+ read -r soft < "$rfk/soft" 2>/dev/null || soft=0
+ read -r hard < "$rfk/hard" 2>/dev/null || hard=0
+ [ "$soft" = "0" ] && [ "$hard" = "0" ] && return 0
+ return 1
+ fi
+ done
+ rfkill list bluetooth -no ID,SOFT,HARD 2>/dev/null | grep -vq " blocked"
+}
+
case "$WMCLASS" in
scripts)
# Scripts menu
@@ -43,11 +57,8 @@ case "$WMCLASS" in
printf %b "$icon_ton ^ 1 ^ superctl stop sxmo_modemmonitor" ||
printf %b "$icon_tof ^ 1 ^ superctl start sxmo_modemmonitor"
) && sxmo_hook_statusbar.sh modem
- $icon_wrh Restart System Daemons ^ 1 ^ sxmo_hook_restart_modem_daemons.sh && sxmo_hook_statusbar.sh modem
$icon_inf Modem Info ^ 0 ^ sxmo_modeminfo.sh
$icon_phl Modem Log ^ 0 ^ sxmo_modemlog.sh
- $icon_img Config MMS ^ 1 ^ sxmo_mmsdconfig.sh
- $icon_img Config VVM ^ 1 ^ sxmo_vvmdconfig.sh
"
WINNAME=Modem
;;
@@ -56,27 +67,12 @@ case "$WMCLASS" in
CHOICES="
$icon_aru Brightness ^ 1 ^ sxmo_brightness.sh up
$icon_ard Brightness ^ 1 ^ sxmo_brightness.sh down
- $icon_cfg Touch $(
- sxmo_wm.sh inputevent touchscreen | grep -q on && \
- printf %b "$icon_ton ^ 1 ^ sxmo_wm.sh inputevent touchscreen off" || \
- printf %b "$icon_tof ^ 1 ^ sxmo_wm.sh inputevent touchscreen on"
- )
- $icon_cfg Stylus $(
- sxmo_wm.sh inputevent stylus | grep -q on && \
- printf %b "$icon_ton ^ 1 ^ sxmo_wm.sh inputevent stylus off" || \
- printf %b "$icon_tof ^ 1 ^ sxmo_wm.sh inputevent stylus on"
- )
- $icon_cfg Gestures $(
- superd_service_isrunning "sxmo_hook_lisgd" &&
- printf "%s" "$icon_ton" || printf "%s" "$icon_tof"
- ) ^ 1 ^ supertoggle_daemon 'sxmo_hook_lisgd' && (rm $XDG_CACHE_HOME/sxmo/sxmo.nogesture 2>/dev/null || touch $XDG_CACHE_HOME/sxmo/sxmo.nogesture)
$icon_cfg Toggle Bar ^ 0 ^ sxmo_wm.sh togglebar
$icon_bth Bluetooth $(
- rfkill list bluetooth -no ID,SOFT,HARD | grep -vq " blocked" &&
+ bt_is_unblocked &&
printf %b "$icon_ton" || printf %b "$icon_tof";
printf %b "^ 1 ^ doas sxmo_bluetoothtoggle.sh && sxmo_hook_statusbar.sh bluetooth"
)
- $(test "$SXMO_WM" = dwm && printf %b "$icon_cfg Invert Colors ^ 1 ^ xcalib -a -invert")
$icon_clk Change Timezone ^ 1 ^ sxmo_timezonechange.sh
$icon_zzz Auto-suspend $(
[ -e "$XDG_CACHE_HOME"/sxmo/sxmo.nosuspend ] && printf "%s" "$icon_tof" || printf "%s" "$icon_ton"
@@ -84,24 +80,7 @@ case "$WMCLASS" in
$icon_zzz Auto-screen-off $(
[ -e "$XDG_CACHE_HOME/sxmo/sxmo.noidle" ] && printf "%s" "$icon_tof" || printf "%s" "$icon_ton"
) ^ 1 ^ (rm $XDG_CACHE_HOME/sxmo/sxmo.noidle 2>/dev/null || touch $XDG_CACHE_HOME/sxmo/sxmo.noidle) && sxmo_state.sh set unlock
- $icon_ror Autorotate $(
- sxmo_jobs.sh running autorotate -q &&
- printf "%s" "$icon_ton" || printf "%s" "$icon_tof"
- ) ^ 1 ^ toggle_daemon 'Autorotate' autorotate sxmo_autorotate.sh
- $([ -n "$SXMO_KEYBOARD_SLIDER_EVENT_DEVICE" ] && echo "$icon_ror Autorotate on Keyboard Open/Close $(
- sxmo_jobs.sh running kb_autorotate -q &&
- printf "%s" "$icon_ton" || printf "%s" "$icon_tof"
- ) ^ 1 ^ toggle_daemon 'Keyboard Autorotate' kb_autorotate sxmo_keyboard_autorotate.sh")
- $icon_ror Rotate ^ 1 ^ sxmo_rotate.sh rotate
- $icon_brightness Adaptive Brightness $(
- superd_service_isrunning sxmo_adaptivebrightness &&
- printf "%s" "$icon_ton" || printf "%s" "$icon_tof"
- ) ^ 1 ^ supertoggle_daemon sxmo_adaptivebrightness
$icon_trm Hooks ^ 0 ^ sxmo_hookmenu.sh
- $icon_upc Upgrade Pkgs ^ 0 ^ sxmo_terminal.sh sxmo_upgrade.sh
- $icon_sfl Migrate configuration ^ 0 ^ sxmo_terminal.sh sxmo_migrate.sh
- $(sxmo_wm.sh configmenuentry)
- $(command -v pmos-tweaks >/dev/null && echo "$icon_cfg PostmarketOS Tweaks ^ 0 ^ GDK_SCALE=1 pmos-tweaks")
$icon_cfg Suspend Blockers ^ 0 ^ sxmo_terminal.sh sxmo_debug_suspend.sh
$icon_inf Log ^ 0 ^ sxmo_terminal.sh tail -n 100 -f ${XDG_STATE_HOME:-$HOME}/sxmo.log
$icon_inf Version ^ 0 ^ sxmo_terminal.sh sxmo_version.sh --block
@@ -114,7 +93,6 @@ case "$WMCLASS" in
$icon_lck Lock ^ 0 ^ sxmo_state.sh set lock
$icon_lck Lock (Screen off) ^ 0 ^ sxmo_state.sh set screenoff
$icon_out Logout ^ 0 ^ confirm Logout && sxmo_power.sh logout
- $icon_rol Switch WM ^ 0 ^ sxmo_power.sh togglewm
$icon_rld Reboot ^ 0 ^ confirm Reboot && sxmo_power.sh reboot
$icon_pwr Poweroff ^ 0 ^ confirm Poweroff && sxmo_power.sh poweroff
"
@@ -213,7 +191,7 @@ case "$WMCLASS" in
"
WINNAME=St
;;
- *foot*|st|st-*|*terminal*|org.gnome.vte.application|org.gnome.vte.app.gtk4|*alacritty*)
+ st|st-*|*terminal*|org.gnome.vte.application|org.gnome.vte.app.gtk4|*alacritty*)
# These git commands only launch the editor.
case "$WMNAME" in
@@ -458,6 +436,8 @@ case "$WMCLASS" in
case "$WMCLASS" in
st|st-*)
CHOICES="
+ $icon_trm New Terminal ^ 0 ^ sxmo_terminal.sh
+ $icon_cls Close Terminal ^ 0 ^ sxmo_killwindow.sh
$icon_itm Type complete ^ 0 ^ sxmo_type -M Ctrl -M Shift -k u
$icon_itm Toggle Selmode ^ 0 ^ sxmo_type -M Ctrl -M Shift -k s
$icon_cpy Copy complete ^ 0 ^ sxmo_type -M Ctrl -M Shift -k i
@@ -472,29 +452,6 @@ case "$WMCLASS" in
"
WINNAME=St
;;
- *foot*)
- CHOICES="
- $icon_win Next Window ^ 0 ^ swaymsg focus next
- $icon_rld Toggle Layout ^ 0 ^ sxmo_wm.sh togglelayout
- $icon_mnu Tile Vertical ^ 0 ^ swaymsg layout splitv && swaymsg splitv
- $icon_grd Tile Horizontal ^ 0 ^ swaymsg layout splith && swaymsg splith
- $icon_trm New Terminal ^ 0 ^ sxmo_terminal.sh
- $icon_cls Close Terminal ^ 0 ^ sxmo_killwindow.sh
- $icon_cpy Copy ^ 0 ^ sxmo_type -M Shift -M Ctrl c
- $icon_pst Paste ^ 0 ^ sxmo_type -M Shift -M Ctrl v
- $icon_zmi Zoom in ^ 1 ^ sxmo_type -M Ctrl +
- $icon_zmo Zoom out ^ 1 ^ sxmo_type -M Ctrl -k Minus
- $icon_aru Scroll up ^ 1 ^ sxmo_type -M Shift -k Prior
- $icon_ard Scroll down ^ 1 ^ sxmo_type -M Shift -k Next
- $icon_lnk URL Mode ^ 0 ^ sxmo_type -M Shift -M Ctrl -k u
- $icon_kbd Hotkeys ^ 0 ^ sxmo_appmenu.sh sthotkeys
- $icon_fnd Search Field ^ 0 ^ sxmo_type -M Ctrl -M Shift -k r
- $icon_aru Search Back ^ 0 ^ sxmo_type -M Ctrl -k r
- $icon_ard Search Forward ^ 0 ^ sxmo_type -M Ctrl -k s
- $icon_itm Search Extend ^ 0 ^ sxmo_type -M Ctrl -k w
- "
- WINNAME=Foot
- ;;
*terminal*|org.gnome.vte.application|org.gnome.vte.app.gtk4)
CHOICES="$icon_kbd Hotkeys ^ 0 ^ sxmo_appmenu.sh sthotkeys"
WINNAME=Terminal
@@ -806,30 +763,28 @@ case "$WMCLASS" in
*)
# Default system menu (no matches)
CHOICES="
- $icon_grd Scripts ^ 0 ^ sxmo_appmenu.sh scripts
+ $icon_trm St ^ 0 ^ st -e ${SHELL:-/bin/sh}
$icon_grd Apps ^ 0 ^ sxmo_appmenu.sh applications
- $([ "$SXMO_MENU" = "wofi" ] && echo "$icon_grd All Apps ^ 0 ^ wofi -O alphabetical -i --show drun")
- $([ "$SXMO_MENU" != "wofi" ] && command -v j4-dmenu-desktop > /dev/null && echo "$icon_grd All Apps ^ 0 ^ j4-dmenu-desktop --dmenu=sxmo_dmenu.sh --term=sxmo_terminal.sh")
- $icon_grd Binaries ^ 0 ^ sxmo_brun.sh
+ $icon_grd Scripts ^ 0 ^ sxmo_appmenu.sh scripts
$icon_dir Files ^ 0 ^ sxmo_files.sh
$icon_phn Dialer ^ 0 ^ sxmo_modemdial.sh
$icon_msg Texts ^ 0 ^ sxmo_modemtext.sh
$icon_usr Contacts ^ 0 ^ sxmo_contactmenu.sh
$(
- rfkill list bluetooth -no ID,SOFT,HARD | grep -vq " blocked" &&
+ bt_is_unblocked &&
printf %b "$icon_bth Bluetooth ^ 1 ^ sxmo_bluetoothmenu.sh"
)
+ $icon_cam Camera ^ 0 ^ bananarchy-photo --menu
$(
- if command -v bananarchy-photo >/dev/null; then
- echo "$icon_cam Camera ^ 0 ^ bananarchy-photo --menu"
- elif command -v megapixels >/dev/null; then
- echo "$icon_cam Camera ^ 0 ^ GDK_SCALE=2 megapixels"
+ brightness=""
+ if [ -r /sys/class/leds/white:torch/brightness ]; then
+ read -r brightness < /sys/class/leds/white:torch/brightness 2>/dev/null || brightness=""
+ elif [ -r /sys/class/leds/white:flash/brightness ]; then
+ read -r brightness < /sys/class/leds/white:flash/brightness 2>/dev/null || brightness=""
fi
- )
- $(
- if brightness="$(brightnessctl -l -m | grep -e "white:torch" -e "white:flash" | cut -d ',' -f 3)" && [ -n "$brightness" ]; then
+ if [ -n "$brightness" ]; then
printf "%s Flashlight " "$icon_fll"
- [ "$brightness" -gt 0 ] &&
+ [ "$brightness" -gt 0 ] 2>/dev/null &&
printf %b "$icon_ton" || printf %b "$icon_tof";
printf %b "^ 1 ^ sxmo_flashtoggle.sh"
fi
@@ -839,7 +794,6 @@ case "$WMCLASS" in
$icon_phn Modem ^ 0 ^ sxmo_appmenu.sh modem
$icon_win Windows ^ 0 ^ sxmo_wmmenu.sh
$icon_cfg Config ^ 0 ^ sxmo_appmenu.sh config
- $icon_inf Help ^ 0 ^ sxmo_terminal.sh man sxmo
$icon_pwr Power ^ 0 ^ sxmo_appmenu.sh power
"
WINNAME=Sys
diff --git a/overlay/rootfs/usr/share/sxmo/default_hooks/sxmo_hook_icons.sh b/overlay/rootfs/usr/share/sxmo/default_hooks/sxmo_hook_icons.sh
index f3a258c..af4aacc 100755
--- a/overlay/rootfs/usr/share/sxmo/default_hooks/sxmo_hook_icons.sh
+++ b/overlay/rootfs/usr/share/sxmo/default_hooks/sxmo_hook_icons.sh
@@ -7,6 +7,9 @@
# for all the variables we define here
# shellcheck disable=SC2034
+[ -n "$SXMO_ICONS_LOADED" ] && return 0 2>/dev/null
+SXMO_ICONS_LOADED=1
+
#this script is meant to be sourced
#the glyphs are often in the private use area and
#therefore require a font like those in https://github.com/ryanoasis/nerd-fonts/ for proper display
diff --git a/overlay/rootfs/usr/share/sxmo/default_hooks/sxmo_hook_inputhandler.sh b/overlay/rootfs/usr/share/sxmo/default_hooks/sxmo_hook_inputhandler.sh
index ed3f8d4..8246223 100755
--- a/overlay/rootfs/usr/share/sxmo/default_hooks/sxmo_hook_inputhandler.sh
+++ b/overlay/rootfs/usr/share/sxmo/default_hooks/sxmo_hook_inputhandler.sh
@@ -17,38 +17,51 @@ stop_proximity_lock() {
sxmo_jobs.sh stop proximity_lock
}
-exec 0</dev/null 2>&1 || sxmo_wm.sh display on
+ else
+ sxmo_wm.sh display on
+ fi
+ if [ -w /sys/class/leds/white:kbd_backlight/brightness ]; then
+ printf '255' > /sys/class/leds/white:kbd_backlight/brightness 2>/dev/null || true
+ else
+ brightnessctl -d white:kbd_backlight set 255 >/dev/null 2>&1 || true
+ fi
+ sxmo_state.sh set unlock &
+ exit 0
+ ;;
+ "voldown_one"|"volup_one")
+ exec 0</dev/null 2>&1 || true
- sxmo_state.sh set unlock
- sxmo_wm.sh display on
- ;;
- "voldown_one")
- sxmo_audio.sh vol down 5
- exit
+ if [ "$ACTION" = "voldown_one" ]; then
+ sxmo_audio.sh vol down 5
+ else
+ sxmo_audio.sh vol up 5
+ fi
+ exit 0
;;
"voldown_two")
sxmo_audio.sh vol down 10
@@ -58,10 +71,6 @@ if sxmo_state.sh is_locked; then
sxmo_audio.sh vol down 15
exit
;;
- "volup_one")
- sxmo_audio.sh vol up 5
- exit
- ;;
"volup_two")
sxmo_audio.sh vol up 10
exit
@@ -75,6 +84,31 @@ if sxmo_state.sh is_locked; then
exit 0
fi
+case "$ACTION" in
+ "menuleft"*|"enter_two"|"enter_three"|"powerbutton_two"|"powerbutton_three"|"voldown_two"|"volup_two"|"volup_three"|"topleftcorner"|"toprightcorner"|"bottomrightcorner")
+ WMCLASS=""
+ WMNAME=""
+ ;;
+ *)
+ if [ -r "$XDG_RUNTIME_DIR/sxmo.focusedwin" ]; then
+ {
+ read -r WMCLASS || WMCLASS=""
+ read -r WMNAME || WMNAME=""
+ } < "$XDG_RUNTIME_DIR/sxmo.focusedwin"
+ else
+ exec 0</dev/null; then
sxmo_hook_pickup.sh
else
sxmo_appmenu.sh "$WMCLASS" "$WMNAME"
diff --git a/overlay/rootfs/usr/share/sxmo/default_hooks/sxmo_hook_lock.sh b/overlay/rootfs/usr/share/sxmo/default_hooks/sxmo_hook_lock.sh
index 83e80ab..93650e7 100755
--- a/overlay/rootfs/usr/share/sxmo/default_hooks/sxmo_hook_lock.sh
+++ b/overlay/rootfs/usr/share/sxmo/default_hooks/sxmo_hook_lock.sh
@@ -17,13 +17,19 @@
# This hook is called when the system reaches a locked state
-sxmo_led.sh blink blue &
+if [ -z "$SXMO_DISABLE_LEDS" ]; then
+ sxmo_led.sh blink blue &
+fi
[ "$SXMO_WM" = "sway" ] && swaymsg mode default
sxmo_wm.sh display on
-sxmo_wm.sh inputevent touchscreen off
+if [ -z "$SXMO_NO_VIRTUAL_KEYBOARD" ]; then
+ sxmo_wm.sh inputevent touchscreen off
+fi
-sxmo_jobs.sh stop periodic_blink
+if [ -z "$SXMO_DISABLE_LEDS" ]; then
+ sxmo_jobs.sh stop periodic_blink
+fi
sxmo_jobs.sh stop periodic_wakelock_check
# Go down after 8 seconds of inactivity
diff --git a/overlay/rootfs/usr/share/sxmo/default_hooks/sxmo_hook_screenoff.sh b/overlay/rootfs/usr/share/sxmo/default_hooks/sxmo_hook_screenoff.sh
index 52e8fad..e2ccf1e 100755
--- a/overlay/rootfs/usr/share/sxmo/default_hooks/sxmo_hook_screenoff.sh
+++ b/overlay/rootfs/usr/share/sxmo/default_hooks/sxmo_hook_screenoff.sh
@@ -17,13 +17,20 @@
# This hook is called when the system reaches a off state (screen off)
-sxmo_led.sh blink red blue &
+if [ -z "$SXMO_DISABLE_LEDS" ]; then
+ sxmo_led.sh blink red blue &
+fi
[ "$SXMO_WM" = "sway" ] && swaymsg mode default
+if [ -w /sys/class/leds/white:kbd_backlight/brightness ]; then
+ printf '0' > /sys/class/leds/white:kbd_backlight/brightness 2>/dev/null || true
+fi
sxmo_wm.sh display off
-sxmo_wm.sh inputevent touchscreen off
+if [ -z "$SXMO_NO_VIRTUAL_KEYBOARD" ]; then
+ sxmo_wm.sh inputevent touchscreen off
+fi
-if [ ! -e "$XDG_CACHE_HOME"/sxmo/sxmo.nosuspend ]; then
+if [ -z "$SXMO_DISABLE_LEDS" ] && [ ! -e "$XDG_CACHE_HOME"/sxmo/sxmo.nosuspend ]; then
sxmo_jobs.sh start periodic_blink \
sxmo_run_periodically.sh -w 2 -- sxmo_led.sh blink red blue
fi
@@ -44,7 +51,7 @@ wait
case "$SXMO_WM" in
sway)
- if command -v peanutbutter > /dev/null; then
+ if [ -n "$SXMO_HAS_PEANUTBUTTER" ] && command -v peanutbutter > /dev/null; then
peanutbutter --font Sxmo --statuscommand sxmo_hook_lockstatusbar.sh && sxmo_hook_statusbar.sh state_change &
fi
;;
diff --git a/overlay/rootfs/usr/share/sxmo/default_hooks/sxmo_hook_scripts.sh b/overlay/rootfs/usr/share/sxmo/default_hooks/sxmo_hook_scripts.sh
index ba45f8f..acf2219 100755
--- a/overlay/rootfs/usr/share/sxmo/default_hooks/sxmo_hook_scripts.sh
+++ b/overlay/rootfs/usr/share/sxmo/default_hooks/sxmo_hook_scripts.sh
@@ -11,18 +11,38 @@
# shellcheck source=configs/default_hooks/sxmo_hook_icons.sh
. sxmo_hook_icons.sh
+SCRIPTS_CACHE="${XDG_RUNTIME_DIR:-/tmp}/sxmo_scripts.cache"
+APPSCRIPTS_DIR="$(xdg_data_path sxmo/appscripts)"
+if [ -f "$SCRIPTS_CACHE" ] && [ ! "$0" -nt "$SCRIPTS_CACHE" ] && \
+ [ ! "$APPSCRIPTS_DIR" -nt "$SCRIPTS_CACHE" ] && \
+ { [ ! -e "$XDG_CONFIG_HOME/sxmo/userscripts" ] || [ ! "$XDG_CONFIG_HOME/sxmo/userscripts" -nt "$SCRIPTS_CACHE" ]; }; then
+ cat "$SCRIPTS_CACHE"
+ exit 0
+fi
+
+exec 3>&1 > "$SCRIPTS_CACHE.tmp"
+trap 'mv -f "$SCRIPTS_CACHE.tmp" "$SCRIPTS_CACHE" 2>/dev/null; cat "$SCRIPTS_CACHE" >&3 2>/dev/null' EXIT
+
write_line() {
printf "%s ^ 0 ^ %s\n" "$1" "$2"
}
get_title() {
title=""
- eval "$(head "$1" | grep '# title="[^\\"]*"' | sed 's/^# //g')"
+ while IFS= read -r line; do
+ case "$line" in
+ "# title=\""*"\"")
+ title="${line#*# title=\"}"
+ title="${title%\"*}"
+ title="$(eval "printf '%s' \"$title\"" 2>/dev/null || printf '%s' "$title")"
+ break
+ ;;
+ esac
+ done < "$1"
if [ -n "$title" ]; then
- echo "$title"
+ printf "%s\n" "$title"
else
- basename="$(basename "$1")"
- echo "$icon_itm $basename"
+ printf "%s %s\n" "$icon_itm" "${1##*/}"
fi
}
@@ -33,12 +53,18 @@ elif [ -d "$XDG_CONFIG_HOME/sxmo/userscripts" ]; then
title="$(get_title "$script")"
write_line "$title" "$script"
done
+ write_line "$icon_cfg Edit Userscripts" "sxmo_terminal.sh $EDITOR $XDG_CONFIG_HOME/sxmo/userscripts/*"
fi
-write_line "$icon_cfg Edit Userscripts" "sxmo_terminal.sh $EDITOR $XDG_CONFIG_HOME/sxmo/userscripts/*"
-
# System Scripts
-find "$(xdg_data_path sxmo/appscripts)" -type f -o -type l | sort -f | while read -r script; do
- title="$(get_title "$script")"
- write_line "$title" "$script"
-done
+if [ -n "$APPSCRIPTS_DIR" ]; then
+ find "$APPSCRIPTS_DIR" -type f -o -type l | sort -f | while read -r script; do
+ case "${script##*/}" in
+ sxmo_record.sh|sxmo_screenshot.sh|sxmo_websearch.sh|sxmo_youtube*.sh)
+ continue
+ ;;
+ esac
+ title="$(get_title "$script")"
+ write_line "$title" "$script"
+ done
+fi
diff --git a/overlay/rootfs/usr/share/sxmo/default_hooks/sxmo_hook_start.sh b/overlay/rootfs/usr/share/sxmo/default_hooks/sxmo_hook_start.sh
index 80f1f22..05c9c36 100755
--- a/overlay/rootfs/usr/share/sxmo/default_hooks/sxmo_hook_start.sh
+++ b/overlay/rootfs/usr/share/sxmo/default_hooks/sxmo_hook_start.sh
@@ -10,13 +10,18 @@
. sxmo_common.sh
# Create xdg user directories, such as ~/Pictures
-xdg-user-dirs-update
+[ -d "$HOME/Pictures" ] || xdg-user-dirs-update &
+
+# Ensure fontconfig cache is valid without forcing a full rescan on every boot
+if command -v fc-cache > /dev/null && [ -z "$(ls -A /var/cache/fontconfig 2>/dev/null)" ]; then
+ fc-cache >/dev/null 2>&1 &
+fi
sxmo_jobs.sh start daemon_manager superd
# let time to superd to start correctly
while ! superctl status > /dev/null 2>&1; do
- sleep 0.5
+ sleep 0.05
done
# Not dangerous if "locker" isn't an available state
@@ -54,48 +59,14 @@ superctl start dunst
# start adaptive brightness at boot
# superctl start sxmo_adaptivebrightness
-# load some other little things here too.
-case "$SXMO_WM" in
- river)
- superctl start sxmo_wob
- [ "$(command -v bonsaid)" ] && superctl start bonsaid
- [ "$(command -v fcitx5)" ] && superctl start fcitx5
- superctl start sxmo_riverbar
- ;;
- sway)
- superctl start sxmo_wob
- superctl start sxmo_menumode_toggler
- [ "$(command -v bonsaid)" ] && superctl start bonsaid
- [ "$(command -v fcitx5)" ] && superctl start fcitx5
- ;;
- dwm|i3)
- superctl start sxmo_xob
-
- # Auto hide cursor with touchscreen, Show it with a mouse
- if command -v "unclutter-xfixes" > /dev/null; then
- set -- unclutter-xfixes
- else
- set -- unclutter
- fi
- superctl start "$1"
-
- superctl start autocutsel
- superctl start autocutsel-primary
- superctl start sxmo-x11-status
- [ "$(command -v bonsaid)" ] && superctl start bonsaid
- [ "$(command -v fcitx5)" ] && superctl start fcitx5
- [ -n "$SXMO_MONITOR" ] && xrandr --output "$SXMO_MONITOR" --primary
- # Set onboard to auto-hide in config first
- if [ "$KEYBOARD" = "onboard" ]; then
- onboard "$KEYBOARD_ARGS"
- fi
- case "$SXMO_WM" in
- i3)
- xbindkeys -f "$XDG_CONFIG_HOME/sxmo/xbindkeysrc_$SXMO_BINDING_PROVIDER"
- ;;
- esac
- ;;
-esac
+# load X11 dwm services
+[ "$(command -v sxmo_xob)" ] && superctl start sxmo_xob
+pidof -s sxmo_status_xsetroot.sh >/dev/null 2>&1 || superctl start sxmo-x11-status
+[ "$(command -v bonsaid)" ] && superctl start bonsaid
+if ! pidof -s fcitx5 >/dev/null 2>&1 && [ "$(command -v fcitx5)" ]; then
+ superctl start fcitx5
+fi
+[ -n "$SXMO_MONITOR" ] && xrandr --output "$SXMO_MONITOR" --primary
# Turn on auto-suspend
if sxmo_wakelock.sh isenabled; then
@@ -106,8 +77,8 @@ fi
# To setup initial unlock state
sxmo_state.sh set unlock
-# Turn on lisgd
-if [ ! -e "$XDG_CACHE_HOME"/sxmo/sxmo.nogesture ]; then
+# Turn on lisgd only on touch devices
+if [ -z "$SXMO_NO_VIRTUAL_KEYBOARD" ] && [ ! -e "$XDG_CACHE_HOME"/sxmo/sxmo.nogesture ]; then
superctl start sxmo_hook_lisgd
fi
@@ -120,11 +91,8 @@ if [ -z "$SXMO_NO_MODEM" ] && command -v ModemManager > /dev/null; then
sxmo_wakelock.sh lock sxmo_modem_warming_up 120s
fi
-# Start the desktop wallpaper
-superctl start sxmo_bg
-
# Start the desktop widget (e.g. clock)
-superctl start sxmo_conky
+pidof -s conky >/dev/null 2>&1 || superctl start sxmo_conky
# Monitor the battery
superctl start sxmo_battery_monitor
@@ -135,25 +103,8 @@ superctl start sxmo_networkmonitor
# The daemon that display notifications popup messages
superctl start sxmo_notificationmonitor
-# Play a funky startup tune if you want (disabled by default)
-#mpv --quiet --no-video ~/welcome.ogg &
-
-# mmsd and vvmd
-if [ -z "$SXMO_NO_MODEM" ]; then
- if [ -f "${SXMO_MMS_BASE_DIR:-"$HOME"/.mms/modemmanager}/mms" ]; then
- superctl start mmsd-tng
- fi
-
- if [ -f "${SXMO_VVM_BASE_DIR:-"$HOME"/.vvm/modemmanager}/vvm" ]; then
- superctl start vvmd
- fi
-fi
-
-# add some warnings if things are not setup correctly
-if ! command -v "sxmo_deviceprofile_$SXMO_DEVICE_NAME.sh"; then
- sxmo_notify_user.sh --urgency=critical \
- "No deviceprofile found $SXMO_DEVICE_NAME. See: https://sxmo.org/deviceprofile"
-fi
-
-sxmo_migrate.sh state || sxmo_notify_user.sh --urgency=critical \
- "Config needs migration" "$? file(s) in your sxmo configuration are out of date and disabled - using defaults until you migrate (run sxmo_migrate.sh)"
+# Pre-warm app and script menu caches in background
+(
+ sxmo_hook_apps.sh >/dev/null 2>&1 || true
+ sxmo_hook_scripts.sh >/dev/null 2>&1 || true
+) &
diff --git a/overlay/rootfs/usr/share/sxmo/default_hooks/sxmo_hook_statusbar.sh b/overlay/rootfs/usr/share/sxmo/default_hooks/sxmo_hook_statusbar.sh
index f16a80e..fcbcdcc 100755
--- a/overlay/rootfs/usr/share/sxmo/default_hooks/sxmo_hook_statusbar.sh
+++ b/overlay/rootfs/usr/share/sxmo/default_hooks/sxmo_hook_statusbar.sh
@@ -18,14 +18,7 @@
# right and "variable" icons (that come and go) on the left.
set_time() {
- if pidof peanutbutter > /dev/null; then
- #peanutbutter already features a clock, no need for one in the icon bar
- sxmobar -d time
- else
- date "+${SXMO_STATUS_DATE_FORMAT:-%H:%M}" | while read -r date; do
- sxmobar -a time 99 "$date"
- done
- fi
+ sxmobar -a time 99 " $(date "+${SXMO_STATUS_DATE_FORMAT:-%H:%M}")"
}
set_state() {
@@ -38,13 +31,8 @@ set_state() {
return
fi
- if command -v peanutbutter > /dev/null; then
- # no need for a state icon in this (default) scenario, the state will be obvious, either peanutbutter is on or it isn't
- sxmobar -d state
- return
- fi
-
- case "$(sxmo_state.sh get)" in
+ read -r cur_state < "$SXMO_STATE" 2>/dev/null || cur_state=""
+ case "$cur_state" in
screenoff)
sxmobar -a -e bold -f red state 90 "$icon_state_screenoff" # filled circle
;;
@@ -52,7 +40,7 @@ set_state() {
sxmobar -a -e bold -f red state 90 "$icon_state_lock" # open circle with slash
;;
unlock)
- sxmobar -a -e bold state 90 "$icon_state_unlock" # open circle
+ sxmobar -d state
;;
esac
}
@@ -211,7 +199,7 @@ set_modem() {
# $2 = interface name (wlan0, tun0)
set_wifi() {
- if rfkill list wifi | grep -q "yes"; then
+ if /usr/sbin/rfkill list wifi 2>/dev/null | grep -q "yes"; then
sxmobar -d wifi-status
return
fi
@@ -238,7 +226,7 @@ set_wifi() {
wifivpn=0
fi
- wifi_signal="$(nmcli -f IN-USE,SIGNAL,SSID device wifi | awk '/^\*/{if (NR!=1) {print $2}}')"
+ wifi_signal="$(nmcli -f IN-USE,SIGNAL,SSID device wifi list --rescan no 2>/dev/null | awk '/^\*/{if (NR!=1) {print $2}}')"
if [ -z "$wifi_signal" ]; then
icon_wif="$icon_wifi_signal_exclam"
elif [ "$wifi_signal" -lt 20 ]; then
@@ -406,33 +394,33 @@ set_volume() {
*Headset*)
VOLCMP="$icon_hst"
;;
- *)
- VOLCMP="$icon_mic"
- ;;
esac
fi
if sxmo_audio.sh vol ismuted; then
- VOLCMP="$VOLCMP $icon_mut"
+ VOLCMP="${VOLCMP:+$VOLCMP }$icon_mut"
else
case "$(sxmo_audio.sh device get 2>/dev/null)" in
*Speaker*|"")
# nothing for default or pulse devices
;;
*Headphone*)
- VOLCMP="$VOLCMP $icon_hdp"
+ VOLCMP="${VOLCMP:+$VOLCMP }$icon_hdp"
;;
*Earpiece*)
- VOLCMP="$VOLCMP $icon_ear"
+ VOLCMP="${VOLCMP:+$VOLCMP }$icon_ear"
;;
esac
- VOL="$(sxmo_audio.sh vol get)"
+ VOL="$(sxmo_audio.sh vol get 2>/dev/null)"
+ case "$VOL" in
+ ''|*[!0-9]*) VOL=0 ;;
+ esac
if [ "$VOL" -gt 66 ]; then
- VOLCMP="$VOLCMP $icon_spk"
+ VOLCMP="${VOLCMP:+$VOLCMP }$icon_spk"
elif [ "$VOL" -gt 33 ]; then
- VOLCMP="$VOLCMP $icon_spm"
+ VOLCMP="${VOLCMP:+$VOLCMP }$icon_spm"
elif [ "$VOL" -ge 0 ]; then
- VOLCMP="$VOLCMP $icon_spl"
+ VOLCMP="${VOLCMP:+$VOLCMP }$icon_spl"
fi
fi
sxmobar -a volume 50 "$VOLCMP"
@@ -446,6 +434,17 @@ set_notch() {
fi
}
+set_inputmethod() {
+ im_file="${XDG_RUNTIME_DIR:-/run/user/10000}/sxmo_t9_mode"
+ if [ -r "$im_file" ]; then
+ read -r im_mode < "$im_file" 2>/dev/null || im_mode="[abc]"
+ else
+ im_mode="[abc]"
+ fi
+ [ -n "$im_mode" ] || im_mode="[abc]"
+ sxmobar -a input-method 5 "$im_mode"
+}
+
sxmo_debug "$@"
case "$1" in
network)
@@ -456,20 +455,28 @@ case "$1" in
shift
set_battery "$@"
;;
- time|modem|volume|state|notifications|notch)
+ time|modem|volume|state|notifications|notch|inputmethod)
set_"$1"
;;
- periodics|state_change) # 55 s loop and screenlock triggers
+ state_change)
+ set_state
set_time
+ set_inputmethod
+ ;;
+ periodics) # 55 s loop
+ set_time
+ set_inputmethod
if [ -z "$SXMO_NO_MODEM" ]; then
set_modem
fi
set_notch
set_state
set_network wifi wlan0
+ sxmo_hook_battery.sh 2>/dev/null || true
;;
all)
sxmobar -r
+ set_inputmethod
set_time
if [ -z "$SXMO_NO_MODEM" ]; then
set_modem
@@ -481,8 +488,13 @@ case "$1" in
set_notifications
set_notch
set_network wifi wlan0
+ sxmo_hook_battery.sh 2>/dev/null || true
;;
*)
exit # swallow it !
;;
esac
+
+if [ "${SXMO_WM:-dwm}" = "dwm" ] && command -v xsetroot >/dev/null 2>&1; then
+ DISPLAY="${DISPLAY:-:0}" xsetroot -name "$(sxmo_status.sh)" 2>/dev/null || true
+fi
diff --git a/overlay/rootfs/usr/share/sxmo/default_hooks/sxmo_hook_unlock.sh b/overlay/rootfs/usr/share/sxmo/default_hooks/sxmo_hook_unlock.sh
index 7950b07..dd0f43b 100755
--- a/overlay/rootfs/usr/share/sxmo/default_hooks/sxmo_hook_unlock.sh
+++ b/overlay/rootfs/usr/share/sxmo/default_hooks/sxmo_hook_unlock.sh
@@ -9,12 +9,21 @@
# This hook is called when the system becomes unlocked again
-sxmo_led.sh blink red green &
+if [ -z "$SXMO_DISABLE_LEDS" ]; then
+ sxmo_led.sh blink red green &
+fi
sxmo_wm.sh display on
-sxmo_wm.sh inputevent touchscreen on
+if [ -w /sys/class/leds/white:kbd_backlight/brightness ]; then
+ printf '255' > /sys/class/leds/white:kbd_backlight/brightness 2>/dev/null || true
+fi
+if [ -z "$SXMO_NO_VIRTUAL_KEYBOARD" ]; then
+ sxmo_wm.sh inputevent touchscreen on
+fi
-sxmo_jobs.sh stop periodic_blink
+if [ -z "$SXMO_DISABLE_LEDS" ]; then
+ sxmo_jobs.sh stop periodic_blink
+fi
sxmo_jobs.sh stop periodic_wakelock_check
# Go to the next idle state after 120 seconds of inactivity
diff --git a/patches/xlibre/0001-xlibre-msm8905-spi-drm-and-shared-vt.patch b/patches/xlibre/0001-xlibre-msm8905-spi-drm-and-shared-vt.patch
new file mode 100644
index 0000000..d8a2027
--- /dev/null
+++ b/patches/xlibre/0001-xlibre-msm8905-spi-drm-and-shared-vt.patch
@@ -0,0 +1,237 @@
+diff --git a/Xext/xfixes/cursor.c b/Xext/xfixes/cursor.c
+index d017da0..a530caa 100644
+--- a/Xext/xfixes/cursor.c
++++ b/Xext/xfixes/cursor.c
+@@ -122,9 +122,9 @@ typedef struct _CursorHideCountRec {
+ #define Wrap(as,s,elt,func) (((as)->elt = (s)->elt), (s)->elt = (func))
+ #define Unwrap(as,s,elt,backup) (((backup) = (s)->elt), (s)->elt = (as)->elt)
+
+-/* The cursor doesn't show up until the first XDefineCursor() */
++/* The cursor is permanently disabled for keypad-only hardware */
+ Bool CursorVisible = FALSE;
+-Bool EnableCursor = TRUE;
++Bool EnableCursor = FALSE;
+
+ static CursorPtr
+ CursorForDevice(DeviceIntPtr pDev)
+diff --git a/hw/xfree86/drivers/video/modesetting/drmmode_bo.c b/hw/xfree86/drivers/video/modesetting/drmmode_bo.c
+index b39aa73..71c876e 100644
+--- a/hw/xfree86/drivers/video/modesetting/drmmode_bo.c
++++ b/hw/xfree86/drivers/video/modesetting/drmmode_bo.c
+@@ -251,6 +251,8 @@ gbm_create_cursor_bo(drmmode_ptr drmmode, Bool do_map,
+
+ /* For older mesa */
+ GBM_BO_USE_CURSOR | GBM_BO_USE_WRITE,
++ GBM_BO_USE_SCANOUT | GBM_BO_USE_WRITE,
++ GBM_BO_USE_WRITE,
+ };
+
+ /* Assume whatever bpp we have for the primary plane, we also have for the cursor plane */
+diff --git a/hw/xfree86/drivers/video/modesetting/drmmode_display.c b/hw/xfree86/drivers/video/modesetting/drmmode_display.c
+index e5f694c..98f1f7a 100644
+--- a/hw/xfree86/drivers/video/modesetting/drmmode_display.c
++++ b/hw/xfree86/drivers/video/modesetting/drmmode_display.c
+@@ -4856,16 +4856,11 @@ drmmode_create_initial_bos(ScrnInfoPtr pScrn, drmmode_ptr drmmode)
+ min_width = MIN(width, min_width);
+ min_height = MIN(height, min_height);
+
+- drmmode_crtc->cursor.bo = gbm_create_best_bo(drmmode, TRUE, width, height, DRMMODE_CURSOR_BO);
+- if (!drmmode_crtc->cursor.bo) {
+- gbm_bo_destroy(drmmode->front_bo);
+- for (int j = 0; j < i; j++) {
+- xf86CrtcPtr free_crtc = xf86_config->crtc[j];
+- drmmode_crtc_private_ptr free_drmmode_crtc = free_crtc->driver_private;
+- gbm_bo_destroy(free_drmmode_crtc->cursor.bo);
+- free_drmmode_crtc->cursor.bo = NULL;
++ if (!drmmode->sw_cursor) {
++ drmmode_crtc->cursor.bo = gbm_create_best_bo(drmmode, TRUE, width, height, DRMMODE_CURSOR_BO);
++ if (!drmmode_crtc->cursor.bo) {
++ drmmode->sw_cursor = TRUE;
+ }
+- return FALSE;
+ }
+ }
+
+@@ -4886,13 +4881,15 @@ drmmode_free_bos(ScrnInfoPtr pScrn, drmmode_ptr drmmode)
+ drmmode->fb_id = 0;
+ }
+
+- gbm_bo_destroy(drmmode->front_bo);
++ if (drmmode->front_bo)
++ gbm_bo_destroy(drmmode->front_bo);
+
+ for (i = 0; i < xf86_config->num_crtc; i++) {
+ xf86CrtcPtr crtc = xf86_config->crtc[i];
+ drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
+
+- gbm_bo_destroy(drmmode_crtc->cursor.bo);
++ if (drmmode_crtc->cursor.bo)
++ gbm_bo_destroy(drmmode_crtc->cursor.bo);
+ drmmode_destroy_tearfree_shadow(crtc);
+ }
+ }
+diff --git a/hw/xfree86/os-support/linux/lnx_init.c b/hw/xfree86/os-support/linux/lnx_init.c
+index 6653dd9..e04b69c 100644
+--- a/hw/xfree86/os-support/linux/lnx_init.c
++++ b/hw/xfree86/os-support/linux/lnx_init.c
+@@ -114,35 +114,41 @@ linux_parse_vt_settings(int may_fail)
+ if (fd < 0) {
+ if (may_fail)
+ return 0;
+- FatalError("parse_vt_settings: Cannot open /dev/tty0 (%s), maybe missing for ex. '-seat seat0 -keeptty' parameters? (in case trying to run uid !=0 mode)\n",
+- strerror(errno));
+- }
+-
+- if (xf86Info.ShareVTs) {
+- SYSCALL(ret = ioctl(fd, VT_GETSTATE, &vts));
+- if (ret < 0) {
+- if (may_fail)
+- return 0;
+- FatalError("parse_vt_settings: Cannot find the current"
+- " VT (%s)\n", strerror(errno));
+- }
+- xf86Info.vtno = vts.v_active;
+- }
+- else {
+- SYSCALL(ret = ioctl(fd, VT_OPENQRY, &xf86Info.vtno));
+- if (ret < 0) {
+- if (may_fail)
+- return 0;
+- FatalError("parse_vt_settings: Cannot find a free VT: "
+- "%s\n", strerror(errno));
++ xf86Info.vtno = 1;
++ KeepTty = TRUE;
++ } else {
++ if (xf86Info.ShareVTs) {
++ SYSCALL(ret = ioctl(fd, VT_GETSTATE, &vts));
++ if (ret < 0) {
++ if (may_fail) {
++ close(fd);
++ return 0;
++ }
++ FatalError("parse_vt_settings: Cannot find the current"
++ " VT (%s)\n", strerror(errno));
++ }
++ xf86Info.vtno = vts.v_active;
+ }
+- if (xf86Info.vtno == -1) {
+- if (may_fail)
+- return 0;
+- FatalError("parse_vt_settings: Cannot find a free VT\n");
++ else {
++ SYSCALL(ret = ioctl(fd, VT_OPENQRY, &xf86Info.vtno));
++ if (ret < 0) {
++ if (may_fail) {
++ close(fd);
++ return 0;
++ }
++ FatalError("parse_vt_settings: Cannot find a free VT: "
++ "%s\n", strerror(errno));
++ }
++ if (xf86Info.vtno == -1) {
++ if (may_fail) {
++ close(fd);
++ return 0;
++ }
++ FatalError("parse_vt_settings: Cannot find a free VT\n");
++ }
+ }
++ close(fd);
+ }
+- close(fd);
+ }
+
+ LogMessageVerb(from, 1, "using VT number %d\n\n", xf86Info.vtno);
+@@ -218,9 +224,14 @@ xf86OpenConsole(void)
+ if (seatd_libseat_controls_session())
+ return;
+
+- if (xf86Info.consoleFd < 0)
+- FatalError("xf86OpenConsole: Cannot open virtual console"
+- " %d (%s)\n", xf86Info.vtno, strerror(errno));
++ if (xf86Info.consoleFd < 0) {
++ LogMessageVerb(X_WARNING, 1,
++ "xf86OpenConsole: Cannot open virtual console %d (%s), using /dev/null in shared VT mode\n",
++ xf86Info.vtno, strerror(errno));
++ xf86Info.consoleFd = open("/dev/null", O_RDWR | O_NDELAY, 0);
++ xf86Info.ShareVTs = TRUE;
++ return;
++ }
+
+ /*
+ * Linux doesn't switch to an active vt after the last close of a vt,
+@@ -237,15 +248,23 @@ xf86OpenConsole(void)
+ struct termios nTty;
+
+ /*
+- * now get the VT. This _must_ succeed, or else fail completely.
++ * now get the VT. If unprivileged without CAP_SYS_TTY_CONFIG,
++ * fall back to ShareVTs mode instead of aborting.
+ */
+- if (!switch_to(xf86Info.vtno, "xf86OpenConsole"))
+- FatalError("xf86OpenConsole: Switching VT failed\n");
++ if (!switch_to(xf86Info.vtno, "xf86OpenConsole")) {
++ LogMessageVerb(X_WARNING, 1,
++ "xf86OpenConsole: VT switch not permitted, continuing in shared VT mode\n");
++ xf86Info.ShareVTs = TRUE;
++ return;
++ }
+
+ SYSCALL(ret = ioctl(xf86Info.consoleFd, VT_GETMODE, &VT));
+- if (ret < 0)
+- FatalError("xf86OpenConsole: VT_GETMODE failed %s\n",
+- strerror(errno));
++ if (ret < 0) {
++ LogMessageVerb(X_WARNING, 1, "xf86OpenConsole: VT_GETMODE failed %s\n",
++ strerror(errno));
++ xf86Info.ShareVTs = TRUE;
++ return;
++ }
+
+ OsSignal(SIGUSR1, xf86VTRequest);
+
+@@ -254,15 +273,20 @@ xf86OpenConsole(void)
+ VT.acqsig = SIGUSR1;
+
+ SYSCALL(ret = ioctl(xf86Info.consoleFd, VT_SETMODE, &VT));
+- if (ret < 0)
+- FatalError
+- ("xf86OpenConsole: VT_SETMODE VT_PROCESS failed: %s\n",
+- strerror(errno));
++ if (ret < 0) {
++ LogMessageVerb(X_WARNING, 1,
++ "xf86OpenConsole: VT_SETMODE VT_PROCESS failed: %s\n",
++ strerror(errno));
++ xf86Info.ShareVTs = TRUE;
++ return;
++ }
+
+ SYSCALL(ret = ioctl(xf86Info.consoleFd, KDSETMODE, KD_GRAPHICS));
+- if (ret < 0)
+- FatalError("xf86OpenConsole: KDSETMODE KD_GRAPHICS failed %s\n",
+- strerror(errno));
++ if (ret < 0) {
++ LogMessageVerb(X_WARNING, 1,
++ "xf86OpenConsole: KDSETMODE KD_GRAPHICS failed %s\n",
++ strerror(errno));
++ }
+
+ tcgetattr(xf86Info.consoleFd, &tty_attr);
+ SYSCALL(ioctl(xf86Info.consoleFd, KDGKBMODE, &tty_mode));
+@@ -274,11 +298,11 @@ xf86OpenConsole(void)
+ /* fine, just disable special keys */
+ SYSCALL(ret = ioctl(xf86Info.consoleFd, KDSKBMODE, K_RAW));
+ if (ret < 0)
+- FatalError("xf86OpenConsole: KDSKBMODE K_RAW failed %s\n",
+- strerror(errno));
+-
+- /* ... and drain events, else the kernel gets angry */
+- xf86SetConsoleHandler(drain_console, NULL);
++ LogMessageVerb(X_WARNING, 1,
++ "xf86OpenConsole: KDSKBMODE K_RAW failed %s\n",
++ strerror(errno));
++ else
++ xf86SetConsoleHandler(drain_console, NULL);
+ }
+
+ nTty = tty_attr;
diff --git a/patches/xlibre/0002-xf86-input-libinput-xlibre25.patch b/patches/xlibre/0002-xf86-input-libinput-xlibre25.patch
new file mode 100644
index 0000000..45b1962
--- /dev/null
+++ b/patches/xlibre/0002-xf86-input-libinput-xlibre25.patch
@@ -0,0 +1,25 @@
+diff --git a/src/xf86libinput.c b/src/xf86libinput.c
+index 1aebca3..8d3691c 100644
+--- a/src/xf86libinput.c
++++ b/src/xf86libinput.c
+@@ -1727,12 +1727,19 @@ xf86libinput_handle_key(InputInfoPtr pInfo, struct libinput_event_keyboard *even
+ if ((driver_data->capabilities & CAP_KEYBOARD) == 0)
+ return;
+
+- /* keycodes > 256 that have a historical mapping in xkeyboard-config */
++ /* keycodes > 256 that have a historical mapping in xkeyboard-config
++ * plus Nokia MSM8909 keypad evdev keycodes > 247 mapped into X11 8-bit range */
+ switch (key) {
+ case KEY_TOUCHPAD_TOGGLE: key = KEY_F21; break;
+ case KEY_TOUCHPAD_ON: key = KEY_F22; break;
+ case KEY_TOUCHPAD_OFF: key = KEY_F23; break;
+ case KEY_MICMUTE: key = KEY_F20; break;
++ case 696: /* KEY_KBD_LCD_MENU1 (Left Softkey) */ key = KEY_COMPOSE; break;
++ case 697: /* KEY_KBD_LCD_MENU2 (Right Softkey) */ key = KEY_BACK; break;
++ case 445: /* KEY_PICKUP_PHONE (Call button) */ key = KEY_PHONE; break;
++ case 352: /* KEY_OK (Center D-pad OK) */ key = KEY_ENTER; break;
++ case 522: /* KEY_NUMERIC_STAR (*) */ key = KEY_KPASTERISK; break;
++ case 523: /* KEY_NUMERIC_POUND (#) */ key = KEY_KPSLASH; break;
+ }
+
+ key += XORG_KEYCODE_OFFSET;
diff --git a/patches/xlibre/0003-xf86-video-fbdev-xlibre25.patch b/patches/xlibre/0003-xf86-video-fbdev-xlibre25.patch
new file mode 100644
index 0000000..519d32c
--- /dev/null
+++ b/patches/xlibre/0003-xf86-video-fbdev-xlibre25.patch
@@ -0,0 +1,65 @@
+diff --git a/src/fbdev.c b/src/fbdev.c
+index 3dfc0b2..6e3b9e7 100644
+--- a/src/fbdev.c
++++ b/src/fbdev.c
+@@ -15,14 +15,18 @@
+ #include "colormapst.h"
+ #include "xf86cmap.h"
+ #include "shadow.h"
++#ifdef XFreeXDGA
+ #include "dgaproc.h"
++#endif
+
+ /* for visuals */
+ #include "fb.h"
+
+ #include "fbdevhw.h"
+
++#ifdef XV
+ #include "xf86xv.h"
++#endif
+
+ #include
+
+@@ -168,9 +172,11 @@ typedef struct {
+ CreateScreenResourcesProcPtr CreateScreenResources;
+ void (*PointerMoved)(ScrnInfoPtr pScrn, int x, int y);
+ EntityInfoPtr pEnt;
++#ifdef XFreeXDGA
+ /* DGA info */
+ DGAModePtr pDGAMode;
+ int nDGAMode;
++#endif
+ OptionInfoPtr Options;
+ } FBDevRec, *FBDevPtr;
+
+@@ -954,11 +960,13 @@ FBDevCloseScreen(ScreenPtr pScreen)
+ free(fPtr->shadow);
+ fPtr->shadow = NULL;
+ }
++#ifdef XFreeXDGA
+ if (fPtr->pDGAMode) {
+ free(fPtr->pDGAMode);
+ fPtr->pDGAMode = NULL;
+ fPtr->nDGAMode = 0;
+ }
++#endif
+ pScrn->vtSema = FALSE;
+
+ pScreen->CreateScreenResources = fPtr->CreateScreenResources;
+@@ -1031,6 +1039,7 @@ FBDevPointerMoved(ScrnInfoPtr pScrn, int x, int y)
+ /***********************************************************************
+ * DGA stuff
+ ***********************************************************************/
++#ifdef XFreeXDGA
+ static Bool FBDevDGAOpenFramebuffer(ScrnInfoPtr pScrn, char **DeviceName,
+ unsigned char **ApertureBase,
+ int *ApertureSize, int *ApertureOffset,
+@@ -1154,6 +1163,7 @@ FBDevDGAAddModes(ScrnInfoPtr pScrn)
+ pMode = pMode->next;
+ } while (pMode != pScrn->modes);
+ }
++#endif
+
+ static Bool
+ FBDevDGAInit(ScrnInfoPtr pScrn, ScreenPtr pScreen)
diff --git a/prebuilt/fcitx5-t9/usr/lib/fcitx5/libt9.so b/prebuilt/fcitx5-t9/usr/lib/fcitx5/libt9.so
index ef7c52f..43a7812 100755
Binary files a/prebuilt/fcitx5-t9/usr/lib/fcitx5/libt9.so and b/prebuilt/fcitx5-t9/usr/lib/fcitx5/libt9.so differ
diff --git a/prebuilt/fcitx5-t9/usr/lib/fcitx5/t9.so b/prebuilt/fcitx5-t9/usr/lib/fcitx5/t9.so
index ef7c52f..43a7812 100755
Binary files a/prebuilt/fcitx5-t9/usr/lib/fcitx5/t9.so and b/prebuilt/fcitx5-t9/usr/lib/fcitx5/t9.so differ
diff --git a/prebuilt/kernel-6.12.1-msm8916/leds/leds-msm8905-torch.ko b/prebuilt/kernel-6.12.1-msm8916/leds/leds-msm8905-torch.ko
index 7430da4..a023978 100644
Binary files a/prebuilt/kernel-6.12.1-msm8916/leds/leds-msm8905-torch.ko and b/prebuilt/kernel-6.12.1-msm8916/leds/leds-msm8905-torch.ko differ
diff --git a/prebuilt/kernel-6.12.1-msm8916/leds/leds-msm8905-torch.ko.zst b/prebuilt/kernel-6.12.1-msm8916/leds/leds-msm8905-torch.ko.zst
index 75024db..08775e5 100644
Binary files a/prebuilt/kernel-6.12.1-msm8916/leds/leds-msm8905-torch.ko.zst and b/prebuilt/kernel-6.12.1-msm8916/leds/leds-msm8905-torch.ko.zst differ
diff --git a/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6adm.ko b/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6adm.ko
index cfc027b..7a9aa81 100644
Binary files a/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6adm.ko and b/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6adm.ko differ
diff --git a/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6adm.ko.zst b/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6adm.ko.zst
index 0e12c99..49f22ce 100644
Binary files a/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6adm.ko.zst and b/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6adm.ko.zst differ
diff --git a/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6afe-clocks.ko.zst b/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6afe-clocks.ko.zst
index 7dd3afd..2800d53 100644
Binary files a/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6afe-clocks.ko.zst and b/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6afe-clocks.ko.zst differ
diff --git a/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6afe-dai.ko.zst b/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6afe-dai.ko.zst
index 87a9bc6..d850b49 100644
Binary files a/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6afe-dai.ko.zst and b/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6afe-dai.ko.zst differ
diff --git a/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6afe.ko b/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6afe.ko
index 52e5460..8e4fbc5 100644
Binary files a/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6afe.ko and b/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6afe.ko differ
diff --git a/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6afe.ko.zst b/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6afe.ko.zst
index 07e8b8c..261d89b 100644
Binary files a/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6afe.ko.zst and b/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6afe.ko.zst differ
diff --git a/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6apm-dai.ko.zst b/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6apm-dai.ko.zst
index 4d43162..c5c3211 100644
Binary files a/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6apm-dai.ko.zst and b/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6apm-dai.ko.zst differ
diff --git a/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6apm-lpass-dais.ko.zst b/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6apm-lpass-dais.ko.zst
index 71d0e1b..7343679 100644
Binary files a/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6apm-lpass-dais.ko.zst and b/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6apm-lpass-dais.ko.zst differ
diff --git a/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6asm-dai.ko.zst b/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6asm-dai.ko.zst
index 80ce3ca..d5dd66b 100644
Binary files a/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6asm-dai.ko.zst and b/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6asm-dai.ko.zst differ
diff --git a/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6asm.ko b/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6asm.ko
index fa6c877..4279d40 100644
Binary files a/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6asm.ko and b/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6asm.ko differ
diff --git a/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6asm.ko.zst b/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6asm.ko.zst
index 91e2e64..0c2283b 100644
Binary files a/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6asm.ko.zst and b/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6asm.ko.zst differ
diff --git a/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6core.ko b/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6core.ko
index 06985db..74d90af 100644
Binary files a/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6core.ko and b/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6core.ko differ
diff --git a/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6core.ko.zst b/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6core.ko.zst
index 5cf5b8e..6d2dcff 100644
Binary files a/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6core.ko.zst and b/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6core.ko.zst differ
diff --git a/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6cvp.ko b/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6cvp.ko
index 079c44a..3d5813f 100644
Binary files a/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6cvp.ko and b/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6cvp.ko differ
diff --git a/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6cvp.ko.zst b/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6cvp.ko.zst
index b3f7c85..480e9be 100644
Binary files a/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6cvp.ko.zst and b/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6cvp.ko.zst differ
diff --git a/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6cvs.ko b/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6cvs.ko
index 762edf8..8657876 100644
Binary files a/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6cvs.ko and b/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6cvs.ko differ
diff --git a/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6cvs.ko.zst b/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6cvs.ko.zst
index 7f83c51..9e84fc5 100644
Binary files a/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6cvs.ko.zst and b/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6cvs.ko.zst differ
diff --git a/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6mvm.ko b/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6mvm.ko
index e756b23..3cea40d 100644
Binary files a/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6mvm.ko and b/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6mvm.ko differ
diff --git a/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6mvm.ko.zst b/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6mvm.ko.zst
index 66eeef6..084acf2 100644
Binary files a/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6mvm.ko.zst and b/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6mvm.ko.zst differ
diff --git a/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6prm-clocks.ko.zst b/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6prm-clocks.ko.zst
index c04685e..e8e63d6 100644
Binary files a/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6prm-clocks.ko.zst and b/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6prm-clocks.ko.zst differ
diff --git a/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6prm.ko b/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6prm.ko
index 7226a6c..5016c62 100644
Binary files a/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6prm.ko and b/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6prm.ko differ
diff --git a/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6prm.ko.zst b/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6prm.ko.zst
index 7fc5a5d..fe2e4df 100644
Binary files a/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6prm.ko.zst and b/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6prm.ko.zst differ
diff --git a/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6routing.ko.zst b/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6routing.ko.zst
index 157746c..58ddd2b 100644
Binary files a/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6routing.ko.zst and b/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6routing.ko.zst differ
diff --git a/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6voice-common.ko b/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6voice-common.ko
index 67f26b2..67b74b2 100644
Binary files a/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6voice-common.ko and b/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6voice-common.ko differ
diff --git a/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6voice-common.ko.zst b/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6voice-common.ko.zst
index 4a7d3c6..49219ef 100644
Binary files a/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6voice-common.ko.zst and b/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6voice-common.ko.zst differ
diff --git a/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6voice-dai.ko.zst b/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6voice-dai.ko.zst
index ed68b39..4059d7b 100644
Binary files a/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6voice-dai.ko.zst and b/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6voice-dai.ko.zst differ
diff --git a/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6voice.ko.zst b/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6voice.ko.zst
index bc3e874..08e1db9 100644
Binary files a/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6voice.ko.zst and b/prebuilt/kernel-6.12.1-msm8916/qdsp6/q6voice.ko.zst differ
diff --git a/prebuilt/kernel-6.12.1-msm8916/qdsp6/snd-q6apm.ko b/prebuilt/kernel-6.12.1-msm8916/qdsp6/snd-q6apm.ko
index d4b9390..bc1c628 100644
Binary files a/prebuilt/kernel-6.12.1-msm8916/qdsp6/snd-q6apm.ko and b/prebuilt/kernel-6.12.1-msm8916/qdsp6/snd-q6apm.ko differ
diff --git a/prebuilt/kernel-6.12.1-msm8916/qdsp6/snd-q6apm.ko.zst b/prebuilt/kernel-6.12.1-msm8916/qdsp6/snd-q6apm.ko.zst
index 2070f2b..8ea3b31 100644
Binary files a/prebuilt/kernel-6.12.1-msm8916/qdsp6/snd-q6apm.ko.zst and b/prebuilt/kernel-6.12.1-msm8916/qdsp6/snd-q6apm.ko.zst differ
diff --git a/prebuilt/kernel-6.12.1-msm8916/qdsp6/snd-q6dsp-common.ko.zst b/prebuilt/kernel-6.12.1-msm8916/qdsp6/snd-q6dsp-common.ko.zst
index 0b4938e..b5c417e 100644
Binary files a/prebuilt/kernel-6.12.1-msm8916/qdsp6/snd-q6dsp-common.ko.zst and b/prebuilt/kernel-6.12.1-msm8916/qdsp6/snd-q6dsp-common.ko.zst differ
diff --git a/prebuilt/sxmo-x11/usr/bin/dmenu b/prebuilt/sxmo-x11/usr/bin/dmenu
new file mode 100755
index 0000000..53d9ec3
Binary files /dev/null and b/prebuilt/sxmo-x11/usr/bin/dmenu differ
diff --git a/prebuilt/sxmo-x11/usr/bin/dmenu_path b/prebuilt/sxmo-x11/usr/bin/dmenu_path
new file mode 100755
index 0000000..3a7cda7
--- /dev/null
+++ b/prebuilt/sxmo-x11/usr/bin/dmenu_path
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+cachedir="${XDG_CACHE_HOME:-"$HOME/.cache"}"
+cache="$cachedir/dmenu_run"
+
+[ ! -e "$cachedir" ] && mkdir -p "$cachedir"
+
+IFS=:
+if stest -dqr -n "$cache" $PATH; then
+ stest -flx $PATH | sort -u | tee "$cache"
+else
+ cat "$cache"
+fi
diff --git a/prebuilt/sxmo-x11/usr/bin/dmenu_run b/prebuilt/sxmo-x11/usr/bin/dmenu_run
new file mode 100755
index 0000000..834ede5
--- /dev/null
+++ b/prebuilt/sxmo-x11/usr/bin/dmenu_run
@@ -0,0 +1,2 @@
+#!/bin/sh
+dmenu_path | dmenu "$@" | ${SHELL:-"/bin/sh"} &
diff --git a/prebuilt/sxmo-x11/usr/bin/dwm b/prebuilt/sxmo-x11/usr/bin/dwm
new file mode 100755
index 0000000..920a79f
Binary files /dev/null and b/prebuilt/sxmo-x11/usr/bin/dwm differ
diff --git a/prebuilt/sxmo-x11/usr/bin/st b/prebuilt/sxmo-x11/usr/bin/st
new file mode 100755
index 0000000..83b666c
Binary files /dev/null and b/prebuilt/sxmo-x11/usr/bin/st differ
diff --git a/prebuilt/sxmo-x11/usr/bin/stest b/prebuilt/sxmo-x11/usr/bin/stest
new file mode 100755
index 0000000..9d9d4ea
Binary files /dev/null and b/prebuilt/sxmo-x11/usr/bin/stest differ
diff --git a/prebuilt/xlibre/usr/bin/X b/prebuilt/xlibre/usr/bin/X
new file mode 120000
index 0000000..e363c6e
--- /dev/null
+++ b/prebuilt/xlibre/usr/bin/X
@@ -0,0 +1 @@
+Xorg
\ No newline at end of file
diff --git a/prebuilt/xlibre/usr/bin/Xorg b/prebuilt/xlibre/usr/bin/Xorg
new file mode 100755
index 0000000..10f585b
Binary files /dev/null and b/prebuilt/xlibre/usr/bin/Xorg differ
diff --git a/prebuilt/xlibre/usr/bin/gtf b/prebuilt/xlibre/usr/bin/gtf
new file mode 100755
index 0000000..2eeee1c
Binary files /dev/null and b/prebuilt/xlibre/usr/bin/gtf differ
diff --git a/prebuilt/xlibre/usr/include/xorg/Xprintf.h b/prebuilt/xlibre/usr/include/xorg/Xprintf.h
new file mode 100644
index 0000000..382e24f
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/Xprintf.h
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2010, Oracle and/or its affiliates.
+ *
+ * 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 (including the next
+ * paragraph) 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 AUTHORS OR COPYRIGHT HOLDERS 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 XPRINTF_H
+#define XPRINTF_H
+
+#include
+#include
+#include
+
+#include "os.h"
+
+#ifndef _X_RESTRICT_KYWD
+#if defined(restrict) /* assume autoconf set it correctly */ || \
+ (defined(__STDC__) && (__STDC_VERSION__ - 0 >= 199901L)) /* C99 */
+#define _X_RESTRICT_KYWD restrict
+#elif defined(__GNUC__) && !defined(__STRICT_ANSI__) /* gcc w/C89+extensions */
+#define _X_RESTRICT_KYWD __restrict__
+#else
+#define _X_RESTRICT_KYWD
+#endif
+#endif
+
+/*
+ * These functions provide a portable implementation of the common (but not
+ * yet universal) asprintf & vasprintf routines to allocate a buffer big
+ * enough to sprintf the arguments to. The XNF variants terminate the server
+ * if the allocation fails.
+ * The buffer allocated is returned in the pointer provided in the first
+ * argument. The return value is the size of the allocated buffer, or -1
+ * on failure.
+ */
+extern _X_EXPORT int /* deprecated */
+XNFasprintf(char **ret, const char *_X_RESTRICT_KYWD fmt, ...)
+_X_ATTRIBUTE_PRINTF(2, 3);
+extern _X_EXPORT int
+XNFvasprintf(char **ret, const char *_X_RESTRICT_KYWD fmt, va_list va)
+_X_ATTRIBUTE_VPRINTF(2, 0);
+
+#endif /* XPRINTF_H */
diff --git a/prebuilt/xlibre/usr/include/xorg/callback.h b/prebuilt/xlibre/usr/include/xorg/callback.h
new file mode 100644
index 0000000..7b78deb
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/callback.h
@@ -0,0 +1,82 @@
+/***********************************************************
+
+Copyright 1987, 1998 The Open Group
+
+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.
+
+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
+OPEN GROUP 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.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+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 Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL 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 CALLBACK_H
+#define CALLBACK_H
+
+#include /* for GContext, Mask */
+#include /* for Bool */
+#include
+#include
+
+/*
+ * callback manager stuff
+ */
+
+typedef struct _CallbackList *CallbackListPtr;
+
+typedef void (*CallbackProcPtr) (CallbackListPtr *, void *, void *);
+
+extern _X_EXPORT Bool AddCallback(CallbackListPtr *pcbl,
+ CallbackProcPtr callback,
+ void *data);
+
+extern _X_EXPORT Bool DeleteCallback(CallbackListPtr *pcbl,
+ CallbackProcPtr callback,
+ void *data);
+
+extern _X_EXPORT void _CallCallbacks(CallbackListPtr *pcbl,
+ void *call_data);
+
+static inline void
+CallCallbacks(CallbackListPtr *pcbl, void *call_data)
+{
+ if (!pcbl || !*pcbl)
+ return;
+ _CallCallbacks(pcbl, call_data);
+}
+
+#endif /* CALLBACK_H */
diff --git a/prebuilt/xlibre/usr/include/xorg/colormap.h b/prebuilt/xlibre/usr/include/xorg/colormap.h
new file mode 100644
index 0000000..48ae0d6
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/colormap.h
@@ -0,0 +1,58 @@
+/*
+
+Copyright 1987, 1998 The Open Group
+
+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.
+
+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
+OPEN GROUP 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.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+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 Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL 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 CMAP_H
+#define CMAP_H 1
+
+#include
+#include "screenint.h"
+#include "window.h"
+
+#define DynamicClass 1
+
+typedef CARD32 Pixel;
+
+#endif /* CMAP_H */
diff --git a/prebuilt/xlibre/usr/include/xorg/colormapst.h b/prebuilt/xlibre/usr/include/xorg/colormapst.h
new file mode 100644
index 0000000..f0149ae
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/colormapst.h
@@ -0,0 +1,59 @@
+/*
+
+Copyright 1987, 1998 The Open Group
+
+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.
+
+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
+OPEN GROUP 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.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+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 Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL 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 CMAPSTRUCT_H
+#define CMAPSTRUCT_H 1
+
+#include
+
+/* LOCO -- a local color for a PseudoColor cell. DirectColor maps always
+ * use the first value (called red) in the structure. What channel they
+ * are really talking about depends on which map they are in. */
+typedef struct {
+ unsigned short red, green, blue;
+} LOCO;
+
+#endif /* COLORMAP_H */
diff --git a/prebuilt/xlibre/usr/include/xorg/compiler.h b/prebuilt/xlibre/usr/include/xorg/compiler.h
new file mode 100644
index 0000000..6aed97a
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/compiler.h
@@ -0,0 +1,724 @@
+/*
+ * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany.
+ *
+ * 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 Thomas Roell not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. Thomas Roell makes no representations
+ * about the suitability of this software for any purpose. It is provided
+ * "as is" without express or implied warranty.
+ *
+ * THOMAS ROELL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL THOMAS ROELL 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.
+ *
+ */
+/*
+ * Copyright (c) 1994-2003 by The XFree86 Project, 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.
+ *
+ * Except as contained in this notice, the name of the copyright holder(s)
+ * and author(s) shall not be used in advertising or otherwise to promote
+ * the sale, use or other dealings in this Software without prior written
+ * authorization from the copyright holder(s) and author(s).
+ */
+
+#ifndef _COMPILER_H
+#define _COMPILER_H
+
+#ifndef _X_EXPORT
+#include
+#endif
+
+#include "xlibre_membarrier.h" /* backwards compat, remove in ABI-26 */
+
+#if defined(__alpha__)
+
+# if defined(__linux__)
+/* for Linux on Alpha, we use the LIBC _inx/_outx routines */
+/* note that the appropriate setup via "ioperm" needs to be done */
+/* *before* any inx/outx is done. */
+
+_X_EXPORT void _outb(unsigned char val, unsigned long port);
+_X_EXPORT void _outw(unsigned short val, unsigned long port);
+_X_EXPORT void _outl(unsigned int val, unsigned long port);
+_X_EXPORT unsigned int _inb(unsigned long port);
+_X_EXPORT unsigned int _inw(unsigned long port);
+_X_EXPORT unsigned int _inl(unsigned long port);
+
+static inline void
+outb(unsigned long port, unsigned char val)
+{
+ _outb(val, port);
+}
+
+static inline void
+outw(unsigned long port, unsigned short val)
+{
+ _outw(val, port);
+}
+
+static inline void
+outl(unsigned long port, unsigned int val)
+{
+ _outl(val, port);
+}
+
+static inline unsigned int
+inb(unsigned long port)
+{
+ return _inb(port);
+}
+
+static inline unsigned int
+inw(unsigned long port)
+{
+ return _inw(port);
+}
+
+static inline unsigned int
+inl(unsigned long port)
+{
+ return _inl(port);
+}
+
+# elif (defined(__FreeBSD__) || defined(__OpenBSD__))
+
+/* for FreeBSD and OpenBSD on Alpha, we use the libio (resp. libalpha) */
+/* inx/outx routines */
+/* note that the appropriate setup via "ioperm" needs to be done */
+/* *before* any inx/outx is done. */
+
+_X_EXPORT void outb(unsigned int port, unsigned char val);
+_X_EXPORT void outw(unsigned int port, unsigned short val);
+_X_EXPORT void outl(unsigned int port, unsigned int val);
+_X_EXPORT unsigned char inb(unsigned int port);
+_X_EXPORT unsigned short inw(unsigned int port);
+_X_EXPORT unsigned int inl(unsigned int port);
+
+# elif defined(__NetBSD__)
+
+# include
+
+# endif /* various OS'es on __alpha__ */
+
+static inline int MMIO_IN8(void *Base, unsigned long Offset) {
+ xlibre_mem_barrier_read();
+ return *(CARD8 *) ((unsigned long) Base + (Offset));
+}
+
+static inline int MMIO_IN16(void *Base, unsigned long Offset) {
+ xlibre_mem_barrier_read();
+ return *(CARD16 *) ((unsigned long) Base + (Offset));
+}
+
+static inline int MMIO_IN32(void *Base, unsigned long Offset) {
+ xlibre_mem_barrier_read();
+ return *(CARD32 *) ((unsigned long) Base + (Offset));
+}
+
+static inline void MMIO_OUT8(void *Base, unsigned long Offset, int Value) {
+ xlibre_mem_barrier_write();
+ *(CARD8 *) ((unsigned long) Base + (Offset)) = Value;
+}
+
+static inline void MMIO_OUT16(void *Base, unsigned long Offset, int Value) {
+ xlibre_mem_barrier_write();
+ *(CARD16 *) ((unsigned long) Base + (Offset)) = Value;
+}
+
+static inline void MMIO_OUT32(void *Base, unsigned long Offset, int Value) {
+ xlibre_mem_barrier_write();
+ *(CARD32 *) ((unsigned long) Base + (Offset)) = Value;
+}
+
+_X_EXPORT void xf86SlowBCopyFromBus(unsigned char *src, unsigned char *dst, int count);
+_X_EXPORT void xf86SlowBCopyToBus(unsigned char *src, unsigned char *dst, int count);
+
+static inline void slowbcopy_tobus(unsigned char *src, unsigned char *dst, int count) {
+ xf86SlowBCopyToBus(src, dst, count);
+}
+
+static inline void slowbcopy_frombus(unsigned char *src, unsigned char *dst, int count) {
+ xf86SlowBCopyFromBus(src, dst, count);
+}
+
+#elif defined(__amd64__) || defined(__i386__) || defined(__ia64__)
+
+#include
+
+static inline void
+outb(unsigned short port, unsigned char val)
+{
+ __asm__ __volatile__("outb %0,%1"::"a"(val), "d"(port));
+}
+
+static inline void
+outw(unsigned short port, unsigned short val)
+{
+ __asm__ __volatile__("outw %0,%1"::"a"(val), "d"(port));
+}
+
+static inline void
+outl(unsigned short port, unsigned int val)
+{
+ __asm__ __volatile__("outl %0,%1"::"a"(val), "d"(port));
+}
+
+static inline unsigned int
+inb(unsigned short port)
+{
+ unsigned char ret;
+ __asm__ __volatile__("inb %1,%0":"=a"(ret):"d"(port));
+
+ return ret;
+}
+
+static inline unsigned int
+inw(unsigned short port)
+{
+ unsigned short ret;
+ __asm__ __volatile__("inw %1,%0":"=a"(ret):"d"(port));
+
+ return ret;
+}
+
+static inline unsigned int
+inl(unsigned short port)
+{
+ unsigned int ret;
+ __asm__ __volatile__("inl %1,%0":"=a"(ret):"d"(port));
+
+ return ret;
+}
+
+#elif defined(__sparc__)
+
+#define __XLIBRE_SPARC_ASI_PRIMAY_LE 0x88 /* just for readability */
+
+static inline void
+outb(unsigned long port, unsigned char val)
+{
+ __asm__ __volatile__("stba %0, [%1] %2": /* No outputs */
+ :"r"(val), "r"(port), "i"(__XLIBRE_SPARC_ASI_PRIMAY_LE));
+ __asm__ __volatile__ (".word 0x8143e00a" : : : "memory");
+}
+
+static inline void
+outw(unsigned long port, unsigned short val)
+{
+ __asm__ __volatile__("stha %0, [%1] %2": /* No outputs */
+ :"r"(val), "r"(port), "i"(__XLIBRE_SPARC_ASI_PRIMAY_LE));
+ __asm__ __volatile__ (".word 0x8143e00a" : : : "memory");
+}
+
+static inline void
+outl(unsigned long port, unsigned int val)
+{
+ __asm__ __volatile__("sta %0, [%1] %2": /* No outputs */
+ :"r"(val), "r"(port), "i"(__XLIBRE_SPARC_ASI_PRIMAY_LE));
+ __asm__ __volatile__ (".word 0x8143e00a" : : : "memory");
+}
+
+static inline unsigned int
+inb(unsigned long port)
+{
+ unsigned int ret;
+ __asm__ __volatile__("lduba [%1] %2, %0":"=r"(ret)
+ :"r"(port), "i"(__XLIBRE_SPARC_ASI_PRIMAY_LE));
+ return ret;
+}
+
+static inline unsigned int
+inw(unsigned long port)
+{
+ unsigned int ret;
+ __asm__ __volatile__("lduha [%1] %2, %0":"=r"(ret)
+ :"r"(port), "i"(__XLIBRE_SPARC_ASI_PRIMAY_LE));
+ return ret;
+}
+
+static inline unsigned int
+inl(unsigned long port)
+{
+ unsigned int ret;
+ __asm__ __volatile__("lda [%1] %2, %0":"=r"(ret)
+ :"r"(port), "i"(__XLIBRE_SPARC_ASI_PRIMAY_LE));
+ return ret;
+}
+
+static inline unsigned char
+xf86ReadMmio8(__volatile__ void *base, const unsigned long offset)
+{
+ unsigned long addr = ((unsigned long) base) + offset;
+ unsigned char ret;
+
+ __asm__ __volatile__("lduba [%1] %2, %0":"=r"(ret)
+ :"r"(addr), "i"(__XLIBRE_SPARC_ASI_PRIMAY_LE));
+
+ return ret;
+}
+
+static inline unsigned short
+xf86ReadMmio16Be(__volatile__ void *base, const unsigned long offset)
+{
+ unsigned long addr = ((unsigned long) base) + offset;
+ unsigned short ret;
+
+ __asm__ __volatile__("lduh [%1], %0":"=r"(ret)
+ :"r"(addr));
+
+ return ret;
+}
+
+static inline unsigned short
+xf86ReadMmio16Le(__volatile__ void *base, const unsigned long offset)
+{
+ unsigned long addr = ((unsigned long) base) + offset;
+ unsigned short ret;
+
+ __asm__ __volatile__("lduha [%1] %2, %0":"=r"(ret)
+ :"r"(addr), "i"(__XLIBRE_SPARC_ASI_PRIMAY_LE));
+
+ return ret;
+}
+
+static inline unsigned int
+xf86ReadMmio32Be(__volatile__ void *base, const unsigned long offset)
+{
+ unsigned long addr = ((unsigned long) base) + offset;
+ unsigned int ret;
+
+ __asm__ __volatile__("ld [%1], %0":"=r"(ret)
+ :"r"(addr));
+
+ return ret;
+}
+
+static inline unsigned int
+xf86ReadMmio32Le(__volatile__ void *base, const unsigned long offset)
+{
+ unsigned long addr = ((unsigned long) base) + offset;
+ unsigned int ret;
+
+ __asm__ __volatile__("lda [%1] %2, %0":"=r"(ret)
+ :"r"(addr), "i"(__XLIBRE_SPARC_ASI_PRIMAY_LE));
+
+ return ret;
+}
+
+static inline void
+xf86WriteMmio8(__volatile__ void *base, const unsigned long offset,
+ const unsigned int val)
+{
+ unsigned long addr = ((unsigned long) base) + offset;
+
+ __asm__ __volatile__("stba %0, [%1] %2": /* No outputs */
+ :"r"(val), "r"(addr), "i"(__XLIBRE_SPARC_ASI_PRIMAY_LE));
+ __asm__ __volatile__ (".word 0x8143e00a" : : : "memory");
+}
+
+static inline void
+xf86WriteMmio16Be(__volatile__ void *base, const unsigned long offset,
+ const unsigned int val)
+{
+ unsigned long addr = ((unsigned long) base) + offset;
+
+ __asm__ __volatile__("sth %0, [%1]": /* No outputs */
+ :"r"(val), "r"(addr));
+ __asm__ __volatile__ (".word 0x8143e00a" : : : "memory");
+}
+
+static inline void
+xf86WriteMmio16Le(__volatile__ void *base, const unsigned long offset,
+ const unsigned int val)
+{
+ unsigned long addr = ((unsigned long) base) + offset;
+
+ __asm__ __volatile__("stha %0, [%1] %2": /* No outputs */
+ :"r"(val), "r"(addr), "i"(__XLIBRE_SPARC_ASI_PRIMAY_LE));
+ __asm__ __volatile__ (".word 0x8143e00a" : : : "memory");
+}
+
+static inline void
+xf86WriteMmio32Be(__volatile__ void *base, const unsigned long offset,
+ const unsigned int val)
+{
+ unsigned long addr = ((unsigned long) base) + offset;
+
+ __asm__ __volatile__("st %0, [%1]": /* No outputs */
+ :"r"(val), "r"(addr));
+ __asm__ __volatile__ (".word 0x8143e00a" : : : "memory");
+}
+
+static inline void
+xf86WriteMmio32Le(__volatile__ void *base, const unsigned long offset,
+ const unsigned int val)
+{
+ unsigned long addr = ((unsigned long) base) + offset;
+
+ __asm__ __volatile__("sta %0, [%1] %2": /* No outputs */
+ :"r"(val), "r"(addr), "i"(__XLIBRE_SPARC_ASI_PRIMAY_LE));
+ __asm__ __volatile__ (".word 0x8143e00a" : : : "memory");
+}
+
+#undef __XLIBRE_SPARC_ASI_PRIMAY_LE
+
+#elif defined(__arm32__) && !defined(__linux__)
+
+extern _X_EXPORT unsigned int IOPortBase; /* Memory mapped I/O port area */
+
+static inline void
+outb(unsigned long port, unsigned char val)
+{
+ *(volatile unsigned char *) (((unsigned long) (port)) + IOPortBase) =
+ val;
+}
+
+static inline void
+outw(unsigned long port, unsigned short val)
+{
+ *(volatile unsigned short *) (((unsigned long) (port)) + IOPortBase) =
+ val;
+}
+
+static inline void
+outl(unsigned long port, unsigned int val)
+{
+ *(volatile unsigned int *) (((unsigned long) (port)) + IOPortBase) =
+ val;
+}
+
+static inline unsigned int
+inb(unsigned long port)
+{
+ return *(volatile unsigned char *) (((unsigned long) (port)) +
+ IOPortBase);
+}
+
+static inline unsigned int
+inw(unsigned long port)
+{
+ return *(volatile unsigned short *) (((unsigned long) (port)) +
+ IOPortBase);
+}
+
+static inline unsigned int
+inl(unsigned long port)
+{
+ return *(volatile unsigned int *) (((unsigned long) (port)) +
+ IOPortBase);
+}
+
+#elif defined(__mips__)
+
+# if defined(__mips64)
+# define __XLIBRE_MIPS_PORT_TYPE unsigned long
+# define __XLIBRE_MIPS_PORT_ADDR(port) (((unsigned long)(port)) + IOPortBase)
+# else
+# define __XLIBRE_MIPS_PORT_TYPE unsigned short
+# define __XLIBRE_MIPS_PORT_ADDR(port) (((unsigned short)(port)) + IOPortBase)
+# endif
+
+extern _X_EXPORT unsigned int IOPortBase; /* Memory mapped I/O port area */
+
+static inline void outb(__XLIBRE_MIPS_PORT_TYPE port, unsigned char val) {
+ *(volatile unsigned char *)(__XLIBRE_MIPS_PORT_ADDR(port)) = val;
+}
+
+static inline void outw(__XLIBRE_MIPS_PORT_TYPE port, unsigned short val) {
+ *(volatile unsigned short *)(__XLIBRE_MIPS_PORT_ADDR(port)) = val;
+}
+
+static inline void outl(__XLIBRE_MIPS_PORT_TYPE port, unsigned int val) {
+ *(volatile unsigned int *)(__XLIBRE_MIPS_PORT_ADDR(port)) = val;
+}
+
+static inline unsigned int inb(__XLIBRE_MIPS_PORT_TYPE port) {
+ return *(volatile unsigned char *)(__XLIBRE_MIPS_PORT_ADDR(port));
+}
+
+static inline unsigned int inw(__XLIBRE_MIPS_PORT_TYPE port) {
+ return *(volatile unsigned short *)(__XLIBRE_MIPS_PORT_ADDR(port));
+}
+
+static inline unsigned int inl(__XLIBRE_MIPS_PORT_TYPE port) {
+ return *(volatile unsigned int *)(__XLIBRE_MIPS_PORT_ADDR(port));
+}
+
+# undef __XLIBRE_MIPS_PORT_TYPE
+# undef __XLIBRE_MIPS_PORT_ADDR
+
+# ifdef __linux__ /* don't mess with other OSs */
+# if X_BYTE_ORDER == X_BIG_ENDIAN
+static inline unsigned int
+xf86ReadMmio32Be(__volatile__ void *base, const unsigned long offset)
+{
+ unsigned long addr = ((unsigned long) base) + offset;
+ unsigned int ret;
+
+ __asm__ __volatile__("lw %0, 0(%1)":"=r"(ret)
+ :"r"(addr));
+
+ return ret;
+}
+
+static inline void
+xf86WriteMmio32Be(__volatile__ void *base, const unsigned long offset,
+ const unsigned int val)
+{
+ unsigned long addr = ((unsigned long) base) + offset;
+
+ __asm__ __volatile__("sw %0, 0(%1)": /* No outputs */
+ :"r"(val), "r"(addr));
+}
+# endif /* X_BYTE_ORDER == X_BIG_ENDIAN */
+# endif /* __linux__ */
+
+#elif defined(__powerpc__)
+
+#include
+
+extern _X_EXPORT void *ioBase;
+
+static inline unsigned char
+xf86ReadMmio8(__volatile__ void *base, const unsigned long offset)
+{
+ register unsigned char val;
+ __asm__ __volatile__("lbzx %0,%1,%2\n\t" "eieio":"=r"(val)
+ :"b"(base), "r"(offset),
+ "m"(*((volatile unsigned char *) base + offset)));
+ return val;
+}
+
+static inline unsigned short
+xf86ReadMmio16Be(__volatile__ void *base, const unsigned long offset)
+{
+ register unsigned short val;
+ __asm__ __volatile__("lhzx %0,%1,%2\n\t" "eieio":"=r"(val)
+ :"b"(base), "r"(offset),
+ "m"(*((volatile unsigned char *) base + offset)));
+ return val;
+}
+
+static inline unsigned short
+xf86ReadMmio16Le(__volatile__ void *base, const unsigned long offset)
+{
+ register unsigned short val;
+ __asm__ __volatile__("lhbrx %0,%1,%2\n\t" "eieio":"=r"(val)
+ :"b"(base), "r"(offset),
+ "m"(*((volatile unsigned char *) base + offset)));
+ return val;
+}
+
+static inline unsigned int
+xf86ReadMmio32Be(__volatile__ void *base, const unsigned long offset)
+{
+ register unsigned int val;
+ __asm__ __volatile__("lwzx %0,%1,%2\n\t" "eieio":"=r"(val)
+ :"b"(base), "r"(offset),
+ "m"(*((volatile unsigned char *) base + offset)));
+ return val;
+}
+
+static inline unsigned int
+xf86ReadMmio32Le(__volatile__ void *base, const unsigned long offset)
+{
+ register unsigned int val;
+ __asm__ __volatile__("lwbrx %0,%1,%2\n\t" "eieio":"=r"(val)
+ :"b"(base), "r"(offset),
+ "m"(*((volatile unsigned char *) base + offset)));
+ return val;
+}
+
+static inline void
+xf86WriteMmio8(__volatile__ void *base, const unsigned long offset,
+ const unsigned char val)
+{
+ __asm__
+ __volatile__("stbx %1,%2,%3\n\t":"=m"
+ (*((volatile unsigned char *) base + offset))
+ :"r"(val), "b"(base), "r"(offset));
+ xlibre_mem_barrier_write();
+}
+
+static inline void
+xf86WriteMmio16Le(__volatile__ void *base, const unsigned long offset,
+ const unsigned short val)
+{
+ __asm__
+ __volatile__("sthbrx %1,%2,%3\n\t":"=m"
+ (*((volatile unsigned char *) base + offset))
+ :"r"(val), "b"(base), "r"(offset));
+ xlibre_mem_barrier_write();
+}
+
+static inline void
+xf86WriteMmio16Be(__volatile__ void *base, const unsigned long offset,
+ const unsigned short val)
+{
+ __asm__
+ __volatile__("sthx %1,%2,%3\n\t":"=m"
+ (*((volatile unsigned char *) base + offset))
+ :"r"(val), "b"(base), "r"(offset));
+ xlibre_mem_barrier_write();
+}
+
+static inline void
+xf86WriteMmio32Le(__volatile__ void *base, const unsigned long offset,
+ const unsigned int val)
+{
+ __asm__
+ __volatile__("stwbrx %1,%2,%3\n\t":"=m"
+ (*((volatile unsigned char *) base + offset))
+ :"r"(val), "b"(base), "r"(offset));
+ xlibre_mem_barrier_write();
+}
+
+static inline void
+xf86WriteMmio32Be(__volatile__ void *base, const unsigned long offset,
+ const unsigned int val)
+{
+ __asm__
+ __volatile__("stwx %1,%2,%3\n\t":"=m"
+ (*((volatile unsigned char *) base + offset))
+ :"r"(val), "b"(base), "r"(offset));
+ xlibre_mem_barrier_write();
+}
+
+static inline void
+outb(unsigned short port, unsigned char value)
+{
+ if (ioBase == MAP_FAILED)
+ return;
+ xf86WriteMmio8(ioBase, port, value);
+}
+
+static inline void
+outw(unsigned short port, unsigned short value)
+{
+ if (ioBase == MAP_FAILED)
+ return;
+ xf86WriteMmio16Le(ioBase, port, value);
+}
+
+static inline void
+outl(unsigned short port, unsigned int value)
+{
+ if (ioBase == MAP_FAILED)
+ return;
+ xf86WriteMmio32Le(ioBase, port, value);
+}
+
+static inline unsigned int
+inb(unsigned short port)
+{
+ if (ioBase == MAP_FAILED)
+ return 0;
+ return xf86ReadMmio8(ioBase, port);
+}
+
+static inline unsigned int
+inw(unsigned short port)
+{
+ if (ioBase == MAP_FAILED)
+ return 0;
+ return xf86ReadMmio16Le(ioBase, port);
+}
+
+static inline unsigned int
+inl(unsigned short port)
+{
+ if (ioBase == MAP_FAILED)
+ return 0;
+ return xf86ReadMmio32Le(ioBase, port);
+}
+
+#endif /* arch madness */
+
+/* drivers that want to prevent automatic byteswapping by MMIO_()* macros
+ on PPC and SPARC should set these */
+#if !defined(MMIO_IS_BE) && \
+ (defined(SPARC_MMIO_IS_BE) || defined(PPC_MMIO_IS_BE))
+#define MMIO_IS_BE
+#endif
+
+#ifdef __alpha__
+#elif defined(__powerpc__) || defined(__sparc__)
+ /*
+ * we provide byteswapping and no byteswapping functions here
+ * with byteswapping as default,
+ * drivers that don't need byteswapping should define MMIO_IS_BE
+ */
+#define MMIO_IN8(base, offset) xf86ReadMmio8((base), (offset))
+#define MMIO_OUT8(base, offset, val) \
+ xf86WriteMmio8((base), (offset), (CARD8)(val))
+
+#if defined(MMIO_IS_BE) /* No byteswapping */
+#define MMIO_IN16(base, offset) xf86ReadMmio16Be((base), (offset))
+#define MMIO_IN32(base, offset) xf86ReadMmio32Be((base), (offset))
+#define MMIO_OUT16(base, offset, val) \
+ xf86WriteMmio16Be((base), (offset), (CARD16)(val))
+#define MMIO_OUT32(base, offset, val) \
+ xf86WriteMmio32Be((base), (offset), (CARD32)(val))
+#else /* byteswapping is the default */
+#define MMIO_IN16(base, offset) xf86ReadMmio16Le((base), (offset))
+#define MMIO_IN32(base, offset) xf86ReadMmio32Le((base), (offset))
+#define MMIO_OUT16(base, offset, val) \
+ xf86WriteMmio16Le((base), (offset), (CARD16)(val))
+#define MMIO_OUT32(base, offset, val) \
+ xf86WriteMmio32Le((base), (offset), (CARD32)(val))
+#endif
+
+#else /* !__alpha__ && !__powerpc__ && !__sparc__ */
+
+#define MMIO_IN8(base, offset) \
+ *(volatile CARD8 *)(((CARD8*)(base)) + (offset))
+#define MMIO_IN16(base, offset) \
+ *(volatile CARD16 *)(void *)(((CARD8*)(base)) + (offset))
+#define MMIO_IN32(base, offset) \
+ *(volatile CARD32 *)(void *)(((CARD8*)(base)) + (offset))
+#define MMIO_OUT8(base, offset, val) \
+ *(volatile CARD8 *)(((CARD8*)(base)) + (offset)) = (val)
+#define MMIO_OUT16(base, offset, val) \
+ *(volatile CARD16 *)(void *)(((CARD8*)(base)) + (offset)) = (val)
+#define MMIO_OUT32(base, offset, val) \
+ *(volatile CARD32 *)(void *)(((CARD8*)(base)) + (offset)) = (val)
+
+#endif /* __alpha__ */
+
+/*
+ * With Intel, the version in os-support/misc/SlowBcopy.s is used.
+ * This avoids port I/O during the copy (which causes problems with
+ * some hardware).
+ */
+#ifndef __alpha__
+#define slowbcopy_tobus(src,dst,count) xf86SlowBcopy((src),(dst),(count))
+#define slowbcopy_frombus(src,dst,count) xf86SlowBcopy((src),(dst),(count))
+#endif /* __alpha__ */
+
+#endif /* _COMPILER_H */
diff --git a/prebuilt/xlibre/usr/include/xorg/compositeext.h b/prebuilt/xlibre/usr/include/xorg/compositeext.h
new file mode 100644
index 0000000..e3e6f4c
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/compositeext.h
@@ -0,0 +1,37 @@
+/*
+ * Copyright © 2009 NVIDIA Corporation
+ *
+ * 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 (including the next
+ * paragraph) 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
+ * AUTHORS OR COPYRIGHT HOLDERS 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 _COMPOSITEEXT_H_
+#define _COMPOSITEEXT_H_
+
+#include "misc.h"
+#include "scrnintstr.h"
+
+extern _X_EXPORT Bool CompositeRegisterAlternateVisuals(ScreenPtr pScreen,
+ VisualID * vids,
+ int nVisuals);
+
+extern _X_EXPORT Bool compIsAlternateVisual(ScreenPtr pScreen, XID visual);
+
+extern _X_EXPORT RESTYPE CompositeClientWindowType;
+
+#endif /* _COMPOSITEEXT_H_ */
diff --git a/prebuilt/xlibre/usr/include/xorg/cursor.h b/prebuilt/xlibre/usr/include/xorg/cursor.h
new file mode 100644
index 0000000..50796d0
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/cursor.h
@@ -0,0 +1,71 @@
+/***********************************************************
+
+Copyright 1987, 1998 The Open Group
+
+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.
+
+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
+OPEN GROUP 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.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+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 Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL 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 CURSOR_H
+#define CURSOR_H
+
+#include "misc.h"
+#include "screenint.h"
+#include "window.h"
+#include "privates.h"
+
+#define NullCursor ((CursorPtr)NULL)
+
+/* Provide support for alpha composited cursors */
+#define ARGB_CURSOR
+
+typedef struct _Cursor *CursorPtr;
+// FUN FACT: If you typedef a pointer type, like the `CursorPtr` above
+// then `const CursorPtr` or `CursorPtr const` actually means `struct _Cursor *const`, a constant pointer
+// which is probably not what you want(a pointer to constant).
+// Maybe better just keep the `*` around, or you have to typedef a separate constPtr type.
+typedef struct _Cursor const *ConstCursorPtr;
+typedef struct _CursorMetric *CursorMetricPtr;
+
+extern _X_EXPORT int FreeCursor(void *pCurs,
+ XID cid);
+
+#endif /* CURSOR_H */
diff --git a/prebuilt/xlibre/usr/include/xorg/cursorstr.h b/prebuilt/xlibre/usr/include/xorg/cursorstr.h
new file mode 100644
index 0000000..4597bde
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/cursorstr.h
@@ -0,0 +1,90 @@
+/***********************************************************
+
+Copyright 1987, 1998 The Open Group
+
+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.
+
+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
+OPEN GROUP 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.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+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 Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL 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 CURSORSTRUCT_H
+#define CURSORSTRUCT_H
+
+#include "cursor.h"
+#include "privates.h"
+/*
+ * device-independent cursor storage
+ */
+
+/*
+ * source and mask point directly to the bits, which are in the server-defined
+ * bitmap format.
+ */
+typedef struct _CursorBits {
+ unsigned char *source; /* points to bits */
+ unsigned char *mask; /* points to bits */
+ Bool emptyMask; /* all zeros mask */
+ unsigned short width, height, xhot, yhot; /* metrics */
+ int refcnt; /* can be shared */
+ PrivateRec *devPrivates; /* set by pScr->RealizeCursor */
+ CARD32 *argb; /* full-color alpha blended */
+} CursorBits, *CursorBitsPtr;
+
+typedef struct _Cursor {
+ CursorBitsPtr bits;
+ unsigned short foreRed, foreGreen, foreBlue; /* device-independent color */
+ unsigned short backRed, backGreen, backBlue; /* device-independent color */
+ int refcnt;
+ PrivateRec *devPrivates; /* set by pScr->RealizeCursor */
+ XID id;
+ CARD32 serialNumber;
+ Atom name;
+} CursorRec;
+
+typedef struct _CursorMetric {
+ unsigned short width, height, xhot, yhot;
+} CursorMetricRec;
+
+typedef struct {
+ int x, y;
+ ScreenPtr pScreen;
+} HotSpot;
+
+#endif /* CURSORSTRUCT_H */
diff --git a/prebuilt/xlibre/usr/include/xorg/damage.h b/prebuilt/xlibre/usr/include/xorg/damage.h
new file mode 100644
index 0000000..7146e47
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/damage.h
@@ -0,0 +1,127 @@
+/*
+ * Copyright © 2003 Keith Packard
+ *
+ * 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 Keith Packard not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. Keith Packard makes no
+ * representations about the suitability of this software for any purpose. It
+ * is provided "as is" without express or implied warranty.
+ *
+ * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL KEITH PACKARD 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 _DAMAGE_H_
+#define _DAMAGE_H_
+
+#include
+
+typedef struct _damage *DamagePtr;
+
+typedef enum _damageReportLevel {
+ DamageReportRawRegion,
+ DamageReportDeltaRegion,
+ DamageReportBoundingBox,
+ DamageReportNonEmpty,
+ DamageReportNone
+} DamageReportLevel;
+
+typedef void (*DamageReportFunc) (DamagePtr pDamage, RegionPtr pRegion,
+ void *closure);
+typedef void (*DamageDestroyFunc) (DamagePtr pDamage, void *closure);
+
+typedef void (*DamageScreenCreateFunc) (DamagePtr);
+typedef void (*DamageScreenRegisterFunc) (DrawablePtr, DamagePtr);
+typedef void (*DamageScreenUnregisterFunc) (DrawablePtr, DamagePtr);
+typedef void (*DamageScreenDestroyFunc) (DamagePtr);
+
+/* @public
+ *
+ * @brief Driver callbacks for getting notified on several damage calls
+ *
+ * The pointer to this struct can be obtained via DamageGetScreenFuncs().
+ * Drivers can inject themselves here, in order to get notified on
+ * DamageCreate(), DamageRegister(), DamageUnregister(), DamageDestroy().
+ *
+ * The fields may be assigned to NULL, if no action at all is wanted.
+ * (by default assigned to default implementations)
+ *
+ * This should ONLY be touched by video drivers, nobody else.
+ *
+ * So far the only one using it is the proprietary NVidia driver.
+ */
+typedef struct _damageScreenFuncs {
+ DamageScreenCreateFunc Create;
+ DamageScreenRegisterFunc Register;
+ DamageScreenUnregisterFunc Unregister;
+ DamageScreenDestroyFunc Destroy;
+} DamageScreenFuncsRec, *DamageScreenFuncsPtr;
+
+extern _X_EXPORT void miDamageCreate(DamagePtr);
+extern _X_EXPORT void miDamageRegister(DrawablePtr, DamagePtr);
+extern _X_EXPORT void miDamageUnregister(DrawablePtr, DamagePtr);
+extern _X_EXPORT void miDamageDestroy(DamagePtr);
+
+extern _X_EXPORT Bool
+ DamageSetup(ScreenPtr pScreen);
+
+extern _X_EXPORT DamagePtr
+DamageCreate(DamageReportFunc damageReport,
+ DamageDestroyFunc damageDestroy,
+ DamageReportLevel damageLevel,
+ Bool isInternal, ScreenPtr pScreen, void *closure);
+
+extern _X_EXPORT void
+ DamageDrawInternal(ScreenPtr pScreen, Bool enable);
+
+extern _X_EXPORT void
+ DamageRegister(DrawablePtr pDrawable, DamagePtr pDamage);
+
+extern _X_EXPORT void
+ DamageUnregister(DamagePtr pDamage);
+
+extern _X_EXPORT void
+ DamageDestroy(DamagePtr pDamage);
+
+extern _X_EXPORT Bool
+ DamageSubtract(DamagePtr pDamage, const RegionPtr pRegion);
+
+extern _X_EXPORT void
+ DamageEmpty(DamagePtr pDamage);
+
+extern _X_EXPORT RegionPtr
+ DamageRegion(DamagePtr pDamage);
+
+extern _X_EXPORT RegionPtr
+ DamagePendingRegion(DamagePtr pDamage);
+
+/* In case of rendering, call this before the submitting the commands. */
+extern _X_EXPORT void
+ DamageRegionAppend(DrawablePtr pDrawable, RegionPtr pRegion);
+
+/* Call this directly after the rendering operation has been submitted. */
+extern _X_EXPORT void
+ DamageRegionProcessPending(DrawablePtr pDrawable);
+
+/* Call this when you create a new Damage and you wish to send an initial damage message (to it). */
+extern _X_EXPORT void
+ DamageReportDamage(DamagePtr pDamage, RegionPtr pDamageRegion);
+
+/* Avoid using this call, it only exists for API compatibility. */
+extern _X_EXPORT void
+ DamageDamageRegion(DrawablePtr pDrawable, const RegionPtr pRegion);
+
+extern _X_EXPORT void
+ DamageSetReportAfterOp(DamagePtr pDamage, Bool reportAfter);
+
+extern _X_EXPORT DamageScreenFuncsPtr DamageGetScreenFuncs(ScreenPtr);
+
+#endif /* _DAMAGE_H_ */
diff --git a/prebuilt/xlibre/usr/include/xorg/damagestr.h b/prebuilt/xlibre/usr/include/xorg/damagestr.h
new file mode 100644
index 0000000..e8c3a72
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/damagestr.h
@@ -0,0 +1,110 @@
+/*
+ * Copyright © 2003 Keith Packard
+ *
+ * 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 Keith Packard not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. Keith Packard makes no
+ * representations about the suitability of this software for any purpose. It
+ * is provided "as is" without express or implied warranty.
+ *
+ * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL KEITH PACKARD 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 _DAMAGESTR_H_
+#define _DAMAGESTR_H_
+
+#include "damage.h"
+#include "gcstruct.h"
+#include "privates.h"
+#include "picturestr.h"
+
+typedef struct _damage {
+ DamagePtr pNext;
+ DamagePtr pNextWin;
+ /*
+ * Drawable on which this damage was inserted. Used to re-derive the list head at removal time
+ * to avoid caching a pointer into a realloc()able privates array.
+ */
+ DrawablePtr pListDrawable;
+ RegionRec damage;
+
+ DamageReportLevel damageLevel;
+ Bool isInternal;
+ void *closure;
+ Bool isWindow;
+ DrawablePtr pDrawable;
+
+ DamageReportFunc damageReport;
+ DamageDestroyFunc damageDestroy;
+
+ Bool reportAfter;
+ RegionRec pendingDamage; /* will be flushed post submission at the latest */
+ ScreenPtr pScreen;
+} DamageRec;
+
+typedef struct _damageScrPriv {
+ int internalLevel;
+
+ /*
+ * For DDXen which don't provide GetScreenPixmap, this provides
+ * a place to hook damage for windows on the screen
+ */
+ DamagePtr pScreenDamage;
+
+ CopyWindowProcPtr CopyWindow;
+ void *_dummy1; // required in place of a removed field for ABI compatibility
+ CreateGCProcPtr CreateGC;
+ void *_dummy2; // required in place of a removed field for ABI compatibility
+ SetWindowPixmapProcPtr SetWindowPixmap;
+ void *_dummy3; // required in place of a removed field for ABI compatibility
+ CompositeProcPtr Composite;
+ GlyphsProcPtr Glyphs;
+ AddTrapsProcPtr AddTraps;
+
+ /* Table of wrappable function pointers */
+ DamageScreenFuncsRec funcs;
+} DamageScrPrivRec, *DamageScrPrivPtr;
+
+typedef struct _damageGCPriv {
+ const GCOps *ops;
+ const GCFuncs *funcs;
+} DamageGCPrivRec, *DamageGCPrivPtr;
+
+/* XXX should move these into damage.c, damageScrPrivateIndex is static */
+#define damageGetScrPriv(pScr) ((DamageScrPrivPtr) \
+ dixLookupPrivate(&(pScr)->devPrivates, damageScrPrivateKey))
+
+#define damageScrPriv(pScr) \
+ DamageScrPrivPtr pScrPriv = damageGetScrPriv((pScr))
+
+#define damageGetPixPriv(pPix) \
+ dixLookupPrivate(&(pPix)->devPrivates, damagePixPrivateKey)
+
+#define damgeSetPixPriv(pPix,v) \
+ dixSetPrivate(&(pPix)->devPrivates, damagePixPrivateKey, (v))
+
+#define damagePixPriv(pPix) \
+ DamagePtr pDamage = damageGetPixPriv((pPix))
+
+#define damageGetGCPriv(pGC) \
+ dixLookupPrivate(&(pGC)->devPrivates, damageGCPrivateKey)
+
+#define damageGCPriv(pGC) \
+ DamageGCPrivPtr pGCPriv = damageGetGCPriv((pGC))
+
+#define damageGetWinPriv(pWin) \
+ ((DamagePtr)dixLookupPrivate(&(pWin)->devPrivates, damageWinPrivateKey))
+
+#define damageSetWinPriv(pWin,d) \
+ dixSetPrivate(&(pWin)->devPrivates, damageWinPrivateKey, d)
+
+#endif /* _DAMAGESTR_H_ */
diff --git a/prebuilt/xlibre/usr/include/xorg/displaymode.h b/prebuilt/xlibre/usr/include/xorg/displaymode.h
new file mode 100644
index 0000000..c97a11e
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/displaymode.h
@@ -0,0 +1,99 @@
+#ifndef _DISMODEPROC_H_
+#define _DISMODEPROC_H_
+
+#include "scrnintstr.h"
+
+#define MAXCLOCKS 128
+
+/* These are possible return values for xf86CheckMode() and ValidMode() */
+typedef enum {
+ MODE_OK = 0, /* Mode OK */
+ MODE_HSYNC, /* hsync out of range */
+ MODE_VSYNC, /* vsync out of range */
+ MODE_H_ILLEGAL, /* mode has illegal horizontal timings */
+ MODE_V_ILLEGAL, /* mode has illegal horizontal timings */
+ MODE_BAD_WIDTH, /* requires an unsupported linepitch */
+ MODE_NOMODE, /* no mode with a matching name */
+ MODE_NO_INTERLACE, /* interlaced mode not supported */
+ MODE_NO_DBLESCAN, /* doublescan mode not supported */
+ MODE_NO_VSCAN, /* multiscan mode not supported */
+ MODE_MEM, /* insufficient video memory */
+ MODE_VIRTUAL_X, /* mode width too large for specified virtual size */
+ MODE_VIRTUAL_Y, /* mode height too large for specified virtual size */
+ MODE_MEM_VIRT, /* insufficient video memory given virtual size */
+ MODE_NOCLOCK, /* no fixed clock available */
+ MODE_CLOCK_HIGH, /* clock required is too high */
+ MODE_CLOCK_LOW, /* clock required is too low */
+ MODE_CLOCK_RANGE, /* clock/mode isn't in a ClockRange */
+ MODE_BAD_HVALUE, /* horizontal timing was out of range */
+ MODE_BAD_VVALUE, /* vertical timing was out of range */
+ MODE_BAD_VSCAN, /* VScan value out of range */
+ MODE_HSYNC_NARROW, /* horizontal sync too narrow */
+ MODE_HSYNC_WIDE, /* horizontal sync too wide */
+ MODE_HBLANK_NARROW, /* horizontal blanking too narrow */
+ MODE_HBLANK_WIDE, /* horizontal blanking too wide */
+ MODE_VSYNC_NARROW, /* vertical sync too narrow */
+ MODE_VSYNC_WIDE, /* vertical sync too wide */
+ MODE_VBLANK_NARROW, /* vertical blanking too narrow */
+ MODE_VBLANK_WIDE, /* vertical blanking too wide */
+ MODE_PANEL, /* exceeds panel dimensions */
+ MODE_INTERLACE_WIDTH, /* width too large for interlaced mode */
+ MODE_ONE_WIDTH, /* only one width is supported */
+ MODE_ONE_HEIGHT, /* only one height is supported */
+ MODE_ONE_SIZE, /* only one resolution is supported */
+ MODE_NO_REDUCED, /* monitor doesn't accept reduced blanking */
+ MODE_BANDWIDTH, /* mode requires too much memory bandwidth */
+ MODE_DUPLICATE, /* mode is duplicated */
+ MODE_BAD = -2, /* unspecified reason */
+ MODE_ERROR = -1 /* error condition */
+} ModeStatus;
+
+/* Video mode */
+typedef struct _DisplayModeRec {
+ struct _DisplayModeRec *prev;
+ struct _DisplayModeRec *next;
+ const char *name; /* identifier for the mode */
+ ModeStatus status;
+ int type;
+
+ /* These are the values that the user sees/provides */
+ int Clock; /* pixel clock freq (kHz) */
+ int HDisplay; /* horizontal timing */
+ int HSyncStart;
+ int HSyncEnd;
+ int HTotal;
+ int HSkew;
+ int VDisplay; /* vertical timing */
+ int VSyncStart;
+ int VSyncEnd;
+ int VTotal;
+ int VScan;
+ int Flags;
+
+ /* These are the values the hardware uses */
+ int ClockIndex;
+ int SynthClock; /* Actual clock freq to
+ * be programmed (kHz) */
+ int CrtcHDisplay;
+ int CrtcHBlankStart;
+ int CrtcHSyncStart;
+ int CrtcHSyncEnd;
+ int CrtcHBlankEnd;
+ int CrtcHTotal;
+ int CrtcHSkew;
+ int CrtcVDisplay;
+ int CrtcVBlankStart;
+ int CrtcVSyncStart;
+ int CrtcVSyncEnd;
+ int CrtcVBlankEnd;
+ int CrtcVTotal;
+ Bool CrtcHAdjusted;
+ Bool CrtcVAdjusted;
+ int PrivSize;
+ INT32 *Private;
+ int PrivFlags;
+
+ float HSync, VRefresh;
+} DisplayModeRec, *DisplayModePtr;
+
+#endif
diff --git a/prebuilt/xlibre/usr/include/xorg/dix.h b/prebuilt/xlibre/usr/include/xorg/dix.h
new file mode 100644
index 0000000..1c8fe8e
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/dix.h
@@ -0,0 +1,229 @@
+/***********************************************************
+
+Copyright 1987, 1998 The Open Group
+
+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.
+
+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
+OPEN GROUP 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.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+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 Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL 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 DIX_H
+#define DIX_H
+
+#include
+
+#include "xlibre_ptrtypes.h"
+
+#include "callback.h"
+#include "gc.h"
+#include "window.h"
+#include "input.h"
+#include "cursor.h"
+#include "events.h"
+
+#define EARLIER -1
+#define SAMETIME 0
+#define LATER 1
+
+#define REQUEST(type) \
+ type * stuff = (type *)client->requestBuffer;
+
+/* Some platforms provide ARRAY_SIZE from a system header (e.g. illumos/Solaris
+ * ); don't redefine it there (-Werror). */
+#ifndef ARRAY_SIZE
+#define ARRAY_SIZE(a) (sizeof((a)) / sizeof((a)[0]))
+#endif
+
+#define REQUEST_SIZE_MATCH(req) \
+ do { \
+ if ((sizeof(req) >> 2) != client->req_len) \
+ return(BadLength); \
+ } while (0)
+
+#define REQUEST_AT_LEAST_SIZE(req) \
+ do { \
+ if ((sizeof(req) >> 2) > client->req_len) \
+ return(BadLength); \
+ } while (0)
+
+#define REQUEST_AT_LEAST_EXTRA_SIZE(req, extra) \
+ do { \
+ if (((sizeof(req) + ((uint64_t) (extra))) >> 2) > client->req_len) \
+ return(BadLength); \
+ } while (0)
+
+#define REQUEST_FIXED_SIZE(req, n) \
+ do { \
+ if ((((sizeof(req)) >> 2) > client->req_len) || \
+ (((n) >> 2) >= client->req_len) || \
+ ((((uint64_t) sizeof(req) + (n) + 3) >> 2) != (uint64_t) client->req_len)) \
+ return(BadLength); \
+ } while (0)
+
+typedef struct _TimeStamp *TimeStampPtr;
+
+extern _X_EXPORT ClientPtr clients[];
+extern _X_EXPORT ClientPtr serverClient;
+extern _X_EXPORT int currentMaxClients;
+
+typedef struct _TimeStamp {
+ CARD32 months; /* really ~49.7 days */
+ CARD32 milliseconds;
+} TimeStamp;
+
+/* dispatch.c */
+extern _X_EXPORT void UpdateCurrentTime(void);
+
+extern _X_EXPORT void UpdateCurrentTimeIf(void);
+
+/*
+ * @brief dereference a pixmap and destroy it when not used anymore
+ *
+ * Despite the name, this function unref's the pixmap, and only destroys it when
+ * the pixmap isn't used anymore. (perhaps it should be renamed to dixUnrefPixmap())
+ *
+ * Note: it's also used as resource destructor callback, hence that strange args.
+ * (not actually finest art, but for now a good compromise, since it's already
+ * existing and exported, thus can easily be used by drivers, w/o breaking compat)
+ *
+ * @param pPixmap pointer to pixmap (PixmapPtr) that should be unref'ed
+ * @param unused ignored, only for matching the resource destructor prototype
+ */
+_X_EXPORT int dixDestroyPixmap(void *pPixmap, XID unused);
+
+/* dixutils.c */
+
+extern _X_EXPORT int dixLookupWindow(WindowPtr *result,
+ XID id,
+ ClientPtr client, Mask access_mode);
+
+extern _X_EXPORT int dixLookupDrawable(DrawablePtr *result,
+ XID id,
+ ClientPtr client,
+ Mask type_mask, Mask access_mode);
+
+extern _X_EXPORT int dixLookupFontable(FontPtr *result,
+ XID id,
+ ClientPtr client, Mask access_mode);
+
+extern _X_EXPORT void NoopDDA(void);
+
+typedef void (*ServerBlockHandlerProcPtr) (void *blockData,
+ void *timeout);
+
+typedef void (*ServerWakeupHandlerProcPtr) (void *blockData,
+ int result);
+
+extern _X_EXPORT Bool RegisterBlockAndWakeupHandlers(ServerBlockHandlerProcPtr blockHandler,
+ ServerWakeupHandlerProcPtr wakeupHandler,
+ void *blockData);
+
+extern _X_EXPORT void RemoveBlockAndWakeupHandlers(ServerBlockHandlerProcPtr blockHandler,
+ ServerWakeupHandlerProcPtr wakeupHandler,
+ void *blockData);
+
+extern _X_EXPORT Bool QueueWorkProc(Bool (*function)(ClientPtr clientUnused,
+ void *closure),
+ ClientPtr client,
+ void *closure);
+
+/* atom.c */
+
+extern _X_EXPORT Atom MakeAtom(const char * /*string */ ,
+ unsigned /*len */ ,
+ Bool /*makeit */ );
+
+extern _X_EXPORT Bool ValidAtom(Atom /*atom */ );
+
+extern _X_EXPORT const char *NameForAtom(Atom /*atom */ );
+
+/* events.c */
+
+extern _X_EXPORT void
+WriteEventsToClient(ClientPtr /*pClient */ ,
+ int /*count */ ,
+ xEventPtr /*events */ );
+
+/*
+ * ServerGrabCallback stuff
+ */
+
+extern _X_EXPORT CallbackListPtr ServerGrabCallback;
+
+typedef enum { SERVER_GRABBED, SERVER_UNGRABBED,
+ CLIENT_PERVIOUS, CLIENT_IMPERVIOUS
+} ServerGrabState;
+
+typedef struct {
+ ClientPtr client;
+ ServerGrabState grabstate;
+} ServerGrabInfoRec;
+
+/*
+ * EventCallback stuff
+ */
+
+extern _X_EXPORT CallbackListPtr EventCallback;
+
+typedef struct {
+ ClientPtr client;
+ xEventPtr events;
+ int count;
+} EventInfoRec;
+
+typedef struct {
+ InternalEvent *event;
+ DeviceIntPtr device;
+} DeviceEventInfoRec;
+
+extern _X_EXPORT void *lastGLContext;
+
+/**
+ * @brief get display string for given screen
+ *
+ * Entry point for drivers/modules that really need to know what
+ * display ID we're running on (eg. xrdp).
+ *
+ * @param pScreen pointer to ScreenRec to query.
+ * @return pointer to string, valid as long as the pScreen is, owned by DIX.
+ */
+_X_EXPORT const char *dixGetDisplayName(ScreenPtr *pScreen);
+
+#endif /* DIX_H */
diff --git a/prebuilt/xlibre/usr/include/xorg/dixaccess.h b/prebuilt/xlibre/usr/include/xorg/dixaccess.h
new file mode 100644
index 0000000..784c83c
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/dixaccess.h
@@ -0,0 +1,54 @@
+/***********************************************************
+
+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
+OPEN GROUP 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 DIX_ACCESS_H
+#define DIX_ACCESS_H
+
+/* These are the access modes that can be passed in the last parameter
+ * to several of the dix lookup functions. They were originally part
+ * of the Security extension, now used by XACE.
+ *
+ * You can or these values together to indicate multiple modes
+ * simultaneously.
+ */
+
+#define DixUnknownAccess 0 /* don't know intentions */
+#define DixReadAccess (1<<0) /* inspecting the object */
+#define DixWriteAccess (1<<1) /* changing the object */
+#define DixDestroyAccess (1<<2) /* destroying the object */
+#define DixCreateAccess (1<<3) /* creating the object */
+#define DixGetAttrAccess (1<<4) /* get object attributes */
+#define DixSetAttrAccess (1<<5) /* set object attributes */
+#define DixListPropAccess (1<<6) /* list properties of object */
+#define DixGetPropAccess (1<<7) /* get properties of object */
+#define DixSetPropAccess (1<<8) /* set properties of object */
+#define DixGetFocusAccess (1<<9) /* get focus of object */
+#define DixSetFocusAccess (1<<10) /* set focus of object */
+#define DixListAccess (1<<11) /* list objects */
+#define DixAddAccess (1<<12) /* add object */
+#define DixRemoveAccess (1<<13) /* remove object */
+#define DixHideAccess (1<<14) /* hide object */
+#define DixShowAccess (1<<15) /* show object */
+#define DixBlendAccess (1<<16) /* mix contents of objects */
+#define DixGrabAccess (1<<17) /* exclusive access to object */
+#define DixFreezeAccess (1<<18) /* freeze status of object */
+#define DixForceAccess (1<<19) /* force status of object */
+#define DixInstallAccess (1<<20) /* install object */
+#define DixUninstallAccess (1<<21) /* uninstall object */
+#define DixSendAccess (1<<22) /* send to object */
+#define DixReceiveAccess (1<<23) /* receive from object */
+#define DixUseAccess (1<<24) /* use object */
+#define DixManageAccess (1<<25) /* manage object */
+#define DixDebugAccess (1<<26) /* debug object */
+#define DixBellAccess (1<<27) /* audible sound */
+#define DixPostAccess (1<<28) /* post or follow-up call */
+
+#endif /* DIX_ACCESS_H */
diff --git a/prebuilt/xlibre/usr/include/xorg/dixfont.h b/prebuilt/xlibre/usr/include/xorg/dixfont.h
new file mode 100644
index 0000000..a161a26
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/dixfont.h
@@ -0,0 +1,93 @@
+/***********************************************************
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+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 Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL 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 DIXFONT_H
+#define DIXFONT_H 1
+
+#include "xlibre_ptrtypes.h"
+
+#include "dix.h"
+#include
+#include
+
+extern _X_EXPORT Bool SetDefaultFont(const char * /*defaultfontname */ );
+
+extern _X_EXPORT int OpenFont(ClientPtr /*client */ ,
+ XID /*fid */ ,
+ Mask /*flags */ ,
+ unsigned /*lenfname */ ,
+ const char * /*pfontname */ );
+
+extern _X_EXPORT int CloseFont(void *pfont,
+ XID fid);
+
+extern _X_EXPORT int ListFonts(ClientPtr /*client */ ,
+ unsigned char * /*pattern */ ,
+ unsigned int /*length */ ,
+ unsigned int /*max_names */ );
+
+extern _X_EXPORT int PolyText(ClientPtr /*client */ ,
+ DrawablePtr /*pDraw */ ,
+ GCPtr /*pGC */ ,
+ unsigned char * /*pElt */ ,
+ unsigned char * /*endReq */ ,
+ int /*xorg */ ,
+ int /*yorg */ ,
+ int /*reqType */ ,
+ XID /*did */ );
+
+extern _X_EXPORT int ImageText(ClientPtr /*client */ ,
+ DrawablePtr /*pDraw */ ,
+ GCPtr /*pGC */ ,
+ int /*nChars */ ,
+ unsigned char * /*data */ ,
+ int /*xorg */ ,
+ int /*yorg */ ,
+ int /*reqType */ ,
+ XID /*did */ );
+
+extern _X_EXPORT int SetFontPath(ClientPtr /*client */ ,
+ int /*npaths */ ,
+ unsigned char * /*paths */ );
+
+extern _X_EXPORT int SetDefaultFontPath(const char * /*path */ );
+
+extern _X_EXPORT void DeleteClientFontStuff(ClientPtr /*client */ );
+
+/* Quartz support on Mac OS X pulls in the QuickDraw
+ framework whose InitFonts function conflicts here. */
+#ifdef __APPLE__
+#define InitFonts Darwin_X_InitFonts
+#endif
+extern _X_EXPORT void InitFonts(void);
+
+extern _X_EXPORT void FreeFonts(void);
+
+extern _X_EXPORT void GetGlyphs(FontPtr /*font */ ,
+ unsigned long /*count */ ,
+ unsigned char * /*chars */ ,
+ FontEncoding /*fontEncoding */ ,
+ unsigned long * /*glyphcount */ ,
+ CharInfoPtr * /*glyphs */ );
+
+#endif /* DIXFONT_H */
diff --git a/prebuilt/xlibre/usr/include/xorg/dixfontstr.h b/prebuilt/xlibre/usr/include/xorg/dixfontstr.h
new file mode 100644
index 0000000..ded864a
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/dixfontstr.h
@@ -0,0 +1,70 @@
+/***********************************************************
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+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 Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL 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 DIXFONTSTRUCT_H
+#define DIXFONTSTRUCT_H
+
+#include "servermd.h"
+#include "dixfont.h"
+#include
+#include /* for xQueryFontReply */
+
+#define FONTCHARSET(font) (font)
+#define FONTMAXBOUNDS(font,field) (font)->info.maxbounds.field
+#define FONTMINBOUNDS(font,field) (font)->info.minbounds.field
+#define TERMINALFONT(font) (font)->info.terminalFont
+#define FONTASCENT(font) (font)->info.fontAscent
+#define FONTDESCENT(font) (font)->info.fontDescent
+#define FONTGLYPHS(font) 0
+#define FONTCONSTMETRICS(font) (font)->info.constantMetrics
+#define FONTCONSTWIDTH(font) (font)->info.constantWidth
+#define FONTALLEXIST(font) (font)->info.allExist
+#define FONTFIRSTCOL(font) (font)->info.firstCol
+#define FONTLASTCOL(font) (font)->info.lastCol
+#define FONTFIRSTROW(font) (font)->info.firstRow
+#define FONTLASTROW(font) (font)->info.lastRow
+#define FONTDEFAULTCH(font) (font)->info.defaultCh
+#define FONTINKMIN(font) (&((font)->info.ink_minbounds))
+#define FONTINKMAX(font) (&((font)->info.ink_maxbounds))
+#define FONTPROPS(font) (font)->info.props
+#define FONTGLYPHBITS(base,pci) ((unsigned char *) (pci)->bits)
+#define FONTINFONPROPS(font) (font)->info.nprops
+
+/* some things haven't changed names, but we'll be careful anyway */
+
+#define FONTREFCNT(font) (font)->refcnt
+
+/*
+ * for linear char sets
+ */
+#define N1dChars(pfont) (FONTLASTCOL((pfont)) - FONTFIRSTCOL((pfont)) + 1)
+
+/*
+ * for 2D char sets
+ */
+#define N2dChars(pfont) (N1dChars((pfont)) * \
+ (FONTLASTROW((pfont)) - FONTFIRSTROW((pfont)) + 1))
+
+#define GLYPHWIDTHBYTESPADDED(pci) ((GLYPHWIDTHBYTES((pci))+3) & ~0x3)
+
+#endif /* DIXFONTSTRUCT_H */
diff --git a/prebuilt/xlibre/usr/include/xorg/dixstruct.h b/prebuilt/xlibre/usr/include/xorg/dixstruct.h
new file mode 100644
index 0000000..ffe858d
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/dixstruct.h
@@ -0,0 +1,123 @@
+/***********************************************************
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+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 Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL 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 DIXSTRUCT_H
+#define DIXSTRUCT_H
+
+#include
+
+#include "xlibre_ptrtypes.h"
+
+#include "callback.h"
+#include "dix.h"
+#include "resource.h"
+#include "cursor.h"
+#include "gc.h"
+#include "pixmap.h"
+#include "privates.h"
+
+/*
+ * direct-mapped hash table, used by resource manager to store
+ * translation from client ids to server addresses.
+ */
+
+extern _X_EXPORT CallbackListPtr ClientStateCallback;
+
+typedef struct {
+ ClientPtr client;
+ xConnSetupPrefix *prefix;
+ xConnSetup *setup;
+} NewClientInfoRec;
+
+typedef void (*ReplySwapPtr) (ClientPtr /* pClient */ ,
+ int /* size */ ,
+ void * /* pbuf */ );
+
+typedef enum { ClientStateInitial,
+ ClientStateRunning,
+ ClientStateRetained,
+ ClientStateGone
+} ClientState;
+
+struct _Client {
+ void *requestBuffer;
+ void *osPrivate; /* for OS layer, including scheduler */
+ struct xorg_list ready; /* List of clients ready to run */
+ struct xorg_list output_pending; /* List of clients with output queued */
+ Mask clientAsMask;
+ unsigned short index;
+ unsigned char majorOp, minorOp;
+ unsigned int swapped:1;
+ unsigned int local:1;
+ unsigned int big_requests:1; /* supports large requests */
+ unsigned int clientGone:1;
+ unsigned int closeDownMode:2;
+ unsigned int clientState:2;
+ signed char smart_priority;
+ short noClientException; /* this client died or needs to be killed */
+ int priority;
+ ReplySwapPtr pSwapReplyFunc;
+ XID errorValue;
+ int sequence;
+ int ignoreCount; /* count for Attend/IgnoreClient */
+ int __dummy0; /* used to be numSave */
+ void *__dummy1; /* used to be saveSet */
+ int (**requestVector) (ClientPtr /* pClient */ );
+ CARD32 req_len; /* length of current request */
+ unsigned int replyBytesRemaining;
+ PrivateRec *devPrivates;
+ unsigned short mapNotifyMask;
+ unsigned short newKeyboardNotifyMask;
+ unsigned char xkbClientFlags;
+ KeyCode minKC, maxKC;
+
+ int smart_start_tick;
+ int smart_stop_tick;
+
+ DeviceIntPtr clientPtr;
+ struct _ClientId *clientIds;
+ int req_fds;
+
+ /* driver should never ever touch anything beyond here */
+ struct xorg_list saveSets;
+};
+
+extern _X_EXPORT TimeStamp currentTime;
+
+extern _X_EXPORT int
+CompareTimeStamps(TimeStamp /*a */ ,
+ TimeStamp /*b */ );
+
+extern _X_EXPORT TimeStamp
+ClientTimeToServerTime(CARD32 /*c */ );
+
+/* proc vectors */
+
+extern _X_EXPORT int (*ProcVector[256]) (ClientPtr /*client */ );
+
+extern _X_EXPORT int (*SwappedProcVector[256]) (ClientPtr /*client */ );
+
+/* fixme: still needed by (public) dix.h */
+extern ReplySwapPtr ReplySwapVector[256];
+
+#endif /* DIXSTRUCT_H */
diff --git a/prebuilt/xlibre/usr/include/xorg/dri.h b/prebuilt/xlibre/usr/include/xorg/dri.h
new file mode 100644
index 0000000..0dc4036
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/dri.h
@@ -0,0 +1,336 @@
+/**************************************************************************
+
+Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
+All Rights Reserved.
+
+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, sub license, 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 (including the
+next paragraph) 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 NON-INFRINGEMENT.
+IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS 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.
+
+**************************************************************************/
+
+/*
+ * Authors:
+ * Jens Owen
+ *
+ */
+
+#ifndef _DRI_H_
+#define _DRI_H_
+
+#include
+
+#include "scrnintstr.h"
+#include "xf86dri.h"
+
+/* Prototypes for DRI functions */
+
+typedef int DRISyncType;
+
+#define DRI_NO_SYNC 0
+#define DRI_2D_SYNC 1
+#define DRI_3D_SYNC 2
+
+typedef int DRIContextType;
+
+typedef struct _DRIContextPrivRec DRIContextPrivRec, *DRIContextPrivPtr;
+
+typedef enum _DRIContextFlags {
+ DRI_CONTEXT_2DONLY = 0x01,
+ DRI_CONTEXT_PRESERVED = 0x02,
+ DRI_CONTEXT_RESERVED = 0x04 /* DRI Only -- no kernel equivalent */
+} DRIContextFlags;
+
+#define DRI_NO_CONTEXT 0
+#define DRI_2D_CONTEXT 1
+#define DRI_3D_CONTEXT 2
+
+typedef int DRISwapMethod;
+
+#define DRI_HIDE_X_CONTEXT 0
+#define DRI_SERVER_SWAP 1
+#define DRI_KERNEL_SWAP 2
+
+typedef int DRIWindowRequests;
+
+#define DRI_NO_WINDOWS 0
+#define DRI_3D_WINDOWS_ONLY 1
+#define DRI_ALL_WINDOWS 2
+
+typedef void (*ClipNotifyPtr) (WindowPtr, int, int);
+typedef void (*AdjustFramePtr) (ScrnInfoPtr pScrn, int x, int y);
+
+/*
+ * These functions can be wrapped by the DRI. Each of these have
+ * generic default funcs (initialized in DRICreateInfoRec) and can be
+ * overridden by the driver in its [driver]DRIScreenInit function.
+ */
+typedef struct {
+ ScreenWakeupHandlerProcPtr WakeupHandler;
+ ScreenBlockHandlerProcPtr BlockHandler;
+ WindowExposuresProcPtr WindowExposures;
+ CopyWindowProcPtr CopyWindow;
+ ClipNotifyProcPtr ClipNotify;
+ AdjustFramePtr AdjustFrame;
+} DRIWrappedFuncsRec, *DRIWrappedFuncsPtr;
+
+/*
+ * Prior to Xorg 6.8.99.8, the DRIInfoRec structure was implicitly versioned
+ * by the XF86DRI_*_VERSION defines in xf86dristr.h. These numbers were also
+ * being used to version the XFree86-DRI protocol. Bugs #3066 and #3163
+ * showed that this was inadequate. The DRIInfoRec structure is now versioned
+ * by the DRIINFO_*_VERSION defines in this file. - ajax, 2005-05-18.
+ *
+ * Revision history:
+ * 4.1.0 and earlier: DRIQueryVersion returns XF86DRI_*_VERSION.
+ * 4.2.0: DRIQueryVersion begins returning DRIINFO_*_VERSION.
+ * 5.0.0: frameBufferPhysicalAddress changed from CARD32 to pointer.
+ */
+
+#define DRIINFO_MAJOR_VERSION 5
+#define DRIINFO_MINOR_VERSION 4
+#define DRIINFO_PATCH_VERSION 0
+
+typedef unsigned long long (*DRITexOffsetStartProcPtr) (PixmapPtr pPix);
+typedef void (*DRITexOffsetFinishProcPtr) (PixmapPtr pPix);
+
+typedef struct {
+ /* driver call back functions
+ *
+ * New fields should be added at the end for backwards compatibility.
+ * Bump the DRIINFO patch number to indicate bugfixes.
+ * Bump the DRIINFO minor number to indicate new fields.
+ * Bump the DRIINFO major number to indicate binary-incompatible changes.
+ */
+ Bool (*CreateContext) (ScreenPtr pScreen,
+ VisualPtr visual,
+ drm_context_t hHWContext,
+ void *pVisualConfigPriv, DRIContextType context);
+ void (*DestroyContext) (ScreenPtr pScreen,
+ drm_context_t hHWContext, DRIContextType context);
+ void (*SwapContext) (ScreenPtr pScreen,
+ DRISyncType syncType,
+ DRIContextType readContextType,
+ void *readContextStore,
+ DRIContextType writeContextType,
+ void *writeContextStore);
+ void (*InitBuffers) (WindowPtr pWin, RegionPtr prgn, CARD32 indx);
+ void (*MoveBuffers) (WindowPtr pWin, xPoint ptOldOrg, RegionPtr prgnSrc, CARD32 indx);
+ void (*TransitionTo3d) (ScreenPtr pScreen);
+ void (*TransitionTo2d) (ScreenPtr pScreen);
+
+ void (*SetDrawableIndex) (WindowPtr pWin, CARD32 indx);
+ Bool (*OpenFullScreen) (ScreenPtr pScreen);
+ Bool (*CloseFullScreen) (ScreenPtr pScreen);
+
+ /* wrapped functions */
+ DRIWrappedFuncsRec wrap;
+
+ /* device info */
+ char *drmDriverName;
+ char *clientDriverName;
+ char *busIdString;
+ int ddxDriverMajorVersion;
+ int ddxDriverMinorVersion;
+ int ddxDriverPatchVersion;
+ void *frameBufferPhysicalAddress;
+ long frameBufferSize;
+ long frameBufferStride;
+ long SAREASize;
+ int maxDrawableTableEntry;
+ int ddxDrawableTableEntry;
+ long contextSize;
+ DRISwapMethod driverSwapMethod;
+ DRIWindowRequests bufferRequests;
+ int devPrivateSize;
+ void *devPrivate;
+ Bool createDummyCtx;
+ Bool createDummyCtxPriv;
+
+ /* New with DRI version 4.1.0 */
+ void (*TransitionSingleToMulti3D) (ScreenPtr pScreen);
+ void (*TransitionMultiToSingle3D) (ScreenPtr pScreen);
+
+ /* New with DRI version 5.1.0 */
+ void (*ClipNotify) (ScreenPtr pScreen, WindowPtr *ppWin, int num);
+
+ /* New with DRI version 5.2.0 */
+ Bool allocSarea;
+ Bool keepFDOpen;
+
+ /* New with DRI version 5.3.0 */
+ DRITexOffsetStartProcPtr texOffsetStart;
+ DRITexOffsetFinishProcPtr texOffsetFinish;
+
+ /* New with DRI version 5.4.0 */
+ int dontMapFrameBuffer;
+ drm_handle_t hFrameBuffer; /* Handle to framebuffer, either
+ * mapped by DDX driver or DRI */
+
+} DRIInfoRec, *DRIInfoPtr;
+
+extern _X_EXPORT Bool DRIOpenDRMMaster(ScrnInfoPtr pScrn,
+ unsigned long sAreaSize,
+ const char *busID,
+ const char *drmDriverName);
+
+extern _X_EXPORT Bool DRIScreenInit(ScreenPtr pScreen,
+ DRIInfoPtr pDRIInfo, int *pDRMFD);
+
+extern _X_EXPORT void DRICloseScreen(ScreenPtr pScreen);
+
+extern _X_EXPORT void DRIReset(void);
+
+extern _X_EXPORT Bool DRIQueryDirectRenderingCapable(ScreenPtr pScreen,
+ Bool *isCapable);
+
+extern _X_EXPORT Bool DRIOpenConnection(ScreenPtr pScreen,
+ drm_handle_t * hSAREA,
+ char **busIdString);
+
+extern _X_EXPORT Bool DRIAuthConnection(ScreenPtr pScreen, drm_magic_t magic);
+
+extern _X_EXPORT Bool DRICloseConnection(ScreenPtr pScreen);
+
+extern _X_EXPORT Bool DRIGetClientDriverName(ScreenPtr pScreen,
+ int *ddxDriverMajorVersion,
+ int *ddxDriverMinorVersion,
+ int *ddxDriverPatchVersion,
+ char **clientDriverName);
+
+extern _X_EXPORT Bool DRICreateContext(ScreenPtr pScreen,
+ VisualPtr visual,
+ XID context, drm_context_t * pHWContext);
+
+extern _X_EXPORT Bool DRIDestroyContext(ScreenPtr pScreen, XID context);
+
+extern _X_EXPORT Bool DRIContextPrivDelete(void *pResource, XID id);
+
+extern _X_EXPORT Bool DRICreateDrawable(ScreenPtr pScreen,
+ ClientPtr client,
+ DrawablePtr pDrawable,
+ drm_drawable_t * hHWDrawable);
+
+extern _X_EXPORT Bool DRIDestroyDrawable(ScreenPtr pScreen,
+ ClientPtr client,
+ DrawablePtr pDrawable);
+
+extern _X_EXPORT Bool DRIDrawablePrivDelete(void *pResource, XID id);
+
+extern _X_EXPORT Bool DRIGetDrawableInfo(ScreenPtr pScreen,
+ DrawablePtr pDrawable,
+ unsigned int *indx,
+ unsigned int *stamp,
+ int *X,
+ int *Y,
+ int *W,
+ int *H,
+ int *numClipRects,
+ drm_clip_rect_t ** pClipRects,
+ int *backX,
+ int *backY,
+ int *numBackClipRects,
+ drm_clip_rect_t ** pBackClipRects);
+
+extern _X_EXPORT Bool DRIGetDeviceInfo(ScreenPtr pScreen,
+ drm_handle_t * hFrameBuffer,
+ int *fbOrigin,
+ int *fbSize,
+ int *fbStride,
+ int *devPrivateSize, void **pDevPrivate);
+
+extern _X_EXPORT DRIInfoPtr DRICreateInfoRec(void);
+
+extern _X_EXPORT void DRIDestroyInfoRec(DRIInfoPtr DRIInfo);
+
+extern _X_EXPORT Bool DRIFinishScreenInit(ScreenPtr pScreen);
+
+extern _X_EXPORT void DRIWakeupHandler(void *wakeupData, int result);
+
+extern _X_EXPORT void DRIBlockHandler(void *blockData, void *timeout);
+
+extern _X_EXPORT void DRIDoWakeupHandler(ScreenPtr pScreen, int result);
+
+extern _X_EXPORT void DRIDoBlockHandler(ScreenPtr pScreen, void *timeout);
+
+extern _X_EXPORT void DRISwapContext(int drmFD, void *oldctx, void *newctx);
+
+extern _X_EXPORT void *DRIGetContextStore(DRIContextPrivPtr context);
+
+extern _X_EXPORT void DRIWindowExposures(WindowPtr pWin, RegionPtr prgn);
+
+extern _X_EXPORT void DRICopyWindow(WindowPtr pWin,
+ xPoint ptOldOrg, RegionPtr prgnSrc);
+
+extern _X_EXPORT void DRIClipNotify(WindowPtr pWin, int dx, int dy);
+
+extern _X_EXPORT CARD32 DRIGetDrawableIndex(WindowPtr pWin);
+
+extern _X_EXPORT void DRIPrintDrawableLock(ScreenPtr pScreen, char *msg);
+
+extern _X_EXPORT void DRILock(ScreenPtr pScreen, int flags);
+
+extern _X_EXPORT void DRIUnlock(ScreenPtr pScreen);
+
+extern _X_EXPORT DRIWrappedFuncsRec *DRIGetWrappedFuncs(ScreenPtr pScreen);
+
+extern _X_EXPORT void *DRIGetSAREAPrivate(ScreenPtr pScreen);
+
+extern _X_EXPORT unsigned int DRIGetDrawableStamp(ScreenPtr pScreen,
+ CARD32 drawable_index);
+
+extern _X_EXPORT DRIContextPrivPtr DRICreateContextPriv(ScreenPtr pScreen,
+ drm_context_t *
+ pHWContext,
+ DRIContextFlags flags);
+
+extern _X_EXPORT DRIContextPrivPtr DRICreateContextPrivFromHandle(ScreenPtr
+ pScreen,
+ drm_context_t
+ hHWContext,
+ DRIContextFlags
+ flags);
+
+extern _X_EXPORT Bool DRIDestroyContextPriv(DRIContextPrivPtr pDRIContextPriv);
+
+extern _X_EXPORT drm_context_t DRIGetContext(ScreenPtr pScreen);
+
+extern _X_EXPORT void DRIQueryVersion(int *majorVersion,
+ int *minorVersion, int *patchVersion);
+
+extern _X_EXPORT void DRIAdjustFrame(ScrnInfoPtr pScrn, int x, int y);
+
+extern _X_EXPORT void DRIMoveBuffersHelper(ScreenPtr pScreen,
+ int dx,
+ int dy,
+ int *xdir, int *ydir, RegionPtr reg);
+
+extern _X_EXPORT int DRIMasterFD(ScrnInfoPtr pScrn);
+
+extern _X_EXPORT void *DRIMasterSareaPointer(ScrnInfoPtr pScrn);
+
+extern _X_EXPORT drm_handle_t DRIMasterSareaHandle(ScrnInfoPtr pScrn);
+
+extern _X_EXPORT void DRIGetTexOffsetFuncs(ScreenPtr pScreen,
+ DRITexOffsetStartProcPtr *
+ texOffsetStartFunc,
+ DRITexOffsetFinishProcPtr *
+ texOffsetFinishFunc);
+
+#endif
diff --git a/prebuilt/xlibre/usr/include/xorg/dri2.h b/prebuilt/xlibre/usr/include/xorg/dri2.h
new file mode 100644
index 0000000..8582a61
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/dri2.h
@@ -0,0 +1,361 @@
+/*
+ * Copyright © 2007 Red Hat, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Soft-
+ * ware"), to deal in the Software without restriction, including without
+ * limitation the rights to use, copy, modify, merge, publish, distribute,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, provided that the above copyright
+ * notice(s) and this permission notice appear in all copies of the Soft-
+ * ware and that both the above copyright notice(s) and this permission
+ * notice appear in supporting documentation.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL-
+ * ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY
+ * RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN
+ * THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSE-
+ * QUENTIAL 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 PERFOR-
+ * MANCE OF THIS SOFTWARE.
+ *
+ * Except as contained in this notice, the name of a copyright holder shall
+ * not be used in advertising or otherwise to promote the sale, use or
+ * other dealings in this Software without prior written authorization of
+ * the copyright holder.
+ *
+ * Authors:
+ * Kristian Høgsberg (krh@redhat.com)
+ */
+
+#ifndef _DRI2_H_
+#define _DRI2_H_
+
+#include
+
+#include "dix.h"
+
+/* Version 2 structure (with format at the end) */
+typedef struct {
+ unsigned int attachment;
+ unsigned int name;
+ unsigned int pitch;
+ unsigned int cpp;
+ unsigned int flags;
+ unsigned int format;
+ void *driverPrivate;
+} DRI2BufferRec, *DRI2BufferPtr;
+
+typedef DRI2BufferRec DRI2Buffer2Rec, *DRI2Buffer2Ptr;
+typedef void (*DRI2SwapEventPtr) (ClientPtr client, void *data, int type,
+ CARD64 ust, CARD64 msc, CARD32 sbc);
+
+typedef DRI2BufferPtr(*DRI2CreateBuffersProcPtr) (DrawablePtr pDraw,
+ unsigned int *attachments,
+ int count);
+typedef void (*DRI2DestroyBuffersProcPtr) (DrawablePtr pDraw,
+ DRI2BufferPtr buffers, int count);
+typedef void (*DRI2CopyRegionProcPtr) (DrawablePtr pDraw,
+ RegionPtr pRegion,
+ DRI2BufferPtr pDestBuffer,
+ DRI2BufferPtr pSrcBuffer);
+typedef void (*DRI2WaitProcPtr) (WindowPtr pWin, unsigned int sequence);
+typedef int (*DRI2AuthMagicProcPtr) (int fd, uint32_t magic);
+typedef int (*DRI2AuthMagic2ProcPtr) (ScreenPtr pScreen, uint32_t magic);
+
+/**
+ * Schedule a buffer swap
+ *
+ * This callback is used to support glXSwapBuffers and the OML_sync_control
+ * extension (see it for a description of the params).
+ *
+ * Drivers should queue an event for the frame count that satisfies the
+ * parameters passed in. If the event is in the future (i.e. the conditions
+ * aren't currently satisfied), the server may block the client at the next
+ * GLX request using DRI2WaitSwap. When the event arrives, drivers should call
+ * \c DRI2SwapComplete, which will handle waking the client and returning
+ * the appropriate data.
+ *
+ * The DDX is responsible for doing a flip, exchange, or blit of the swap
+ * when the corresponding event arrives. The \c DRI2CanFlip and
+ * \c DRI2CanExchange functions can be used as helpers for this purpose.
+ *
+ * \param client client pointer (used for block/unblock)
+ * \param pDraw drawable whose count we want
+ * \param pDestBuffer current front buffer
+ * \param pSrcBuffer current back buffer
+ * \param target_msc frame count to wait for
+ * \param divisor divisor for condition equation
+ * \param remainder remainder for division equation
+ * \param func function to call when the swap completes
+ * \param data data for the callback \p func.
+ */
+typedef int (*DRI2ScheduleSwapProcPtr) (ClientPtr client,
+ DrawablePtr pDraw,
+ DRI2BufferPtr pDestBuffer,
+ DRI2BufferPtr pSrcBuffer,
+ CARD64 * target_msc,
+ CARD64 divisor,
+ CARD64 remainder,
+ DRI2SwapEventPtr func, void *data);
+typedef DRI2BufferPtr(*DRI2CreateBufferProcPtr) (DrawablePtr pDraw,
+ unsigned int attachment,
+ unsigned int format);
+typedef void (*DRI2DestroyBufferProcPtr) (DrawablePtr pDraw,
+ DRI2BufferPtr buffer);
+/**
+ * Notifies driver when DRI2GetBuffers reuses a dri2 buffer.
+ *
+ * Driver may rename the dri2 buffer in this notify if it is required.
+ *
+ * \param pDraw drawable whose count we want
+ * \param buffer buffer that will be returned to client
+ */
+typedef void (*DRI2ReuseBufferNotifyProcPtr) (DrawablePtr pDraw,
+ DRI2BufferPtr buffer);
+/**
+ * Get current media stamp counter values
+ *
+ * This callback is used to support the SGI_video_sync and OML_sync_control
+ * extensions.
+ *
+ * Drivers should return the current frame counter and the timestamp from
+ * when the returned frame count was last incremented.
+ *
+ * The count should correspond to the screen where the drawable is currently
+ * visible. If the drawable isn't visible (e.g. redirected), the server
+ * should return BadDrawable to the client, pending GLX spec updates to
+ * define this behavior.
+ *
+ * \param pDraw drawable whose count we want
+ * \param ust timestamp from when the count was last incremented.
+ * \param mst current frame count
+ */
+typedef int (*DRI2GetMSCProcPtr) (DrawablePtr pDraw, CARD64 * ust,
+ CARD64 * msc);
+/**
+ * Schedule a frame count related wait
+ *
+ * This callback is used to support the SGI_video_sync and OML_sync_control
+ * extensions. See those specifications for details on how to handle
+ * the divisor and remainder parameters.
+ *
+ * Drivers should queue an event for the frame count that satisfies the
+ * parameters passed in. If the event is in the future (i.e. the conditions
+ * aren't currently satisfied), the driver should block the client using
+ * \c DRI2BlockClient. When the event arrives, drivers should call
+ * \c DRI2WaitMSCComplete, which will handle waking the client and returning
+ * the appropriate data.
+ *
+ * \param client client pointer (used for block/unblock)
+ * \param pDraw drawable whose count we want
+ * \param target_msc frame count to wait for
+ * \param divisor divisor for condition equation
+ * \param remainder remainder for division equation
+ */
+typedef int (*DRI2ScheduleWaitMSCProcPtr) (ClientPtr client,
+ DrawablePtr pDraw,
+ CARD64 target_msc,
+ CARD64 divisor, CARD64 remainder);
+
+typedef void (*DRI2InvalidateProcPtr) (DrawablePtr pDraw, void *data, XID id);
+
+/**
+ * DRI2 calls this hook when ever swap_limit is going to be changed. Default
+ * implementation for the hook only accepts one as swap_limit. If driver can
+ * support other swap_limits it has to implement supported limits with this
+ * callback.
+ *
+ * \param pDraw drawable whose swap_limit is going to be changed
+ * \param swap_limit new swap_limit that going to be set
+ * \return TRUE if limit is support, FALSE if not.
+ */
+typedef Bool (*DRI2SwapLimitValidateProcPtr) (DrawablePtr pDraw,
+ int swap_limit);
+
+typedef DRI2BufferPtr(*DRI2CreateBuffer2ProcPtr) (ScreenPtr pScreen,
+ DrawablePtr pDraw,
+ unsigned int attachment,
+ unsigned int format);
+typedef void (*DRI2DestroyBuffer2ProcPtr) (ScreenPtr pScreen, DrawablePtr pDraw,
+ DRI2BufferPtr buffer);
+
+typedef void (*DRI2CopyRegion2ProcPtr) (ScreenPtr pScreen, DrawablePtr pDraw,
+ RegionPtr pRegion,
+ DRI2BufferPtr pDestBuffer,
+ DRI2BufferPtr pSrcBuffer);
+
+/**
+ * \brief Get the value of a parameter.
+ *
+ * The parameter's \a value is looked up on the screen associated with
+ * \a pDrawable.
+ *
+ * \return \c Success or error code.
+ */
+typedef int (*DRI2GetParamProcPtr) (ClientPtr client,
+ DrawablePtr pDrawable,
+ CARD64 param,
+ BOOL *is_param_recognized,
+ CARD64 *value);
+
+/**
+ * Version of the DRI2InfoRec structure defined in this header
+ */
+#define DRI2INFOREC_VERSION 9
+
+typedef struct {
+ unsigned int version; /**< Version of this struct */
+ int fd;
+ const char *driverName;
+ const char *deviceName;
+
+ DRI2CreateBufferProcPtr CreateBuffer;
+ DRI2DestroyBufferProcPtr DestroyBuffer;
+ DRI2CopyRegionProcPtr CopyRegion;
+ DRI2WaitProcPtr Wait;
+
+ /* added in version 4 */
+
+ DRI2ScheduleSwapProcPtr ScheduleSwap;
+ DRI2GetMSCProcPtr GetMSC;
+ DRI2ScheduleWaitMSCProcPtr ScheduleWaitMSC;
+
+ /* number of drivers in the driverNames array */
+ unsigned int numDrivers;
+ /* array of driver names, indexed by DRI2Driver* driver types */
+ /* a name of NULL means that driver is not supported */
+ const char *const *driverNames;
+
+ /* added in version 5 */
+
+ DRI2AuthMagicProcPtr AuthMagic;
+
+ /* added in version 6 */
+
+ DRI2ReuseBufferNotifyProcPtr ReuseBufferNotify;
+ DRI2SwapLimitValidateProcPtr SwapLimitValidate;
+
+ /* added in version 7 */
+ DRI2GetParamProcPtr GetParam;
+
+ /* added in version 8 */
+ /* AuthMagic callback which passes extra context */
+ /* If this is NULL the AuthMagic callback is used */
+ /* If this is non-NULL the AuthMagic callback is ignored */
+ DRI2AuthMagic2ProcPtr AuthMagic2;
+
+ /* added in version 9 */
+ DRI2CreateBuffer2ProcPtr CreateBuffer2;
+ DRI2DestroyBuffer2ProcPtr DestroyBuffer2;
+ DRI2CopyRegion2ProcPtr CopyRegion2;
+} DRI2InfoRec, *DRI2InfoPtr;
+
+extern _X_EXPORT Bool DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info);
+
+extern _X_EXPORT void DRI2CloseScreen(ScreenPtr pScreen);
+
+extern _X_EXPORT Bool DRI2HasSwapControl(ScreenPtr pScreen);
+
+extern _X_EXPORT Bool DRI2Connect(ClientPtr client, ScreenPtr pScreen,
+ unsigned int driverType,
+ int *fd,
+ const char **driverName,
+ const char **deviceName);
+
+extern _X_EXPORT Bool DRI2Authenticate(ClientPtr client, ScreenPtr pScreen, uint32_t magic);
+
+extern _X_EXPORT int DRI2CreateDrawable(ClientPtr client,
+ DrawablePtr pDraw,
+ XID id,
+ DRI2InvalidateProcPtr invalidate,
+ void *priv);
+
+extern _X_EXPORT int DRI2CreateDrawable2(ClientPtr client,
+ DrawablePtr pDraw,
+ XID id,
+ DRI2InvalidateProcPtr invalidate,
+ void *priv,
+ XID *dri2_id_out);
+
+extern _X_EXPORT DRI2BufferPtr *DRI2GetBuffers(DrawablePtr pDraw,
+ int *width,
+ int *height,
+ unsigned int *attachments,
+ int count, int *out_count);
+
+extern _X_EXPORT int DRI2CopyRegion(DrawablePtr pDraw,
+ RegionPtr pRegion,
+ unsigned int dest, unsigned int src);
+
+/**
+ * Determine the major and minor version of the DRI2 extension.
+ *
+ * Provides a mechanism to other modules (e.g., 2D drivers) to determine the
+ * version of the DRI2 extension. While it is possible to peek directly at
+ * the \c XF86ModuleData from a layered module, such a module will fail to
+ * load (due to an unresolved symbol) if the DRI2 extension is not loaded.
+ *
+ * \param major Location to store the major version of the DRI2 extension
+ * \param minor Location to store the minor version of the DRI2 extension
+ *
+ * \note
+ * This interface was added some time after the initial release of the DRI2
+ * module. Layered modules that wish to use this interface must first test
+ * its existence by calling \c xf86LoaderCheckSymbol.
+ */
+extern _X_EXPORT void DRI2Version(int *major, int *minor);
+
+extern _X_EXPORT DRI2BufferPtr *DRI2GetBuffersWithFormat(DrawablePtr pDraw,
+ int *width,
+ int *height,
+ unsigned int
+ *attachments,
+ int count,
+ int *out_count);
+
+extern _X_EXPORT void DRI2SwapInterval(DrawablePtr pDrawable, int interval);
+extern _X_EXPORT Bool DRI2SwapLimit(DrawablePtr pDraw, int swap_limit);
+extern _X_EXPORT int DRI2SwapBuffers(ClientPtr client, DrawablePtr pDrawable,
+ CARD64 target_msc, CARD64 divisor,
+ CARD64 remainder, CARD64 * swap_target,
+ DRI2SwapEventPtr func, void *data);
+extern _X_EXPORT Bool DRI2WaitSwap(ClientPtr client, DrawablePtr pDrawable);
+
+extern _X_EXPORT int DRI2GetMSC(DrawablePtr pDrawable, CARD64 * ust,
+ CARD64 * msc, CARD64 * sbc);
+extern _X_EXPORT int DRI2WaitMSC(ClientPtr client, DrawablePtr pDrawable,
+ CARD64 target_msc, CARD64 divisor,
+ CARD64 remainder);
+extern _X_EXPORT int ProcDRI2WaitMSCReply(ClientPtr client, CARD64 ust,
+ CARD64 msc, CARD64 sbc);
+extern _X_EXPORT int DRI2WaitSBC(ClientPtr client, DrawablePtr pDraw,
+ CARD64 target_sbc);
+extern _X_EXPORT Bool DRI2ThrottleClient(ClientPtr client, DrawablePtr pDraw);
+
+extern _X_EXPORT Bool DRI2CanFlip(DrawablePtr pDraw);
+
+extern _X_EXPORT Bool DRI2CanExchange(DrawablePtr pDraw);
+
+/* Note: use *only* for MSC related waits */
+extern _X_EXPORT void DRI2BlockClient(ClientPtr client, DrawablePtr pDraw);
+
+extern _X_EXPORT void DRI2SwapComplete(ClientPtr client, DrawablePtr pDraw,
+ int frame, unsigned int tv_sec,
+ unsigned int tv_usec, int type,
+ DRI2SwapEventPtr swap_complete,
+ void *swap_data);
+extern _X_EXPORT void DRI2WaitMSCComplete(ClientPtr client, DrawablePtr pDraw,
+ int frame, unsigned int tv_sec,
+ unsigned int tv_usec);
+
+extern _X_EXPORT int DRI2GetParam(ClientPtr client,
+ DrawablePtr pDrawable,
+ CARD64 param,
+ BOOL *is_param_recognized,
+ CARD64 *value);
+
+extern _X_EXPORT DrawablePtr DRI2UpdatePrime(DrawablePtr pDraw, DRI2BufferPtr pDest);
+#endif
diff --git a/prebuilt/xlibre/usr/include/xorg/dri3.h b/prebuilt/xlibre/usr/include/xorg/dri3.h
new file mode 100644
index 0000000..63e47b9
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/dri3.h
@@ -0,0 +1,131 @@
+/*
+ * Copyright © 2013 Keith Packard
+ *
+ * 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 _DRI3_H_
+#define _DRI3_H_
+
+#include
+#include
+
+#define DRI3_SCREEN_INFO_VERSION 4
+
+struct dri3_syncobj
+{
+ XID id;
+ ScreenPtr screen;
+ uint32_t refcount;
+
+ void (*free)(struct dri3_syncobj *syncobj);
+ Bool (*has_fence)(struct dri3_syncobj *syncobj, uint64_t point);
+ Bool (*is_signaled)(struct dri3_syncobj *syncobj, uint64_t point);
+ int (*export_fence)(struct dri3_syncobj *syncobj, uint64_t point);
+ void (*import_fence)(struct dri3_syncobj *syncobj, uint64_t point, int fd);
+ void (*signal)(struct dri3_syncobj *syncobj, uint64_t point);
+ void (*submitted_eventfd)(struct dri3_syncobj *syncobj, uint64_t point, int efd);
+ void (*signaled_eventfd)(struct dri3_syncobj *syncobj, uint64_t point, int efd);
+};
+
+typedef int (*dri3_open_proc)(ScreenPtr screen,
+ RRProviderPtr provider,
+ int *fd);
+
+typedef int (*dri3_open_client_proc)(ClientPtr client,
+ ScreenPtr screen,
+ RRProviderPtr provider,
+ int *fd);
+
+typedef PixmapPtr (*dri3_pixmap_from_fd_proc) (ScreenPtr screen,
+ int fd,
+ CARD16 width,
+ CARD16 height,
+ CARD16 stride,
+ CARD8 depth,
+ CARD8 bpp);
+
+typedef PixmapPtr (*dri3_pixmap_from_fds_proc) (ScreenPtr screen,
+ CARD8 num_fds,
+ const int *fds,
+ CARD16 width,
+ CARD16 height,
+ const CARD32 *strides,
+ const CARD32 *offsets,
+ CARD8 depth,
+ CARD8 bpp,
+ CARD64 modifier);
+
+typedef int (*dri3_fd_from_pixmap_proc) (ScreenPtr screen,
+ PixmapPtr pixmap,
+ CARD16 *stride,
+ CARD32 *size);
+
+typedef int (*dri3_fds_from_pixmap_proc) (ScreenPtr screen,
+ PixmapPtr pixmap,
+ int *fds,
+ uint32_t *strides,
+ uint32_t *offsets,
+ uint64_t *modifier);
+
+typedef int (*dri3_get_formats_proc) (ScreenPtr screen,
+ CARD32 *num_formats,
+ CARD32 **formats);
+
+typedef int (*dri3_get_modifiers_proc) (ScreenPtr screen,
+ uint32_t format,
+ uint32_t *num_modifiers,
+ uint64_t **modifiers);
+
+typedef int (*dri3_get_drawable_modifiers_proc) (DrawablePtr draw,
+ uint32_t format,
+ uint32_t *num_modifiers,
+ uint64_t **modifiers);
+
+typedef struct dri3_syncobj *(*dri3_import_syncobj_proc) (ClientPtr client,
+ ScreenPtr screen,
+ XID id,
+ int fd);
+
+typedef struct dri3_screen_info {
+ uint32_t version;
+
+ dri3_open_proc open;
+ dri3_pixmap_from_fd_proc pixmap_from_fd;
+ dri3_fd_from_pixmap_proc fd_from_pixmap;
+
+ /* Version 1 */
+ dri3_open_client_proc open_client;
+
+ /* Version 2 */
+ dri3_pixmap_from_fds_proc pixmap_from_fds;
+ dri3_fds_from_pixmap_proc fds_from_pixmap;
+ dri3_get_formats_proc get_formats;
+ dri3_get_modifiers_proc get_modifiers;
+ dri3_get_drawable_modifiers_proc get_drawable_modifiers;
+
+ /* Version 4 */
+ dri3_import_syncobj_proc import_syncobj;
+
+} dri3_screen_info_rec, *dri3_screen_info_ptr;
+
+extern _X_EXPORT Bool
+dri3_screen_init(ScreenPtr screen, const dri3_screen_info_rec *info);
+
+#endif /* _DRI3_H_ */
diff --git a/prebuilt/xlibre/usr/include/xorg/dristruct.h b/prebuilt/xlibre/usr/include/xorg/dristruct.h
new file mode 100644
index 0000000..9626006
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/dristruct.h
@@ -0,0 +1,122 @@
+/**************************************************************************
+
+Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
+All Rights Reserved.
+
+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, sub license, 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 (including the
+next paragraph) 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 NON-INFRINGEMENT.
+IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS 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.
+
+**************************************************************************/
+
+/*
+ * Authors:
+ * Jens Owen
+ *
+ */
+
+#ifndef DRI_STRUCT_H
+#define DRI_STRUCT_H
+
+#include "dri.h"
+#include "sarea.h"
+#include "xf86drm.h"
+#include "xf86Crtc.h"
+
+#define DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin) ((DRIDrawablePrivPtr) \
+ dixLookupPrivate(&(pWin)->devPrivates, DRIWindowPrivKey))
+#define DRI_DRAWABLE_PRIV_FROM_PIXMAP(pPix) ((DRIDrawablePrivPtr) \
+ dixLookupPrivate(&(pPix)->devPrivates, DRIWindowPrivKey))
+
+typedef struct _DRIDrawablePrivRec {
+ drm_drawable_t hwDrawable;
+ int drawableIndex;
+ ScreenPtr pScreen;
+ int refCount;
+ int nrects;
+} DRIDrawablePrivRec, *DRIDrawablePrivPtr;
+
+struct _DRIContextPrivRec {
+ drm_context_t hwContext;
+ ScreenPtr pScreen;
+ Bool valid3D;
+ DRIContextFlags flags;
+ void **pContextStore;
+};
+
+#define DRI_SCREEN_PRIV_FROM_INDEX(screenIndex) ((DRIScreenPrivPtr) \
+ dixLookupPrivate(&screenInfo.screens[(screenIndex)]->devPrivates, \
+ DRIScreenPrivKey))
+
+#define DRI_ENT_PRIV(pScrn) \
+ ((DRIEntPrivIndex < 0) ? \
+ NULL: \
+ ((DRIEntPrivPtr)(xf86GetEntityPrivate((pScrn)->entityList[0], \
+ DRIEntPrivIndex)->ptr)))
+
+typedef struct _DRIScreenPrivRec {
+ Bool directRenderingSupport;
+ int drmFD; /* File descriptor for /dev/video/? */
+ drm_handle_t hSAREA; /* Handle to SAREA, for mapping */
+ XF86DRISAREAPtr pSAREA; /* Mapped pointer to SAREA */
+ drm_context_t myContext; /* DDX Driver's context */
+ DRIContextPrivPtr myContextPriv; /* Pointer to server's private area */
+ DRIContextPrivPtr lastPartial3DContext; /* last one partially saved */
+ void **hiddenContextStore; /* hidden X context */
+ void **partial3DContextStore; /* partial 3D context */
+ DRIInfoPtr pDriverInfo;
+ int nrWindows;
+ int nrWindowsVisible;
+ int nrWalked;
+ drm_clip_rect_t private_buffer_rect; /* management of private buffers */
+ DrawablePtr fullscreen; /* pointer to fullscreen drawable */
+ drm_clip_rect_t fullscreen_rect; /* fake rect for fullscreen mode */
+ DRIWrappedFuncsRec wrap;
+ void *_dummy1; // required in place of a removed field for ABI compatibility
+ DrawablePtr DRIDrawables[SAREA_MAX_DRAWABLES];
+ DRIContextPrivPtr dummyCtxPriv; /* Pointer to dummy context */
+ Bool createDummyCtx;
+ Bool createDummyCtxPriv;
+ Bool grabbedDRILock;
+ Bool drmSIGIOHandlerInstalled;
+ Bool wrapped;
+ Bool windowsTouched;
+ int lockRefCount;
+ drm_handle_t hLSAREA; /* Handle to SAREA containing lock, for mapping */
+ XF86DRILSAREAPtr pLSAREA; /* Mapped pointer to SAREA containing lock */
+ int *pLockRefCount;
+ int *pLockingContext;
+ xf86_crtc_notify_proc_ptr xf86_crtc_notify;
+} DRIScreenPrivRec, *DRIScreenPrivPtr;
+
+typedef struct _DRIEntPrivRec {
+ int drmFD;
+ Bool drmOpened;
+ Bool sAreaGrabbed;
+ drm_handle_t hLSAREA;
+ XF86DRILSAREAPtr pLSAREA;
+ unsigned long sAreaSize;
+ int lockRefCount;
+ int lockingContext;
+ ScreenPtr resOwner;
+ Bool keepFDOpen;
+ int refCount;
+} DRIEntPrivRec, *DRIEntPrivPtr;
+
+#endif /* DRI_STRUCT_H */
diff --git a/prebuilt/xlibre/usr/include/xorg/edid.h b/prebuilt/xlibre/usr/include/xorg/edid.h
new file mode 100644
index 0000000..9cbd161
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/edid.h
@@ -0,0 +1,269 @@
+/*
+ * edid.h: defines to parse an EDID block
+ *
+ * This file contains all information to interpret a standard EDIC block
+ * transmitted by a display device via DDC (Display Data Channel). So far
+ * there is no information to deal with optional EDID blocks.
+ * DDC is a Trademark of VESA (Video Electronics Standard Association).
+ *
+ * Copyright 1998 by Egbert Eich
+ */
+
+#ifndef _EDID_H_
+#define _EDID_H_
+
+#include
+#include
+#include
+#include
+
+#define STD_TIMINGS 8
+#define DET_TIMINGS 4
+
+/* input type */
+#define DIGITAL(x) (x)
+
+/* Msc stuff EDID Ver > 1.1 */
+#define PREFERRED_TIMING_MODE(x) ((x) & 0x2)
+#define GTF_SUPPORTED(x) ((x) & 0x1)
+
+struct vendor {
+ char name[4];
+ int prod_id;
+ unsigned int serial;
+ int week;
+ int year;
+};
+
+struct edid_version {
+ int version;
+ int revision;
+};
+
+struct disp_features {
+ unsigned int input_type:1;
+ unsigned int input_voltage:2;
+ unsigned int input_setup:1;
+ unsigned int input_sync:5;
+ unsigned int input_dfp:1;
+ unsigned int input_bpc:3;
+ unsigned int input_interface:4;
+ /* 15 bit hole */
+ int hsize;
+ int vsize;
+ float gamma;
+ unsigned int dpms:3;
+ unsigned int display_type:2;
+ unsigned int msc:3;
+ float redx;
+ float redy;
+ float greenx;
+ float greeny;
+ float bluex;
+ float bluey;
+ float whitex;
+ float whitey;
+};
+
+struct established_timings {
+ uint8_t t1;
+ uint8_t t2;
+ uint8_t t_manu;
+};
+
+struct std_timings {
+ int hsize;
+ int vsize;
+ int refresh;
+ CARD16 id;
+};
+
+struct detailed_timings {
+ int clock;
+ int h_active;
+ int h_blanking;
+ int v_active;
+ int v_blanking;
+ int h_sync_off;
+ int h_sync_width;
+ int v_sync_off;
+ int v_sync_width;
+ int h_size;
+ int v_size;
+ int h_border;
+ int v_border;
+ unsigned int interlaced:1;
+ unsigned int stereo:2;
+ unsigned int sync:2;
+ unsigned int misc:2;
+ unsigned int stereo_1:1;
+};
+
+#define DT 0
+#define DS_SERIAL 0xFF
+#define DS_ASCII_STR 0xFE
+#define DS_NAME 0xFC
+#define DS_RANGES 0xFD
+#define DS_WHITE_P 0xFB
+#define DS_STD_TIMINGS 0xFA
+#define DS_CMD 0xF9
+#define DS_CVT 0xF8
+#define DS_EST_III 0xF7
+#define DS_DUMMY 0x10
+#define DS_UNKOWN 0x100 /* type is an int */
+#define DS_VENDOR 0x101
+#define DS_VENDOR_MAX 0x110
+
+/*
+ * Display range limit Descriptor of EDID version1, reversion 4
+ */
+typedef enum {
+ DR_DEFAULT_GTF,
+ DR_LIMITS_ONLY,
+ DR_SECONDARY_GTF,
+ DR_CVT_SUPPORTED = 4,
+} DR_timing_flags;
+
+struct monitor_ranges {
+ int min_v;
+ int max_v;
+ int min_h;
+ int max_h;
+ int max_clock; /* in mhz */
+ int gtf_2nd_f;
+ int gtf_2nd_c;
+ int gtf_2nd_m;
+ int gtf_2nd_k;
+ int gtf_2nd_j;
+ int max_clock_khz;
+ int maxwidth; /* in pixels */
+ char supported_aspect;
+ char preferred_aspect;
+ char supported_blanking;
+ char supported_scaling;
+ int preferred_refresh; /* in hz */
+ DR_timing_flags display_range_timing_flags;
+};
+
+struct whitePoints {
+ int index;
+ float white_x;
+ float white_y;
+ float white_gamma;
+};
+
+struct cvt_timings {
+ int width;
+ int height;
+ int rate;
+ int rates;
+};
+
+/*
+ * Be careful when adding new sections; this structure can't grow, it's
+ * embedded in the middle of xf86Monitor which is ABI. Sizes below are
+ * in bytes, for ILP32 systems. If all else fails just copy the section
+ * literally like serial and friends.
+ */
+struct detailed_monitor_section {
+ int type;
+ union {
+ struct detailed_timings d_timings; /* 56 */
+ uint8_t serial[13];
+ uint8_t ascii_data[13];
+ uint8_t name[13];
+ struct monitor_ranges ranges; /* 60 */
+ struct std_timings std_t[5]; /* 80 */
+ struct whitePoints wp[2]; /* 32 */
+ /* color management data */
+ struct cvt_timings cvt[4]; /* 64 */
+ uint8_t est_iii[6]; /* 6 */
+ } section; /* max: 80 */
+};
+
+/* flags */
+#define MONITOR_EDID_COMPLETE_RAWDATA 0x01
+/* old, don't use */
+#define EDID_COMPLETE_RAWDATA 0x01
+
+/**
+ * @brief The monitor_hdr_data hdr metadata struct
+ * This struct mirrors Table 92 - HDR Static Metadata Data Block (HDR SMDB) structure
+ */
+struct monitor_hdr_data {
+ bool hdr_valid : 1; /* static metadata v1 found, doesn't mean all fields are set */
+ bool colorimetry_valid : 1; /* if colorimetry tag found */
+
+ bool tf_traditional_sdr : 1,
+ tf_traditional_hdr : 1,
+ tf_pq : 1,
+ tf_hlg : 1,
+ tf_4 : 1,
+ tf_5 : 1;
+
+ unsigned int resv : 2; /* reserved bits */
+
+ float desired_content_min_luminance; /* in cd/m2, can be 0 */
+ float desired_content_max_luminance; /* in cd/m2, can be 0 */
+ float desired_content_max_frame_avg_luminance; /* in cd/m2, if unset 0 */
+
+ bool sm_static_metadata_type1 : 1;
+
+ unsigned int sm_1_7 : 7; /* reserved bits */
+
+ int reserved_1[4]; /* for future */
+
+ unsigned int colorimetry_profiles : 16;
+
+ int reserved_2[4]; /* for future */
+};
+
+#define CTA_HDR_SMDB_TF_SDR 1
+#define CTA_HDR_SMDB_TF_HDR 2
+#define CTA_HDR_SMDB_TF_ST2084 4
+#define CTA_HDR_SMDB_TF_HLG 8
+
+#define CTA_HDR_SMDB_SM_TYPE1 1
+
+/* these constants are from Colorimetry Data Block (CDB) byte 3 and 4, converted into natural representation (big endian) uint16 */
+
+#define is_CTA_CDB_BT2020_RGB(x) (((x) & 0x8000) == 0x8000)
+#define is_CTA_CDB_BT2020_YCC(x) (((x) & 0x4000) == 0x4000)
+#define is_CTA_CDB_BT2020_cYCC(x) (((x) & 0x2000) == 0x2000)
+#define is_CTA_CDB_opRGB(x) (((x) & 0x1000) == 0x1000)
+#define is_CTA_CDB_opYCC601(x) (((x) & 0x0800) == 0x0800)
+#define is_CTA_CDB_sYCC601(x) (((x) & 0x0400) == 0x0400)
+#define is_CTA_CDB_xvYCC709(x) (((x) & 0x0200) == 0x0200)
+#define is_CTA_CDB_xvYCC601(x) (((x) & 0x0100) == 0x0100)
+#define is_CTA_CDB_ST2113RGB(x) (((x) & 0x0080) == 0x0080)
+#define is_CTA_CDB_iCtCp(x) (((x) & 0x0040) == 0x0040)
+
+/*
+ * For DisplayID devices, only the scrnIndex, flags, and rawData fields
+ * are meaningful. For EDID, they all are.
+ */
+typedef struct {
+ int scrnIndex;
+ struct vendor vendor;
+ struct edid_version ver;
+ struct disp_features features;
+ struct established_timings timings1;
+ struct std_timings timings2[8];
+ struct detailed_monitor_section det_mon[4];
+ unsigned long flags;
+ int no_sections;
+ uint8_t *rawData;
+ struct monitor_hdr_data hdr;
+} xf86Monitor, *xf86MonPtr;
+
+extern _X_EXPORT xf86MonPtr ConfiguredMonitor;
+
+/*
+ * check whether monitor supports Generalized Timing Formula
+ *
+ * @param monitor the monitor information structure to check
+ * @return true if GTF is supported by the monitor
+ */
+_X_EXPORT bool xf86Monitor_gtf_supported(xf86MonPtr monitor);
+
+#endif /* _EDID_H_ */
diff --git a/prebuilt/xlibre/usr/include/xorg/events.h b/prebuilt/xlibre/usr/include/xorg/events.h
new file mode 100644
index 0000000..544dfad
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/events.h
@@ -0,0 +1,43 @@
+/*
+ * Copyright © 2009 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 (including the next
+ * paragraph) 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 AUTHORS OR COPYRIGHT HOLDERS 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 EVENTS_H
+#define EVENTS_H
+typedef struct _DeviceEvent DeviceEvent;
+typedef struct _DeviceChangedEvent DeviceChangedEvent;
+typedef struct _TouchOwnershipEvent TouchOwnershipEvent;
+typedef struct _BarrierEvent BarrierEvent;
+typedef struct _GestureEvent GestureEvent;
+
+#ifdef XFreeXDGA
+typedef struct _DGAEvent DGAEvent;
+#endif
+typedef struct _RawDeviceEvent RawDeviceEvent;
+
+#ifdef XQUARTZ
+typedef struct _XQuartzEvent XQuartzEvent;
+#endif
+typedef union _InternalEvent InternalEvent;
+
+#endif
diff --git a/prebuilt/xlibre/usr/include/xorg/exa.h b/prebuilt/xlibre/usr/include/xorg/exa.h
new file mode 100644
index 0000000..1251dc7
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/exa.h
@@ -0,0 +1,811 @@
+/*
+ *
+ * Copyright (C) 2000 Keith Packard
+ * 2004 Eric Anholt
+ * 2005 Zack Rusin
+ *
+ * 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 copyright holders not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. 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.
+ */
+
+/** @file
+ * This is the header containing the public API of EXA for exa drivers.
+ */
+
+#ifndef EXA_H
+#define EXA_H
+
+#include "scrnintstr.h"
+#include "pixmapstr.h"
+#include "windowstr.h"
+#include "gcstruct.h"
+#include "picturestr.h"
+#include "fb.h"
+
+#define EXA_VERSION_MAJOR 2
+#define EXA_VERSION_MINOR 6
+#define EXA_VERSION_RELEASE 0
+
+typedef struct _ExaOffscreenArea ExaOffscreenArea;
+
+typedef void (*ExaOffscreenSaveProc) (ScreenPtr pScreen,
+ ExaOffscreenArea * area);
+
+typedef enum _ExaOffscreenState {
+ ExaOffscreenAvail,
+ ExaOffscreenRemovable,
+ ExaOffscreenLocked
+} ExaOffscreenState;
+
+struct _ExaOffscreenArea {
+ int base_offset; /* allocation base */
+ int offset; /* aligned offset */
+ int size; /* total allocation size */
+ unsigned last_use;
+ void *privData;
+
+ ExaOffscreenSaveProc save;
+
+ ExaOffscreenState state;
+
+ ExaOffscreenArea *next;
+
+ unsigned eviction_cost;
+
+ ExaOffscreenArea *prev; /* Double-linked list for defragmentation */
+ int align; /* required alignment */
+};
+
+/**
+ * The ExaDriver structure is allocated through exaDriverAlloc(), and then
+ * fllled in by drivers.
+ */
+typedef struct _ExaDriver {
+ /**
+ * exa_major and exa_minor should be set by the driver to the version of
+ * EXA which the driver was compiled for (or configures itself at runtime
+ * to support). This allows EXA to extend the structure for new features
+ * without breaking ABI for drivers compiled against older versions.
+ */
+ int exa_major, exa_minor;
+
+ /**
+ * memoryBase is the address of the beginning of framebuffer memory.
+ * The visible screen should be within memoryBase to memoryBase +
+ * memorySize.
+ */
+ CARD8 *memoryBase;
+
+ /**
+ * offScreenBase is the offset from memoryBase of the beginning of the area
+ * to be managed by EXA's linear offscreen memory manager.
+ *
+ * In XFree86 DDX drivers, this is probably:
+ * (pScrn->displayWidth * cpp * pScrn->virtualY)
+ */
+ unsigned long offScreenBase;
+
+ /**
+ * memorySize is the length (in bytes) of framebuffer memory beginning
+ * from memoryBase.
+ *
+ * The offscreen memory manager will manage the area beginning at
+ * (memoryBase + offScreenBase), with a length of (memorySize -
+ * offScreenBase)
+ *
+ * In XFree86 DDX drivers, this is probably (pScrn->videoRam * 1024)
+ */
+ unsigned long memorySize;
+
+ /**
+ * pixmapOffsetAlign is the byte alignment necessary for pixmap offsets
+ * within framebuffer.
+ *
+ * Hardware typically has a required alignment of offsets, which may or may
+ * not be a power of two. EXA will ensure that pixmaps managed by the
+ * offscreen memory manager meet this alignment requirement.
+ */
+ int pixmapOffsetAlign;
+
+ /**
+ * pixmapPitchAlign is the byte alignment necessary for pixmap pitches
+ * within the framebuffer.
+ *
+ * Hardware typically has a required alignment of pitches for acceleration.
+ * For 3D hardware, Composite acceleration often requires that source and
+ * mask pixmaps (textures) have a power-of-two pitch, which can be demanded
+ * using EXA_OFFSCREEN_ALIGN_POT. These pitch requirements only apply to
+ * pixmaps managed by the offscreen memory manager. Thus, it is up to the
+ * driver to ensure that the visible screen has an appropriate pitch for
+ * acceleration.
+ */
+ int pixmapPitchAlign;
+
+ /**
+ * The flags field is bitfield of boolean values controlling EXA's behavior.
+ *
+ * The flags include EXA_OFFSCREEN_PIXMAPS, EXA_OFFSCREEN_ALIGN_POT, and
+ * EXA_TWO_BITBLT_DIRECTIONS.
+ */
+ int flags;
+
+ /** @{ */
+ /**
+ * maxX controls the X coordinate limitation for rendering from the card.
+ * The driver should never receive a request for rendering beyond maxX
+ * in the X direction from the origin of a pixmap.
+ */
+ int maxX;
+
+ /**
+ * maxY controls the Y coordinate limitation for rendering from the card.
+ * The driver should never receive a request for rendering beyond maxY
+ * in the Y direction from the origin of a pixmap.
+ */
+ int maxY;
+ /** @} */
+
+ /* private */
+ ExaOffscreenArea *offScreenAreas;
+ Bool needsSync;
+ int lastMarker;
+
+ /** @name Solid
+ * @{
+ */
+ /**
+ * PrepareSolid() sets up the driver for doing a solid fill.
+ * @param pPixmap Destination pixmap
+ * @param alu raster operation
+ * @param planemask write mask for the fill
+ * @param fg "foreground" color for the fill
+ *
+ * This call should set up the driver for doing a series of solid fills
+ * through the Solid() call. The alu raster op is one of the GX*
+ * graphics functions listed in X.h, and typically maps to a similar
+ * single-byte "ROP" setting in all hardware. The planemask controls
+ * which bits of the destination should be affected, and will only represent
+ * the bits up to the depth of pPixmap. The fg is the pixel value of the
+ * foreground color referred to in ROP descriptions.
+ *
+ * Note that many drivers will need to store some of the data in the driver
+ * private record, for sending to the hardware with each drawing command.
+ *
+ * The PrepareSolid() call is required of all drivers, but it may fail for any
+ * reason. Failure results in a fallback to software rendering.
+ */
+ Bool (*PrepareSolid) (PixmapPtr pPixmap,
+ int alu, Pixel planemask, Pixel fg);
+
+ /**
+ * Solid() performs a solid fill set up in the last PrepareSolid() call.
+ *
+ * @param pPixmap destination pixmap
+ * @param x1 left coordinate
+ * @param y1 top coordinate
+ * @param x2 right coordinate
+ * @param y2 bottom coordinate
+ *
+ * Performs the fill set up by the last PrepareSolid() call, covering the
+ * area from (x1,y1) to (x2,y2) in pPixmap. Note that the coordinates are
+ * in the coordinate space of the destination pixmap, so the driver will
+ * need to set up the hardware's offset and pitch for the destination
+ * coordinates according to the pixmap's offset and pitch within
+ * framebuffer. This likely means using exaGetPixmapOffset() and
+ * exaGetPixmapPitch().
+ *
+ * This call is required if PrepareSolid() ever succeeds.
+ */
+ void (*Solid) (PixmapPtr pPixmap, int x1, int y1, int x2, int y2);
+
+ /**
+ * DoneSolid() finishes a set of solid fills.
+ *
+ * @param pPixmap destination pixmap.
+ *
+ * The DoneSolid() call is called at the end of a series of consecutive
+ * Solid() calls following a successful PrepareSolid(). This allows drivers
+ * to finish up emitting drawing commands that were buffered, or clean up
+ * state from PrepareSolid().
+ *
+ * This call is required if PrepareSolid() ever succeeds.
+ */
+ void (*DoneSolid) (PixmapPtr pPixmap);
+ /** @} */
+
+ /** @name Copy
+ * @{
+ */
+ /**
+ * PrepareCopy() sets up the driver for doing a copy within video
+ * memory.
+ *
+ * @param pSrcPixmap source pixmap
+ * @param pDstPixmap destination pixmap
+ * @param dx X copy direction
+ * @param dy Y copy direction
+ * @param alu raster operation
+ * @param planemask write mask for the fill
+ *
+ * This call should set up the driver for doing a series of copies from the
+ * the pSrcPixmap to the pDstPixmap. The dx flag will be positive if the
+ * hardware should do the copy from the left to the right, and dy will be
+ * positive if the copy should be done from the top to the bottom. This
+ * is to deal with self-overlapping copies when pSrcPixmap == pDstPixmap.
+ * If your hardware can only support blits that are (left to right, top to
+ * bottom) or (right to left, bottom to top), then you should set
+ * #EXA_TWO_BITBLT_DIRECTIONS, and EXA will break down Copy operations to
+ * ones that meet those requirements. The alu raster op is one of the GX*
+ * graphics functions listed in X.h, and typically maps to a similar
+ * single-byte "ROP" setting in all hardware. The planemask controls which
+ * bits of the destination should be affected, and will only represent the
+ * bits up to the depth of pPixmap.
+ *
+ * Note that many drivers will need to store some of the data in the driver
+ * private record, for sending to the hardware with each drawing command.
+ *
+ * The PrepareCopy() call is required of all drivers, but it may fail for any
+ * reason. Failure results in a fallback to software rendering.
+ */
+ Bool (*PrepareCopy) (PixmapPtr pSrcPixmap,
+ PixmapPtr pDstPixmap,
+ int dx, int dy, int alu, Pixel planemask);
+
+ /**
+ * Copy() performs a copy set up in the last PrepareCopy call.
+ *
+ * @param pDstPixmap destination pixmap
+ * @param srcX source X coordinate
+ * @param srcY source Y coordinate
+ * @param dstX destination X coordinate
+ * @param dstY destination Y coordinate
+ * @param width width of the rectangle to be copied
+ * @param height height of the rectangle to be copied.
+ *
+ * Performs the copy set up by the last PrepareCopy() call, copying the
+ * rectangle from (srcX, srcY) to (srcX + width, srcY + width) in the source
+ * pixmap to the same-sized rectangle at (dstX, dstY) in the destination
+ * pixmap. Those rectangles may overlap in memory, if
+ * pSrcPixmap == pDstPixmap. Note that this call does not receive the
+ * pSrcPixmap as an argument -- if it's needed in this function, it should
+ * be stored in the driver private during PrepareCopy(). As with Solid(),
+ * the coordinates are in the coordinate space of each pixmap, so the driver
+ * will need to set up source and destination pitches and offsets from those
+ * pixmaps, probably using exaGetPixmapOffset() and exaGetPixmapPitch().
+ *
+ * This call is required if PrepareCopy ever succeeds.
+ */
+ void (*Copy) (PixmapPtr pDstPixmap,
+ int srcX,
+ int srcY, int dstX, int dstY, int width, int height);
+
+ /**
+ * DoneCopy() finishes a set of copies.
+ *
+ * @param pPixmap destination pixmap.
+ *
+ * The DoneCopy() call is called at the end of a series of consecutive
+ * Copy() calls following a successful PrepareCopy(). This allows drivers
+ * to finish up emitting drawing commands that were buffered, or clean up
+ * state from PrepareCopy().
+ *
+ * This call is required if PrepareCopy() ever succeeds.
+ */
+ void (*DoneCopy) (PixmapPtr pDstPixmap);
+ /** @} */
+
+ /** @name Composite
+ * @{
+ */
+ /**
+ * CheckComposite() checks to see if a composite operation could be
+ * accelerated.
+ *
+ * @param op Render operation
+ * @param pSrcPicture source Picture
+ * @param pMaskPicture mask picture
+ * @param pDstPicture destination Picture
+ *
+ * The CheckComposite() call checks if the driver could handle acceleration
+ * of op with the given source, mask, and destination pictures. This allows
+ * drivers to check source and destination formats, supported operations,
+ * transformations, and component alpha state, and send operations it can't
+ * support to software rendering early on. This avoids costly pixmap
+ * migration to the wrong places when the driver can't accelerate
+ * operations. Note that because migration hasn't happened, the driver
+ * can't know during CheckComposite() what the offsets and pitches of the
+ * pixmaps are going to be.
+ *
+ * See PrepareComposite() for more details on likely issues that drivers
+ * will have in accelerating Composite operations.
+ *
+ * The CheckComposite() call is recommended if PrepareComposite() is
+ * implemented, but is not required.
+ */
+ Bool (*CheckComposite) (int op,
+ PicturePtr pSrcPicture,
+ PicturePtr pMaskPicture, PicturePtr pDstPicture);
+
+ /**
+ * PrepareComposite() sets up the driver for doing a Composite operation
+ * described in the Render extension protocol spec.
+ *
+ * @param op Render operation
+ * @param pSrcPicture source Picture
+ * @param pMaskPicture mask picture
+ * @param pDstPicture destination Picture
+ * @param pSrc source pixmap
+ * @param pMask mask pixmap
+ * @param pDst destination pixmap
+ *
+ * This call should set up the driver for doing a series of Composite
+ * operations, as described in the Render protocol spec, with the given
+ * pSrcPicture, pMaskPicture, and pDstPicture. The pSrc, pMask, and
+ * pDst are the pixmaps containing the pixel data, and should be used for
+ * setting the offset and pitch used for the coordinate spaces for each of
+ * the Pictures.
+ *
+ * Notes on interpreting Picture structures:
+ * - The Picture structures will always have a valid pDrawable.
+ * - The Picture structures will never have alphaMap set.
+ * - The mask Picture (and therefore pMask) may be NULL, in which case the
+ * operation is simply src OP dst instead of src IN mask OP dst, and
+ * mask coordinates should be ignored.
+ * - pMarkPicture may have componentAlpha set, which greatly changes
+ * the behavior of the Composite operation. componentAlpha has no effect
+ * when set on pSrcPicture or pDstPicture.
+ * - The source and mask Pictures may have a transformation set
+ * (Picture->transform != NULL), which means that the source coordinates
+ * should be transformed by that transformation, resulting in scaling,
+ * rotation, etc. The PictureTransformPoint() call can transform
+ * coordinates for you. Transforms have no effect on Pictures when used
+ * as a destination.
+ * - The source and mask pictures may have a filter set. PictFilterNearest
+ * and PictFilterBilinear are defined in the Render protocol, but others
+ * may be encountered, and must be handled correctly (usually by
+ * PrepareComposite failing, and falling back to software). Filters have
+ * no effect on Pictures when used as a destination.
+ * - The source and mask Pictures may have repeating set, which must be
+ * respected. Many chipsets will be unable to support repeating on
+ * pixmaps that have a width or height that is not a power of two.
+ *
+ * If your hardware can't support source pictures (textures) with
+ * non-power-of-two pitches, you should set #EXA_OFFSCREEN_ALIGN_POT.
+ *
+ * Note that many drivers will need to store some of the data in the driver
+ * private record, for sending to the hardware with each drawing command.
+ *
+ * The PrepareComposite() call is not required. However, it is highly
+ * recommended for performance of antialiased font rendering and performance
+ * of cairo applications. Failure results in a fallback to software
+ * rendering.
+ */
+ Bool (*PrepareComposite) (int op,
+ PicturePtr pSrcPicture,
+ PicturePtr pMaskPicture,
+ PicturePtr pDstPicture,
+ PixmapPtr pSrc, PixmapPtr pMask, PixmapPtr pDst);
+
+ /**
+ * Composite() performs a Composite operation set up in the last
+ * PrepareComposite() call.
+ *
+ * @param pDstPixmap destination pixmap
+ * @param srcX source X coordinate
+ * @param srcY source Y coordinate
+ * @param maskX source X coordinate
+ * @param maskY source Y coordinate
+ * @param dstX destination X coordinate
+ * @param dstY destination Y coordinate
+ * @param width destination rectangle width
+ * @param height destination rectangle height
+ *
+ * Performs the Composite operation set up by the last PrepareComposite()
+ * call, to the rectangle from (dstX, dstY) to (dstX + width, dstY + height)
+ * in the destination Pixmap. Note that if a transformation was set on
+ * the source or mask Pictures, the source rectangles may not be the same
+ * size as the destination rectangles and filtering. Getting the coordinate
+ * transformation right at the subpixel level can be tricky, and rendercheck
+ * can test this for you.
+ *
+ * This call is required if PrepareComposite() ever succeeds.
+ */
+ void (*Composite) (PixmapPtr pDst,
+ int srcX,
+ int srcY,
+ int maskX,
+ int maskY, int dstX, int dstY, int width, int height);
+
+ /**
+ * DoneComposite() finishes a set of Composite operations.
+ *
+ * @param pPixmap destination pixmap.
+ *
+ * The DoneComposite() call is called at the end of a series of consecutive
+ * Composite() calls following a successful PrepareComposite(). This allows
+ * drivers to finish up emitting drawing commands that were buffered, or
+ * clean up state from PrepareComposite().
+ *
+ * This call is required if PrepareComposite() ever succeeds.
+ */
+ void (*DoneComposite) (PixmapPtr pDst);
+ /** @} */
+
+ /**
+ * UploadToScreen() loads a rectangle of data from src into pDst.
+ *
+ * @param pDst destination pixmap
+ * @param x destination X coordinate.
+ * @param y destination Y coordinate
+ * @param width width of the rectangle to be copied
+ * @param height height of the rectangle to be copied
+ * @param src pointer to the beginning of the source data
+ * @param src_pitch pitch (in bytes) of the lines of source data.
+ *
+ * UploadToScreen() copies data in system memory beginning at src (with
+ * pitch src_pitch) into the destination pixmap from (x, y) to
+ * (x + width, y + height). This is typically done with hostdata uploads,
+ * where the CPU sets up a blit command on the hardware with instructions
+ * that the blit data will be fed through some sort of aperture on the card.
+ *
+ * If UploadToScreen() is performed asynchronously, it is up to the driver
+ * to call exaMarkSync(). This is in contrast to most other acceleration
+ * calls in EXA.
+ *
+ * UploadToScreen() can aid in pixmap migration, but is most important for
+ * the performance of exaGlyphs() (antialiased font drawing) by allowing
+ * pipelining of data uploads, avoiding a sync of the card after each glyph.
+ *
+ * @return TRUE if the driver successfully uploaded the data. FALSE
+ * indicates that EXA should fall back to doing the upload in software.
+ *
+ * UploadToScreen() is not required, but is recommended if Composite
+ * acceleration is supported.
+ */
+ Bool (*UploadToScreen) (PixmapPtr pDst,
+ int x,
+ int y, int w, int h, char *src, int src_pitch);
+
+ /**
+ * UploadToScratch() is no longer used and will be removed next time the EXA
+ * major version needs to be bumped.
+ */
+ Bool (*UploadToScratch) (PixmapPtr pSrc, PixmapPtr pDst);
+
+ /**
+ * DownloadFromScreen() loads a rectangle of data from pSrc into dst
+ *
+ * @param pSrc source pixmap
+ * @param x source X coordinate.
+ * @param y source Y coordinate
+ * @param width width of the rectangle to be copied
+ * @param height height of the rectangle to be copied
+ * @param dst pointer to the beginning of the destination data
+ * @param dst_pitch pitch (in bytes) of the lines of destination data.
+ *
+ * DownloadFromScreen() copies data from offscreen memory in pSrc from
+ * (x, y) to (x + width, y + height), to system memory starting at
+ * dst (with pitch dst_pitch). This would usually be done
+ * using scatter-gather DMA, supported by a DRM call, or by blitting to AGP
+ * and then synchronously reading from AGP. Because the implementation
+ * might be synchronous, EXA leaves it up to the driver to call
+ * exaMarkSync() if DownloadFromScreen() was asynchronous. This is in
+ * contrast to most other acceleration calls in EXA.
+ *
+ * DownloadFromScreen() can aid in the largest bottleneck in pixmap
+ * migration, which is the read from framebuffer when evicting pixmaps from
+ * framebuffer memory. Thus, it is highly recommended, even though
+ * implementations are typically complicated.
+ *
+ * @return TRUE if the driver successfully downloaded the data. FALSE
+ * indicates that EXA should fall back to doing the download in software.
+ *
+ * DownloadFromScreen() is not required, but is highly recommended.
+ */
+ Bool (*DownloadFromScreen) (PixmapPtr pSrc,
+ int x, int y,
+ int w, int h, char *dst, int dst_pitch);
+
+ /**
+ * MarkSync() requests that the driver mark a synchronization point,
+ * returning an driver-defined integer marker which could be requested for
+ * synchronization to later in WaitMarker(). This might be used in the
+ * future to avoid waiting for full hardware stalls before accessing pixmap
+ * data with the CPU, but is not important in the current incarnation of
+ * EXA.
+ *
+ * Note that drivers should call exaMarkSync() when they have done some
+ * acceleration, rather than their own MarkSync() handler, as otherwise EXA
+ * will be unaware of the driver's acceleration and not sync to it during
+ * fallbacks.
+ *
+ * MarkSync() is optional.
+ */
+ int (*MarkSync) (ScreenPtr pScreen);
+
+ /**
+ * WaitMarker() waits for all rendering before the given marker to have
+ * completed. If the driver does not implement MarkSync(), marker is
+ * meaningless, and all rendering by the hardware should be completed before
+ * WaitMarker() returns.
+ *
+ * Note that drivers should call exaWaitSync() to wait for all acceleration
+ * to finish, as otherwise EXA will be unaware of the driver having
+ * synchronized, resulting in excessive WaitMarker() calls.
+ *
+ * WaitMarker() is required of all drivers.
+ */
+ void (*WaitMarker) (ScreenPtr pScreen, int marker);
+
+ /** @{ */
+ /**
+ * PrepareAccess() is called before CPU access to an offscreen pixmap.
+ *
+ * @param pPix the pixmap being accessed
+ * @param index the index of the pixmap being accessed.
+ *
+ * PrepareAccess() will be called before CPU access to an offscreen pixmap.
+ * This can be used to set up hardware surfaces for byteswapping or
+ * untiling, or to adjust the pixmap's devPrivate.ptr for the purpose of
+ * making CPU access use a different aperture.
+ *
+ * The index is one of #EXA_PREPARE_DEST, #EXA_PREPARE_SRC,
+ * #EXA_PREPARE_MASK, #EXA_PREPARE_AUX_DEST, #EXA_PREPARE_AUX_SRC, or
+ * #EXA_PREPARE_AUX_MASK. Since only up to #EXA_NUM_PREPARE_INDICES pixmaps
+ * will have PrepareAccess() called on them per operation, drivers can have
+ * a small, statically-allocated space to maintain state for PrepareAccess()
+ * and FinishAccess() in. Note that PrepareAccess() is only called once per
+ * pixmap and operation, regardless of whether the pixmap is used as a
+ * destination and/or source, and the index may not reflect the usage.
+ *
+ * PrepareAccess() may fail. An example might be the case of hardware that
+ * can set up 1 or 2 surfaces for CPU access, but not 3. If PrepareAccess()
+ * fails, EXA will migrate the pixmap to system memory.
+ * DownloadFromScreen() must be implemented and must not fail if a driver
+ * wishes to fail in PrepareAccess(). PrepareAccess() must not fail when
+ * pPix is the visible screen, because the visible screen can not be
+ * migrated.
+ *
+ * @return TRUE if PrepareAccess() successfully prepared the pixmap for CPU
+ * drawing.
+ * @return FALSE if PrepareAccess() is unsuccessful and EXA should use
+ * DownloadFromScreen() to mitigate the pixmap out.
+ */
+ Bool (*PrepareAccess) (PixmapPtr pPix, int index);
+
+ /**
+ * FinishAccess() is called after CPU access to an offscreen pixmap.
+ *
+ * @param pPix the pixmap being accessed
+ * @param index the index of the pixmap being accessed.
+ *
+ * FinishAccess() will be called after finishing CPU access of an offscreen
+ * pixmap set up by PrepareAccess(). Note that the FinishAccess() will not be
+ * called if PrepareAccess() failed and the pixmap was migrated out.
+ */
+ void (*FinishAccess) (PixmapPtr pPix, int index);
+
+ /**
+ * PixmapIsOffscreen() is an optional driver replacement to
+ * exaPixmapHasGpuCopy(). Set to NULL if you want the standard behaviour
+ * of exaPixmapHasGpuCopy().
+ *
+ * @param pPix the pixmap
+ * @return TRUE if the given drawable is in framebuffer memory.
+ *
+ * exaPixmapHasGpuCopy() is used to determine if a pixmap is in offscreen
+ * memory, meaning that acceleration could probably be done to it, and that it
+ * will need to be wrapped by PrepareAccess()/FinishAccess() when accessing it
+ * with the CPU.
+ *
+ *
+ */
+ Bool (*PixmapIsOffscreen) (PixmapPtr pPix);
+
+ /** @name PrepareAccess() and FinishAccess() indices
+ * @{
+ */
+ /**
+ * EXA_PREPARE_DEST is the index for a pixmap that may be drawn to or
+ * read from.
+ */
+#define EXA_PREPARE_DEST 0
+ /**
+ * EXA_PREPARE_SRC is the index for a pixmap that may be read from
+ */
+#define EXA_PREPARE_SRC 1
+ /**
+ * EXA_PREPARE_SRC is the index for a second pixmap that may be read
+ * from.
+ */
+#define EXA_PREPARE_MASK 2
+ /**
+ * EXA_PREPARE_AUX* are additional indices for other purposes, e.g.
+ * separate alpha maps with Composite operations.
+ */
+#define EXA_PREPARE_AUX_DEST 3
+#define EXA_PREPARE_AUX_SRC 4
+#define EXA_PREPARE_AUX_MASK 5
+#define EXA_NUM_PREPARE_INDICES 6
+ /** @} */
+
+ /**
+ * maxPitchPixels controls the pitch limitation for rendering from
+ * the card.
+ * The driver should never receive a request for rendering a pixmap
+ * that has a pitch (in pixels) beyond maxPitchPixels.
+ *
+ * Setting this field is optional -- if your hardware doesn't have
+ * a pitch limitation in pixels, don't set this. If neither this value
+ * nor maxPitchBytes is set, then maxPitchPixels is set to maxX.
+ * If set, it must not be smaller than maxX.
+ *
+ * @sa maxPitchBytes
+ */
+ int maxPitchPixels;
+
+ /**
+ * maxPitchBytes controls the pitch limitation for rendering from
+ * the card.
+ * The driver should never receive a request for rendering a pixmap
+ * that has a pitch (in bytes) beyond maxPitchBytes.
+ *
+ * Setting this field is optional -- if your hardware doesn't have
+ * a pitch limitation in bytes, don't set this.
+ * If set, it must not be smaller than maxX * 4.
+ * There's no default value for maxPitchBytes.
+ *
+ * @sa maxPitchPixels
+ */
+ int maxPitchBytes;
+
+ /* Hooks to allow driver to its own pixmap memory management */
+ void *(*CreatePixmap) (ScreenPtr pScreen, int size, int align);
+ void (*DestroyPixmap) (ScreenPtr pScreen, void *driverPriv);
+ /**
+ * Returning a pixmap with non-NULL devPrivate.ptr implies a pixmap which is
+ * not offscreen, which will never be accelerated and Prepare/FinishAccess won't
+ * be called.
+ */
+ Bool (*ModifyPixmapHeader) (PixmapPtr pPixmap, int width, int height,
+ int depth, int bitsPerPixel, int devKind,
+ void *pPixData);
+
+ /* hooks for drivers with tiling support:
+ * driver MUST fill out new_fb_pitch with valid pitch of pixmap
+ */
+ void *(*CreatePixmap2) (ScreenPtr pScreen, int width, int height,
+ int depth, int usage_hint, int bitsPerPixel,
+ int *new_fb_pitch);
+ /** @} */
+ Bool (*SharePixmapBacking)(PixmapPtr pPixmap, ScreenPtr secondary, void **handle_p);
+
+ Bool (*SetSharedPixmapBacking)(PixmapPtr pPixmap, void *handle);
+
+} ExaDriverRec, *ExaDriverPtr;
+
+/** @name EXA driver flags
+ * @{
+ */
+/**
+ * EXA_OFFSCREEN_PIXMAPS indicates to EXA that the driver can support
+ * offscreen pixmaps.
+ */
+#define EXA_OFFSCREEN_PIXMAPS (1 << 0)
+
+/**
+ * EXA_OFFSCREEN_ALIGN_POT indicates to EXA that the driver needs pixmaps
+ * to have a power-of-two pitch.
+ */
+#define EXA_OFFSCREEN_ALIGN_POT (1 << 1)
+
+/**
+ * EXA_TWO_BITBLT_DIRECTIONS indicates to EXA that the driver can only
+ * support copies that are (left-to-right, top-to-bottom) or
+ * (right-to-left, bottom-to-top).
+ */
+#define EXA_TWO_BITBLT_DIRECTIONS (1 << 2)
+
+/**
+ * EXA_HANDLES_PIXMAPS indicates to EXA that the driver can handle
+ * all pixmap addressing and migration.
+ */
+#define EXA_HANDLES_PIXMAPS (1 << 3)
+
+/**
+ * EXA_SUPPORTS_PREPARE_AUX indicates to EXA that the driver can handle the
+ * EXA_PREPARE_AUX* indices in the Prepare/FinishAccess hooks. If there are no
+ * such hooks, this flag has no effect.
+ */
+#define EXA_SUPPORTS_PREPARE_AUX (1 << 4)
+
+/**
+ * EXA_SUPPORTS_OFFSCREEN_OVERLAPS indicates to EXA that the driver Copy hooks
+ * can handle the source and destination occupying overlapping offscreen memory
+ * areas. This allows the offscreen memory defragmentation code to defragment
+ * areas where the defragmented position overlaps the fragmented position.
+ *
+ * Typically this is supported by traditional 2D engines but not by 3D engines.
+ */
+#define EXA_SUPPORTS_OFFSCREEN_OVERLAPS (1 << 5)
+
+/**
+ * EXA_MIXED_PIXMAPS will hide unacceleratable pixmaps from drivers and manage the
+ * problem known software fallbacks like trapezoids. This only migrates pixmaps one way
+ * into a driver pixmap and then pins it.
+ */
+#define EXA_MIXED_PIXMAPS (1 << 6)
+
+/** @} */
+
+/* in exa.c */
+extern _X_EXPORT ExaDriverPtr exaDriverAlloc(void);
+
+extern _X_EXPORT Bool
+ exaDriverInit(ScreenPtr pScreen, ExaDriverPtr pScreenInfo);
+
+extern _X_EXPORT void
+ exaDriverFini(ScreenPtr pScreen);
+
+extern _X_EXPORT void
+ exaMarkSync(ScreenPtr pScreen);
+extern _X_EXPORT void
+ exaWaitSync(ScreenPtr pScreen);
+
+extern _X_EXPORT unsigned long
+ exaGetPixmapOffset(PixmapPtr pPix);
+
+extern _X_EXPORT unsigned long
+ exaGetPixmapPitch(PixmapPtr pPix);
+
+extern _X_EXPORT void *exaGetPixmapDriverPrivate(PixmapPtr p);
+
+/* in exa_offscreen.c */
+extern _X_EXPORT ExaOffscreenArea *exaOffscreenAlloc(ScreenPtr pScreen,
+ int size, int align,
+ Bool locked,
+ ExaOffscreenSaveProc save,
+ void *privData);
+
+extern _X_EXPORT ExaOffscreenArea *exaOffscreenFree(ScreenPtr pScreen,
+ ExaOffscreenArea * area);
+
+extern _X_EXPORT void
+ exaEnableDisableFBAccess(ScreenPtr pScreen, Bool enable);
+
+extern _X_EXPORT Bool
+ exaDrawableIsOffscreen(DrawablePtr pDrawable);
+
+/* in exa.c */
+extern _X_EXPORT void
+ exaMoveInPixmap(PixmapPtr pPixmap);
+
+/* in exa_unaccel.c */
+extern _X_EXPORT CARD32
+ exaGetPixmapFirstPixel(PixmapPtr pPixmap);
+
+/**
+ * Returns TRUE if the given planemask covers all the significant bits in the
+ * pixel values for pDrawable.
+ */
+#define EXA_PM_IS_SOLID(_pDrawable, _pm) \
+ (((_pm) & FbFullMask((_pDrawable)->depth)) == \
+ FbFullMask((_pDrawable)->depth))
+
+#endif /* EXA_H */
diff --git a/prebuilt/xlibre/usr/include/xorg/exevents.h b/prebuilt/xlibre/usr/include/xorg/exevents.h
new file mode 100644
index 0000000..b58596b
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/exevents.h
@@ -0,0 +1,125 @@
+/************************************************************
+
+Copyright 1996 by Thomas E. Dickey
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+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 above listed
+copyright holder(s) not be used in advertising or publicity pertaining
+to distribution of the software without specific, written prior
+permission.
+
+THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
+TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) 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.
+
+********************************************************/
+
+/********************************************************************
+ * Interface of 'exevents.c'
+ */
+
+#ifndef EXEVENTS_H
+#define EXEVENTS_H
+
+#include
+#include "inputstr.h"
+
+/***************************************************************
+ * Interface available to drivers *
+ ***************************************************************/
+
+/**
+ * Scroll flags for ::SetScrollValuator.
+ */
+enum ScrollFlags {
+ SCROLL_FLAG_NONE = 0,
+ /**
+ * Do not emulate legacy button events for valuator events on this axis.
+ */
+ SCROLL_FLAG_DONT_EMULATE = (1 << 1),
+ /**
+ * This axis is the preferred axis for valuator emulation for this axis'
+ * scroll type.
+ */
+ SCROLL_FLAG_PREFERRED = (1 << 2)
+};
+
+extern _X_EXPORT int InitProximityClassDeviceStruct(DeviceIntPtr /* dev */ );
+
+extern _X_EXPORT Bool InitValuatorAxisStruct(DeviceIntPtr /* dev */ ,
+ int /* axnum */ ,
+ Atom /* label */ ,
+ int /* minval */ ,
+ int /* maxval */ ,
+ int /* resolution */ ,
+ int /* min_res */ ,
+ int /* max_res */ ,
+ int /* mode */ );
+
+extern _X_EXPORT Bool SetScrollValuator(DeviceIntPtr /* dev */ ,
+ int /* axnum */ ,
+ enum ScrollType /* type */ ,
+ double /* increment */ ,
+ int /* flags */ );
+
+extern _X_EXPORT int XIDeleteDeviceProperty(DeviceIntPtr /* device */ ,
+ Atom /* property */ ,
+ Bool /* fromClient */
+ );
+
+extern _X_EXPORT int XIChangeDeviceProperty(DeviceIntPtr /* dev */ ,
+ Atom /* property */ ,
+ Atom /* type */ ,
+ int /* format */ ,
+ int /* mode */ ,
+ unsigned long /* len */ ,
+ const void * /* value */ ,
+ Bool /* sendevent */
+ );
+
+extern _X_EXPORT int XIGetDeviceProperty(DeviceIntPtr /* dev */ ,
+ Atom /* property */ ,
+ XIPropertyValuePtr * /* value */
+ );
+
+extern _X_EXPORT int XISetDevicePropertyDeletable(DeviceIntPtr /* dev */ ,
+ Atom /* property */ ,
+ Bool /* deletable */
+ );
+
+extern _X_EXPORT long XIRegisterPropertyHandler(DeviceIntPtr dev,
+ int (*SetProperty) (DeviceIntPtr
+ dev,
+ Atom
+ property,
+ XIPropertyValuePtr
+ prop,
+ BOOL
+ checkonly),
+ int (*GetProperty) (DeviceIntPtr
+ dev,
+ Atom
+ property),
+ int (*DeleteProperty)
+ (DeviceIntPtr dev,
+ Atom property)
+ );
+
+extern _X_EXPORT Atom XIGetKnownProperty(const char *name);
+
+extern _X_EXPORT DeviceIntPtr XIGetDevice(xEvent *ev);
+
+/****************************************************************************
+ * End of driver interface *
+ ****************************************************************************/
+
+#endif /* EXEVENTS_H */
diff --git a/prebuilt/xlibre/usr/include/xorg/extension.h b/prebuilt/xlibre/usr/include/xorg/extension.h
new file mode 100644
index 0000000..168019b
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/extension.h
@@ -0,0 +1,104 @@
+/***********************************************************
+
+Copyright 1987, 1998 The Open Group
+
+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.
+
+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
+OPEN GROUP 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.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+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 Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL 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.
+
+******************************************************************/
+
+/*
+ * Copyright (c) 1997-2003 by The XFree86 Project, 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.
+ *
+ * Except as contained in this notice, the name of the copyright holder(s)
+ * and author(s) shall not be used in advertising or otherwise to promote
+ * the sale, use or other dealings in this Software without prior written
+ * authorization from the copyright holder(s) and author(s).
+ */
+
+#ifndef EXTENSION_H
+#define EXTENSION_H
+
+#include
+
+#include "xlibre_ptrtypes.h"
+#include "dixstruct.h"
+
+typedef void (*InitExtension) (void);
+
+typedef struct {
+ InitExtension initFunc;
+ const char *name;
+ Bool *disablePtr;
+} ExtensionModule;
+
+extern _X_EXPORT unsigned short StandardMinorOpcode(ClientPtr /*client */ );
+
+extern _X_EXPORT Bool EnableDisableExtension(const char *name, Bool enable);
+
+extern _X_EXPORT void EnableDisableExtensionError(const char *name,
+ Bool enable);
+
+extern _X_EXPORT void InitExtensions(int argc, char **argv);
+
+extern _X_EXPORT void CloseDownExtensions(void);
+
+extern _X_EXPORT void LoadExtensionList(const ExtensionModule ext[],
+ int listSize, Bool external);
+
+#endif /* EXTENSION_H */
diff --git a/prebuilt/xlibre/usr/include/xorg/extinit.h b/prebuilt/xlibre/usr/include/xorg/extinit.h
new file mode 100644
index 0000000..7df1a08
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/extinit.h
@@ -0,0 +1,68 @@
+/************************************************************
+
+Copyright 1996 by Thomas E. Dickey
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+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 above listed
+copyright holder(s) not be used in advertising or publicity pertaining
+to distribution of the software without specific, written prior
+permission.
+
+THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
+TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) 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.
+
+********************************************************/
+
+/*
+ * Copyright (C) 1994-2003 The XFree86 Project, Inc. All Rights Reserved.
+ *
+ * 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, FIT-
+ * NESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * XFREE86 PROJECT 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.
+ *
+ * Except as contained in this notice, the name of the XFree86 Project shall not
+ * be used in advertising or otherwise to promote the sale, use or other dealings
+ * in this Software without prior written authorization from the XFree86 Project.
+ */
+
+#ifndef EXTINIT_H
+#define EXTINIT_H
+
+#include "extnsionst.h"
+
+/* required by: libglx */
+extern _X_EXPORT Bool noCompositeExtension;
+
+/* required by: several video drivers (eg. vmware, sis and nvidia proprietary) */
+#ifdef XINERAMA
+extern _X_EXPORT Bool noPanoramiXExtension;
+#endif /* XINERAMA */
+
+#if defined(XV)
+extern _X_EXPORT Bool noXvExtension;
+#endif
+
+#endif
diff --git a/prebuilt/xlibre/usr/include/xorg/extnsionst.h b/prebuilt/xlibre/usr/include/xorg/extnsionst.h
new file mode 100644
index 0000000..083e514
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/extnsionst.h
@@ -0,0 +1,98 @@
+/***********************************************************
+
+Copyright 1987, 1998 The Open Group
+
+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.
+
+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
+OPEN GROUP 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.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+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 Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL 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 EXTENSIONSTRUCT_H
+#define EXTENSIONSTRUCT_H
+
+#include "xlibre_ptrtypes.h"
+#include "extension.h"
+#include "privates.h"
+
+typedef struct _ExtensionEntry {
+ int index;
+ void (*CloseDown) ( /* called at server shutdown */
+ struct _ExtensionEntry * /* extension */ );
+ const char *name; /* extension name */
+ int base; /* base request number */
+ int eventBase;
+ int eventLast;
+ int errorBase;
+ int errorLast;
+ void *extPrivate;
+ unsigned short (*MinorOpcode) ( /* called for errors */
+ ClientPtr /* client */ );
+ PrivateRec *devPrivates;
+} ExtensionEntry;
+
+/*
+ * The arguments may be different for extension event swapping functions.
+ * Deal with this by casting when initializing the event's EventSwapVector[]
+ * entries.
+ */
+typedef void (*EventSwapPtr) (xEvent *, xEvent *);
+
+extern _X_EXPORT EventSwapPtr EventSwapVector[128];
+
+extern _X_EXPORT void
+NotImplemented( /* FIXME: this may move to another file... */
+ xEvent *, xEvent *) _X_NORETURN;
+
+extern _X_EXPORT ExtensionEntry *
+AddExtension(const char * /*name */ ,
+ int /*NumEvents */ ,
+ int /*NumErrors */ ,
+ int (* /*MainProc */ )(ClientPtr /*client */ ),
+ int (* /*SwappedMainProc */ )(ClientPtr /*client */ ),
+ void (* /*CloseDownProc */ )(ExtensionEntry * /*extension */ ),
+ unsigned short (* /*MinorOpcodeProc */ )(ClientPtr /*client */ )
+ );
+
+extern _X_EXPORT ExtensionEntry *
+CheckExtension(const char *extname);
+extern _X_EXPORT ExtensionEntry *
+GetExtensionEntry(int major);
+
+#endif /* EXTENSIONSTRUCT_H */
diff --git a/prebuilt/xlibre/usr/include/xorg/fb.h b/prebuilt/xlibre/usr/include/xorg/fb.h
new file mode 100644
index 0000000..7ca5c1b
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/fb.h
@@ -0,0 +1,1017 @@
+/*
+ *
+ * Copyright © 1998 Keith Packard
+ *
+ * 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 Keith Packard not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. Keith Packard makes no
+ * representations about the suitability of this software for any purpose. It
+ * is provided "as is" without express or implied warranty.
+ *
+ * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL KEITH PACKARD 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 _FB_H_
+#define _FB_H_
+
+#include
+#include
+
+#include "scrnintstr.h"
+#include "pixmap.h"
+#include "pixmapstr.h"
+#include "regionstr.h"
+#include "gcstruct.h"
+#include "colormap.h"
+#include "miscstruct.h"
+#include "servermd.h"
+#include "windowstr.h"
+#include "privates.h"
+#include "mi.h"
+#include "migc.h"
+#include "picturestr.h"
+
+#ifdef FB_ACCESS_WRAPPER
+
+#include "wfbrename.h"
+#define FBPREFIX(x) wfb##x
+#define WRITE(ptr, val) ((*wfbWriteMemory)((ptr), (val), sizeof(*(ptr))))
+#define READ(ptr) ((*wfbReadMemory)((ptr), sizeof(*(ptr))))
+
+#else
+
+#define FBPREFIX(x) fb##x
+#define WRITE(ptr, val) (*(ptr) = (val))
+#define READ(ptr) (*(ptr))
+
+#endif
+
+/*
+ * This single define controls the basic size of data manipulated
+ * by this software; it must be log2(sizeof (FbBits) * 8)
+ */
+
+#ifndef FB_SHIFT
+#define FB_SHIFT LOG2_BITMAP_PAD
+#endif
+
+#define FB_UNIT (1 << FB_SHIFT)
+#define FB_MASK (FB_UNIT - 1)
+#define FB_ALLONES ((FbBits) -1)
+#define FB_STIP_SHIFT LOG2_BITMAP_PAD
+#define FB_STIP_UNIT (1 << FB_STIP_SHIFT)
+#define FB_STIP_MASK (FB_STIP_UNIT - 1)
+#define FB_STIP_ALLONES ((FbStip) -1)
+#define FbFullMask(n) ((n) == FB_UNIT ? FB_ALLONES : ((((FbBits) 1) << (n)) - 1))
+
+#if FB_SHIFT == 5
+typedef CARD32 FbBits;
+#else
+#error "Unsupported FB_SHIFT"
+#endif
+
+#if LOG2_BITMAP_PAD == FB_SHIFT
+typedef FbBits FbStip;
+#endif
+
+typedef int FbStride;
+
+#include "fbrop.h"
+
+#if BITMAP_BIT_ORDER == LSBFirst
+#define FbScrLeft(x,n) ((x) >> (n))
+#define FbScrRight(x,n) ((x) << (n))
+#define FbLeftStipBits(x,n) ((x) & ((((FbStip) 1) << (n)) - 1))
+#define FbStipMoveLsb(x,s,n) (FbStipRight ((x),(s)-(n)))
+#define FbPatternOffsetBits 0
+#else
+#define FbScrLeft(x,n) ((x) << (n))
+#define FbScrRight(x,n) ((x) >> (n))
+#define FbLeftStipBits(x,n) ((x) >> (FB_STIP_UNIT - (n)))
+#define FbStipMoveLsb(x,s,n) (x)
+#define FbPatternOffsetBits (sizeof (FbBits) - 1)
+#endif
+
+#include "micoord.h"
+
+#define FbStipLeft(x,n) FbScrLeft((x),(n))
+#define FbStipRight(x,n) FbScrRight((x),(n))
+
+#define FbRotLeft(x,n) FbScrLeft((x),(n)) | ((n) ? FbScrRight((x),FB_UNIT-(n)) : 0)
+
+#define FbLeftMask(x) ( ((x) & FB_MASK) ? \
+ FbScrRight(FB_ALLONES,(x) & FB_MASK) : 0)
+#define FbRightMask(x) ( ((FB_UNIT - (x)) & FB_MASK) ? \
+ FbScrLeft(FB_ALLONES,(FB_UNIT - (x)) & FB_MASK) : 0)
+
+#define FbLeftStipMask(x) ( ((x) & FB_STIP_MASK) ? \
+ FbStipRight(FB_STIP_ALLONES,(x) & FB_STIP_MASK) : 0)
+#define FbRightStipMask(x) ( ((FB_STIP_UNIT - (x)) & FB_STIP_MASK) ? \
+ FbScrLeft(FB_STIP_ALLONES,(FB_STIP_UNIT - (x)) & FB_STIP_MASK) : 0)
+
+#define FbBitsMask(x,w) (FbScrRight(FB_ALLONES,(x) & FB_MASK) & \
+ FbScrLeft(FB_ALLONES,(FB_UNIT - ((x) + (w))) & FB_MASK))
+
+#define FbStipMask(x,w) (FbStipRight(FB_STIP_ALLONES,(x) & FB_STIP_MASK) & \
+ FbStipLeft(FB_STIP_ALLONES,(FB_STIP_UNIT - ((x)+(w))) & FB_STIP_MASK))
+
+#define FbByteMaskInvalid 0x10
+
+#define FbPatternOffset(o,t) ((o) ^ (FbPatternOffsetBits & ~(sizeof (t) - 1)))
+
+#define FbPtrOffset(p,o,t) ((t *) ((CARD8 *) (p) + (o)))
+#define FbSelectPatternPart(xor,o,t) ((xor) >> (FbPatternOffset ((o),t) << 3))
+#define FbStorePart(dst,off,t,xor) (WRITE(FbPtrOffset((dst),(off),t), \
+ FbSelectPart((xor),(off),t)))
+#ifndef FbSelectPart
+#define FbSelectPart(x,o,t) FbSelectPatternPart((x),(o),t)
+#endif
+
+#define FbMaskBitsBytes(x,w,copy,l,lb,n,r,rb) { \
+ (n) = (w); \
+ (lb) = 0; \
+ (rb) = 0; \
+ (r) = FbRightMask((x)+(n)); \
+ if (r) { \
+ /* compute right byte length */ \
+ if ((copy) && (((x) + (n)) & 7) == 0) { \
+ (rb) = (((x) + (n)) & FB_MASK) >> 3; \
+ } else { \
+ (rb) = FbByteMaskInvalid; \
+ } \
+ } \
+ (l) = FbLeftMask((x)); \
+ if (l) { \
+ /* compute left byte length */ \
+ if ((copy) && ((x) & 7) == 0) { \
+ (lb) = ((x) & FB_MASK) >> 3; \
+ } else { \
+ (lb) = FbByteMaskInvalid; \
+ } \
+ /* subtract out the portion painted by leftMask */ \
+ (n) -= FB_UNIT - ((x) & FB_MASK); \
+ if ((n) < 0) { \
+ if ((lb) != FbByteMaskInvalid) { \
+ if ((rb) == FbByteMaskInvalid) { \
+ (lb) = FbByteMaskInvalid; \
+ } else if (rb) { \
+ (lb) |= ((rb) - (lb)) << (FB_SHIFT - 3); \
+ (rb) = 0; \
+ } \
+ } \
+ (n) = 0; \
+ (l) &= (r); \
+ (r) = 0; \
+ }\
+ } \
+ (n) >>= FB_SHIFT; \
+}
+
+#define FbDoLeftMaskByteRRop(dst,lb,l,and,xor) { \
+ switch (lb) { \
+ case (sizeof (FbBits) - 3) | (1 << (FB_SHIFT - 3)): \
+ FbStorePart((dst),sizeof (FbBits) - 3,CARD8,(xor)); \
+ break; \
+ case (sizeof (FbBits) - 3) | (2 << (FB_SHIFT - 3)): \
+ FbStorePart((dst),sizeof (FbBits) - 3,CARD8,(xor)); \
+ FbStorePart((dst),sizeof (FbBits) - 2,CARD8,(xor)); \
+ break; \
+ case (sizeof (FbBits) - 2) | (1 << (FB_SHIFT - 3)): \
+ FbStorePart((dst),sizeof (FbBits) - 2,CARD8,(xor)); \
+ break; \
+ case sizeof (FbBits) - 3: \
+ FbStorePart((dst),sizeof (FbBits) - 3,CARD8,(xor)); \
+ /* fallthrough */ \
+ case sizeof (FbBits) - 2: \
+ FbStorePart((dst),sizeof (FbBits) - 2,CARD16,(xor)); \
+ break; \
+ case sizeof (FbBits) - 1: \
+ FbStorePart((dst),sizeof (FbBits) - 1,CARD8,(xor)); \
+ break; \
+ default: \
+ WRITE((dst), FbDoMaskRRop(READ((dst)), (and), (xor), (l))); \
+ break; \
+ } \
+}
+
+#define FbDoRightMaskByteRRop(dst,rb,r,and,xor) { \
+ switch (rb) { \
+ case 1: \
+ FbStorePart((dst),0,CARD8,(xor)); \
+ break; \
+ case 2: \
+ FbStorePart((dst),0,CARD16,(xor)); \
+ break; \
+ case 3: \
+ FbStorePart((dst),0,CARD16,(xor)); \
+ FbStorePart((dst),2,CARD8,(xor)); \
+ break; \
+ default: \
+ WRITE((dst), FbDoMaskRRop (READ((dst)), (and), (xor), (r))); \
+ } \
+}
+
+/* Framebuffer access wrapper */
+typedef FbBits(*ReadMemoryProcPtr) (const void *src, int size);
+typedef void (*WriteMemoryProcPtr) (void *dst, FbBits value, int size);
+typedef void (*SetupWrapProcPtr) (ReadMemoryProcPtr * pRead,
+ WriteMemoryProcPtr * pWrite,
+ DrawablePtr pDraw);
+typedef void (*FinishWrapProcPtr) (DrawablePtr pDraw);
+
+#ifdef FB_ACCESS_WRAPPER
+
+#define fbPrepareAccess(pDraw) \
+ fbGetScreenPrivate((pDraw)->pScreen)->setupWrap( \
+ &wfbReadMemory, \
+ &wfbWriteMemory, \
+ (pDraw))
+#define fbFinishAccess(pDraw) \
+ fbGetScreenPrivate((pDraw)->pScreen)->finishWrap((pDraw))
+
+#else
+
+#define fbPrepareAccess(pPix)
+#define fbFinishAccess(pDraw)
+
+#endif
+
+extern _X_EXPORT DevPrivateKey
+fbGetScreenPrivateKey(void);
+
+/* private field of a screen */
+typedef struct {
+#ifdef FB_ACCESS_WRAPPER
+ SetupWrapProcPtr setupWrap; /* driver hook to set pixmap access wrapping */
+ FinishWrapProcPtr finishWrap; /* driver hook to clean up pixmap access wrapping */
+#endif
+ DevPrivateKeyRec gcPrivateKeyRec;
+ DevPrivateKeyRec winPrivateKeyRec;
+} FbScreenPrivRec, *FbScreenPrivPtr;
+
+#define fbGetScreenPrivate(pScreen) ((FbScreenPrivPtr) \
+ dixLookupPrivate(&(pScreen)->devPrivates, fbGetScreenPrivateKey()))
+
+/* private field of GC */
+typedef struct {
+ FbBits and, xor; /* reduced rop values */
+ FbBits bgand, bgxor; /* for stipples */
+ FbBits fg, bg, pm; /* expanded and filled */
+ unsigned int dashLength; /* total of all dash elements */
+} FbGCPrivRec, *FbGCPrivPtr;
+
+#define fbGetCompositeClip(pGC) ((pGC)->pCompositeClip)
+
+#define fbGetWinPrivateKey(pWin) (&fbGetScreenPrivate(((DrawablePtr) (pWin))->pScreen)->winPrivateKeyRec)
+
+#define fbGetWindowPixmap(pWin) ((PixmapPtr)\
+ dixLookupPrivate(&((WindowPtr)(pWin))->devPrivates, fbGetWinPrivateKey((pWin))))
+
+#define __fbPixDrawableX(pPix) ((pPix)->drawable.x)
+#define __fbPixDrawableY(pPix) ((pPix)->drawable.y)
+
+#define __fbPixOffXWin(pPix) (__fbPixDrawableX((pPix)) - (pPix)->screen_x)
+#define __fbPixOffYWin(pPix) (__fbPixDrawableY((pPix)) - (pPix)->screen_y)
+#define __fbPixOffXPix(pPix) (__fbPixDrawableX((pPix)))
+#define __fbPixOffYPix(pPix) (__fbPixDrawableY((pPix)))
+
+#define fbGetDrawablePixmap(pDrawable, pixmap, xoff, yoff) { \
+ if ((pDrawable)->type != DRAWABLE_PIXMAP) { \
+ (pixmap) = fbGetWindowPixmap((pDrawable)); \
+ (xoff) = __fbPixOffXWin((pixmap)); \
+ (yoff) = __fbPixOffYWin((pixmap)); \
+ } else { \
+ (pixmap) = (PixmapPtr) (pDrawable); \
+ (xoff) = __fbPixOffXPix((pixmap)); \
+ (yoff) = __fbPixOffYPix((pixmap)); \
+ } \
+ fbPrepareAccess((pDrawable)); \
+}
+
+#define fbGetPixmapBitsData(pixmap, pointer, stride, bpp) { \
+ (pointer) = (FbBits *) (pixmap)->devPrivate.ptr; \
+ (stride) = ((int) (pixmap)->devKind) / sizeof (FbBits); (void)(stride); \
+ (bpp) = (pixmap)->drawable.bitsPerPixel; (void)(bpp); \
+}
+
+#define fbGetPixmapStipData(pixmap, pointer, stride, bpp) { \
+ (pointer) = (FbStip *) (pixmap)->devPrivate.ptr; \
+ (stride) = ((int) (pixmap)->devKind) / sizeof (FbStip); (void)(stride); \
+ (bpp) = (pixmap)->drawable.bitsPerPixel; (void)(bpp); \
+}
+
+#define fbGetDrawable(pDrawable, pointer, stride, bpp, xoff, yoff) { \
+ PixmapPtr _pPix; \
+ fbGetDrawablePixmap((pDrawable), _pPix, (xoff), (yoff)); \
+ fbGetPixmapBitsData(_pPix, (pointer), (stride), (bpp)); \
+}
+
+#define fbGetStipDrawable(pDrawable, pointer, stride, bpp, xoff, yoff) { \
+ PixmapPtr _pPix; \
+ fbGetDrawablePixmap((pDrawable), _pPix, (xoff), (yoff)); \
+ fbGetPixmapStipData(_pPix, (pointer), (stride), (bpp)); \
+}
+
+/*
+ * XFree86 empties the root BorderClip when the VT is inactive,
+ * here's a macro which uses that to disable GetImage and GetSpans
+ */
+
+#define fbWindowEnabled(pWin) \
+ RegionNotEmpty(&(pWin)->borderClip)
+
+#define fbDrawableEnabled(pDrawable) \
+ ((pDrawable)->type == DRAWABLE_PIXMAP ? \
+ TRUE : fbWindowEnabled((WindowPtr) (pDrawable)))
+
+#define FbPowerOfTwo(w) (((w) & ((w) - 1)) == 0)
+/*
+ * Accelerated tiles are power of 2 width <= FB_UNIT
+ */
+#define FbEvenTile(w) ((w) <= FB_UNIT && FbPowerOfTwo((w)))
+
+/*
+ * fbarc.c
+ */
+
+extern _X_EXPORT void
+fbPolyArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc * parcs);
+
+/*
+ * fbbits.c
+ */
+
+extern _X_EXPORT void
+
+fbBresSolid8(DrawablePtr pDrawable,
+ GCPtr pGC,
+ int dashOffset,
+ int signdx,
+ int signdy,
+ int axis, int x, int y, int e, int e1, int e3, int len);
+
+extern _X_EXPORT void
+
+fbBresDash8(DrawablePtr pDrawable,
+ GCPtr pGC,
+ int dashOffset,
+ int signdx,
+ int signdy, int axis, int x, int y, int e, int e1, int e3, int len);
+
+extern _X_EXPORT void
+
+fbDots8(FbBits * dst,
+ FbStride dstStride,
+ int dstBpp,
+ BoxPtr pBox,
+ xPoint * pts,
+ int npt,
+ int xorg, int yorg, int xoff, int yoff, FbBits and, FbBits xor);
+
+extern _X_EXPORT void
+
+fbArc8(FbBits * dst,
+ FbStride dstStride,
+ int dstBpp, xArc * arc, int dx, int dy, FbBits and, FbBits xor);
+
+extern _X_EXPORT void
+
+fbGlyph8(FbBits * dstLine,
+ FbStride dstStride,
+ int dstBpp, FbStip * stipple, FbBits fg, int height, int shift);
+
+extern _X_EXPORT void
+
+fbPolyline8(DrawablePtr pDrawable,
+ GCPtr pGC, int mode, int npt, DDXPointPtr ptsOrig);
+
+extern _X_EXPORT void
+ fbPolySegment8(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment * pseg);
+
+extern _X_EXPORT void
+
+fbBresSolid16(DrawablePtr pDrawable,
+ GCPtr pGC,
+ int dashOffset,
+ int signdx,
+ int signdy,
+ int axis, int x, int y, int e, int e1, int e3, int len);
+
+extern _X_EXPORT void
+
+fbBresDash16(DrawablePtr pDrawable,
+ GCPtr pGC,
+ int dashOffset,
+ int signdx,
+ int signdy,
+ int axis, int x, int y, int e, int e1, int e3, int len);
+
+extern _X_EXPORT void
+
+fbDots16(FbBits * dst,
+ FbStride dstStride,
+ int dstBpp,
+ BoxPtr pBox,
+ xPoint * pts,
+ int npt,
+ int xorg, int yorg, int xoff, int yoff, FbBits and, FbBits xor);
+
+extern _X_EXPORT void
+
+fbArc16(FbBits * dst,
+ FbStride dstStride,
+ int dstBpp, xArc * arc, int dx, int dy, FbBits and, FbBits xor);
+
+extern _X_EXPORT void
+
+fbGlyph16(FbBits * dstLine,
+ FbStride dstStride,
+ int dstBpp, FbStip * stipple, FbBits fg, int height, int shift);
+
+extern _X_EXPORT void
+
+fbPolyline16(DrawablePtr pDrawable,
+ GCPtr pGC, int mode, int npt, DDXPointPtr ptsOrig);
+
+extern _X_EXPORT void
+ fbPolySegment16(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment * pseg);
+
+extern _X_EXPORT void
+
+fbBresSolid32(DrawablePtr pDrawable,
+ GCPtr pGC,
+ int dashOffset,
+ int signdx,
+ int signdy,
+ int axis, int x, int y, int e, int e1, int e3, int len);
+
+extern _X_EXPORT void
+
+fbBresDash32(DrawablePtr pDrawable,
+ GCPtr pGC,
+ int dashOffset,
+ int signdx,
+ int signdy,
+ int axis, int x, int y, int e, int e1, int e3, int len);
+
+extern _X_EXPORT void
+
+fbDots32(FbBits * dst,
+ FbStride dstStride,
+ int dstBpp,
+ BoxPtr pBox,
+ xPoint * pts,
+ int npt,
+ int xorg, int yorg, int xoff, int yoff, FbBits and, FbBits xor);
+
+extern _X_EXPORT void
+
+fbArc32(FbBits * dst,
+ FbStride dstStride,
+ int dstBpp, xArc * arc, int dx, int dy, FbBits and, FbBits xor);
+
+extern _X_EXPORT void
+
+fbGlyph32(FbBits * dstLine,
+ FbStride dstStride,
+ int dstBpp, FbStip * stipple, FbBits fg, int height, int shift);
+extern _X_EXPORT void
+
+fbPolyline32(DrawablePtr pDrawable,
+ GCPtr pGC, int mode, int npt, DDXPointPtr ptsOrig);
+
+extern _X_EXPORT void
+ fbPolySegment32(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment * pseg);
+
+/*
+ * fbblt.c
+ */
+extern _X_EXPORT void
+
+fbBlt(FbBits * src,
+ FbStride srcStride,
+ int srcX,
+ FbBits * dst,
+ FbStride dstStride,
+ int dstX,
+ int width,
+ int height, int alu, FbBits pm, int bpp, Bool reverse, Bool upsidedown);
+
+extern _X_EXPORT void
+ fbBltStip(FbStip * src, FbStride srcStride, /* in FbStip units, not FbBits units */
+ int srcX, FbStip * dst, FbStride dstStride, /* in FbStip units, not FbBits units */
+ int dstX, int width, int height, int alu, FbBits pm, int bpp);
+
+/*
+ * fbbltone.c
+ */
+extern _X_EXPORT void
+
+fbBltOne(FbStip * src,
+ FbStride srcStride,
+ int srcX,
+ FbBits * dst,
+ FbStride dstStride,
+ int dstX,
+ int dstBpp,
+ int width,
+ int height, FbBits fgand, FbBits fbxor, FbBits bgand, FbBits bgxor);
+
+extern _X_EXPORT void
+
+fbBltPlane(FbBits * src,
+ FbStride srcStride,
+ int srcX,
+ int srcBpp,
+ FbStip * dst,
+ FbStride dstStride,
+ int dstX,
+ int width,
+ int height,
+ FbStip fgand,
+ FbStip fgxor, FbStip bgand, FbStip bgxor, Pixel planeMask);
+
+/*
+ * fbcmap_mi.c
+ */
+extern _X_EXPORT void
+ fbInstallColormap(ColormapPtr pmap);
+
+extern _X_EXPORT void
+ fbUninstallColormap(ColormapPtr pmap);
+
+extern _X_EXPORT void
+
+fbResolveColor(unsigned short *pred,
+ unsigned short *pgreen,
+ unsigned short *pblue, VisualPtr pVisual);
+
+extern _X_EXPORT Bool
+ fbInitializeColormap(ColormapPtr pmap);
+
+extern _X_EXPORT Bool
+ mfbCreateColormap(ColormapPtr pmap);
+
+extern _X_EXPORT int
+
+fbExpandDirectColors(ColormapPtr pmap,
+ int ndef, xColorItem * indefs, xColorItem * outdefs);
+
+extern _X_EXPORT Bool
+ fbCreateDefColormap(ScreenPtr pScreen);
+
+extern _X_EXPORT void
+ fbClearVisualTypes(void);
+
+extern _X_EXPORT Bool
+ fbSetVisualTypes(int depth, int visuals, int bitsPerRGB);
+
+extern _X_EXPORT Bool
+fbSetVisualTypesAndMasks(int depth, int visuals, int bitsPerRGB,
+ Pixel redMask, Pixel greenMask, Pixel blueMask);
+
+extern _X_EXPORT Bool
+
+fbInitVisuals(VisualPtr * visualp,
+ DepthPtr * depthp,
+ int *nvisualp,
+ int *ndepthp,
+ int *rootDepthp,
+ VisualID * defaultVisp, unsigned long sizes, int bitsPerRGB);
+
+/*
+ * fbcopy.c
+ */
+
+extern _X_EXPORT void
+
+fbCopyNtoN(DrawablePtr pSrcDrawable,
+ DrawablePtr pDstDrawable,
+ GCPtr pGC,
+ BoxPtr pbox,
+ int nbox,
+ int dx,
+ int dy,
+ Bool reverse, Bool upsidedown, Pixel bitplane, void *closure);
+
+extern _X_EXPORT void
+
+fbCopy1toN(DrawablePtr pSrcDrawable,
+ DrawablePtr pDstDrawable,
+ GCPtr pGC,
+ BoxPtr pbox,
+ int nbox,
+ int dx,
+ int dy,
+ Bool reverse, Bool upsidedown, Pixel bitplane, void *closure);
+
+extern _X_EXPORT void
+
+fbCopyNto1(DrawablePtr pSrcDrawable,
+ DrawablePtr pDstDrawable,
+ GCPtr pGC,
+ BoxPtr pbox,
+ int nbox,
+ int dx,
+ int dy,
+ Bool reverse, Bool upsidedown, Pixel bitplane, void *closure);
+
+extern _X_EXPORT RegionPtr
+
+fbCopyArea(DrawablePtr pSrcDrawable,
+ DrawablePtr pDstDrawable,
+ GCPtr pGC,
+ int xIn, int yIn, int widthSrc, int heightSrc, int xOut, int yOut);
+
+extern _X_EXPORT RegionPtr
+
+fbCopyPlane(DrawablePtr pSrcDrawable,
+ DrawablePtr pDstDrawable,
+ GCPtr pGC,
+ int xIn,
+ int yIn,
+ int widthSrc,
+ int heightSrc, int xOut, int yOut, unsigned long bitplane);
+
+/*
+ * fbfill.c
+ */
+extern _X_EXPORT void
+ fbFill(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int width, int height);
+
+extern _X_EXPORT void
+
+fbSolidBoxClipped(DrawablePtr pDrawable,
+ RegionPtr pClip,
+ int xa, int ya, int xb, int yb, FbBits and, FbBits xor);
+
+/*
+ * fbfillrect.c
+ */
+extern _X_EXPORT void
+
+fbPolyFillRect(DrawablePtr pDrawable,
+ GCPtr pGC, int nrectInit, xRectangle *prectInit);
+
+/*
+ * fbfillsp.c
+ */
+extern _X_EXPORT void
+
+fbFillSpans(DrawablePtr pDrawable,
+ GCPtr pGC,
+ int nInit, DDXPointPtr pptInit, int *pwidthInit, int fSorted);
+
+/*
+ * fbgc.c
+ */
+
+extern _X_EXPORT Bool
+ fbCreateGC(GCPtr pGC);
+
+extern _X_EXPORT void
+ fbPadPixmap(PixmapPtr pPixmap);
+
+extern _X_EXPORT void
+ fbValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable);
+
+/*
+ * fbgetsp.c
+ */
+extern _X_EXPORT void
+
+fbGetSpans(DrawablePtr pDrawable,
+ int wMax,
+ DDXPointPtr ppt, int *pwidth, int nspans, char *pchardstStart);
+
+/*
+ * fbglyph.c
+ */
+
+extern _X_EXPORT void
+
+fbPolyGlyphBlt(DrawablePtr pDrawable,
+ GCPtr pGC,
+ int x,
+ int y,
+ unsigned int nglyph, CharInfoPtr * ppci, void *pglyphBase);
+
+extern _X_EXPORT void
+
+fbImageGlyphBlt(DrawablePtr pDrawable,
+ GCPtr pGC,
+ int x,
+ int y,
+ unsigned int nglyph, CharInfoPtr * ppci, void *pglyphBase);
+
+/*
+ * fbimage.c
+ */
+
+extern _X_EXPORT void
+
+fbPutImage(DrawablePtr pDrawable,
+ GCPtr pGC,
+ int depth,
+ int x, int y, int w, int h, int leftPad, int format, char *pImage);
+
+extern _X_EXPORT void
+
+fbPutZImage(DrawablePtr pDrawable,
+ RegionPtr pClip,
+ int alu,
+ FbBits pm,
+ int x,
+ int y, int width, int height, FbStip * src, FbStride srcStride);
+
+extern _X_EXPORT void
+
+fbPutXYImage(DrawablePtr pDrawable,
+ RegionPtr pClip,
+ FbBits fg,
+ FbBits bg,
+ FbBits pm,
+ int alu,
+ Bool opaque,
+ int x,
+ int y,
+ int width, int height, FbStip * src, FbStride srcStride, int srcX);
+
+extern _X_EXPORT void
+
+fbGetImage(DrawablePtr pDrawable,
+ int x,
+ int y,
+ int w, int h, unsigned int format, unsigned long planeMask, char *d);
+/*
+ * fbline.c
+ */
+
+extern _X_EXPORT void
+fbPolyLine(DrawablePtr pDrawable,
+ GCPtr pGC, int mode, int npt, DDXPointPtr ppt);
+
+extern _X_EXPORT void
+ fbFixCoordModePrevious(int npt, DDXPointPtr ppt);
+
+extern _X_EXPORT void
+ fbPolySegment(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment * pseg);
+
+/*
+ * fbpict.c
+ */
+
+extern _X_EXPORT Bool
+ fbPictureInit(ScreenPtr pScreen, PictFormatPtr formats, int nformats);
+
+extern _X_EXPORT void
+fbDestroyGlyphCache(void);
+
+/*
+ * fbpixmap.c
+ */
+
+extern _X_EXPORT PixmapPtr
+fbCreatePixmap(ScreenPtr pScreen, int width, int height, int depth,
+ unsigned usage_hint);
+
+extern _X_EXPORT Bool
+ fbDestroyPixmap(PixmapPtr pPixmap);
+
+extern _X_EXPORT RegionPtr
+ fbPixmapToRegion(PixmapPtr pPix);
+
+/*
+ * fbpoint.c
+ */
+
+extern _X_EXPORT void
+
+fbPolyPoint(DrawablePtr pDrawable,
+ GCPtr pGC, int mode, int npt, xPoint * pptInit);
+
+/*
+ * fbpush.c
+ */
+
+extern _X_EXPORT void
+
+fbPushImage(DrawablePtr pDrawable,
+ GCPtr pGC,
+ FbStip * src,
+ FbStride srcStride, int srcX, int x, int y, int width, int height);
+
+extern _X_EXPORT void
+
+fbPushPixels(GCPtr pGC,
+ PixmapPtr pBitmap,
+ DrawablePtr pDrawable, int dx, int dy, int xOrg, int yOrg);
+
+/*
+ * fbscreen.c
+ */
+
+extern _X_EXPORT Bool
+ fbCloseScreen(ScreenPtr pScreen);
+
+extern _X_EXPORT Bool
+ fbRealizeFont(ScreenPtr pScreen, FontPtr pFont);
+
+extern _X_EXPORT Bool
+ fbUnrealizeFont(ScreenPtr pScreen, FontPtr pFont);
+
+extern _X_EXPORT void
+
+fbQueryBestSize(int class,
+ unsigned short *width, unsigned short *height,
+ ScreenPtr pScreen);
+
+extern _X_EXPORT PixmapPtr
+ _fbGetWindowPixmap(WindowPtr pWindow);
+
+extern _X_EXPORT void
+ _fbSetWindowPixmap(WindowPtr pWindow, PixmapPtr pPixmap);
+
+extern _X_EXPORT Bool
+ fbSetupScreen(ScreenPtr pScreen, void *pbits, /* pointer to screen bitmap */
+ int xsize, /* in pixels */
+ int ysize, int dpix, /* dots per inch */
+ int dpiy, int width, /* pixel width of frame buffer */
+ int bpp); /* bits per pixel of frame buffer */
+
+#ifdef FB_ACCESS_WRAPPER
+extern _X_EXPORT Bool
+wfbFinishScreenInit(ScreenPtr pScreen,
+ void *pbits,
+ int xsize,
+ int ysize,
+ int dpix,
+ int dpiy,
+ int width,
+ int bpp,
+ SetupWrapProcPtr setupWrap, FinishWrapProcPtr finishWrap);
+
+extern _X_EXPORT Bool
+wfbScreenInit(ScreenPtr pScreen,
+ void *pbits,
+ int xsize,
+ int ysize,
+ int dpix,
+ int dpiy,
+ int width,
+ int bpp,
+ SetupWrapProcPtr setupWrap, FinishWrapProcPtr finishWrap);
+#endif
+
+extern _X_EXPORT Bool
+fbFinishScreenInit(ScreenPtr pScreen,
+ void *pbits,
+ int xsize,
+ int ysize, int dpix, int dpiy, int width, int bpp);
+
+extern _X_EXPORT Bool
+
+fbScreenInit(ScreenPtr pScreen,
+ void *pbits,
+ int xsize, int ysize, int dpix, int dpiy, int width, int bpp);
+
+/*
+ * fbseg.c
+ */
+typedef void FbBres(DrawablePtr pDrawable,
+ GCPtr pGC,
+ int dashOffset,
+ int signdx,
+ int signdy,
+ int axis, int x, int y, int e, int e1, int e3, int len);
+
+extern _X_EXPORT void
+fbSegment(DrawablePtr pDrawable,
+ GCPtr pGC,
+ int xa, int ya, int xb, int yb, Bool drawLast, int *dashOffset);
+
+/*
+ * fbsetsp.c
+ */
+
+extern _X_EXPORT void
+fbSetSpans(DrawablePtr pDrawable,
+ GCPtr pGC,
+ char *src, DDXPointPtr ppt, int *pwidth, int nspans, int fSorted);
+
+/*
+ * fbsolid.c
+ */
+
+extern _X_EXPORT void
+
+fbSolid(FbBits * dst,
+ FbStride dstStride,
+ int dstX, int bpp, int width, int height, FbBits and, FbBits xor);
+
+/*
+ * fbtile.c
+ */
+
+extern _X_EXPORT void
+
+fbEvenTile(FbBits * dst,
+ FbStride dstStride,
+ int dstX,
+ int width,
+ int height,
+ FbBits * tile,
+ FbStride tileStride,
+ int tileHeight, int alu, FbBits pm, int xRot, int yRot);
+
+extern _X_EXPORT void
+
+fbOddTile(FbBits * dst,
+ FbStride dstStride,
+ int dstX,
+ int width,
+ int height,
+ FbBits * tile,
+ FbStride tileStride,
+ int tileWidth,
+ int tileHeight, int alu, FbBits pm, int bpp, int xRot, int yRot);
+
+extern _X_EXPORT void
+
+fbTile(FbBits * dst,
+ FbStride dstStride,
+ int dstX,
+ int width,
+ int height,
+ FbBits * tile,
+ FbStride tileStride,
+ int tileWidth,
+ int tileHeight, int alu, FbBits pm, int bpp, int xRot, int yRot);
+
+/*
+ * fbutil.c
+ */
+extern _X_EXPORT FbBits fbReplicatePixel(Pixel p, int bpp);
+
+#ifdef FB_ACCESS_WRAPPER
+extern _X_EXPORT ReadMemoryProcPtr wfbReadMemory;
+extern _X_EXPORT WriteMemoryProcPtr wfbWriteMemory;
+#endif
+
+/*
+ * fbwindow.c
+ */
+
+extern _X_EXPORT Bool
+ fbCreateWindow(WindowPtr pWin);
+
+extern _X_EXPORT Bool
+ fbDestroyWindow(WindowPtr pWin);
+
+extern _X_EXPORT Bool
+ fbRealizeWindow(WindowPtr pWindow);
+
+extern _X_EXPORT Bool
+ fbPositionWindow(WindowPtr pWin, int x, int y);
+
+extern _X_EXPORT Bool
+ fbUnrealizeWindow(WindowPtr pWindow);
+
+extern _X_EXPORT void
+
+fbCopyWindowProc(DrawablePtr pSrcDrawable,
+ DrawablePtr pDstDrawable,
+ GCPtr pGC,
+ BoxPtr pbox,
+ int nbox,
+ int dx,
+ int dy,
+ Bool reverse, Bool upsidedown, Pixel bitplane, void *closure);
+
+_X_EXPORT void fbCopyWindow(WindowPtr pWin, xPoint ptOldOrg, RegionPtr prgnSrc);
+
+extern _X_EXPORT Bool
+ fbChangeWindowAttributes(WindowPtr pWin, unsigned long mask);
+
+extern _X_EXPORT void
+
+fbFillRegionSolid(DrawablePtr pDrawable,
+ RegionPtr pRegion, FbBits and, FbBits xor);
+
+extern _X_EXPORT pixman_image_t *image_from_pict(PicturePtr pict,
+ Bool has_clip,
+ int *xoff, int *yoff);
+
+extern _X_EXPORT void free_pixman_pict(PicturePtr, pixman_image_t *);
+
+#endif /* _FB_H_ */
diff --git a/prebuilt/xlibre/usr/include/xorg/fbdevhw.h b/prebuilt/xlibre/usr/include/xorg/fbdevhw.h
new file mode 100644
index 0000000..3de5779
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/fbdevhw.h
@@ -0,0 +1,56 @@
+
+#ifndef _FBDEVHW_H_
+#define _FBDEVHW_H_
+
+#include "xf86str.h"
+
+#define FBDEVHW_PACKED_PIXELS 0 /* Packed Pixels */
+#define FBDEVHW_INTERLEAVED_PLANES 2 /* Interleaved planes */
+#define FBDEVHW_TEXT 3 /* Text/attributes */
+#define FBDEVHW_VGA_PLANES 4 /* EGA/VGA planes */
+
+extern _X_EXPORT Bool fbdevHWProbe(struct pci_device *pPci, const char *device,
+ char **namep);
+extern _X_EXPORT Bool fbdevHWInit(ScrnInfoPtr pScrn, struct pci_device *pPci,
+ const char *device);
+
+extern _X_EXPORT char *fbdevHWGetName(ScrnInfoPtr pScrn);
+extern _X_EXPORT int fbdevHWGetDepth(ScrnInfoPtr pScrn, int *fbbpp);
+extern _X_EXPORT int fbdevHWGetLineLength(ScrnInfoPtr pScrn);
+extern _X_EXPORT int fbdevHWGetType(ScrnInfoPtr pScrn);
+extern _X_EXPORT int fbdevHWGetVidmem(ScrnInfoPtr pScrn);
+
+extern _X_EXPORT void *fbdevHWMapVidmem(ScrnInfoPtr pScrn);
+extern _X_EXPORT int fbdevHWLinearOffset(ScrnInfoPtr pScrn);
+extern _X_EXPORT Bool fbdevHWUnmapVidmem(ScrnInfoPtr pScrn);
+extern _X_EXPORT void *fbdevHWMapMMIO(ScrnInfoPtr pScrn);
+extern _X_EXPORT Bool fbdevHWUnmapMMIO(ScrnInfoPtr pScrn);
+
+extern _X_EXPORT void fbdevHWSetVideoModes(ScrnInfoPtr pScrn);
+extern _X_EXPORT void fbdevHWUseBuildinMode(ScrnInfoPtr pScrn);
+extern _X_EXPORT Bool fbdevHWModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode);
+extern _X_EXPORT void fbdevHWSave(ScrnInfoPtr pScrn);
+extern _X_EXPORT void fbdevHWRestore(ScrnInfoPtr pScrn);
+
+extern _X_EXPORT void fbdevHWLoadPalette(ScrnInfoPtr pScrn, int numColors,
+ int *indices, LOCO * colors,
+ VisualPtr pVisual);
+
+extern _X_EXPORT ModeStatus fbdevHWValidMode(ScrnInfoPtr pScrn, DisplayModePtr mode,
+ Bool verbose, int flags);
+extern _X_EXPORT Bool fbdevHWSwitchMode(ScrnInfoPtr pScrn, DisplayModePtr mode);
+extern _X_EXPORT void fbdevHWAdjustFrame(ScrnInfoPtr pScrn, int x, int y);
+extern _X_EXPORT Bool fbdevHWEnterVT(ScrnInfoPtr pScrn);
+extern _X_EXPORT void fbdevHWLeaveVT(ScrnInfoPtr pScrn);
+extern _X_EXPORT void fbdevHWDPMSSet(ScrnInfoPtr pScrn, int mode, int flags);
+
+extern _X_EXPORT Bool fbdevHWSaveScreen(ScreenPtr pScreen, int mode);
+
+extern _X_EXPORT xf86SwitchModeProc *fbdevHWSwitchModeWeak(void);
+extern _X_EXPORT xf86AdjustFrameProc *fbdevHWAdjustFrameWeak(void);
+extern _X_EXPORT xf86LeaveVTProc *fbdevHWLeaveVTWeak(void);
+extern _X_EXPORT xf86ValidModeProc *fbdevHWValidModeWeak(void);
+extern _X_EXPORT xf86DPMSSetProc *fbdevHWDPMSSetWeak(void);
+extern _X_EXPORT xf86LoadPaletteProc *fbdevHWLoadPaletteWeak(void);
+
+#endif
diff --git a/prebuilt/xlibre/usr/include/xorg/fboverlay.h b/prebuilt/xlibre/usr/include/xorg/fboverlay.h
new file mode 100644
index 0000000..4de5a0e
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/fboverlay.h
@@ -0,0 +1,76 @@
+/*
+ *
+ * Copyright © 2000 SuSE, 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 SuSE not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission. SuSE makes no representations about the
+ * suitability of this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ *
+ * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE
+ * 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.
+ *
+ * Author: Keith Packard, SuSE, Inc.
+ */
+
+#ifndef _FBOVERLAY_H_
+#define _FBOVERLAY_H_
+
+#include "privates.h"
+
+extern _X_EXPORT DevPrivateKey fbOverlayGetScreenPrivateKey(void);
+
+#ifndef FB_OVERLAY_MAX
+#define FB_OVERLAY_MAX 2
+#endif
+
+typedef void (*fbOverlayPaintKeyProc) (DrawablePtr, RegionPtr, CARD32, int);
+
+typedef struct _fbOverlayLayer {
+ union {
+ struct {
+ void *pbits;
+ int width;
+ int depth;
+ } init;
+ struct {
+ PixmapPtr pixmap;
+ RegionRec region;
+ } run;
+ } u;
+ CARD32 key; /* special pixel value */
+} FbOverlayLayer;
+
+typedef struct _fbOverlayScrPriv {
+ int nlayers;
+ fbOverlayPaintKeyProc PaintKey;
+ miCopyProc CopyWindow;
+ FbOverlayLayer layer[FB_OVERLAY_MAX];
+} FbOverlayScrPrivRec, *FbOverlayScrPrivPtr;
+
+#define fbOverlayGetScrPriv(s) \
+ dixLookupPrivate(&(s)->devPrivates, fbOverlayGetScreenPrivateKey())
+
+extern _X_EXPORT Bool
+
+fbOverlayFinishScreenInit(ScreenPtr pScreen,
+ void *pbits1,
+ void *pbits2,
+ int xsize,
+ int ysize,
+ int dpix,
+ int dpiy,
+ int width1,
+ int width2,
+ int bpp1, int bpp2, int depth1, int depth2);
+
+#endif /* _FBOVERLAY_H_ */
diff --git a/prebuilt/xlibre/usr/include/xorg/fbpict.h b/prebuilt/xlibre/usr/include/xorg/fbpict.h
new file mode 100644
index 0000000..a35765b
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/fbpict.h
@@ -0,0 +1,45 @@
+/*
+ *
+ * Copyright © 2000 Keith Packard, member of The XFree86 Project, 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 Keith Packard not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. Keith Packard makes no
+ * representations about the suitability of this software for any purpose. It
+ * is provided "as is" without express or implied warranty.
+ *
+ * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL KEITH PACKARD 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 _FBPICT_H_
+#define _FBPICT_H_
+
+#include "fb.h"
+
+/* fbpict.c */
+extern _X_EXPORT void
+fbComposite(CARD8 op,
+ PicturePtr pSrc,
+ PicturePtr pMask,
+ PicturePtr pDst,
+ INT16 xSrc,
+ INT16 ySrc,
+ INT16 xMask,
+ INT16 yMask, INT16 xDst, INT16 yDst, CARD16 width, CARD16 height);
+
+/* fbtrap.c */
+
+extern _X_EXPORT void
+fbAddTraps(PicturePtr pPicture,
+ INT16 xOff, INT16 yOff, int ntrap, xTrap * traps);
+
+#endif /* _FBPICT_H_ */
diff --git a/prebuilt/xlibre/usr/include/xorg/fbrop.h b/prebuilt/xlibre/usr/include/xorg/fbrop.h
new file mode 100644
index 0000000..c21faca
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/fbrop.h
@@ -0,0 +1,129 @@
+/*
+ * Copyright © 1998 Keith Packard
+ *
+ * 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 Keith Packard not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. Keith Packard makes no
+ * representations about the suitability of this software for any purpose. It
+ * is provided "as is" without express or implied warranty.
+ *
+ * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL KEITH PACKARD 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 _FBROP_H_
+#define _FBROP_H_
+
+#include
+
+typedef struct _mergeRopBits {
+ FbBits ca1, cx1, ca2, cx2;
+} FbMergeRopRec, *FbMergeRopPtr;
+
+extern _X_EXPORT const FbMergeRopRec FbMergeRopBits[16];
+
+#define FbDeclareMergeRop() FbBits _ca1, _cx1, _ca2, _cx2;
+#define FbDeclarePrebuiltMergeRop() FbBits _cca, _ccx;
+
+#define FbInitializeMergeRop(alu,pm) {\
+ const FbMergeRopRec *_bits; \
+ _bits = &FbMergeRopBits[(alu)]; \
+ _ca1 = _bits->ca1 & (pm); \
+ _cx1 = _bits->cx1 | ~(pm); \
+ _ca2 = _bits->ca2 & (pm); \
+ _cx2 = _bits->cx2 & (pm); \
+}
+
+#define FbDestInvarientRop(alu,pm) ((pm) == FB_ALLONES && \
+ (((alu) >> 1 & 5) == ((alu) & 5)))
+
+#define FbDestInvarientMergeRop() (_ca1 == 0 && _cx1 == 0)
+
+/* AND has higher precedence than XOR */
+
+#define FbDoMergeRop(src, dst) \
+ (((dst) & (((src) & _ca1) ^ _cx1)) ^ (((src) & _ca2) ^ _cx2))
+
+#define FbDoDestInvarientMergeRop(src) (((src) & _ca2) ^ _cx2)
+
+#define FbDoMaskMergeRop(src, dst, mask) \
+ (((dst) & ((((src) & _ca1) ^ _cx1) | ~(mask))) ^ ((((src) & _ca2) ^ _cx2) & (mask)))
+
+#define FbDoLeftMaskByteMergeRop(dst, src, lb, l) { \
+ FbBits __xor = ((src) & _ca2) ^ _cx2; \
+ FbDoLeftMaskByteRRop((dst),(lb),(l),((src) & _ca1) ^ _cx1,__xor); \
+}
+
+#define FbDoRightMaskByteMergeRop(dst, src, rb, r) { \
+ FbBits __xor = ((src) & _ca2) ^ _cx2; \
+ FbDoRightMaskByteRRop((dst),(rb),(r),((src) & _ca1) ^ _cx1,__xor); \
+}
+
+#define FbDoRRop(dst, and, xor) (((dst) & (and)) ^ (xor))
+
+#define FbDoMaskRRop(dst, and, xor, mask) \
+ (((dst) & ((and) | ~(mask))) ^ ((xor) & (mask)))
+
+/*
+ * Take a single bit (0 or 1) and generate a full mask
+ */
+#define fbFillFromBit(b,t) (~((t) ((b) & 1)-1))
+
+#define fbXorT(rop,fg,pm,t) ((((fg) & fbFillFromBit((rop) >> 1,t)) | \
+ (~(fg) & fbFillFromBit((rop) >> 3,t))) & (pm))
+
+#define fbAndT(rop,fg,pm,t) ((((fg) & fbFillFromBit ((rop) ^ ((rop)>>1),t)) | \
+ (~(fg) & fbFillFromBit(((rop)>>2) ^ ((rop)>>3),t))) | \
+ ~(pm))
+
+#define fbXor(rop,fg,pm) fbXorT((rop),(fg),(pm),FbBits)
+
+#define fbAnd(rop,fg,pm) fbAndT((rop),(fg),(pm),FbBits)
+
+#define fbXorStip(rop,fg,pm) fbXorT((rop),(fg),(pm),FbStip)
+
+#define fbAndStip(rop,fg,pm) fbAndT((rop),(fg),(pm),FbStip)
+
+/*
+ * Stippling operations;
+ */
+
+#define FbStippleRRop(dst, b, fa, fx, ba, bx) \
+ (FbDoRRop((dst), (fa), (fx)) & (b)) | (FbDoRRop((dst), (ba), (bx)) & ~(b))
+
+#define FbStippleRRopMask(dst, b, fa, fx, ba, bx, m) \
+ (FbDoMaskRRop((dst), (fa), (fx), (m)) & (b)) | (FbDoMaskRRop((dst), (ba), (bx), (m)) & ~(b))
+
+#define FbDoLeftMaskByteStippleRRop(dst, b, fa, fx, ba, bx, lb, l) { \
+ FbBits __xor = ((fx) & (b)) | ((bx) & ~(b)); \
+ FbDoLeftMaskByteRRop((dst), (lb), (l), ((fa) & (b)) | ((ba) & ~(b)), __xor); \
+}
+
+#define FbDoRightMaskByteStippleRRop(dst, b, fa, fx, ba, bx, rb, r) { \
+ FbBits __xor = ((fx) & (b)) | ((bx) & ~(b)); \
+ FbDoRightMaskByteRRop((dst), (rb), (r), ((fa) & (b)) | ((ba) & ~(b)), __xor); \
+}
+
+#define FbOpaqueStipple(b, fg, bg) (((fg) & (b)) | ((bg) & ~(b)))
+
+/*
+ * Compute rop for using tile code for 1-bit dest stipples; modifies
+ * existing rop to flip depending on pixel values
+ */
+#define FbStipple1RopPick(alu,b) (((alu) >> (2 - (((b) & 1) << 1))) & 3)
+
+#define FbOpaqueStipple1Rop(alu,fg,bg) (FbStipple1RopPick((alu),(fg)) | \
+ (FbStipple1RopPick((alu),(bg)) << 2))
+
+#define FbStipple1Rop(alu,fg) (FbStipple1RopPick((alu),(fg)) | 4)
+
+#endif
diff --git a/prebuilt/xlibre/usr/include/xorg/fd_notify.h b/prebuilt/xlibre/usr/include/xorg/fd_notify.h
new file mode 100644
index 0000000..67a47c8
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/fd_notify.h
@@ -0,0 +1,15 @@
+/* SPDX-License-Identifier: X11 OR MIT OR AGPL-3.0-or-later
+ *
+ * Copyright © 2024 Enrico Weigelt, metux IT consult
+ *
+ * @brief: defines needed for SetNotifyFd() as well as ospoll
+ */
+#ifndef _XSERVER_INCLUDE_FDNOTIFY_H
+#define _XSERVER_INCLUDE_FDNOTIFY_H
+
+#define X_NOTIFY_NONE 0x0
+#define X_NOTIFY_READ 0x1
+#define X_NOTIFY_WRITE 0x2
+#define X_NOTIFY_ERROR 0x4 /* don't need to select for, always reported */
+
+#endif /* _XSERVER_INCLUDE_FDNOTIFY_H */
diff --git a/prebuilt/xlibre/usr/include/xorg/fourcc.h b/prebuilt/xlibre/usr/include/xorg/fourcc.h
new file mode 100644
index 0000000..97885e5
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/fourcc.h
@@ -0,0 +1,218 @@
+
+/*
+ * Copyright (c) 2000-2003 by The XFree86 Project, 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.
+ *
+ * Except as contained in this notice, the name of the copyright holder(s)
+ * and author(s) shall not be used in advertising or otherwise to promote
+ * the sale, use or other dealings in this Software without prior written
+ * authorization from the copyright holder(s) and author(s).
+ */
+
+/*
+ This header file contains listings of STANDARD guids for video formats.
+ Please do not place non-registered, or incomplete entries in this file.
+ A list of some popular fourcc's are at: http://www.webartz.com/fourcc/
+ For an explanation of fourcc <-> guid mappings see RFC2361.
+*/
+
+#ifndef _XF86_FOURCC_H_
+#define _XF86_FOURCC_H_ 1
+
+#define FOURCC_YUY2 0x32595559
+#define XVIMAGE_YUY2 \
+ { \
+ FOURCC_YUY2, \
+ XvYUV, \
+ LSBFirst, \
+ {'Y','U','Y','2', \
+ 0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71}, \
+ 16, \
+ XvPacked, \
+ 1, \
+ 0, 0, 0, 0, \
+ 8, 8, 8, \
+ 1, 2, 2, \
+ 1, 1, 1, \
+ {'Y','U','Y','V', \
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, \
+ XvTopToBottom \
+ }
+
+#define FOURCC_YV12 0x32315659
+#define XVIMAGE_YV12 \
+ { \
+ FOURCC_YV12, \
+ XvYUV, \
+ LSBFirst, \
+ {'Y','V','1','2', \
+ 0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71}, \
+ 12, \
+ XvPlanar, \
+ 3, \
+ 0, 0, 0, 0, \
+ 8, 8, 8, \
+ 1, 2, 2, \
+ 1, 2, 2, \
+ {'Y','V','U', \
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, \
+ XvTopToBottom \
+ }
+
+#define FOURCC_I420 0x30323449
+#define XVIMAGE_I420 \
+ { \
+ FOURCC_I420, \
+ XvYUV, \
+ LSBFirst, \
+ {'I','4','2','0', \
+ 0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71}, \
+ 12, \
+ XvPlanar, \
+ 3, \
+ 0, 0, 0, 0, \
+ 8, 8, 8, \
+ 1, 2, 2, \
+ 1, 2, 2, \
+ {'Y','U','V', \
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, \
+ XvTopToBottom \
+ }
+
+#define FOURCC_UYVY 0x59565955
+#define XVIMAGE_UYVY \
+ { \
+ FOURCC_UYVY, \
+ XvYUV, \
+ LSBFirst, \
+ {'U','Y','V','Y', \
+ 0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71}, \
+ 16, \
+ XvPacked, \
+ 1, \
+ 0, 0, 0, 0, \
+ 8, 8, 8, \
+ 1, 2, 2, \
+ 1, 1, 1, \
+ {'U','Y','V','Y', \
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, \
+ XvTopToBottom \
+ }
+
+#define FOURCC_IA44 0x34344149
+#define XVIMAGE_IA44 \
+ { \
+ FOURCC_IA44, \
+ XvYUV, \
+ LSBFirst, \
+ {'I','A','4','4', \
+ 0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71}, \
+ 8, \
+ XvPacked, \
+ 1, \
+ 0, 0, 0, 0, \
+ 8, 8, 8, \
+ 1, 1, 1, \
+ 1, 1, 1, \
+ {'A','I', \
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, \
+ XvTopToBottom \
+ }
+
+#define FOURCC_AI44 0x34344941
+#define XVIMAGE_AI44 \
+ { \
+ FOURCC_AI44, \
+ XvYUV, \
+ LSBFirst, \
+ {'A','I','4','4', \
+ 0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71}, \
+ 8, \
+ XvPacked, \
+ 1, \
+ 0, 0, 0, 0, \
+ 8, 8, 8, \
+ 1, 1, 1, \
+ 1, 1, 1, \
+ {'I','A', \
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, \
+ XvTopToBottom \
+ }
+
+#define FOURCC_NV12 0x3231564e
+#define XVIMAGE_NV12 \
+ { \
+ FOURCC_NV12, \
+ XvYUV, \
+ LSBFirst, \
+ {'N','V','1','2', \
+ 0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71}, \
+ 12, \
+ XvPlanar, \
+ 2, \
+ 0, 0, 0, 0, \
+ 8, 8, 8, \
+ 1, 2, 2, \
+ 1, 2, 2, \
+ {'Y','U','V', \
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, \
+ XvTopToBottom \
+ }
+
+#define FOURCC_RGBA32 0x41424752
+#define XVIMAGE_RGB32 \
+ { \
+ FOURCC_RGBA32, \
+ XvRGB, \
+ LSBFirst, \
+ {'R','A','2','4', \
+ 0x00, 0x00, 0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71}, \
+ 32, \
+ XvPacked, \
+ 1, \
+ 32, 0xff0000, 0xff00, 0xff, \
+ 0, 0, 0, \
+ 0, 0, 0, \
+ 0, 0, 0, \
+ {0,0,0,0, \
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, \
+ 0 \
+ }
+
+#define FOURCC_RGB565 0x36314752
+#define XVIMAGE_RGB565 \
+ { \
+ FOURCC_RGB565, \
+ XvRGB, \
+ LSBFirst, \
+ {'R','G','1','6', \
+ 0x00, 0x00, 0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71}, \
+ 16, \
+ XvPacked, \
+ 1, \
+ 16, 0xf800, 0x7e0, 0x1f, \
+ 0, 0, 0, \
+ 0, 0, 0, \
+ 0, 0, 0, \
+ {0,0,0,0, \
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, \
+ 0 \
+ }
+#endif /* _XF86_FOURCC_H_ */
diff --git a/prebuilt/xlibre/usr/include/xorg/gc.h b/prebuilt/xlibre/usr/include/xorg/gc.h
new file mode 100644
index 0000000..66e27bc
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/gc.h
@@ -0,0 +1,96 @@
+/***********************************************************
+
+Copyright 1987, 1998 The Open Group
+
+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.
+
+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
+OPEN GROUP 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.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+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 Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL 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 GC_H
+#define GC_H
+
+#include /* for GContext, Mask */
+#include /* for Bool */
+#include
+#include "screenint.h" /* for ScreenPtr */
+#include "pixmap.h" /* for DrawablePtr */
+
+/* clientClipType field in GC */
+#define CT_NONE 0
+#define CT_PIXMAP 1
+#define CT_REGION 2
+#define CT_UNSORTED 6
+#define CT_YSORTED 10
+#define CT_YXSORTED 14
+#define CT_YXBANDED 18
+
+#define GC_CHANGE_SERIAL_BIT (((unsigned long)1)<<31)
+
+#define DRAWABLE_SERIAL_BITS (~(GC_CHANGE_SERIAL_BIT))
+
+#define MAX_SERIAL_NUM (1L<<28)
+
+#define NEXT_SERIAL_NUMBER ((++globalSerialNumber) > MAX_SERIAL_NUM ? \
+ (globalSerialNumber = 1): globalSerialNumber)
+
+typedef struct _GCInterest *GCInterestPtr;
+typedef struct _GC *GCPtr;
+typedef struct _GCOps *GCOpsPtr;
+
+extern _X_EXPORT void ValidateGC(DrawablePtr /*pDraw */ ,
+ GCPtr /*pGC */ );
+
+typedef union {
+ CARD32 val;
+ void *ptr;
+} ChangeGCVal, *ChangeGCValPtr;
+
+extern _X_EXPORT int ChangeGC(ClientPtr /*client */ ,
+ GCPtr /*pGC */ ,
+ BITS32 /*mask */ ,
+ ChangeGCValPtr /*pCGCV */ );
+
+extern _X_EXPORT GCPtr GetScratchGC(unsigned /*depth */ ,
+ ScreenPtr /*pScreen */ );
+
+extern _X_EXPORT void FreeScratchGC(GCPtr /*pGC */ );
+
+#endif /* GC_H */
diff --git a/prebuilt/xlibre/usr/include/xorg/gcstruct.h b/prebuilt/xlibre/usr/include/xorg/gcstruct.h
new file mode 100644
index 0000000..9e3c53d
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/gcstruct.h
@@ -0,0 +1,286 @@
+/***********************************************************
+
+Copyright 1987, 1998 The Open Group
+
+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.
+
+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
+OPEN GROUP 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.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+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 Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL 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 GCSTRUCT_H
+#define GCSTRUCT_H
+
+#include
+
+#include "gc.h"
+#include "pixmap.h"
+#include "regionstr.h"
+#include "screenint.h"
+#include "privates.h"
+
+#ifndef _XTYPEDEF_CHARINFOPTR
+typedef struct _CharInfo *CharInfoPtr; /* also in fonts/include/font.h */
+#define _XTYPEDEF_CHARINFOPTR
+#endif
+
+/*
+ * functions which modify the state of the GC
+ */
+
+typedef struct _GCFuncs {
+ void (*ValidateGC) (GCPtr /*pGC */ ,
+ unsigned long /*stateChanges */ ,
+ DrawablePtr /*pDrawable */ );
+
+ void (*ChangeGC) (GCPtr /*pGC */ ,
+ unsigned long /*mask */ );
+
+ void (*CopyGC) (GCPtr /*pGCSrc */ ,
+ unsigned long /*mask */ ,
+ GCPtr /*pGCDst */ );
+
+ void (*DestroyGC) (GCPtr /*pGC */ );
+
+ void (*ChangeClip) (GCPtr pGC,
+ int type,
+ void *pvalue,
+ int nrects);
+
+ void (*DestroyClip) (GCPtr /*pGC */ );
+
+ void (*CopyClip) (GCPtr /*pgcDst */ ,
+ GCPtr /*pgcSrc */ );
+} GCFuncs;
+
+/*
+ * graphics operations invoked through a GC
+ */
+
+typedef struct _GCOps {
+ void (*FillSpans) (DrawablePtr /*pDrawable */ ,
+ GCPtr /*pGC */ ,
+ int /*nInit */ ,
+ DDXPointPtr /*pptInit */ ,
+ int * /*pwidthInit */ ,
+ int /*fSorted */ );
+
+ void (*SetSpans) (DrawablePtr /*pDrawable */ ,
+ GCPtr /*pGC */ ,
+ char * /*psrc */ ,
+ DDXPointPtr /*ppt */ ,
+ int * /*pwidth */ ,
+ int /*nspans */ ,
+ int /*fSorted */ );
+
+ void (*PutImage) (DrawablePtr /*pDrawable */ ,
+ GCPtr /*pGC */ ,
+ int /*depth */ ,
+ int /*x */ ,
+ int /*y */ ,
+ int /*w */ ,
+ int /*h */ ,
+ int /*leftPad */ ,
+ int /*format */ ,
+ char * /*pBits */ );
+
+ RegionPtr (*CopyArea) (DrawablePtr /*pSrc */ ,
+ DrawablePtr /*pDst */ ,
+ GCPtr /*pGC */ ,
+ int /*srcx */ ,
+ int /*srcy */ ,
+ int /*w */ ,
+ int /*h */ ,
+ int /*dstx */ ,
+ int /*dsty */ );
+
+ RegionPtr (*CopyPlane) (DrawablePtr /*pSrcDrawable */ ,
+ DrawablePtr /*pDstDrawable */ ,
+ GCPtr /*pGC */ ,
+ int /*srcx */ ,
+ int /*srcy */ ,
+ int /*width */ ,
+ int /*height */ ,
+ int /*dstx */ ,
+ int /*dsty */ ,
+ unsigned long /*bitPlane */ );
+ void (*PolyPoint) (DrawablePtr /*pDrawable */ ,
+ GCPtr /*pGC */ ,
+ int /*mode */ ,
+ int /*npt */ ,
+ DDXPointPtr /*pptInit */ );
+
+ void (*Polylines) (DrawablePtr /*pDrawable */ ,
+ GCPtr /*pGC */ ,
+ int /*mode */ ,
+ int /*npt */ ,
+ DDXPointPtr /*pptInit */ );
+
+ void (*PolySegment) (DrawablePtr /*pDrawable */ ,
+ GCPtr /*pGC */ ,
+ int /*nseg */ ,
+ xSegment * /*pSegs */ );
+
+ void (*PolyRectangle) (DrawablePtr /*pDrawable */ ,
+ GCPtr /*pGC */ ,
+ int /*nrects */ ,
+ xRectangle * /*pRects */ );
+
+ void (*PolyArc) (DrawablePtr /*pDrawable */ ,
+ GCPtr /*pGC */ ,
+ int /*narcs */ ,
+ xArc * /*parcs */ );
+
+ void (*FillPolygon) (DrawablePtr /*pDrawable */ ,
+ GCPtr /*pGC */ ,
+ int /*shape */ ,
+ int /*mode */ ,
+ int /*count */ ,
+ DDXPointPtr /*pPts */ );
+
+ void (*PolyFillRect) (DrawablePtr /*pDrawable */ ,
+ GCPtr /*pGC */ ,
+ int /*nrectFill */ ,
+ xRectangle * /*prectInit */ );
+
+ void (*PolyFillArc) (DrawablePtr /*pDrawable */ ,
+ GCPtr /*pGC */ ,
+ int /*narcs */ ,
+ xArc * /*parcs */ );
+
+ int (*PolyText8) (DrawablePtr /*pDrawable */ ,
+ GCPtr /*pGC */ ,
+ int /*x */ ,
+ int /*y */ ,
+ int /*count */ ,
+ char * /*chars */ );
+
+ int (*PolyText16) (DrawablePtr /*pDrawable */ ,
+ GCPtr /*pGC */ ,
+ int /*x */ ,
+ int /*y */ ,
+ int /*count */ ,
+ unsigned short * /*chars */ );
+
+ void (*ImageText8) (DrawablePtr /*pDrawable */ ,
+ GCPtr /*pGC */ ,
+ int /*x */ ,
+ int /*y */ ,
+ int /*count */ ,
+ char * /*chars */ );
+
+ void (*ImageText16) (DrawablePtr /*pDrawable */ ,
+ GCPtr /*pGC */ ,
+ int /*x */ ,
+ int /*y */ ,
+ int /*count */ ,
+ unsigned short * /*chars */ );
+
+ void (*ImageGlyphBlt) (DrawablePtr pDrawable,
+ GCPtr pGC,
+ int x,
+ int y,
+ unsigned int nglyph,
+ CharInfoPtr *ppci,
+ void *pglyphBase);
+
+ void (*PolyGlyphBlt) (DrawablePtr pDrawable,
+ GCPtr pGC,
+ int x,
+ int y,
+ unsigned int nglyph,
+ CharInfoPtr *ppci,
+ void *pglyphBase);
+
+ void (*PushPixels) (GCPtr /*pGC */ ,
+ PixmapPtr /*pBitMap */ ,
+ DrawablePtr /*pDst */ ,
+ int /*w */ ,
+ int /*h */ ,
+ int /*x */ ,
+ int /*y */ );
+} GCOps;
+
+/* there is padding in the bit fields because the Sun compiler doesn't
+ * force alignment to 32-bit boundaries. losers.
+ */
+typedef struct _GC {
+ ScreenPtr pScreen;
+ unsigned char depth;
+ unsigned char alu;
+ unsigned short lineWidth;
+ unsigned short dashOffset;
+ unsigned short numInDashList;
+ unsigned char *dash;
+ unsigned int lineStyle:2;
+ unsigned int capStyle:2;
+ unsigned int joinStyle:2;
+ unsigned int fillStyle:2;
+ unsigned int fillRule:1;
+ unsigned int arcMode:1;
+ unsigned int subWindowMode:1;
+ unsigned int graphicsExposures:1;
+ unsigned int miTranslate:1; /* should mi things translate? */
+ unsigned int tileIsPixel:1; /* tile is solid pixel */
+ unsigned int fExpose:1; /* Call exposure handling */
+ unsigned int freeCompClip:1; /* Free composite clip */
+ unsigned int scratch_inuse:1; /* is this GC in a pool for reuse? */
+ unsigned int unused:15; /* see comment above */
+ unsigned int planemask;
+ unsigned int fgPixel;
+ unsigned int bgPixel;
+ /*
+ * alas -- both tile and stipple must be here as they
+ * are independently specifiable
+ */
+ PixUnion tile;
+ PixmapPtr stipple;
+ xPoint patOrg; /* origin for (tile, stipple) */
+ xPoint clipOrg;
+ struct _Font *font;
+ RegionPtr clientClip;
+ unsigned int stateChanges; /* masked with GC_ */
+ unsigned int serialNumber;
+ const GCFuncs *funcs;
+ const GCOps *ops;
+ PrivateRec *devPrivates;
+ RegionPtr pCompositeClip;
+} GCRec;
+
+#endif /* GCSTRUCT_H */
diff --git a/prebuilt/xlibre/usr/include/xorg/glamor.h b/prebuilt/xlibre/usr/include/xorg/glamor.h
new file mode 100644
index 0000000..373de7c
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/glamor.h
@@ -0,0 +1,427 @@
+/*
+ * Copyright © 2008 Intel Corporation
+ *
+ * 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 (including the next
+ * paragraph) 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 AUTHORS OR COPYRIGHT HOLDERS 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.
+ *
+ * Authors:
+ * Eric Anholt
+ * Zhigang Gong
+ *
+ */
+
+#ifndef GLAMOR_H
+#define GLAMOR_H
+
+#include
+#include
+#include
+#include
+#include
+#ifdef GLAMOR_FOR_XORG
+#include
+#endif
+
+struct glamor_context;
+struct gbm_bo;
+struct gbm_device;
+
+/*
+ * glamor_pixmap_type : glamor pixmap's type.
+ * @MEMORY: pixmap is in memory.
+ * @TEXTURE_DRM: pixmap is in a texture created from a DRM buffer.
+ * @SEPARATE_TEXTURE: The texture is created from a DRM buffer, but
+ * the format is incompatible, so this type of pixmap
+ * will never fallback to DDX layer.
+ * @DRM_ONLY: pixmap is in a external DRM buffer.
+ * @TEXTURE_ONLY: pixmap is in an internal texture.
+ */
+typedef enum glamor_pixmap_type {
+ GLAMOR_MEMORY = 0, /* Newly calloc()ed pixmaps are memory. */
+ GLAMOR_TEXTURE_DRM,
+ GLAMOR_DRM_ONLY,
+ GLAMOR_TEXTURE_ONLY,
+} glamor_pixmap_type_t;
+
+typedef Bool (*GetDrawableModifiersFuncPtr) (DrawablePtr draw,
+ uint32_t format,
+ uint32_t *num_modifiers,
+ uint64_t **modifiers);
+
+#define GLAMOR_EGL_EXTERNAL_BUFFER 3
+#define GLAMOR_USE_EGL_SCREEN (1 << 0)
+#define GLAMOR_NO_DRI3 (1 << 1)
+#define GLAMOR_NO_RENDER_ACCEL (1 << 2)
+#define GLAMOR_VALID_FLAGS (GLAMOR_USE_EGL_SCREEN \
+ | GLAMOR_NO_DRI3 \
+ | GLAMOR_NO_RENDER_ACCEL)
+
+/* until we need geometry shaders GL3.1 should suffice. */
+#define GLAMOR_GL_CORE_VER_MAJOR 3
+#define GLAMOR_GL_CORE_VER_MINOR 1
+
+/* @glamor_init: Initialize glamor internal data structure.
+ *
+ * @screen: Current screen pointer.
+ * @flags: Please refer the flags description above.
+ *
+ * @GLAMOR_USE_EGL_SCREEN:
+ * If you are using EGL layer, then please set this bit
+ * on, otherwise, clear it.
+ *
+ * @GLAMOR_NO_DRI3
+ * Disable the built-in DRI3 support
+ *
+ * This function initializes necessary internal data structure
+ * for glamor. And before calling into this function, the OpenGL
+ * environment should be ready. Should be called before any real
+ * glamor rendering or texture allocation functions. And should
+ * be called after the DDX's screen initialization or at the last
+ * step of the DDX's screen initialization.
+ */
+extern _X_EXPORT Bool glamor_init(ScreenPtr screen, unsigned int flags);
+extern _X_EXPORT void glamor_fini(ScreenPtr screen);
+
+/* Returns is the initialized gl context is gles
+ * Must not be called before glamor_init
+ */
+extern _X_EXPORT Bool glamor_is_gles(ScreenPtr screen);
+
+/* This function is used to free the glamor private screen's
+ * resources. If the DDX driver is not set GLAMOR_USE_SCREEN,
+ * then, DDX need to call this function at proper stage, if
+ * it is the xorg DDX driver,then it should be called at free
+ * screen stage not the close screen stage. The reason is after
+ * call to this function, the xorg DDX may need to destroy the
+ * screen pixmap which must be a glamor pixmap and requires
+ * the internal data structure still exist at that time.
+ * Otherwise, the glamor internal structure will not be freed.*/
+
+extern _X_EXPORT uint32_t glamor_get_pixmap_texture(PixmapPtr pixmap);
+
+extern _X_EXPORT void glamor_clear_pixmap(PixmapPtr pixmap);
+
+extern _X_EXPORT void glamor_block_handler(ScreenPtr screen);
+
+extern _X_EXPORT PixmapPtr glamor_create_pixmap(ScreenPtr screen, int w, int h,
+ int depth, unsigned int usage);
+
+/* needed by Xrdp module */
+#define GLAMOR_CREATE_PIXMAP_CPU 0x100
+#define GLAMOR_CREATE_PIXMAP_FIXUP 0x101
+#define GLAMOR_CREATE_FBO_NO_FBO 0x103
+#define GLAMOR_CREATE_NO_LARGE 0x105
+#define GLAMOR_CREATE_PIXMAP_NO_TEXTURE 0x106
+#define GLAMOR_CREATE_FORMAT_CBCR 0x107
+
+/* @glamor_egl_exchange_buffers: Exchange the underlying buffers(KHR image,fbo).
+ *
+ * @front: front pixmap.
+ * @back: back pixmap.
+ *
+ * Used by the DRI2 page flip. This function will exchange the KHR images and
+ * fbos of the two pixmaps.
+ * */
+extern _X_EXPORT void glamor_egl_exchange_buffers(PixmapPtr front,
+ PixmapPtr back);
+
+extern _X_EXPORT struct gbm_device *glamor_egl_get_gbm_device(ScreenPtr screen);
+
+/* @glamor_supports_pixmap_import_export: Returns whether
+ * glamor_fds_from_pixmap(), glamor_name_from_pixmap(), and
+ * glamor_pixmap_from_fds() are supported.
+ *
+ * @screen: Current screen pointer.
+ *
+ * To have DRI3 support enabled, glamor and glamor_egl need to be
+ * initialized. glamor also has to be compiled with gbm support.
+ *
+ * The EGL layer needs to have the following extensions working:
+ *
+ * .EGL_KHR_surfaceless_context
+ * */
+extern _X_EXPORT Bool glamor_supports_pixmap_import_export(ScreenPtr screen);
+
+/* @glamor_fds_from_pixmap: Get a dma-buf fd from a pixmap.
+ *
+ * @screen: Current screen pointer.
+ * @pixmap: The pixmap from which we want the fd.
+ * @fds, @strides, @offsets: Pointers to fill info of each plane.
+ * @modifier: Pointer to fill the modifier of the buffer.
+ *
+ * the pixmap and the buffer associated by the fds will share the same
+ * content. The caller is responsible to close the returned file descriptors.
+ * Returns the number of planes, -1 on error.
+ *
+ * Currently just exported for Xrdp's virtual driver - real HW drivers
+ * usually shouldn't need this.
+ * */
+_X_EXPORT int glamor_fds_from_pixmap(ScreenPtr screen,
+ PixmapPtr pixmap,
+ int *fds,
+ uint32_t *strides,
+ uint32_t *offsets,
+ uint64_t *modifier);
+
+/* @glamor_fd_from_pixmap: Get a dma-buf fd from a pixmap.
+ *
+ * @screen: Current screen pointer.
+ * @pixmap: The pixmap from which we want the fd.
+ * @stride, @size: Pointers to fill the stride and size of the
+ * buffer associated to the fd.
+ *
+ * the pixmap and the buffer associated by the fd will share the same
+ * content.
+ * Returns the fd on success, -1 on error.
+ * */
+extern _X_EXPORT int glamor_fd_from_pixmap(ScreenPtr screen,
+ PixmapPtr pixmap,
+ CARD16 *stride, CARD32 *size);
+
+/* @glamor_shareable_fd_from_pixmap: Get a dma-buf fd suitable for sharing
+ * with other GPUs from a pixmap.
+ *
+ * @screen: Current screen pointer.
+ * @pixmap: The pixmap from which we want the fd.
+ * @stride, @size: Pointers to fill the stride and size of the
+ * buffer associated to the fd.
+ *
+ * The returned fd will point to a buffer which is suitable for sharing
+ * across GPUs (not using GPU specific tiling).
+ * The pixmap and the buffer associated by the fd will share the same
+ * content.
+ * The pixmap's stride may be modified by this function.
+ * Returns the fd on success, -1 on error.
+ * */
+extern _X_EXPORT int glamor_shareable_fd_from_pixmap(ScreenPtr screen,
+ PixmapPtr pixmap,
+ CARD16 *stride,
+ CARD32 *size);
+
+/**
+ * @glamor_name_from_pixmap: Gets a gem name from a pixmap.
+ *
+ * @pixmap: The pixmap from which we want the gem name.
+ *
+ * the pixmap and the buffer associated by the gem name will share the
+ * same content. This function can be used by the DDX to support DRI2,
+ * and needs the same set of buffer export GL extensions as DRI3
+ * support.
+ *
+ * Returns the name on success, -1 on error.
+ * */
+extern _X_EXPORT int glamor_name_from_pixmap(PixmapPtr pixmap,
+ CARD16 *stride, CARD32 *size);
+
+/* @glamor_gbm_bo_from_pixmap: Get a GBM bo from a pixmap.
+ *
+ * @screen: Current screen pointer.
+ * @pixmap: The pixmap from which we want the fd.
+ * @stride, @size: Pointers to fill the stride and size of the
+ * buffer associated to the fd.
+ *
+ * the pixmap and the buffer represented by the gbm_bo will share the same
+ * content.
+ *
+ * Returns the gbm_bo on success, NULL on error.
+ * */
+extern _X_EXPORT struct gbm_bo *glamor_gbm_bo_from_pixmap(ScreenPtr screen,
+ PixmapPtr pixmap);
+
+/* @glamor_pixmap_from_fds: Creates a pixmap to wrap a dma-buf fds.
+ *
+ * @screen: Current screen pointer.
+ * @num_fds: Number of fds to import
+ * @fds: The dma-buf fds to import.
+ * @width: The width of the buffers.
+ * @height: The height of the buffers.
+ * @stride: The stride of the buffers.
+ * @depth: The depth of the buffers.
+ * @bpp: The bpp of the buffers.
+ * @modifier: The modifier of the buffers.
+ *
+ * Returns a valid pixmap if the import succeeded, else NULL.
+ *
+ * Currently just exported for Xrdp's virtual driver - real HW drivers
+ * usually shouldn't need this.
+ * */
+_X_EXPORT PixmapPtr glamor_pixmap_from_fds(ScreenPtr screen,
+ CARD8 num_fds,
+ const int *fds,
+ CARD16 width,
+ CARD16 height,
+ const CARD32 *strides,
+ const CARD32 *offsets,
+ CARD8 depth,
+ CARD8 bpp,
+ uint64_t modifier);
+
+/* @glamor_pixmap_from_fd: Creates a pixmap to wrap a dma-buf fd.
+ *
+ * @screen: Current screen pointer.
+ * @fd: The dma-buf fd to import.
+ * @width: The width of the buffer.
+ * @height: The height of the buffer.
+ * @stride: The stride of the buffer.
+ * @depth: The depth of the buffer.
+ * @bpp: The bpp of the buffer.
+ *
+ * Returns a valid pixmap if the import succeeded, else NULL.
+ * */
+extern _X_EXPORT PixmapPtr glamor_pixmap_from_fd(ScreenPtr screen,
+ int fd,
+ CARD16 width,
+ CARD16 height,
+ CARD16 stride,
+ CARD8 depth,
+ CARD8 bpp);
+
+/* @glamor_back_pixmap_from_fd: Backs an existing pixmap with a dma-buf fd.
+ *
+ * @pixmap: Pixmap to change backing for
+ * @fd: The dma-buf fd to import.
+ * @width: The width of the buffer.
+ * @height: The height of the buffer.
+ * @stride: The stride of the buffer.
+ * @depth: The depth of the buffer.
+ * @bpp: The number of bpp of the buffer.
+ *
+ * Returns TRUE if successful, FALSE on failure.
+ * */
+extern _X_EXPORT Bool glamor_back_pixmap_from_fd(PixmapPtr pixmap,
+ int fd,
+ CARD16 width,
+ CARD16 height,
+ CARD16 stride,
+ CARD8 depth,
+ CARD8 bpp);
+
+/* for xorgrdp */
+_X_EXPORT Bool glamor_get_formats(ScreenPtr screen,
+ CARD32 *num_formats,
+ CARD32 **formats);
+
+/* for xorgrdp */
+_X_EXPORT Bool glamor_get_modifiers(ScreenPtr screen,
+ uint32_t format,
+ uint32_t *num_modifiers,
+ uint64_t **modifiers);
+
+/* for xorgrdp */
+_X_EXPORT Bool glamor_get_drawable_modifiers(DrawablePtr draw,
+ uint32_t format,
+ uint32_t *num_modifiers,
+ uint64_t **modifiers);
+
+extern _X_EXPORT void glamor_set_drawable_modifiers_func(ScreenPtr screen,
+ GetDrawableModifiersFuncPtr func);
+
+
+#define GLAMOR_EGL_MODULE_NAME "glamoregl"
+
+/* @glamor_egl_init: Initialize EGL environment.
+ *
+ * @scrn: Current screen info pointer.
+ * @fd: Current drm fd.
+ *
+ * This function creates and initializes EGL contexts.
+ * Should be called from DDX's preInit function.
+ * Return TRUE if success, otherwise return FALSE.
+ * */
+extern _X_EXPORT Bool glamor_egl_init(ScrnInfoPtr scrn, int fd);
+
+enum {
+ GLAMOR_EGL_CAP_NONE = 0,
+ GLAMOR_EGL_CAP_DRI3 = 1 << 0,
+ GLAMOR_EGL_CAP_DRI3_IMPORT = 1 << 1,
+ GLAMOR_EGL_CAP_DRI3_EXPORT = 1 << 2,
+ GLAMOR_EGL_CAP_DRI3_SYNCOBJ = 1 << 3,
+ GLAMOR_EGL_CAP_TEXTURE_GBM_BO = 1 << 4,
+};
+
+#define GLAMOR_EGL_DEFAULT_CAPS (GLAMOR_EGL_CAP_DRI3 | GLAMOR_EGL_CAP_DRI3_IMPORT | GLAMOR_EGL_CAP_DRI3_EXPORT | GLAMOR_EGL_CAP_TEXTURE_GBM_BO)
+
+/* @glamor_egl_init2: Initialize EGL environment.
+ *
+ * @scrn: Current screen info pointer.
+ * @fd: Current drm fd.
+ * @caps: Some capabilities that glamor can have
+ *
+ * This function creates and initializes EGL contexts.
+ * Should be called from DDX's preInit function.
+ * Return TRUE if success, otherwise return FALSE.
+ *
+ * Unlike glamor_egl_init, this function returns true
+ * even if some capabilities are missing.
+ *
+ * If caps is not NULL, it is set to a bitmask
+ * describing what glamor capabilites are available.
+ * */
+extern _X_EXPORT Bool glamor_egl_init2(ScrnInfoPtr scrn, int fd, int *caps, int flags);
+
+extern _X_EXPORT Bool glamor_egl_init_textured_pixmap(ScreenPtr screen);
+
+/*
+ * @glamor_egl_create_textured_pixmap: Try to create a textured pixmap from
+ * a BO handle.
+ *
+ * @pixmap: The pixmap need to be processed.
+ * @handle: The BO's handle attached to this pixmap at DDX layer.
+ * @stride: Stride in bytes for this pixmap.
+ *
+ * This function try to create a texture from the handle and attach
+ * the texture to the pixmap , thus glamor can render to this pixmap
+ * as well. Return true if successful, otherwise return FALSE.
+ */
+extern _X_EXPORT Bool glamor_egl_create_textured_pixmap(PixmapPtr pixmap,
+ int handle, int stride);
+
+/*
+ * @glamor_egl_create_textured_pixmap_from_bo: Try to create a textured pixmap
+ * from a gbm_bo.
+ *
+ * @pixmap: The pixmap need to be processed.
+ * @bo: a pointer on a gbm_bo structure attached to this pixmap at DDX layer.
+ *
+ * This function is similar to glamor_egl_create_textured_pixmap.
+ */
+extern _X_EXPORT Bool
+ glamor_egl_create_textured_pixmap_from_gbm_bo(PixmapPtr pixmap,
+ struct gbm_bo *bo,
+ Bool used_modifiers);
+
+extern _X_EXPORT const char *glamor_egl_get_driver_name(ScreenPtr screen);
+
+
+extern _X_EXPORT int glamor_create_gc(GCPtr gc);
+
+extern _X_EXPORT void glamor_validate_gc(GCPtr gc, unsigned long changes,
+ DrawablePtr drawable);
+
+#define HAS_GLAMOR_DESTROY_GC 1
+
+extern _X_EXPORT void glamor_finish(ScreenPtr screen);
+#define HAS_GLAMOR_TEXT 1
+
+#ifdef GLAMOR_FOR_XORG
+extern _X_EXPORT XF86VideoAdaptorPtr glamor_xv_init(ScreenPtr pScreen,
+ int num_texture_ports);
+#endif
+
+#endif /* GLAMOR_H */
diff --git a/prebuilt/xlibre/usr/include/xorg/globals.h b/prebuilt/xlibre/usr/include/xorg/globals.h
new file mode 100644
index 0000000..ecb7b2b
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/globals.h
@@ -0,0 +1,13 @@
+#ifndef _XSERV_GLOBAL_H_
+#define _XSERV_GLOBAL_H_
+
+#include
+#include
+
+/* Global X server variables that are visible to mi, dix, os, and ddx */
+
+extern _X_EXPORT const char *defaultFontPath;
+extern _X_EXPORT int monitorResolution;
+extern _X_EXPORT int defaultColorVisualClass;
+
+#endif /* !_XSERV_GLOBAL_H_ */
diff --git a/prebuilt/xlibre/usr/include/xorg/glxvndabi.h b/prebuilt/xlibre/usr/include/xorg/glxvndabi.h
new file mode 100644
index 0000000..0767f2f
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/glxvndabi.h
@@ -0,0 +1,320 @@
+/*
+ * Copyright (c) 2016, NVIDIA CORPORATION.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and/or associated documentation files (the
+ * "Materials"), to deal in the Materials without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Materials, and to
+ * permit persons to whom the Materials are furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * unaltered in all copies or substantial portions of the Materials.
+ * Any additions, deletions, or changes to the original source files
+ * must be clearly indicated in accompanying documentation.
+ *
+ * If only executable code is distributed, then the accompanying
+ * documentation must state that "this software is based in part on the
+ * work of the Khronos Group."
+ *
+ * THE MATERIALS ARE 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 AUTHORS OR COPYRIGHT HOLDERS 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
+ * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+ */
+
+/**
+ * \file
+ *
+ * Defines the interface between the libglvnd server module and a vendor
+ * library.
+ *
+ * Each screen may have one vendor library assigned to it. The GLVND module
+ * will examine each GLX request to determine which screen it goes to, and then
+ * it will forward that request to whichever vendor is assigned to that screen.
+ *
+ * Each vendor library is represented by an opaque __GLXServerVendor handle.
+ * Display drivers are responsible for creating handles for its GLX
+ * implementations, and assigning those handles to each screen.
+ *
+ * The GLVND module keeps a list of callbacks, which are called from
+ * InitExtensions. Drivers should use that callback to assign a vendor
+ * handle to whichever screens they support.
+ *
+ * Additional notes about dispatching:
+ * - If a request has one or more GLXContextTag values, then the dispatch stub
+ * must ensure that all of the tags belong to the vendor that it forwards the
+ * request to. Otherwise, if a vendor library tries to look up the private
+ * data for the tag, it could get the data from another vendor and crash.
+ * - Following from the last point, if a request takes a GLXContextTag value,
+ * then the dispatch stub should use the tag to select a vendor. If the
+ * request takes two or more tags, then the vendor must ensure that they all
+ * map to the same vendor.
+ */
+
+#ifndef GLXVENDORABI_H
+#define GLXVENDORABI_H
+
+#include "xlibre_ptrtypes.h"
+
+#include
+#include
+#include
+
+/*!
+ * Current version of the ABI.
+ *
+ * This version number contains a major number in the high-order 16 bits, and
+ * a minor version number in the low-order 16 bits.
+ *
+ * The major version number is incremented when an interface change will break
+ * backwards compatibility with existing vendor libraries. The minor version
+ * number is incremented when there's a change but existing vendor libraries
+ * will still work.
+ */
+#define GLXSERVER_VENDOR_ABI_MAJOR_VERSION 0
+#define GLXSERVER_VENDOR_ABI_MINOR_VERSION 1
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+/**
+ * An opaque pointer representing a vendor library.
+ */
+typedef struct GlxServerVendorRec GlxServerVendor;
+
+typedef int (* GlxServerDispatchProc) (ClientPtr client);
+
+typedef struct GlxServerImportsRec GlxServerImports;
+
+/**
+ * Functions exported by libglvnd to the vendor library.
+ */
+typedef struct GlxServerExportsRec {
+ int majorVersion;
+ int minorVersion;
+
+ /**
+ * This callback is called during each server generation when the GLX
+ * extension is initialized.
+ *
+ * Drivers may create a __GLXServerVendor handle at any time, but may only
+ * assign a vendor to a screen from this callback.
+ *
+ * The callback is called with the ExtensionEntry pointer for the GLX
+ * extension.
+ */
+ CallbackListPtr *extensionInitCallback;
+
+ /**
+ * Allocates and zeroes a __GLXserverImports structure.
+ *
+ * Future versions of the GLVND interface may add optional members to the
+ * end of the __GLXserverImports struct. Letting the GLVND layer allocate
+ * the __GLXserverImports struct allows backward compatibility with
+ * existing drivers.
+ */
+ GlxServerImports * (* allocateServerImports) (void);
+
+ /**
+ * Frees a __GLXserverImports structure that was allocated with
+ * \c allocateServerImports.
+ */
+ void (* freeServerImports) (GlxServerImports *imports);
+
+ /**
+ * Creates a new vendor library handle.
+ */
+ GlxServerVendor * (* createVendor) (const GlxServerImports *imports);
+
+ /**
+ * Destroys a vendor library handle.
+ *
+ * This function may not be called while the vendor handle is assigned to a
+ * screen, but it may be called from the __GLXserverImports::extensionCloseDown
+ * callback.
+ */
+ void (* destroyVendor) (GlxServerVendor *vendor);
+
+ /**
+ * Sets the vendor library to use for a screen.
+ *
+ * This function should be called from the screen's CreateScreenResources
+ * callback.
+ */
+ Bool (* setScreenVendor) (ScreenPtr screen, GlxServerVendor *vendor);
+
+
+ /**
+ * Adds an entry to the XID map.
+ *
+ * This mapping is used to dispatch requests based on an XID.
+ *
+ * Client-generated XID's (contexts, drawables, etc) must be added to the
+ * map by the dispatch stub.
+ *
+ * XID's that are generated in the server should be added by the vendor
+ * library.
+ *
+ * Vendor libraries are responsible for keeping track of any additional
+ * data they need for the XID's.
+ *
+ * Note that adding GLXFBConfig ID's appears to be unnecessary -- every GLX
+ * request I can find that takes a GLXFBConfig also takes a screen number.
+ *
+ * \param id The XID to add to the map. The XID must not already be in the
+ * map.
+ * \param vendor The vendor library to associate with \p id.
+ * \return True on success, or False on failure.
+ */
+ Bool (* addXIDMap) (XID id, GlxServerVendor *vendor);
+
+ /**
+ * Returns the vendor and data for an XID, as added with \c addXIDMap.
+ *
+ * If \p id wasn't added with \c addXIDMap (for example, if it's a regular
+ * X window), then libglvnd will try to look it up as a drawable and return
+ * the vendor for whatever screen it's on.
+ *
+ * \param id The XID to look up.
+ * \return The vendor that owns the XID, or \c NULL if no matching vendor
+ * was found.
+ */
+ GlxServerVendor * (* getXIDMap) (XID id);
+
+ /**
+ * Removes an entry from the XID map.
+ */
+ void (* removeXIDMap) (XID id);
+
+ /**
+ * Looks up a context tag.
+ *
+ * Context tags are created and managed by libglvnd to ensure that they're
+ * unique between vendors.
+ *
+ * \param client The client connection.
+ * \param tag The context tag.
+ * \return The vendor that owns the context tag, or \c NULL if the context
+ * tag is invalid.
+ */
+ GlxServerVendor * (* getContextTag)(ClientPtr client, GLXContextTag tag);
+
+ /**
+ * Assigns a pointer to vendor-private data for a context tag.
+ *
+ * Since the tag values are assigned by GLVND, vendors can use this
+ * function to store any private data they need for a context tag.
+ *
+ * \param client The client connection.
+ * \param tag The context tag.
+ * \param data An arbitrary pointer value.
+ */
+ Bool (* setContextTagPrivate)(ClientPtr client, GLXContextTag tag, void *data);
+
+ /**
+ * Returns the private data pointer that was assigned from
+ * setContextTagPrivate.
+ *
+ * This function is safe to use in __GLXserverImports::makeCurrent to look
+ * up the old context private pointer.
+ *
+ * However, this function is not safe to use from a ClientStateCallback,
+ * because GLVND may have already deleted the tag by that point.
+ */
+ void * (* getContextTagPrivate)(ClientPtr client, GLXContextTag tag);
+
+ GlxServerVendor * (* getVendorForScreen) (ClientPtr client, ScreenPtr screen);
+
+ /**
+ * Forwards a request to a vendor library.
+ *
+ * \param vendor The vendor to send the request to.
+ * \param client The client.
+ */
+ int (* forwardRequest) (GlxServerVendor *vendor, ClientPtr client);
+
+ /**
+ * Sets the vendor library to use for a screen for a specific client.
+ *
+ * This function changes which vendor should handle GLX requests for a
+ * screen. Unlike \c setScreenVendor, this function can be called at any
+ * time, and only applies to requests from a single client.
+ *
+ * This function is available in GLXVND version 0.1 or later.
+ */
+ Bool (* setClientScreenVendor) (ClientPtr client, ScreenPtr screen, GlxServerVendor *vendor);
+} GlxServerExports;
+
+extern _X_EXPORT const GlxServerExports glxServer;
+
+/**
+ * Functions exported by the vendor library to libglvnd.
+ */
+struct GlxServerImportsRec {
+ /**
+ * Called on a server reset.
+ *
+ * This is called from the extension's CloseDown callback.
+ *
+ * Note that this is called after freeing all of GLVND's per-screen data,
+ * so the callback may destroy any vendor handles.
+ *
+ * If the server is exiting, then GLVND will free any remaining vendor
+ * handles after calling the extensionCloseDown callbacks.
+ */
+ void (* extensionCloseDown) (const ExtensionEntry *extEntry);
+
+ /**
+ * Handles a GLX request.
+ */
+ int (* handleRequest) (ClientPtr client);
+
+ /**
+ * Returns a dispatch function for a request.
+ *
+ * \param minorOpcode The minor opcode of the request.
+ * \param vendorCode The vendor opcode, if \p minorOpcode
+ * is \c X_GLXVendorPrivate or \c X_GLXVendorPrivateWithReply.
+ * \return A dispatch function, or NULL if the vendor doesn't support this
+ * request.
+ */
+ GlxServerDispatchProc (* getDispatchAddress) (CARD8 minorOpcode, CARD32 vendorCode);
+
+ /**
+ * Handles a MakeCurrent request.
+ *
+ * This function is called to handle any MakeCurrent request. The vendor
+ * library should deal with changing the current context. After the vendor
+ * returns GLVND will send the reply.
+ *
+ * In addition, GLVND will call this function with any current contexts
+ * when a client disconnects.
+ *
+ * To ensure that context tags are unique, libglvnd will select a context
+ * tag and pass it to the vendor library.
+ *
+ * The vendor can use \c __GLXserverExports::getContextTagPrivate to look
+ * up the private data pointer for \p oldContextTag.
+ *
+ * Likewise, the vendor can use \c __GLXserverExports::setContextTagPrivate
+ * to assign a private data pointer to \p newContextTag.
+ */
+ int (* makeCurrent) (ClientPtr client,
+ GLXContextTag oldContextTag,
+ XID drawable,
+ XID readdrawable,
+ XID context,
+ GLXContextTag newContextTag);
+};
+
+#if defined(__cplusplus)
+}
+#endif
+
+#endif // GLXVENDORABI_H
diff --git a/prebuilt/xlibre/usr/include/xorg/glyphstr.h b/prebuilt/xlibre/usr/include/xorg/glyphstr.h
new file mode 100644
index 0000000..5a75ba6
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/glyphstr.h
@@ -0,0 +1,62 @@
+/*
+ *
+ * Copyright © 2000 SuSE, 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 SuSE not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission. SuSE makes no representations about the
+ * suitability of this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ *
+ * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE
+ * 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.
+ *
+ * Author: Keith Packard, SuSE, Inc.
+ */
+
+#ifndef _GLYPHSTR_H_
+#define _GLYPHSTR_H_
+
+#include
+
+#include "picture.h"
+#include "screenint.h"
+
+#define GlyphFormat1 0
+#define GlyphFormat4 1
+#define GlyphFormat8 2
+#define GlyphFormat16 3
+#define GlyphFormat32 4
+#define GlyphFormatNum 5
+
+typedef struct _Glyph {
+ CARD32 refcnt;
+ PrivateRec *devPrivates;
+ unsigned char sha1[20];
+ CARD32 size; /* info + bitmap */
+ xGlyphInfo info;
+ /* per-screen pixmaps follow */
+} GlyphRec, *GlyphPtr;
+
+typedef struct _GlyphList {
+ INT16 xOff;
+ INT16 yOff;
+ CARD8 len;
+ PictFormatPtr format;
+} GlyphListRec, *GlyphListPtr;
+
+#define GLYPH_HAS_GLYPH_PICTURE_ACCESSOR 1 /* used for api compat */
+extern _X_EXPORT PicturePtr
+ GetGlyphPicture(GlyphPtr glyph, ScreenPtr pScreen);
+extern _X_EXPORT void
+ SetGlyphPicture(GlyphPtr glyph, ScreenPtr pScreen, PicturePtr picture);
+
+#endif /* _GLYPHSTR_H_ */
diff --git a/prebuilt/xlibre/usr/include/xorg/i2c_def.h b/prebuilt/xlibre/usr/include/xorg/i2c_def.h
new file mode 100644
index 0000000..140a071
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/i2c_def.h
@@ -0,0 +1,6 @@
+#ifndef __I2C_DEF_H__
+#define __I2C_DEF_H__
+
+#include "xf86i2c.h"
+
+#endif
diff --git a/prebuilt/xlibre/usr/include/xorg/input.h b/prebuilt/xlibre/usr/include/xorg/input.h
new file mode 100644
index 0000000..125322d
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/input.h
@@ -0,0 +1,581 @@
+/************************************************************
+
+Copyright 1987, 1998 The Open Group
+
+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.
+
+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
+OPEN GROUP 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.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+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 Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL 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 INPUT_H
+#define INPUT_H
+
+#include "xlibre_ptrtypes.h"
+
+#include "misc.h"
+#include "screenint.h"
+#include
+#include
+#include
+#include "window.h" /* for WindowPtr */
+#include "xkbrules.h"
+#include "events.h"
+#include "list.h"
+#include "os.h"
+#include
+
+#define DEFAULT_KEYBOARD_CLICK 0
+#define DEFAULT_BELL 50
+#define DEFAULT_BELL_PITCH 400
+#define DEFAULT_BELL_DURATION 100
+#define DEFAULT_AUTOREPEAT TRUE
+#define DEFAULT_AUTOREPEATS {\
+ 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\
+ 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
+
+#define DEFAULT_LEDS 0x0 /* all off */
+#define DEFAULT_LEDS_MASK 0xffffffff /* 32 */
+#define DEFAULT_INT_RESOLUTION 1000
+#define DEFAULT_INT_MIN_VALUE 0
+#define DEFAULT_INT_MAX_VALUE 100
+#define DEFAULT_INT_DISPLAYED 0
+
+#define DEFAULT_PTR_NUMERATOR 2
+#define DEFAULT_PTR_DENOMINATOR 1
+#define DEFAULT_PTR_THRESHOLD 4
+
+#define DEVICE_INIT 0
+#define DEVICE_ON 1
+#define DEVICE_OFF 2
+#define DEVICE_CLOSE 3
+#define DEVICE_ABORT 4
+
+#define POINTER_RELATIVE (1 << 1)
+#define POINTER_ABSOLUTE (1 << 2)
+#define POINTER_ACCELERATE (1 << 3)
+#define POINTER_SCREEN (1 << 4) /* Data in screen coordinates */
+#define POINTER_NORAW (1 << 5) /* Don't generate RawEvents */
+#define POINTER_EMULATED (1 << 6) /* Event was emulated from another event */
+#define POINTER_DESKTOP (1 << 7) /* Data in desktop coordinates */
+#define POINTER_RAWONLY (1 << 8) /* Only generate RawEvents */
+
+/* GetTouchEvent flags */
+#define TOUCH_ACCEPT (1 << 0)
+#define TOUCH_REJECT (1 << 1)
+#define TOUCH_PENDING_END (1 << 2)
+#define TOUCH_CLIENT_ID (1 << 3) /* touch ID is the client-visible id */
+#define TOUCH_REPLAYING (1 << 4) /* event is being replayed */
+#define TOUCH_POINTER_EMULATED (1 << 5) /* touch event may be pointer emulated */
+#define TOUCH_END (1 << 6) /* really end this touch now */
+
+/* GetGestureEvent flags */
+#define GESTURE_CANCELLED (1 << 0)
+
+/*int constants for pointer acceleration schemes*/
+#define PtrAccelNoOp 0
+#define PtrAccelPredictable 1
+#define PtrAccelLightweight 2
+#define PtrAccelDefault PtrAccelPredictable
+
+#define MAX_VALUATORS 36
+/* Maximum number of valuators, divided by six, rounded up, to get number
+ * of events. */
+#define MAX_VALUATOR_EVENTS 6
+#define MAX_BUTTONS 256 /* completely arbitrarily chosen */
+
+#define NO_AXIS_LIMITS -1
+
+#define MAP_LENGTH MAX_BUTTONS
+#define DOWN_LENGTH (MAX_BUTTONS/8) /* 256/8 => number of bytes to hold 256 bits */
+#define NullGrab ((GrabPtr)NULL)
+#define PointerRootWin ((WindowPtr)PointerRoot)
+#define NoneWin ((WindowPtr)None)
+#define NullDevice ((DevicePtr)NULL)
+
+#ifndef FollowKeyboard
+#define FollowKeyboard 3
+#endif
+#ifndef FollowKeyboardWin
+#define FollowKeyboardWin ((WindowPtr) FollowKeyboard)
+#endif
+#ifndef RevertToFollowKeyboard
+#define RevertToFollowKeyboard 3
+#endif
+
+enum InputLevel {
+ CORE = 1,
+ XI = 2,
+ XI2 = 3,
+};
+
+typedef unsigned long Leds;
+typedef struct _OtherClients *OtherClientsPtr;
+typedef struct _InputClients *InputClientsPtr;
+typedef struct _ValuatorClassRec *ValuatorClassPtr;
+typedef struct _ClassesRec *ClassesPtr;
+typedef struct _SpriteRec *SpritePtr;
+typedef struct _TouchClassRec *TouchClassPtr;
+typedef struct _GestureClassRec *GestureClassPtr;
+typedef struct _TouchPointInfo *TouchPointInfoPtr;
+typedef struct _GestureInfo *GestureInfoPtr;
+typedef struct _DDXTouchPointInfo *DDXTouchPointInfoPtr;
+typedef union _GrabMask GrabMask;
+
+typedef struct _ValuatorMask ValuatorMask;
+
+/* The DIX stores incoming input events in this list */
+extern InternalEvent *InputEventList;
+
+typedef int (*DeviceProc) (DeviceIntPtr /*device */ ,
+ int /*what */ );
+
+typedef void (*ProcessInputProc) (InternalEvent * /*event */ ,
+ DeviceIntPtr /*device */ );
+
+typedef Bool (*DeviceHandleProc) (DeviceIntPtr /*device */ ,
+ void * /*data */
+ );
+
+typedef void (*DeviceUnwrapProc) (DeviceIntPtr /*device */ ,
+ DeviceHandleProc /*proc */ ,
+ void * /*data */
+ );
+
+/* pointer acceleration handling */
+typedef void (*PointerAccelSchemeProc) (DeviceIntPtr /*device */ ,
+ ValuatorMask * /*valuators */ ,
+ CARD32 /*evtime */ );
+
+typedef void (*DeviceCallbackProc) (DeviceIntPtr /*pDev */ );
+
+struct _ValuatorAccelerationRec;
+typedef Bool (*PointerAccelSchemeInitProc) (DeviceIntPtr /*dev */ ,
+ struct _ValuatorAccelerationRec *
+ /*protoScheme */ );
+
+typedef void (*DeviceSendEventsProc) (DeviceIntPtr /*dev */ ,
+ int /* event type */ ,
+ int /* detail, buttons or keycode */ ,
+ int /* flags */ ,
+ const ValuatorMask * /* valuators */ );
+
+typedef struct _DeviceRec {
+ void *devicePrivate;
+ ProcessInputProc processInputProc; /* current */
+ ProcessInputProc realInputProc; /* deliver */
+ ProcessInputProc enqueueInputProc; /* enqueue */
+ Bool on; /* used by DDX to keep state */
+} DeviceRec, *DevicePtr;
+
+typedef struct {
+ int click, bell, bell_pitch, bell_duration;
+ Bool autoRepeat;
+ unsigned char autoRepeats[32];
+ Leds leds;
+ unsigned char id;
+} KeybdCtrl;
+
+typedef struct {
+ KeySym *map;
+ KeyCode minKeyCode, maxKeyCode;
+ int mapWidth;
+} KeySymsRec, *KeySymsPtr;
+
+typedef struct {
+ int num, den, threshold;
+ unsigned char id;
+} PtrCtrl;
+
+typedef struct {
+ int resolution, min_value, max_value;
+ int integer_displayed;
+ unsigned char id;
+} IntegerCtrl;
+
+typedef struct {
+ int max_symbols, num_symbols_supported;
+ int num_symbols_displayed;
+ KeySym *symbols_supported;
+ KeySym *symbols_displayed;
+ unsigned char id;
+} StringCtrl;
+
+typedef struct {
+ int percent, pitch, duration;
+ unsigned char id;
+} BellCtrl;
+
+typedef struct {
+ Leds led_values;
+ Mask led_mask;
+ unsigned char id;
+} LedCtrl;
+
+extern _X_EXPORT KeybdCtrl defaultKeyboardControl;
+extern _X_EXPORT PtrCtrl defaultPointerControl;
+
+typedef struct _InputOption InputOption;
+typedef struct _XI2Mask XI2Mask;
+
+typedef struct _InputAttributes {
+ char *product;
+ char *vendor;
+ char *device;
+ char *pnp_id;
+ char *usb_id;
+ char **tags; /* null-terminated */
+ uint32_t flags;
+} InputAttributes;
+
+#define ATTR_KEYBOARD (1<<0)
+#define ATTR_POINTER (1<<1)
+#define ATTR_JOYSTICK (1<<2)
+#define ATTR_TABLET (1<<3)
+#define ATTR_TOUCHPAD (1<<4)
+#define ATTR_TOUCHSCREEN (1<<5)
+#define ATTR_KEY (1<<6)
+#define ATTR_TABLET_PAD (1<<7)
+
+/* Key/Button has been run through all input processing and events sent to clients. */
+#define KEY_PROCESSED 1
+#define BUTTON_PROCESSED 1
+/* Key/Button has not been fully processed, no events have been sent. */
+#define KEY_POSTED 2
+#define BUTTON_POSTED 2
+
+extern _X_EXPORT void set_key_down(DeviceIntPtr pDev, int key_code, int type);
+extern _X_EXPORT void set_key_up(DeviceIntPtr pDev, int key_code, int type);
+extern _X_EXPORT int key_is_down(DeviceIntPtr pDev, int key_code, int type);
+extern _X_EXPORT void set_button_down(DeviceIntPtr pDev, int button, int type);
+extern _X_EXPORT void set_button_up(DeviceIntPtr pDev, int button, int type);
+extern _X_EXPORT int button_is_down(DeviceIntPtr pDev, int button, int type);
+
+extern _X_EXPORT DeviceIntPtr AddInputDevice(ClientPtr /*client */ ,
+ DeviceProc /*deviceProc */ ,
+ Bool /*autoStart */ );
+
+extern _X_EXPORT Bool EnableDevice(DeviceIntPtr /*device */ ,
+ BOOL /* sendevent */ );
+
+extern _X_EXPORT Bool ActivateDevice(DeviceIntPtr /*device */ ,
+ BOOL /* sendevent */ );
+
+extern _X_EXPORT Bool DisableDevice(DeviceIntPtr /*device */ ,
+ BOOL /* sendevent */ );
+
+extern _X_EXPORT int RemoveDevice(DeviceIntPtr /*dev */ ,
+ BOOL /* sendevent */ );
+
+extern _X_EXPORT int NumMotionEvents(void);
+
+extern _X_EXPORT int dixLookupDevice(DeviceIntPtr * /* dev */ ,
+ int /* id */ ,
+ ClientPtr /* client */ ,
+ Mask /* access_mode */ );
+
+extern _X_EXPORT void QueryMinMaxKeyCodes(KeyCode * /*minCode */ ,
+ KeyCode * /*maxCode */ );
+
+extern _X_EXPORT Bool InitButtonClassDeviceStruct(DeviceIntPtr /*device */ ,
+ int /*numButtons */ ,
+ Atom * /* labels */ ,
+ CARD8 * /*map */ );
+
+extern _X_EXPORT Bool InitValuatorClassDeviceStruct(DeviceIntPtr /*device */ ,
+ int /*numAxes */ ,
+ Atom * /* labels */ ,
+ int /*numMotionEvents */ ,
+ int /*mode */ );
+
+extern _X_EXPORT Bool InitPointerAccelerationScheme(DeviceIntPtr /*dev */ ,
+ int /*scheme */ );
+
+extern _X_EXPORT Bool InitFocusClassDeviceStruct(DeviceIntPtr /*device */ );
+
+extern _X_EXPORT Bool InitTouchClassDeviceStruct(DeviceIntPtr /*device */ ,
+ unsigned int /*max_touches */ ,
+ unsigned int /*mode */ ,
+ unsigned int /*numAxes */ );
+
+extern _X_EXPORT Bool InitGestureClassDeviceStruct(DeviceIntPtr device,
+ unsigned int max_touches);
+
+typedef void (*BellProcPtr) (int percent,
+ DeviceIntPtr device,
+ void *ctrl,
+ int feedbackClass);
+
+typedef void (*KbdCtrlProcPtr) (DeviceIntPtr /*device */ ,
+ KeybdCtrl * /*ctrl */ );
+
+typedef void (*PtrCtrlProcPtr) (DeviceIntPtr /*device */ ,
+ PtrCtrl * /*ctrl */ );
+
+extern _X_EXPORT Bool InitPtrFeedbackClassDeviceStruct(DeviceIntPtr /*device */
+ ,
+ PtrCtrlProcPtr
+ /*controlProc */ );
+
+typedef void (*StringCtrlProcPtr) (DeviceIntPtr /*device */ ,
+ StringCtrl * /*ctrl */ );
+
+extern _X_EXPORT Bool InitStringFeedbackClassDeviceStruct(DeviceIntPtr
+ /*device */ ,
+ StringCtrlProcPtr
+ /*controlProc */ ,
+ int /*max_symbols */ ,
+ int
+ /*num_symbols_supported */
+ ,
+ KeySym * /*symbols */
+ );
+
+typedef void (*BellCtrlProcPtr) (DeviceIntPtr /*device */ ,
+ BellCtrl * /*ctrl */ );
+
+extern _X_EXPORT Bool InitBellFeedbackClassDeviceStruct(DeviceIntPtr /*device */
+ ,
+ BellProcPtr
+ /*bellProc */ ,
+ BellCtrlProcPtr
+ /*controlProc */ );
+
+typedef void (*LedCtrlProcPtr) (DeviceIntPtr /*device */ ,
+ LedCtrl * /*ctrl */ );
+
+extern _X_EXPORT Bool InitLedFeedbackClassDeviceStruct(DeviceIntPtr /*device */
+ ,
+ LedCtrlProcPtr
+ /*controlProc */ );
+
+typedef void (*IntegerCtrlProcPtr) (DeviceIntPtr /*device */ ,
+ IntegerCtrl * /*ctrl */ );
+
+extern _X_EXPORT Bool InitIntegerFeedbackClassDeviceStruct(DeviceIntPtr
+ /*device */ ,
+ IntegerCtrlProcPtr
+ /*controlProc */ );
+
+extern _X_EXPORT Bool InitPointerDeviceStruct(DevicePtr /*device */ ,
+ CARD8 * /*map */ ,
+ int /*numButtons */ ,
+ Atom * /* btn_labels */ ,
+ PtrCtrlProcPtr /*controlProc */ ,
+ int /*numMotionEvents */ ,
+ int /*numAxes */ ,
+ Atom * /* axes_labels */ );
+
+extern _X_EXPORT Bool InitKeyboardDeviceStruct(DeviceIntPtr /*device */ ,
+ XkbRMLVOSet * /*rmlvo */ ,
+ BellProcPtr /*bellProc */ ,
+ KbdCtrlProcPtr /*controlProc */
+ );
+
+extern _X_EXPORT Bool InitKeyboardDeviceStructFromString(DeviceIntPtr dev,
+ const char *keymap,
+ int keymap_length,
+ BellProcPtr bell_func,
+ KbdCtrlProcPtr ctrl_func);
+
+extern _X_EXPORT void ProcessInputEvents(void);
+
+extern _X_EXPORT void InitInput(int /*argc */ ,
+ char ** /*argv */ );
+extern _X_EXPORT void CloseInput(void);
+
+extern _X_EXPORT int GetMaximumEventsNum(void);
+
+extern _X_EXPORT InternalEvent *InitEventList(int num_events);
+extern _X_EXPORT void FreeEventList(InternalEvent *list, int num_events);
+
+extern _X_EXPORT int GetPointerEvents(InternalEvent *events,
+ DeviceIntPtr pDev,
+ int type,
+ int buttons,
+ int flags, const ValuatorMask *mask);
+
+extern _X_EXPORT void QueuePointerEvents(DeviceIntPtr pDev,
+ int type,
+ int buttons,
+ int flags, const ValuatorMask *mask);
+
+extern _X_EXPORT int GetKeyboardEvents(InternalEvent *events,
+ DeviceIntPtr pDev,
+ int type,
+ int key_code);
+
+extern _X_EXPORT void QueueKeyboardEvents(DeviceIntPtr pDev,
+ int type,
+ int key_code);
+
+extern _X_EXPORT int GetProximityEvents(InternalEvent *events,
+ DeviceIntPtr pDev,
+ int type, const ValuatorMask *mask);
+
+extern _X_EXPORT void QueueProximityEvents(DeviceIntPtr pDev,
+ int type, const ValuatorMask *mask);
+
+extern _X_EXPORT int GetMotionHistorySize(void);
+
+extern _X_EXPORT void AllocateMotionHistory(DeviceIntPtr pDev);
+
+extern _X_EXPORT int GetMotionHistory(DeviceIntPtr pDev,
+ xTimecoord ** buff,
+ unsigned long start,
+ unsigned long stop,
+ ScreenPtr pScreen, BOOL core);
+
+extern _X_EXPORT DeviceIntPtr GetPairedDevice(DeviceIntPtr kbd);
+extern _X_EXPORT DeviceIntPtr GetMaster(DeviceIntPtr dev, int type);
+
+extern _X_EXPORT int AllocDevicePair(ClientPtr client,
+ const char *name,
+ DeviceIntPtr *ptr,
+ DeviceIntPtr *keybd,
+ DeviceProc ptr_proc,
+ DeviceProc keybd_proc, Bool master);
+
+/* Helper functions. */
+extern _X_EXPORT int generate_modkeymap(ClientPtr client, DeviceIntPtr dev,
+ KeyCode **modkeymap,
+ int *max_keys_per_mod);
+
+enum TouchListenerState {
+ TOUCH_LISTENER_AWAITING_BEGIN = 0, /**< Waiting for a TouchBegin event */
+ TOUCH_LISTENER_AWAITING_OWNER, /**< Waiting for a TouchOwnership event */
+ TOUCH_LISTENER_EARLY_ACCEPT, /**< Waiting for ownership, has already
+ accepted */
+ TOUCH_LISTENER_IS_OWNER, /**< Is the current owner, hasn't
+ accepted */
+ TOUCH_LISTENER_HAS_ACCEPTED, /**< Is the current owner, has accepted */
+ TOUCH_LISTENER_HAS_END, /**< Has already received the end event */
+};
+
+enum TouchListenerType {
+ TOUCH_LISTENER_GRAB,
+ TOUCH_LISTENER_POINTER_GRAB,
+ TOUCH_LISTENER_REGULAR,
+ TOUCH_LISTENER_POINTER_REGULAR,
+};
+
+enum GestureListenerType {
+ GESTURE_LISTENER_GRAB,
+ GESTURE_LISTENER_NONGESTURE_GRAB,
+ GESTURE_LISTENER_REGULAR
+};
+
+extern _X_EXPORT InputAttributes *DuplicateInputAttributes(InputAttributes *
+ attrs);
+
+extern _X_EXPORT void FreeInputAttributes(InputAttributes * attrs);
+
+/* Implemented by the DDX. */
+extern _X_EXPORT int NewInputDeviceRequest(InputOption *options,
+ InputAttributes * attrs,
+ DeviceIntPtr *dev);
+extern _X_EXPORT void DeleteInputDeviceRequest(DeviceIntPtr dev);
+extern _X_EXPORT void RemoveInputDeviceTraces(const char *config_info);
+extern _X_EXPORT void DDXRingBell(int volume, int pitch, int duration);
+extern _X_EXPORT ValuatorMask *valuator_mask_new(int num_valuators);
+extern _X_EXPORT void valuator_mask_free(ValuatorMask **mask);
+extern _X_EXPORT void valuator_mask_set_range(ValuatorMask *mask,
+ int first_valuator,
+ int num_valuators,
+ const int *valuators);
+extern _X_EXPORT void valuator_mask_set(ValuatorMask *mask, int valuator,
+ int data);
+extern _X_EXPORT void valuator_mask_set_double(ValuatorMask *mask, int valuator,
+ double data);
+extern _X_EXPORT void valuator_mask_zero(ValuatorMask *mask);
+extern _X_EXPORT int valuator_mask_size(const ValuatorMask *mask);
+extern _X_EXPORT int valuator_mask_isset(const ValuatorMask *mask, int bit);
+extern _X_EXPORT void valuator_mask_unset(ValuatorMask *mask, int bit);
+extern _X_EXPORT int valuator_mask_num_valuators(const ValuatorMask *mask);
+extern _X_EXPORT void valuator_mask_copy(ValuatorMask *dest,
+ const ValuatorMask *src);
+extern _X_EXPORT int valuator_mask_get(const ValuatorMask *mask, int valnum);
+extern _X_EXPORT double valuator_mask_get_double(const ValuatorMask *mask,
+ int valnum);
+extern _X_EXPORT Bool valuator_mask_fetch(const ValuatorMask *mask,
+ int valnum, int *val);
+extern _X_EXPORT Bool valuator_mask_fetch_double(const ValuatorMask *mask,
+ int valnum, double *val);
+extern _X_EXPORT Bool valuator_mask_has_unaccelerated(const ValuatorMask *mask);
+extern _X_EXPORT void valuator_mask_set_unaccelerated(ValuatorMask *mask,
+ int valuator,
+ double accel,
+ double unaccel);
+extern _X_EXPORT void valuator_mask_set_absolute_unaccelerated(ValuatorMask *mask,
+ int valuator,
+ int absolute,
+ double unaccel);
+extern _X_EXPORT double valuator_mask_get_accelerated(const ValuatorMask *mask,
+ int valuator);
+extern _X_EXPORT double valuator_mask_get_unaccelerated(const ValuatorMask *mask,
+ int valuator);
+extern _X_EXPORT Bool valuator_mask_fetch_unaccelerated(const ValuatorMask *mask,
+ int valuator,
+ double *accel,
+ double *unaccel);
+/* InputOption handling interface */
+extern _X_EXPORT InputOption *input_option_new(InputOption *list,
+ const char *key,
+ const char *value);
+extern _X_EXPORT void input_option_free_list(InputOption **opt);
+extern _X_EXPORT InputOption *input_option_free_element(InputOption *opt,
+ const char *key);
+extern _X_EXPORT InputOption *input_option_find(InputOption *list,
+ const char *key);
+extern _X_EXPORT const char *input_option_get_key(const InputOption *opt);
+extern _X_EXPORT const char *input_option_get_value(const InputOption *opt);
+extern _X_EXPORT void input_option_set_key(InputOption *opt, const char *key);
+extern _X_EXPORT void input_option_set_value(InputOption *opt,
+ const char *value);
+
+extern _X_EXPORT void input_lock(void);
+extern _X_EXPORT void input_unlock(void);
+extern _X_EXPORT void input_force_unlock(void);
+extern _X_EXPORT int in_input_thread(void);
+
+extern _X_EXPORT Bool InputThreadEnable;
+
+#endif /* INPUT_H */
diff --git a/prebuilt/xlibre/usr/include/xorg/inputstr.h b/prebuilt/xlibre/usr/include/xorg/inputstr.h
new file mode 100644
index 0000000..9b60d7f
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/inputstr.h
@@ -0,0 +1,672 @@
+/************************************************************
+
+Copyright 1987, 1998 The Open Group
+
+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.
+
+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
+OPEN GROUP 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.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+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 Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL 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 INPUTSTRUCT_H
+#define INPUTSTRUCT_H
+
+#include
+
+#include
+#include "input.h"
+#include "window.h"
+#include "dixstruct.h"
+#include "cursorstr.h"
+#include "privates.h"
+
+#define BitIsOn(ptr, bit) (!!(((const BYTE *) (ptr))[(bit)>>3] & (1 << ((bit) & 7))))
+#define SetBit(ptr, bit) (((BYTE *) (ptr))[(bit)>>3] |= (1 << ((bit) & 7)))
+#define ClearBit(ptr, bit) (((BYTE *)(ptr))[(bit)>>3] &= ~(1 << ((bit) & 7)))
+
+#define EMASKSIZE (MAXDEVICES + 2)
+
+/* This is the last XI2 event supported by the server. If you add
+ * events to the protocol, the server will not support these events until
+ * this number here is bumped.
+ */
+#define XI2LASTEVENT XI_GestureSwipeEnd
+#define XI2MASKSIZE ((XI2LASTEVENT >> 3) + 1) /* no of bytes for masks */
+
+/**
+ * Scroll types for ::SetScrollValuator and the scroll type in the
+ * ::ScrollInfoPtr.
+ */
+enum ScrollType {
+ SCROLL_TYPE_NONE = 0, /**< Not a scrolling valuator */
+ SCROLL_TYPE_VERTICAL = 8,
+ SCROLL_TYPE_HORIZONTAL = 9,
+};
+
+/**
+ * This struct stores the core event mask for each client except the client
+ * that created the window.
+ *
+ * Each window that has events selected from other clients has at least one of
+ * these masks. If multiple clients selected for events on the same window,
+ * these masks are in a linked list.
+ *
+ * The event mask for the client that created the window is stored in
+ * win->eventMask instead.
+ *
+ * The resource id is simply a fake client ID to associate this mask with a
+ * client.
+ *
+ * Kludge: OtherClients and InputClients must be compatible, see code.
+ */
+typedef struct _OtherClients {
+ OtherClientsPtr next; /**< Pointer to the next mask */
+ XID resource; /**< id for putting into resource manager */
+ Mask mask; /**< Core event mask */
+} OtherClients;
+
+/**
+ * This struct stores the XI event mask for each client.
+ *
+ * Each window that has events selected has at least one of these masks. If
+ * multiple client selected for events on the same window, these masks are in
+ * a linked list.
+ */
+typedef struct _InputClients {
+ InputClientsPtr next; /**< Pointer to the next mask */
+ XID resource; /**< id for putting into resource manager */
+ Mask mask[EMASKSIZE]; /**< Actual XI event mask, deviceid is index */
+ /** XI2 event masks. One per device, each bit is a mask of (1 << type) */
+ struct _XI2Mask *xi2mask;
+} InputClients;
+
+/**
+ * Combined XI event masks from all devices.
+ *
+ * This is the XI equivalent of the deliverableEvents, eventMask and
+ * dontPropagate mask of the WindowRec (or WindowOptRec).
+ *
+ * A window that has an XI client selecting for events has exactly one
+ * OtherInputMasks struct and exactly one InputClients struct hanging off
+ * inputClients. Each further client appends to the inputClients list.
+ * Each Mask field is per-device, with the device id as the index.
+ * Exception: for non-device events (Presence events), the MAXDEVICES
+ * deviceid is used.
+ */
+typedef struct _OtherInputMasks {
+ /**
+ * Bitwise OR of all masks by all clients and the window's parent's masks.
+ */
+ Mask deliverableEvents[EMASKSIZE];
+ /**
+ * Bitwise OR of all masks by all clients on this window.
+ */
+ Mask inputEvents[EMASKSIZE];
+ /** The do-not-propagate masks for each device. */
+ Mask dontPropagateMask[EMASKSIZE];
+ /** The clients that selected for events */
+ InputClientsPtr inputClients;
+ /* XI2 event masks. One per device, each bit is a mask of (1 << type) */
+ struct _XI2Mask *xi2mask;
+} OtherInputMasks;
+
+/*
+ * The following structure gets used for both active and passive grabs. For
+ * active grabs some of the fields (e.g. modifiers) are not used. However,
+ * that is not much waste since there aren't many active grabs (one per
+ * keyboard/pointer device) going at once in the server.
+ */
+
+typedef struct _DetailRec { /* Grab details may be bit masks */
+ unsigned int exact;
+ Mask *pMask;
+} DetailRec;
+
+union _GrabMask {
+ Mask core;
+ Mask xi;
+ struct _XI2Mask *xi2mask;
+};
+
+/**
+ * Central struct for device grabs.
+ * The same struct is used for both core grabs and device grabs, with
+ * different fields being set.
+ * If the grab is a core grab (GrabPointer/GrabKeyboard), then the eventMask
+ * is a combination of standard event masks (i.e. PointerMotionMask |
+ * ButtonPressMask).
+ * If the grab is a device grab (GrabDevice), then the eventMask is a
+ * combination of event masks for a given XI event type (see SetEventInfo).
+ *
+ * If the grab is a result of a ButtonPress, then eventMask is the core mask
+ * and deviceMask is set to the XI event mask for the grab.
+ */
+typedef struct _GrabRec {
+ GrabPtr next; /* for chain of passive grabs */
+ XID resource;
+ DeviceIntPtr device;
+ WindowPtr window;
+ unsigned ownerEvents:1;
+ unsigned keyboardMode:1;
+ unsigned pointerMode:1;
+ enum InputLevel grabtype;
+ CARD8 type; /* event type for passive grabs, 0 for active grabs */
+ DetailRec modifiersDetail;
+ DeviceIntPtr modifierDevice;
+ DetailRec detail; /* key or button */
+ WindowPtr confineTo; /* always NULL for keyboards */
+ CursorPtr cursor; /* always NULL for keyboards */
+ Mask eventMask;
+ Mask deviceMask;
+ /* XI2 event masks. One per device, each bit is a mask of (1 << type) */
+ struct _XI2Mask *xi2mask;
+} GrabRec;
+
+/**
+ * Sprite information for a device.
+ */
+typedef struct _SpriteRec {
+ CursorPtr current;
+ BoxRec hotLimits; /* logical constraints of hot spot */
+ Bool confined; /* confined to screen */
+ RegionPtr hotShape; /* additional logical shape constraint */
+ BoxRec physLimits; /* physical constraints of hot spot */
+ WindowPtr win; /* window of logical position */
+ HotSpot hot; /* logical pointer position */
+ HotSpot hotPhys; /* physical pointer position */
+#ifdef XINERAMA
+ ScreenPtr screen; /* all others are in Screen 0 coordinates */
+ RegionRec Reg1; /* Region 1 for confining motion */
+ RegionRec Reg2; /* Region 2 for confining virtual motion */
+ WindowPtr windows[MAXSCREENS];
+ WindowPtr confineWin; /* confine window */
+#endif /* XINERAMA */
+ /* The window trace information is used at dix/events.c to avoid having
+ * to compute all the windows between the root and the current pointer
+ * window each time a button or key goes down. The grabs on each of those
+ * windows must be checked.
+ * spriteTraces should only be used at dix/events.c! */
+ WindowPtr *spriteTrace;
+ int spriteTraceSize;
+ int spriteTraceGood;
+
+ /* Due to delays between event generation and event processing, it is
+ * possible that the pointer has crossed screen boundaries between the
+ * time in which it begins generating events and the time when
+ * those events are processed.
+ *
+ * pEnqueueScreen: screen the pointer was on when the event was generated
+ * pDequeueScreen: screen the pointer was on when the event is processed
+ */
+ ScreenPtr pEnqueueScreen;
+ ScreenPtr pDequeueScreen;
+
+} SpriteRec;
+
+typedef struct _KeyClassRec {
+ int sourceid;
+ CARD8 down[DOWN_LENGTH];
+ CARD8 postdown[DOWN_LENGTH];
+ int modifierKeyCount[8];
+ struct _XkbSrvInfo *xkbInfo;
+} KeyClassRec, *KeyClassPtr;
+
+typedef struct _ScrollInfo {
+ enum ScrollType type;
+ double increment;
+ int flags;
+} ScrollInfo, *ScrollInfoPtr;
+
+typedef struct _AxisInfo {
+ int resolution;
+ int min_resolution;
+ int max_resolution;
+ int min_value;
+ int max_value;
+ Atom label;
+ CARD8 mode;
+ ScrollInfo scroll;
+} AxisInfo, *AxisInfoPtr;
+
+typedef struct _ValuatorAccelerationRec {
+ int number;
+ PointerAccelSchemeProc AccelSchemeProc;
+ void *accelData; /* at disposal of AccelScheme */
+ PointerAccelSchemeInitProc AccelInitProc;
+ DeviceCallbackProc AccelCleanupProc;
+} ValuatorAccelerationRec, *ValuatorAccelerationPtr;
+
+typedef struct _ValuatorClassRec {
+ int sourceid;
+ int numMotionEvents;
+ int first_motion;
+ int last_motion;
+ void *motion; /* motion history buffer. Different layout
+ for MDs and SDs! */
+ WindowPtr motionHintWindow;
+
+ AxisInfoPtr axes;
+ unsigned short numAxes;
+ double *axisVal; /* always absolute, but device-coord system */
+ ValuatorAccelerationRec accelScheme;
+ int h_scroll_axis; /* horiz smooth-scrolling axis */
+ int v_scroll_axis; /* vert smooth-scrolling axis */
+} ValuatorClassRec;
+
+typedef struct _TouchListener {
+ XID listener; /* grabs/event selection IDs receiving
+ * events for this touch */
+ int resource_type; /* listener's resource type */
+ enum TouchListenerType type;
+ enum TouchListenerState state;
+ enum InputLevel level; /* matters only for emulating touches */
+ WindowPtr window;
+ GrabPtr grab;
+} TouchListener;
+
+typedef struct _TouchPointInfo {
+ uint32_t client_id; /* touch ID as seen in client events */
+ int sourceid; /* Source device's ID for this touchpoint */
+ Bool active; /* whether or not the touch is active */
+ Bool pending_finish; /* true if the touch is physically inactive
+ * but still owned by a grab */
+ SpriteRec sprite; /* window trace for delivery */
+ ValuatorMask *valuators; /* last recorded axis values */
+ TouchListener *listeners; /* set of listeners */
+ int num_listeners;
+ int num_grabs; /* number of open grabs on this touch
+ * which have not accepted or rejected */
+ Bool emulate_pointer;
+ DeviceEvent *history; /* History of events on this touchpoint */
+ size_t history_elements; /* Number of current elements in history */
+ size_t history_size; /* Size of history in elements */
+} TouchPointInfoRec;
+
+typedef struct _TouchClassRec {
+ int sourceid;
+ TouchPointInfoPtr touches;
+ unsigned short num_touches; /* number of allocated touches */
+ unsigned short max_touches; /* maximum number of touches, may be 0 */
+ CARD8 mode; /* ::XIDirectTouch, XIDependentTouch */
+ /* for pointer-emulation */
+ CARD8 buttonsDown; /* number of buttons down */
+ unsigned short state; /* logical button state */
+ Mask motionMask;
+} TouchClassRec;
+
+typedef struct _GestureListener {
+ XID listener; /* grabs/event selection IDs receiving
+ * events for this gesture */
+ int resource_type; /* listener's resource type */
+ enum GestureListenerType type;
+ WindowPtr window;
+ GrabPtr grab;
+} GestureListener;
+
+typedef struct _GestureInfo {
+ int sourceid; /* Source device's ID for this gesture */
+ Bool active; /* whether or not the gesture is active */
+ uint8_t type; /* Gesture type: either ET_GesturePinchBegin or
+ ET_GestureSwipeBegin. Valid if active == TRUE */
+ int num_touches; /* The number of touches in the gesture */
+ SpriteRec sprite; /* window trace for delivery */
+ GestureListener listener; /* the listener that will receive events */
+ Bool has_listener; /* true if listener has been setup already */
+} GestureInfoRec;
+
+typedef struct _GestureClassRec {
+ int sourceid;
+ GestureInfoRec gesture;
+ unsigned short max_touches; /* maximum number of touches, may be 0 */
+} GestureClassRec;
+
+typedef struct _ButtonClassRec {
+ int sourceid;
+ CARD8 numButtons;
+ CARD8 buttonsDown; /* number of buttons currently down
+ This counts logical buttons, not
+ physical ones, i.e if some buttons
+ are mapped to 0, they're not counted
+ here */
+ unsigned short state;
+ Mask motionMask;
+ CARD8 down[DOWN_LENGTH];
+ CARD8 postdown[DOWN_LENGTH];
+ CARD8 map[MAP_LENGTH];
+ union _XkbAction *xkb_acts;
+ Atom labels[MAX_BUTTONS];
+} ButtonClassRec, *ButtonClassPtr;
+
+typedef struct _FocusClassRec {
+ int sourceid;
+ WindowPtr win; /* May be set to a int constant (e.g. PointerRootWin)! */
+ int revert;
+ TimeStamp time;
+ WindowPtr *trace;
+ int traceSize;
+ int traceGood;
+} FocusClassRec, *FocusClassPtr;
+
+typedef struct _ProximityClassRec {
+ int sourceid;
+ char in_proximity;
+} ProximityClassRec, *ProximityClassPtr;
+
+typedef struct _KbdFeedbackClassRec *KbdFeedbackPtr;
+typedef struct _PtrFeedbackClassRec *PtrFeedbackPtr;
+typedef struct _IntegerFeedbackClassRec *IntegerFeedbackPtr;
+typedef struct _StringFeedbackClassRec *StringFeedbackPtr;
+typedef struct _BellFeedbackClassRec *BellFeedbackPtr;
+typedef struct _LedFeedbackClassRec *LedFeedbackPtr;
+
+typedef struct _KbdFeedbackClassRec {
+ BellProcPtr BellProc;
+ KbdCtrlProcPtr CtrlProc;
+ KeybdCtrl ctrl;
+ KbdFeedbackPtr next;
+ struct _XkbSrvLedInfo *xkb_sli;
+} KbdFeedbackClassRec;
+
+typedef struct _PtrFeedbackClassRec {
+ PtrCtrlProcPtr CtrlProc;
+ PtrCtrl ctrl;
+ PtrFeedbackPtr next;
+} PtrFeedbackClassRec;
+
+typedef struct _IntegerFeedbackClassRec {
+ IntegerCtrlProcPtr CtrlProc;
+ IntegerCtrl ctrl;
+ IntegerFeedbackPtr next;
+} IntegerFeedbackClassRec;
+
+typedef struct _StringFeedbackClassRec {
+ StringCtrlProcPtr CtrlProc;
+ StringCtrl ctrl;
+ StringFeedbackPtr next;
+} StringFeedbackClassRec;
+
+typedef struct _BellFeedbackClassRec {
+ BellProcPtr BellProc;
+ BellCtrlProcPtr CtrlProc;
+ BellCtrl ctrl;
+ BellFeedbackPtr next;
+} BellFeedbackClassRec;
+
+typedef struct _LedFeedbackClassRec {
+ LedCtrlProcPtr CtrlProc;
+ LedCtrl ctrl;
+ LedFeedbackPtr next;
+ struct _XkbSrvLedInfo *xkb_sli;
+} LedFeedbackClassRec;
+
+typedef struct _ClassesRec {
+ KeyClassPtr key;
+ ValuatorClassPtr valuator;
+ TouchClassPtr touch;
+ GestureClassPtr gesture;
+ ButtonClassPtr button;
+ FocusClassPtr focus;
+ ProximityClassPtr proximity;
+ KbdFeedbackPtr kbdfeed;
+ PtrFeedbackPtr ptrfeed;
+ IntegerFeedbackPtr intfeed;
+ StringFeedbackPtr stringfeed;
+ BellFeedbackPtr bell;
+ LedFeedbackPtr leds;
+} ClassesRec;
+
+/* Device properties */
+typedef struct _XIPropertyValue {
+ Atom type; /* ignored by server */
+ short format; /* format of data for swapping - 8,16,32 */
+ long size; /* size of data in (format/8) bytes */
+ void *data; /* private to client */
+} XIPropertyValueRec;
+
+typedef struct _XIProperty {
+ struct _XIProperty *next;
+ Atom propertyName;
+ BOOL deletable; /* clients can delete this prop? */
+ XIPropertyValueRec value;
+} XIPropertyRec;
+
+typedef XIPropertyRec *XIPropertyPtr;
+typedef XIPropertyValueRec *XIPropertyValuePtr;
+
+typedef struct _XIPropertyHandler {
+ struct _XIPropertyHandler *next;
+ long id;
+ int (*SetProperty) (DeviceIntPtr dev,
+ Atom property, XIPropertyValuePtr prop, BOOL checkonly);
+ int (*GetProperty) (DeviceIntPtr dev, Atom property);
+ int (*DeleteProperty) (DeviceIntPtr dev, Atom property);
+} XIPropertyHandler, *XIPropertyHandlerPtr;
+
+typedef struct _GrabInfoRec {
+ TimeStamp grabTime;
+ Bool fromPassiveGrab; /* true if from passive grab */
+ Bool implicitGrab; /* implicit from ButtonPress */
+ GrabPtr unused; /* Kept for ABI stability, remove soon */
+ GrabPtr grab;
+ CARD8 activatingKey;
+ void (*ActivateGrab) (DeviceIntPtr /*device */ ,
+ GrabPtr /*grab */ ,
+ TimeStamp /*time */ ,
+ Bool /*autoGrab */ );
+ void (*DeactivateGrab) (DeviceIntPtr /*device */ );
+ struct {
+ Bool frozen;
+ int state;
+ GrabPtr other; /* if other grab has this frozen */
+ InternalEvent *event; /* saved to be replayed */
+ } sync;
+} GrabInfoRec, *GrabInfoPtr;
+
+typedef struct _SpriteInfoRec {
+ /* sprite must always point to a valid sprite. For devices sharing the
+ * sprite, let sprite point to a paired spriteOwner's sprite. */
+ SpritePtr sprite; /* sprite information */
+ Bool spriteOwner; /* True if device owns the sprite */
+ DeviceIntPtr paired; /* The paired device. Keyboard if
+ spriteOwner is TRUE, otherwise the
+ pointer that owns the sprite. */
+
+ /* keep states for animated cursor */
+ struct {
+ CursorPtr pCursor;
+ ScreenPtr pScreen;
+ int elt;
+ } anim;
+} SpriteInfoRec, *SpriteInfoPtr;
+
+/* device types */
+#define MASTER_POINTER 1
+#define MASTER_KEYBOARD 2
+#define SLAVE 3
+/* special types for GetMaster */
+#define MASTER_ATTACHED 4 /* Master for this device */
+#define KEYBOARD_OR_FLOAT 5 /* Keyboard master for this device or this device if floating */
+#define POINTER_OR_FLOAT 6 /* Pointer master for this device or this device if floating */
+
+typedef struct _DeviceIntRec {
+ DeviceRec public;
+ DeviceIntPtr next;
+ Bool startup; /* true if needs to be turned on at
+ server initialization time */
+ DeviceProc deviceProc; /* proc(DevicePtr, DEVICE_xx). It is
+ used to initialize, turn on, or
+ turn off the device */
+ Bool inited; /* TRUE if INIT returns Success */
+ Bool enabled; /* TRUE if ON returns Success */
+ Bool coreEvents; /* TRUE if device also sends core */
+ GrabInfoRec deviceGrab; /* grab on the device */
+ int type; /* MASTER_POINTER, MASTER_KEYBOARD, SLAVE */
+ Atom xinput_type;
+ char *name;
+ int id;
+ KeyClassPtr key;
+ ValuatorClassPtr valuator;
+ TouchClassPtr touch;
+ GestureClassPtr gesture;
+ ButtonClassPtr button;
+ FocusClassPtr focus;
+ ProximityClassPtr proximity;
+ KbdFeedbackPtr kbdfeed;
+ PtrFeedbackPtr ptrfeed;
+ IntegerFeedbackPtr intfeed;
+ StringFeedbackPtr stringfeed;
+ BellFeedbackPtr bell;
+ LedFeedbackPtr leds;
+ struct _XkbInterest *xkb_interest;
+ char *config_info; /* used by the hotplug layer */
+ ClassesPtr unused_classes; /* for master devices */
+ int saved_master_id; /* for slaves while grabbed */
+ PrivateRec *devPrivates;
+ DeviceUnwrapProc unwrapProc;
+ SpriteInfoPtr spriteInfo;
+ DeviceIntPtr master; /* master device */
+ DeviceIntPtr lastSlave; /* last slave device used */
+
+ /* last valuator values recorded, not posted to client;
+ * for slave devices, valuators is in device coordinates, mapped to the
+ * desktop
+ * for master devices, valuators is in desktop coordinates.
+ * see dix/getevents.c
+ * remainder supports acceleration
+ */
+ struct {
+ double valuators[MAX_VALUATORS];
+ int numValuators;
+ DeviceIntPtr slave;
+ ValuatorMask *scroll;
+ int num_touches; /* size of the touches array */
+ DDXTouchPointInfoPtr touches;
+ } last;
+
+ /* Input device property handling. */
+ struct {
+ XIPropertyPtr properties;
+ XIPropertyHandlerPtr handlers; /* NULL-terminated */
+ } properties;
+
+ /* coordinate transformation matrix for relative movement. Matrix with
+ * the translation component dropped */
+ struct pixman_f_transform relative_transform;
+ /* scale matrix for absolute devices, this is the combined matrix of
+ [1/scale] . [transform] . [scale]. See DeviceSetTransform */
+ struct pixman_f_transform scale_and_transform;
+
+ /* XTest related master device id */
+ int xtest_master_id;
+ DeviceSendEventsProc sendEventsProc;
+
+ struct _SyncCounter *idle_counter;
+
+ Bool ignoreXkbActionsBehaviors; /* TRUE if keys don't trigger behaviors and actions */
+} DeviceIntRec;
+
+typedef struct {
+ int numDevices; /* total number of devices */
+ DeviceIntPtr devices; /* all devices turned on */
+ DeviceIntPtr off_devices; /* all devices turned off */
+ DeviceIntPtr keyboard; /* the main one for the server */
+ DeviceIntPtr pointer;
+ DeviceIntPtr all_devices;
+ DeviceIntPtr all_master_devices;
+} InputInfo;
+
+extern _X_EXPORT InputInfo inputInfo;
+
+/* for keeping the events for devices grabbed synchronously */
+typedef struct _QdEvent *QdEventPtr;
+typedef struct _QdEvent {
+ struct xorg_list next;
+ DeviceIntPtr device;
+ ScreenPtr pScreen; /* what screen the pointer was on */
+ unsigned long months; /* milliseconds is in the event */
+ InternalEvent *event;
+} QdEventRec;
+
+/**
+ * syncEvents is the global structure for queued events.
+ *
+ * Devices can be frozen through GrabModeSync pointer grabs. If this is the
+ * case, events from these devices are added to "pending" instead of being
+ * processed normally. When the device is unfrozen, events in "pending" are
+ * replayed and processed as if they would come from the device directly.
+ */
+typedef struct _EventSyncInfo {
+ struct xorg_list pending;
+
+ /** The device to replay events for. Only set in AllowEvents(), in which
+ * case it is set to the device specified in the request. */
+ DeviceIntPtr replayDev; /* kludgy rock to put flag for */
+
+ /**
+ * The window the events are supposed to be replayed on.
+ * This window may be set to the grab's window (but only when
+ * Replay{Pointer|Keyboard} is given in the XAllowEvents()
+ * request. */
+ WindowPtr replayWin; /* ComputeFreezes */
+ /**
+ * Flag to indicate whether we're in the process of
+ * replaying events. Only set in ComputeFreezes(). */
+ Bool playingEvents;
+ TimeStamp time;
+} EventSyncInfoRec, *EventSyncInfoPtr;
+
+extern EventSyncInfoRec syncEvents;
+
+/**
+ * Given a sprite, returns the window at the bottom of the trace (i.e. the
+ * furthest window from the root).
+ */
+static inline WindowPtr
+DeepestSpriteWin(SpritePtr sprite)
+{
+ return sprite->spriteTrace[sprite->spriteTraceGood - 1];
+}
+
+struct _XI2Mask {
+ unsigned char **masks; /* event mask in masks[deviceid][event type byte] */
+ size_t nmasks; /* number of masks */
+ size_t mask_size; /* size of each mask in bytes */
+};
+
+#endif /* INPUTSTRUCT_H */
diff --git a/prebuilt/xlibre/usr/include/xorg/libinput-properties.h b/prebuilt/xlibre/usr/include/xorg/libinput-properties.h
new file mode 100644
index 0000000..2034338
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/libinput-properties.h
@@ -0,0 +1,269 @@
+/*
+ * SPDX-License-Identifier: MIT
+ *
+ * Copyright © 2015 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 (including the next
+ * paragraph) 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
+ * AUTHORS OR COPYRIGHT HOLDERS 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 _LIBINPUT_PROPERTIES_H_
+#define _LIBINPUT_PROPERTIES_H_
+
+/* Tapping enabled/disabled: BOOL, 1 value */
+#define LIBINPUT_PROP_TAP "libinput Tapping Enabled"
+
+/* Tapping default enabled/disabled: BOOL, 1 value, read-only */
+#define LIBINPUT_PROP_TAP_DEFAULT "libinput Tapping Enabled Default"
+
+/* Tap drag enabled/disabled: BOOL, 1 value */
+#define LIBINPUT_PROP_TAP_DRAG "libinput Tapping Drag Enabled"
+
+/* Tap drag default enabled/disabled: BOOL, 1 value, read-only */
+#define LIBINPUT_PROP_TAP_DRAG_DEFAULT "libinput Tapping Drag Enabled Default"
+
+/* Tap drag lock enabled/disabled: BOOL, 1 value */
+#define LIBINPUT_PROP_TAP_DRAG_LOCK "libinput Tapping Drag Lock Enabled"
+
+/* Tap drag lock default enabled/disabled: BOOL, 1 value, read-only */
+#define LIBINPUT_PROP_TAP_DRAG_LOCK_DEFAULT "libinput Tapping Drag Lock Enabled Default"
+
+/* Tap button order: BOOL, 2 values in order LRM, LMR, only one may be set
+ at any time */
+#define LIBINPUT_PROP_TAP_BUTTONMAP "libinput Tapping Button Mapping Enabled"
+
+/* Tap button default order: BOOL, 2 values in order LRM, LMR, read-only */
+#define LIBINPUT_PROP_TAP_BUTTONMAP_DEFAULT "libinput Tapping Button Mapping Default"
+
+/* Clickfinger button order: BOOL, 2 values in order LRM, LMR, only one may be set
+ at any time */
+#define LIBINPUT_PROP_CLICKFINGER_BUTTONMAP "libinput Clickfinger Button Mapping Enabled"
+
+/* Clickfinger button default order: BOOL, 2 values in order LRM, LMR, read-only */
+#define LIBINPUT_PROP_CLICKFINGER_BUTTONMAP_DEFAULT "libinput Clickfinger Button Mapping Default"
+
+/* Calibration matrix: FLOAT, 9 values of a 3x3 matrix, in rows */
+#define LIBINPUT_PROP_CALIBRATION "libinput Calibration Matrix"
+
+/* Calibration matrix: FLOAT, 9 values of a 3x3 matrix, in rows, read-only*/
+#define LIBINPUT_PROP_CALIBRATION_DEFAULT "libinput Calibration Matrix Default"
+
+/* Pointer accel speed: FLOAT, 1 value, 32 bit */
+#define LIBINPUT_PROP_ACCEL "libinput Accel Speed"
+
+/* Pointer accel speed: FLOAT, 1 value, 32 bit, read-only*/
+#define LIBINPUT_PROP_ACCEL_DEFAULT "libinput Accel Speed Default"
+
+/* Pointer accel profile: BOOL, 3 values in order adaptive, flat, custom
+ * only one is enabled at a time at max, read-only */
+#define LIBINPUT_PROP_ACCEL_PROFILES_AVAILABLE "libinput Accel Profiles Available"
+
+/* Pointer accel profile: BOOL, 3 values in order adaptive, flat, custom
+ only one is enabled at a time at max, read-only */
+#define LIBINPUT_PROP_ACCEL_PROFILE_ENABLED_DEFAULT "libinput Accel Profile Enabled Default"
+
+/* Pointer accel profile: BOOL, 3 values in order adaptive, flat, custom
+ only one is enabled at a time at max */
+#define LIBINPUT_PROP_ACCEL_PROFILE_ENABLED "libinput Accel Profile Enabled"
+
+/* Points for the custom accel profile: FLOAT, N values */
+#define LIBINPUT_PROP_ACCEL_CUSTOM_POINTS_FALLBACK "libinput Accel Custom Fallback Points"
+
+/* Steps for the custom accel profile: FLOAT, 1 value */
+#define LIBINPUT_PROP_ACCEL_CUSTOM_STEP_FALLBACK "libinput Accel Custom Fallback Step"
+
+/* Points for the custom accel profile: FLOAT, N values */
+#define LIBINPUT_PROP_ACCEL_CUSTOM_POINTS_MOTION "libinput Accel Custom Motion Points"
+
+/* Steps for the custom accel profile: FLOAT, 1 value */
+#define LIBINPUT_PROP_ACCEL_CUSTOM_STEP_MOTION "libinput Accel Custom Motion Step"
+
+/* Points for the custom accel profile: FLOAT, N values */
+#define LIBINPUT_PROP_ACCEL_CUSTOM_POINTS_SCROLL "libinput Accel Custom Scroll Points"
+
+/* Steps for the custom accel profile: FLOAT, 1 value */
+#define LIBINPUT_PROP_ACCEL_CUSTOM_STEP_SCROLL "libinput Accel Custom Scroll Step"
+
+/* Natural scrolling: BOOL, 1 value */
+#define LIBINPUT_PROP_NATURAL_SCROLL "libinput Natural Scrolling Enabled"
+
+/* Natural scrolling: BOOL, 1 value, read-only */
+#define LIBINPUT_PROP_NATURAL_SCROLL_DEFAULT "libinput Natural Scrolling Enabled Default"
+
+/* Send-events mode: BOOL read-only, 2 values in order disabled,
+ disabled-on-external-mouse */
+#define LIBINPUT_PROP_SENDEVENTS_AVAILABLE "libinput Send Events Modes Available"
+
+/* Send-events mode: BOOL, 2 values in order disabled,
+ disabled-on-external-mouse */
+#define LIBINPUT_PROP_SENDEVENTS_ENABLED "libinput Send Events Mode Enabled"
+
+/* Send-events mode: BOOL, 2 values in order disabled,
+ disabled-on-external-mouse, read-only */
+#define LIBINPUT_PROP_SENDEVENTS_ENABLED_DEFAULT "libinput Send Events Mode Enabled Default"
+
+/* Left-handed enabled/disabled: BOOL, 1 value */
+#define LIBINPUT_PROP_LEFT_HANDED "libinput Left Handed Enabled"
+
+/* Left-handed enabled/disabled: BOOL, 1 value, read-only */
+#define LIBINPUT_PROP_LEFT_HANDED_DEFAULT "libinput Left Handed Enabled Default"
+
+/* Scroll method: BOOL read-only, 3 values in order 2fg, edge, button.
+ shows available scroll methods */
+#define LIBINPUT_PROP_SCROLL_METHODS_AVAILABLE "libinput Scroll Methods Available"
+
+/* Scroll method: BOOL, 3 values in order 2fg, edge, button
+ only one is enabled at a time at max */
+#define LIBINPUT_PROP_SCROLL_METHOD_ENABLED "libinput Scroll Method Enabled"
+
+/* Scroll method: BOOL, 3 values in order 2fg, edge, button
+ only one is enabled at a time at max, read-only */
+#define LIBINPUT_PROP_SCROLL_METHOD_ENABLED_DEFAULT "libinput Scroll Method Enabled Default"
+
+/* Scroll button for button scrolling: 32-bit int, 1 value */
+#define LIBINPUT_PROP_SCROLL_BUTTON "libinput Button Scrolling Button"
+
+/* Scroll button for button scrolling: 32-bit int, 1 value, read-only */
+#define LIBINPUT_PROP_SCROLL_BUTTON_DEFAULT "libinput Button Scrolling Button Default"
+
+/* Scroll button lock: BOOL, 1 value, TRUE for enabled, FALSE otherwise */
+#define LIBINPUT_PROP_SCROLL_BUTTON_LOCK "libinput Button Scrolling Button Lock Enabled"
+
+/* Scroll button lock: BOOL, 1 value, TRUE for enabled, FALSE otherwise, read-only*/
+#define LIBINPUT_PROP_SCROLL_BUTTON_LOCK_DEFAULT "libinput Button Scrolling Button Lock Enabled Default"
+
+/* Scroll pixel distance: CARD32, 1 value (with implementation-defined limits) */
+#define LIBINPUT_PROP_SCROLL_PIXEL_DISTANCE "libinput Scrolling Pixel Distance"
+
+/* Scroll pixel distance: CARD32, 1 value, read-only */
+#define LIBINPUT_PROP_SCROLL_PIXEL_DISTANCE_DEFAULT "libinput Scrolling Pixel Distance Default"
+
+/* Scroll factor: FLOAT, 1 value, 32 bit */
+#define LIBINPUT_PROP_SCROLL_FACTOR "libinput Scrolling Factor"
+
+/* Scroll factor: FLOAT, 1 value, 32 bit, read-only */
+#define LIBINPUT_PROP_SCROLL_FACTOR_DEFAULT "libinput Scrolling Factor Default"
+
+/* Click method: BOOL read-only, 2 values in order buttonareas, clickfinger
+ shows available click methods */
+#define LIBINPUT_PROP_CLICK_METHODS_AVAILABLE "libinput Click Methods Available"
+
+/* Click method: BOOL, 2 values in order buttonareas, clickfinger
+ only one enabled at a time at max */
+#define LIBINPUT_PROP_CLICK_METHOD_ENABLED "libinput Click Method Enabled"
+
+/* Click method: BOOL, 2 values in order buttonareas, clickfinger
+ only one enabled at a time at max, read-only */
+#define LIBINPUT_PROP_CLICK_METHOD_ENABLED_DEFAULT "libinput Click Method Enabled Default"
+
+/* Middle button emulation: BOOL, 1 value */
+#define LIBINPUT_PROP_MIDDLE_EMULATION_ENABLED "libinput Middle Emulation Enabled"
+
+/* Middle button emulation: BOOL, 1 value, read-only */
+#define LIBINPUT_PROP_MIDDLE_EMULATION_ENABLED_DEFAULT "libinput Middle Emulation Enabled Default"
+
+/* Disable while typing: BOOL, 1 value */
+#define LIBINPUT_PROP_DISABLE_WHILE_TYPING "libinput Disable While Typing Enabled"
+
+/* Disable while typing: BOOL, 1 value, read-only */
+#define LIBINPUT_PROP_DISABLE_WHILE_TYPING_DEFAULT "libinput Disable While Typing Enabled Default"
+
+/* Drag lock buttons, either:
+ CARD8, one value, the meta lock button, or
+ CARD8, n * 2 values, the drag lock pairs with n being the button and n+1
+ the target button number */
+#define LIBINPUT_PROP_DRAG_LOCK_BUTTONS "libinput Drag Lock Buttons"
+
+/* Horizontal scroll events enabled: BOOL, 1 value (0 or 1).
+ * If disabled, horizontal scroll events are discarded */
+#define LIBINPUT_PROP_HORIZ_SCROLL_ENABLED "libinput Horizontal Scroll Enabled"
+
+/* Number of modes each pad mode group has available: CARD8, one for each
+ * pad mode group, read-only.
+ */
+#define LIBINPUT_PROP_TABLET_PAD_MODE_GROUPS_AVAILABLE "libinput Pad Mode Groups Modes Available"
+
+/* Mode each pad mode group is currently in: CARD8, one for each pad mode
+ * group, read-only.
+ */
+#define LIBINPUT_PROP_TABLET_PAD_MODE_GROUPS "libinput Pad Mode Groups Modes"
+
+/* The association of each logical button with the pad mode group: INT8,
+ * one for each logical button. If set to -1 the button cannot be associated
+ * with a mode group. read-only
+ */
+#define LIBINPUT_PROP_TABLET_PAD_MODE_GROUP_BUTTONS "libinput Pad Mode Group Buttons"
+
+/* The association of each logical strip with the pad mode group: INT8,
+ * one for each logical strip. If set to -1 the strip cannot be associated
+ * with a mode group. read-only
+ */
+#define LIBINPUT_PROP_TABLET_PAD_MODE_GROUP_STRIPS "libinput Pad Mode Group Strips"
+
+/* The association of each logical ring with the pad mode group: INT8,
+ * one for each logical ring. If set to -1 the ring cannot be associated
+ * with a mode group. read-only
+ */
+#define LIBINPUT_PROP_TABLET_PAD_MODE_GROUP_RINGS "libinput Pad Mode Group Rings"
+
+/* Device rotation: FLOAT, 1 value, 32 bit */
+#define LIBINPUT_PROP_ROTATION_ANGLE "libinput Rotation Angle"
+
+/* Device rotation: FLOAT, 1 value, 32 bit, read-only */
+#define LIBINPUT_PROP_ROTATION_ANGLE_DEFAULT "libinput Rotation Angle Default"
+
+/* Tablet tool pressure curve: float, 8 values, 32 bit
+ * Value range is [0.0, 1.0], the values specify the x/y of the four
+ * control points for a cubic bezier curve.
+ * Default value: 0.0 0.0 0.0 0.0 1.0 1.0 1.0 1.0
+ */
+#define LIBINPUT_PROP_TABLET_TOOL_PRESSURECURVE "libinput Tablet Tool Pressurecurve"
+
+/* Tablet tool pressure range: float, 2 values, 32 bit
+ * Value range is [0.0, 1.0] for min and max physical pressure to map to the logical range
+ * Default value: 0.0 1.0
+ */
+#define LIBINPUT_PROP_TABLET_TOOL_PRESSURE_RANGE "libinput Tablet Tool Pressure Range"
+
+/* Tablet tool pressure range: float, 2 values, 32 bit, read-only */
+#define LIBINPUT_PROP_TABLET_TOOL_PRESSURE_RANGE_DEFAULT "libinput Tablet Tool Pressure Range Default"
+
+/* Tablet tool area ratio: CARD32, 2 values, w and h */
+#define LIBINPUT_PROP_TABLET_TOOL_AREA_RATIO "libinput Tablet Tool Area Ratio"
+
+/* High-resolution wheel scroll events enabled: BOOL, 1 value (0 or 1).
+ * If disabled, high-resolution wheel scroll events are discarded */
+#define LIBINPUT_PROP_HIRES_WHEEL_SCROLL_ENABLED "libinput High Resolution Wheel Scroll Enabled"
+
+/* The tablet tool unique serial number: CARD32, 1 value, constant for the
+ * lifetime of the device.
+ *
+ * If this property exists and is zero, the tool does not have a unique serial
+ * number.
+ */
+#define LIBINPUT_PROP_TABLET_TOOL_SERIAL "libinput Tablet Tool Serial"
+
+/* The tablet tool hardware ID: CARD32, 1 value, constant for the lifetime of the device.
+ *
+ * This property only exists if the device has a known tool ID.
+ * See libinput_tablet_tool_get_tool_id() in the libinput documentation for details.
+ */
+#define LIBINPUT_PROP_TABLET_TOOL_ID "libinput Tablet Tool ID"
+
+#endif /* _LIBINPUT_PROPERTIES_H_ */
diff --git a/prebuilt/xlibre/usr/include/xorg/list.h b/prebuilt/xlibre/usr/include/xorg/list.h
new file mode 100644
index 0000000..349d99a
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/list.h
@@ -0,0 +1,554 @@
+/*
+ * Copyright © 2010 Intel Corporation
+ * Copyright © 2010 Francisco Jerez
+ *
+ * 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 (including the next
+ * paragraph) 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 AUTHORS OR COPYRIGHT HOLDERS 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 _XORG_LIST_H_
+#define _XORG_LIST_H_
+
+#include /* offsetof() */
+
+/**
+ * @file Classic doubly-link circular list implementation.
+ * For real usage examples of the linked list, see the file test/list.c
+ *
+ * Example:
+ * We need to keep a list of struct foo in the parent struct bar, i.e. what
+ * we want is something like this.
+ *
+ * struct bar {
+ * ...
+ * struct foo *list_of_foos; -----> struct foo {}, struct foo {}, struct foo{}
+ * ...
+ * }
+ *
+ * We need one list head in bar and a list element in all list_of_foos (both are of
+ * data type 'struct xorg_list').
+ *
+ * struct bar {
+ * ...
+ * struct xorg_list list_of_foos;
+ * ...
+ * }
+ *
+ * struct foo {
+ * ...
+ * struct xorg_list entry;
+ * ...
+ * }
+ *
+ * Now we initialize the list head:
+ *
+ * struct bar bar;
+ * ...
+ * xorg_list_init(&bar.list_of_foos);
+ *
+ * Then we create the first element and add it to this list:
+ *
+ * struct foo *foo = malloc(...);
+ * ....
+ * xorg_list_add(&foo->entry, &bar.list_of_foos);
+ *
+ * Repeat the above for each element you want to add to the list. Deleting
+ * works with the element itself.
+ * xorg_list_del(&foo->entry);
+ * free(foo);
+ *
+ * Note: calling xorg_list_del(&bar.list_of_foos) will set bar.list_of_foos to an empty
+ * list again.
+ *
+ * Looping through the list requires a 'struct foo' as iterator and the
+ * name of the field the subnodes use.
+ *
+ * struct foo *iterator;
+ * xorg_list_for_each_entry(iterator, &bar.list_of_foos, entry) {
+ * if (iterator->something == ...)
+ * ...
+ * }
+ *
+ * Note: You must not call xorg_list_del() on the iterator if you continue the
+ * loop. You need to run the safe for-each loop instead:
+ *
+ * struct foo *iterator, *next;
+ * xorg_list_for_each_entry_safe(iterator, next, &bar.list_of_foos, entry) {
+ * if (...)
+ * xorg_list_del(&iterator->entry);
+ * }
+ *
+ * WARNING: entries MUST NOT be added to the list twice, otherwise iterating
+ * will end up in infinite loop.
+ * WARNING: entries MUST NOT be added to multiple lists - use separate entry
+ * nodes within the container struct, if it needs to be added to
+ * several lists at the same time.
+ */
+
+/**
+ * The linkage struct for list nodes. This struct must be part of your
+ * to-be-linked struct. struct xorg_list is required for both the head of the
+ * list and for each list node.
+ *
+ * Position and name of the struct xorg_list field is irrelevant.
+ * There are no requirements that elements of a list are of the same type.
+ * There are no requirements for a list head, any struct xorg_list can be a list
+ * head.
+ */
+struct xorg_list {
+ struct xorg_list *next, *prev;
+};
+
+/**
+ * Initialize the list as an empty list.
+ *
+ * Example:
+ * xorg_list_init(&bar->list_of_foos);
+ *
+ * @param list The list to initialize
+ */
+static inline void
+xorg_list_init(struct xorg_list *list)
+{
+ list->next = list->prev = list;
+}
+
+static inline void
+__xorg_list_autoinit(struct xorg_list *head)
+{
+ if ((!head->prev) && (!head->next))
+ xorg_list_init(head);
+}
+
+static inline void
+__xorg_list_add(struct xorg_list *entry,
+ struct xorg_list *prev, struct xorg_list *next)
+{
+ next->prev = entry;
+ entry->next = next;
+ entry->prev = prev;
+ prev->next = entry;
+}
+
+/**
+ * Insert a new element after the given list head. The new element does not
+ * need to be initialised as empty list.
+ * The list changes from:
+ * head → some element → ...
+ * to
+ * head → new element → older element → ...
+ *
+ * Example:
+ * struct foo *newfoo = malloc(...);
+ * xorg_list_add(&newfoo->entry, &bar->list_of_foos);
+ *
+ * @param entry The new element to prepend to the list.
+ * @param head The existing list.
+ */
+static inline void
+xorg_list_add(struct xorg_list *entry, struct xorg_list *head)
+{
+ __xorg_list_autoinit(head);
+ __xorg_list_add(entry, head, head->next);
+}
+
+/**
+ * Append a new element to the end of the list given with this list head.
+ *
+ * The list changes from:
+ * head → some element → ... → lastelement
+ * to
+ * head → some element → ... → lastelement → new element
+ *
+ * Example:
+ * struct foo *newfoo = malloc(...);
+ * xorg_list_append(&newfoo->entry, &bar->list_of_foos);
+ *
+ * @param entry The new element to append to the list.
+ * @param head The existing list.
+ */
+static inline void
+xorg_list_append(struct xorg_list *entry, struct xorg_list *head)
+{
+ __xorg_list_autoinit(head);
+ __xorg_list_add(entry, head->prev, head);
+}
+
+static inline void
+__xorg_list_del(struct xorg_list *prev, struct xorg_list *next)
+{
+ next->prev = prev;
+ prev->next = next;
+}
+
+/**
+ * Remove the element from the list it is in. Using this function will reset
+ * the pointers to/from this element so it is removed from the list. It does
+ * NOT free the element itself or manipulate it otherwise.
+ *
+ * Using xorg_list_del on a pure list head (like in the example at the top of
+ * this file) will NOT remove the first element from
+ * the list but rather reset the list as empty list.
+ *
+ * Example:
+ * xorg_list_del(&foo->entry);
+ *
+ * @param entry The element to remove.
+ */
+static inline void
+xorg_list_del(struct xorg_list *entry)
+{
+ __xorg_list_autoinit(entry);
+ __xorg_list_del(entry->prev, entry->next);
+ xorg_list_init(entry);
+}
+
+/**
+ * Check if the list is empty.
+ *
+ * Example:
+ * xorg_list_is_empty(&bar->list_of_foos);
+ *
+ * @return True if the list is empty or False if the list contains one or more
+ * elements.
+ */
+static inline int
+xorg_list_is_empty(struct xorg_list *head)
+{
+ return ((head->next == NULL) || (head->next == head));
+}
+
+/**
+ * @brief check whether element already is in list
+ *
+ * @param entry The element to check for
+ * @param head The existing list.
+ * @return zero when entry isn't present in list, otherwise non-zero
+ */
+static inline int
+xorg_list_present(struct xorg_list *entry, struct xorg_list *head)
+{
+ for (struct xorg_list *l=head->next; l && (l != head); l=l->next) {
+ if (l == entry)
+ return 1;
+ }
+ return 0;
+}
+
+/**
+ * @brief prepend a new element to the end of the list if not existing yet
+ *
+ * Same as xorg_list_add(), but protecting against duplicate insertion.
+ *
+ * @param entry The new element to append to the list.
+ * @param head The existing list.
+ * @return zero if element already in list, otherwise non-zero
+ */
+static inline int
+xorg_list_add_ndup(struct xorg_list *entry, struct xorg_list *head)
+{
+ if (xorg_list_present(entry, head))
+ return 0;
+
+ xorg_list_add(entry, head);
+ return 1;
+}
+
+/**
+ * @brief append a new element to the end of the list if not existing yet
+ *
+ * Same as xorg_list_append(), but protecting against duplicate insertion.
+ *
+ * @param entry The new element to append to the list.
+ * @param head The existing list.
+ * @return zero if element already in list, otherwise non-zero
+ */
+static inline int
+xorg_list_append_ndup(struct xorg_list *entry, struct xorg_list *head)
+{
+ if (xorg_list_present(entry, head))
+ return 0;
+
+ xorg_list_append(entry, head);
+ return 1;
+}
+
+/**
+ * Returns a pointer to the container of this list element.
+ *
+ * Example:
+ * struct foo* f;
+ * f = container_of(&foo->entry, struct foo, entry);
+ * assert(f == foo);
+ *
+ * @param ptr Pointer to the struct xorg_list.
+ * @param type Data type of the list element.
+ * @param member Member name of the struct xorg_list field in the list element.
+ * @return A pointer to the data struct containing the list head.
+ */
+#ifndef container_of
+#define container_of(ptr, type, member) \
+ (type *)((char *)(ptr) - offsetof(type, member))
+#endif
+
+/**
+ * Alias of container_of
+ */
+#define xorg_list_entry(ptr, type, member) \
+ container_of((ptr), type, member)
+
+/**
+ * Retrieve the first list entry for the given list pointer.
+ *
+ * Example:
+ * struct foo *first;
+ * first = xorg_list_first_entry(&bar->list_of_foos, struct foo, list_of_foos);
+ *
+ * @param ptr The list head
+ * @param type Data type of the list element to retrieve
+ * @param member Member name of the struct xorg_list field in the list element.
+ * @return A pointer to the first list element.
+ */
+#define xorg_list_first_entry(ptr, type, member) \
+ xorg_list_entry((ptr)->next, type, member)
+
+/**
+ * Retrieve the last list entry for the given listpointer.
+ *
+ * Example:
+ * struct foo *first;
+ * first = xorg_list_last_entry(&bar->list_of_foos, struct foo, list_of_foos);
+ *
+ * @param ptr The list head
+ * @param type Data type of the list element to retrieve
+ * @param member Member name of the struct xorg_list field in the list element.
+ * @return A pointer to the last list element.
+ */
+#define xorg_list_last_entry(ptr, type, member) \
+ xorg_list_entry((ptr)->prev, type, member)
+
+#define __container_of(ptr, sample, member) \
+ container_of((ptr), typeof(*(sample)), member)
+
+/**
+ * Loop through the list given by head and set pos to struct in the list.
+ *
+ * Example:
+ * struct foo *iterator;
+ * xorg_list_for_each_entry(iterator, &bar->list_of_foos, entry) {
+ * [modify iterator]
+ * }
+ *
+ * This macro is not safe for node deletion. Use xorg_list_for_each_entry_safe
+ * instead.
+ *
+ * @param pos Iterator variable of the type of the list elements.
+ * @param head List head
+ * @param member Member name of the struct xorg_list in the list elements.
+ *
+ */
+#define xorg_list_for_each_entry(pos, head, member) \
+ for ((pos) = NULL, \
+ (pos) = __container_of((head)->next, (pos), member); \
+ (((head)->next != NULL) && &(pos)->member != (head)); \
+ (pos) = __container_of((pos)->member.next, (pos), member))
+
+/**
+ * Loop through the list, keeping a backup pointer to the element. This
+ * macro allows for the deletion of a list element while looping through the
+ * list.
+ *
+ * See xorg_list_for_each_entry for more details.
+ */
+#define xorg_list_for_each_entry_safe(pos, tmp, head, member) \
+ for ((pos) = NULL, \
+ (pos) = __container_of((head)->next, (pos), member), \
+ (tmp) = __container_of((head)->next ? (pos)->member.next : NULL, (pos), member); \
+ (((head)->next != NULL) && (&(pos)->member != (head))); \
+ (pos) = (tmp), (tmp) = __container_of((pos)->member.next, (tmp), member))
+
+/* NULL-Terminated List Interface
+ *
+ * The interface below does _not_ use the struct xorg_list as described above.
+ * It is mainly for legacy structures that cannot easily be switched to
+ * struct xorg_list.
+ *
+ * This interface is for structs like
+ * struct foo {
+ * [...]
+ * struct foo *next;
+ * [...]
+ * };
+ *
+ * The position and field name of "next" are arbitrary.
+ */
+
+/**
+ * Init the element as null-terminated list.
+ *
+ * Example:
+ * struct foo *list = malloc();
+ * nt_list_init(list, next);
+ *
+ * @param list The list element that will be the start of the list
+ * @param member Member name of the field pointing to next struct
+ */
+#define nt_list_init(_list, _member) \
+ (_list)->_member = NULL
+
+/**
+ * Returns the next element in the list or NULL on termination.
+ *
+ * Example:
+ * struct foo *element = list;
+ * while ((element = nt_list_next(element, next)) { }
+ *
+ * This macro is not safe for node deletion. Use nt_list_for_each_entry_safe
+ * instead.
+ *
+ * @param list The list or current element.
+ * @param member Member name of the field pointing to next struct.
+ */
+#define nt_list_next(_list, _member) \
+ (_list)->_member
+
+/**
+ * Iterate through each element in the list.
+ *
+ * Example:
+ * struct foo *iterator;
+ * nt_list_for_each_entry(iterator, list, next) {
+ * [modify iterator]
+ * }
+ *
+ * @param entry Assigned to the current list element
+ * @param list The list to iterate through.
+ * @param member Member name of the field pointing to next struct.
+ */
+#define nt_list_for_each_entry(_entry, _list, _member) \
+ for ((_entry) = (_list); (_entry); (_entry) = (_entry)->_member)
+
+/**
+ * Iterate through each element in the list, keeping a backup pointer to the
+ * element. This macro allows for the deletion of a list element while
+ * looping through the list.
+ *
+ * See nt_list_for_each_entry for more details.
+ *
+ * @param entry Assigned to the current list element
+ * @param tmp The pointer to the next element
+ * @param list The list to iterate through.
+ * @param member Member name of the field pointing to next struct.
+ */
+#define nt_list_for_each_entry_safe(_entry, _tmp, _list, _member) \
+ for ((_entry) = (_list), (_tmp) = (_entry) ? (_entry)->_member : NULL;\
+ (_entry); \
+ (_entry) = (_tmp), (_tmp) = (_tmp) ? (_tmp)->_member: NULL)
+
+/**
+ * Append the element to the end of the list. This macro may be used to
+ * merge two lists.
+ *
+ * Example:
+ * struct foo *elem = malloc(...);
+ * nt_list_init(elem, next)
+ * nt_list_append(elem, list, struct foo, next);
+ *
+ * Resulting list order:
+ * list_item_0 -> list_item_1 -> ... -> elem_item_0 -> elem_item_1 ...
+ *
+ * @param entry An entry (or list) to append to the list
+ * @param list The list to append to. This list must be a valid list, not
+ * NULL.
+ * @param type The list type
+ * @param member Member name of the field pointing to next struct
+ */
+#define nt_list_append(_entry, _list, _type, _member) \
+ do { \
+ _type *__iterator = (_list); \
+ while (__iterator->_member) { __iterator = __iterator->_member;}\
+ __iterator->_member = (_entry); \
+ } while (0)
+
+/**
+ * Insert the element at the next position in the list. This macro may be
+ * used to insert a list into a list.
+ *
+ * struct foo *elem = malloc(...);
+ * nt_list_init(elem, next)
+ * nt_list_insert(elem, list, struct foo, next);
+ *
+ * Resulting list order:
+ * list_item_0 -> elem_item_0 -> elem_item_1 ... -> list_item_1 -> ...
+ *
+ * @param entry An entry (or list) to append to the list
+ * @param list The list to insert to. This list must be a valid list, not
+ * NULL.
+ * @param type The list type
+ * @param member Member name of the field pointing to next struct
+ */
+#define nt_list_insert(_entry, _list, _type, _member) \
+ do { \
+ nt_list_append((_list)->_member, (_entry), _type, _member); \
+ (_list)->_member = (_entry); \
+ } while (0)
+
+/**
+ * Delete the entry from the list by iterating through the list and
+ * removing any reference from the list to the entry.
+ *
+ * Example:
+ * struct foo *elem =
+ * nt_list_del(elem, list, struct foo, next);
+ *
+ * @param entry The entry to delete from the list. entry is always
+ * re-initialized as a null-terminated list.
+ * @param list The list containing the entry, set to the new list without
+ * the removed entry.
+ * @param type The list type
+ * @param member Member name of the field pointing to the next entry
+ */
+#define nt_list_del(_entry, _list, _type, _member) \
+ do { \
+ _type *__e = (_entry); \
+ if (__e == NULL || (_list) == NULL) break; \
+ if ((_list) == __e) { \
+ (_list) = __e->_member; \
+ } else { \
+ _type *__prev = (_list); \
+ while (__prev->_member && __prev->_member != __e) \
+ __prev = nt_list_next(__prev, _member); \
+ if (__prev->_member) \
+ __prev->_member = __e->_member; \
+ } \
+ nt_list_init(__e, _member); \
+ } while(0)
+
+/**
+ * DO NOT USE THIS.
+ * This is a remainder of the xfree86 DDX attempt of having a set of generic
+ * list functions. Unfortunately, the xf86OptionRec uses it and we can't
+ * easily get rid of it. Do not use for new code.
+ */
+typedef struct generic_list_rec {
+ void *next;
+} GenericListRec, *GenericListPtr, *glp;
+
+#endif
diff --git a/prebuilt/xlibre/usr/include/xorg/mi.h b/prebuilt/xlibre/usr/include/xorg/mi.h
new file mode 100644
index 0000000..7144fb5
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/mi.h
@@ -0,0 +1,300 @@
+/***********************************************************
+
+Copyright 1987, 1998 The Open Group
+
+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.
+
+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
+OPEN GROUP 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.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+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 Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL 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 MI_H
+#define MI_H
+
+#include
+#include
+
+#include "regionstr.h"
+#include "validate.h"
+#include "window.h"
+#include "gc.h"
+#include "input.h"
+#include "cursor.h"
+#include "privates.h"
+#include "colormap.h"
+#include "events.h"
+
+#define MiBits CARD32
+
+typedef struct _miDash *miDashPtr;
+
+#define EVEN_DASH 0
+#define ODD_DASH ~0
+
+/* miarc.c */
+
+extern _X_EXPORT void miPolyArc(DrawablePtr /*pDraw */ ,
+ GCPtr /*pGC */ ,
+ int /*narcs */ ,
+ xArc * /*parcs */
+ );
+
+/* micopy.c */
+
+#define miGetCompositeClip(pGC) ((pGC)->pCompositeClip)
+
+typedef void (*miCopyProc) (DrawablePtr pSrcDrawable,
+ DrawablePtr pDstDrawable,
+ GCPtr pGC,
+ BoxPtr pDstBox,
+ int nbox,
+ int dx,
+ int dy,
+ Bool reverse,
+ Bool upsidedown, Pixel bitplane, void *closure);
+
+extern _X_EXPORT void
+
+miCopyRegion(DrawablePtr pSrcDrawable,
+ DrawablePtr pDstDrawable,
+ GCPtr pGC,
+ RegionPtr pDstRegion,
+ int dx,
+ int dy, miCopyProc copyProc, Pixel bitPlane, void *closure);
+
+extern _X_EXPORT RegionPtr
+
+miDoCopy(DrawablePtr pSrcDrawable,
+ DrawablePtr pDstDrawable,
+ GCPtr pGC,
+ int xIn,
+ int yIn,
+ int widthSrc,
+ int heightSrc,
+ int xOut,
+ int yOut, miCopyProc copyProc, Pixel bitplane, void *closure);
+
+/* mieq.c */
+
+#ifndef INPUT_H
+typedef struct _DeviceRec *DevicePtr;
+#endif
+
+/* miexpose.c */
+
+extern _X_EXPORT RegionPtr miHandleExposures(DrawablePtr /*pSrcDrawable */ ,
+ DrawablePtr /*pDstDrawable */ ,
+ GCPtr /*pGC */ ,
+ int /*srcx */ ,
+ int /*srcy */ ,
+ int /*width */ ,
+ int /*height */ ,
+ int /*dstx */ ,
+ int /*dsty */
+ );
+
+extern _X_EXPORT void miClearDrawable(DrawablePtr /*pDraw */ ,
+ GCPtr /*pGC */
+ );
+
+/* miglblt.c */
+
+extern _X_EXPORT void miPolyGlyphBlt(DrawablePtr pDrawable,
+ GCPtr pGC,
+ int x,
+ int y,
+ unsigned int nglyph,
+ CharInfoPtr *ppci,
+ void *pglyphBase
+ );
+
+extern _X_EXPORT void miImageGlyphBlt(DrawablePtr pDrawable,
+ GCPtr pGC,
+ int x,
+ int y,
+ unsigned int nglyph,
+ CharInfoPtr *ppci,
+ void *pglyphBase
+ );
+
+/* mipoly.c */
+
+extern _X_EXPORT void miFillPolygon(DrawablePtr /*dst */ ,
+ GCPtr /*pgc */ ,
+ int /*shape */ ,
+ int /*mode */ ,
+ int /*count */ ,
+ DDXPointPtr /*pPts */
+ );
+
+/* mipolypnt.c */
+
+extern _X_EXPORT void miPolyPoint(DrawablePtr /*pDrawable */ ,
+ GCPtr /*pGC */ ,
+ int /*mode */ ,
+ int /*npt */ ,
+ xPoint * /*pptInit */
+ );
+
+/* mipolyrect.c */
+
+extern _X_EXPORT void miPolyRectangle(DrawablePtr /*pDraw */ ,
+ GCPtr /*pGC */ ,
+ int /*nrects */ ,
+ xRectangle * /*pRects */
+ );
+
+/* mipolyseg.c */
+
+extern _X_EXPORT void miPolySegment(DrawablePtr /*pDraw */ ,
+ GCPtr /*pGC */ ,
+ int /*nseg */ ,
+ xSegment * /*pSegs */
+ );
+
+/* mipolytext.c */
+
+extern _X_EXPORT int miPolyText8(DrawablePtr /*pDraw */ ,
+ GCPtr /*pGC */ ,
+ int /*x */ ,
+ int /*y */ ,
+ int /*count */ ,
+ char * /*chars */
+ );
+
+extern _X_EXPORT int miPolyText16(DrawablePtr /*pDraw */ ,
+ GCPtr /*pGC */ ,
+ int /*x */ ,
+ int /*y */ ,
+ int /*count */ ,
+ unsigned short * /*chars */
+ );
+
+extern _X_EXPORT void miImageText8(DrawablePtr /*pDraw */ ,
+ GCPtr /*pGC */ ,
+ int /*x */ ,
+ int /*y */ ,
+ int /*count */ ,
+ char * /*chars */
+ );
+
+extern _X_EXPORT void miImageText16(DrawablePtr /*pDraw */ ,
+ GCPtr /*pGC */ ,
+ int /*x */ ,
+ int /*y */ ,
+ int /*count */ ,
+ unsigned short * /*chars */
+ );
+
+/* mipushpxl.c */
+
+extern _X_EXPORT void miPushPixels(GCPtr /*pGC */ ,
+ PixmapPtr /*pBitMap */ ,
+ DrawablePtr /*pDrawable */ ,
+ int /*dx */ ,
+ int /*dy */ ,
+ int /*xOrg */ ,
+ int /*yOrg */
+ );
+
+/* miscrinit.c */
+extern _X_EXPORT Bool miModifyPixmapHeader(PixmapPtr pPixmap,
+ int width,
+ int height,
+ int depth,
+ int bitsPerPixel,
+ int devKind,
+ void *pPixData
+ );
+
+extern _X_EXPORT Bool miScreenInit(ScreenPtr pScreen,
+ void *pbits,
+ int xsize,
+ int ysize,
+ int dpix,
+ int dpiy,
+ int width,
+ int rootDepth,
+ int numDepths,
+ DepthPtr depths,
+ VisualID rootVisual,
+ int numVisuals,
+ VisualPtr visuals
+ );
+
+/* mivaltree.c */
+
+extern _X_EXPORT void miWideLine(DrawablePtr /*pDrawable */ ,
+ GCPtr /*pGC */ ,
+ int /*mode */ ,
+ int /*npt */ ,
+ DDXPointPtr /*pPts */
+ );
+
+extern _X_EXPORT void miWideDash(DrawablePtr /*pDrawable */ ,
+ GCPtr /*pGC */ ,
+ int /*mode */ ,
+ int /*npt */ ,
+ DDXPointPtr /*pPts */
+ );
+
+extern _X_EXPORT void miPolylines(DrawablePtr pDrawable,
+ GCPtr pGC,
+ int mode,
+ int npt,
+ DDXPointPtr pPts);
+
+/* mizerarc.c */
+
+extern _X_EXPORT void miZeroPolyArc(DrawablePtr /*pDraw */ ,
+ GCPtr /*pGC */ ,
+ int /*narcs */ ,
+ xArc * /*parcs */
+ );
+
+_X_EXPORT void miZeroLine(DrawablePtr dst, GCPtr gc, int mode, int nptInit, xPoint* pptInit);
+_X_EXPORT void miZeroDashLine(DrawablePtr dst, GCPtr pgc, int mode, int nptInit, xPoint *pptInit);
+
+extern _X_EXPORT void miPolyFillArc(DrawablePtr /*pDraw */ ,
+ GCPtr /*pGC */ ,
+ int /*narcs */ ,
+ xArc * /*parcs */
+ );
+
+#endif /* MI_H */
diff --git a/prebuilt/xlibre/usr/include/xorg/micmap.h b/prebuilt/xlibre/usr/include/xorg/micmap.h
new file mode 100644
index 0000000..781b4e4
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/micmap.h
@@ -0,0 +1,43 @@
+#ifndef _MICMAP_H_
+#define _MICMAP_H_
+
+#include
+#include
+#include
+
+#include "colormap.h"
+#include "privates.h"
+#include "screenint.h"
+
+extern _X_EXPORT DevPrivateKeyRec micmapScrPrivateKeyRec;
+
+#define micmapScrPrivateKey (&micmapScrPrivateKeyRec)
+
+extern _X_EXPORT int miListInstalledColormaps(ScreenPtr pScreen,
+ Colormap * pmaps);
+extern _X_EXPORT void miInstallColormap(ColormapPtr pmap);
+extern _X_EXPORT void miUninstallColormap(ColormapPtr pmap);
+
+extern _X_EXPORT void miResolveColor(unsigned short *, unsigned short *,
+ unsigned short *, VisualPtr);
+extern _X_EXPORT Bool miInitializeColormap(ColormapPtr);
+extern _X_EXPORT Bool miCreateDefColormap(ScreenPtr);
+extern _X_EXPORT void miClearVisualTypes(void);
+extern _X_EXPORT Bool miSetVisualTypes(int, int, int, int);
+extern _X_EXPORT Bool miSetPixmapDepths(void);
+extern _X_EXPORT Bool miSetVisualTypesAndMasks(int depth, int visuals,
+ int bitsPerRGB, int preferredCVC,
+ Pixel redMask, Pixel greenMask,
+ Pixel blueMask);
+extern _X_EXPORT int miGetDefaultVisualMask(int);
+extern _X_EXPORT Bool miInitVisuals(VisualPtr *, DepthPtr *, int *, int *,
+ int *, VisualID *, unsigned long, int, int);
+
+#define MAX_PSEUDO_DEPTH 10
+
+#define StaticColorMask (1 << StaticColor)
+#define PseudoColorMask (1 << PseudoColor)
+#define TrueColorMask (1 << TrueColor)
+#define DirectColorMask (1 << DirectColor)
+
+#endif /* _MICMAP_H_ */
diff --git a/prebuilt/xlibre/usr/include/xorg/micoord.h b/prebuilt/xlibre/usr/include/xorg/micoord.h
new file mode 100644
index 0000000..20f467a
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/micoord.h
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2000 The XFree86 Project, Inc. All Rights Reserved.
+ *
+ * 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
+ * XFREE86 PROJECT 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.
+ *
+ * Except as contained in this notice, the name of the XFree86 Project shall
+ * not be used in advertising or otherwise to promote the sale, use or other
+ * dealings in this Software without prior written authorization from the
+ * XFree86 Project.
+ *
+ */
+
+#ifndef _MICOORD_H_
+#define _MICOORD_H_ 1
+
+#include "servermd.h"
+
+/* Macros which handle a coordinate in a single register */
+
+#define GetHighWord(x) (((int) (x)) >> 16)
+
+#if IMAGE_BYTE_ORDER == MSBFirst
+#define coordToInt(x,y) (((x) << 16) | ((y) & 0xffff))
+#define intToX(i) (GetHighWord((i)))
+#define intToY(i) ((int) ((short) (i)))
+#else
+#define coordToInt(x,y) (((y) << 16) | ((x) & 0xffff))
+#define intToX(i) ((int) ((short) (i)))
+#define intToY(i) (GetHighWord((i)))
+#endif
+
+#endif /* _MICOORD_H_ */
diff --git a/prebuilt/xlibre/usr/include/xorg/migc.h b/prebuilt/xlibre/usr/include/xorg/migc.h
new file mode 100644
index 0000000..add601a
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/migc.h
@@ -0,0 +1,54 @@
+/*
+
+Copyright 1993, 1998 The Open Group
+
+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.
+
+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 OPEN GROUP 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.
+
+Except as contained in this notice, the name of The Open Group shall
+not be used in advertising or otherwise to promote the sale, use or
+other dealings in this Software without prior written authorization
+from The Open Group.
+
+*/
+
+#ifndef _MIGC_H
+#define _MIGC_H
+
+extern _X_EXPORT void miChangeGC(GCPtr pGC,
+ unsigned long mask);
+
+extern _X_EXPORT void miDestroyGC(GCPtr pGC);
+
+extern _X_EXPORT void miDestroyClip(GCPtr pGC);
+
+extern _X_EXPORT void miChangeClip(GCPtr pGC,
+ int type,
+ void *pvalue,
+ int nrects);
+
+extern _X_EXPORT void miCopyClip(GCPtr pgcDst,
+ GCPtr pgcSrc);
+
+extern _X_EXPORT void miCopyGC(GCPtr pGCSrc,
+ unsigned long changes,
+ GCPtr pGCDst);
+
+extern _X_EXPORT void miComputeCompositeClip(GCPtr pGC,
+ DrawablePtr pDrawable);
+
+#endif
diff --git a/prebuilt/xlibre/usr/include/xorg/miline.h b/prebuilt/xlibre/usr/include/xorg/miline.h
new file mode 100644
index 0000000..ad6b373
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/miline.h
@@ -0,0 +1,152 @@
+/*
+
+Copyright 1994, 1998 The Open Group
+
+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.
+
+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
+OPEN GROUP 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.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+*/
+
+#ifndef MILINE_H
+#define MILINE_H
+
+#include "screenint.h"
+#include "privates.h"
+
+/*
+ * Public definitions used for configuring basic pixelization aspects
+ * of the sample implementation line-drawing routines provided in
+ * {mfb,mi,cfb*} at run-time.
+ */
+
+#define XDECREASING 4
+#define YDECREASING 2
+#define YMAJOR 1
+
+#define OCTANT1 (1 << (YDECREASING))
+#define OCTANT2 (1 << (YDECREASING|YMAJOR))
+#define OCTANT3 (1 << (XDECREASING|YDECREASING|YMAJOR))
+#define OCTANT4 (1 << (XDECREASING|YDECREASING))
+#define OCTANT5 (1 << (XDECREASING))
+#define OCTANT6 (1 << (XDECREASING|YMAJOR))
+#define OCTANT7 (1 << (YMAJOR))
+#define OCTANT8 (1 << (0))
+
+/*
+ * Devices can configure the rendering of routines in mi, mfb, and cfb*
+ * by specifying a thin line bias to be applied to a particular screen
+ * using the following function. The bias parameter is an OR'ing of
+ * the appropriate OCTANT constants defined above to indicate which
+ * octants to bias a line to prefer an axial step when the Bresenham
+ * error term is exactly zero. The octants are mapped as follows:
+ *
+ * \ | /
+ * \ 3 | 2 /
+ * \ | /
+ * 4 \ | / 1
+ * \|/
+ * -----------
+ * /|\
+ * 5 / | \ 8
+ * / | \
+ * / 6 | 7 \
+ * / | \
+ *
+ * For more information, see "Ambiguities in Incremental Line Rastering,"
+ * Jack E. Bresenham, IEEE CG&A, May 1987.
+ */
+
+extern _X_EXPORT void miSetZeroLineBias(ScreenPtr /* pScreen */ ,
+ unsigned int /* bias */
+ );
+
+/*
+ * Private definitions needed for drawing thin (zero width) lines
+ * Used by the mi, mfb, and all cfb* components.
+ */
+
+#define X_AXIS 0
+#define Y_AXIS 1
+
+#define OUT_LEFT 0x08
+#define OUT_RIGHT 0x04
+#define OUT_ABOVE 0x02
+#define OUT_BELOW 0x01
+
+#define OUTCODES(_result, _x, _y, _pbox) \
+ if ( (_x) < (_pbox)->x1) (_result) |= OUT_LEFT; \
+ else if ( (_x) >= (_pbox)->x2) (_result) |= OUT_RIGHT; \
+ if ( (_y) < (_pbox)->y1) (_result) |= OUT_ABOVE; \
+ else if ( (_y) >= (_pbox)->y2) (_result) |= OUT_BELOW;
+
+#define MIOUTCODES(outcode, x, y, xmin, ymin, xmax, ymax) \
+{\
+ if ((x) < (xmin)) (outcode) |= OUT_LEFT;\
+ if ((x) > (xmax)) (outcode) |= OUT_RIGHT;\
+ if ((y) < (ymin)) (outcode) |= OUT_ABOVE;\
+ if ((y) > (ymax)) (outcode) |= OUT_BELOW;\
+}
+
+#define miGetZeroLineBias(_pScreen) ((unsigned long) (unsigned long*)\
+ dixLookupPrivate(&(_pScreen)->devPrivates, miZeroLineScreenKey))
+
+#define CalcLineDeltas(_x1,_y1,_x2,_y2,_adx,_ady,_sx,_sy,_SX,_SY,_octant) \
+ (_octant) = 0; \
+ (_sx) = (_SX); \
+ if (((_adx) = (_x2) - (_x1)) < 0) { \
+ (_adx) = -(_adx); \
+ ((_sx) = -(_sx)); \
+ (_octant) |= XDECREASING; \
+ } \
+ (_sy) = (_SY); \
+ if (((_ady) = (_y2) - (_y1)) < 0) { \
+ (_ady) = -(_ady); \
+ ((_sy) = -(_sy)); \
+ (_octant) |= YDECREASING; \
+ }
+
+#define SetYMajorOctant(_octant) ((_octant) |= YMAJOR)
+
+#define FIXUP_ERROR(_e, _octant, _bias) \
+ (_e) -= (((_bias) >> (_octant)) & 1)
+
+extern _X_EXPORT DevPrivateKeyRec miZeroLineScreenKeyRec;
+
+#define miZeroLineScreenKey (&miZeroLineScreenKeyRec)
+
+extern _X_EXPORT int miZeroClipLine(int /*xmin */ ,
+ int /*ymin */ ,
+ int /*xmax */ ,
+ int /*ymax */ ,
+ int * /*new_x1 */ ,
+ int * /*new_y1 */ ,
+ int * /*new_x2 */ ,
+ int * /*new_y2 */ ,
+ unsigned int /*adx */ ,
+ unsigned int /*ady */ ,
+ int * /*pt1_clipped */ ,
+ int * /*pt2_clipped */ ,
+ int /*octant */ ,
+ unsigned int /*bias */ ,
+ int /*oc1 */ ,
+ int /*oc2 */
+ );
+
+#endif /* MILINE_H */
diff --git a/prebuilt/xlibre/usr/include/xorg/mipict.h b/prebuilt/xlibre/usr/include/xorg/mipict.h
new file mode 100644
index 0000000..5551d38
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/mipict.h
@@ -0,0 +1,124 @@
+/*
+ *
+ * Copyright © 2000 SuSE, 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 SuSE not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission. SuSE makes no representations about the
+ * suitability of this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ *
+ * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE
+ * 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.
+ *
+ * Author: Keith Packard, SuSE, Inc.
+ */
+
+#ifndef _MIPICT_H_
+#define _MIPICT_H_
+
+#include "picturestr.h"
+
+#define MI_MAX_INDEXED 256 /* XXX depth must be <= 8 */
+
+#if MI_MAX_INDEXED <= 256
+typedef CARD8 miIndexType;
+#endif
+
+typedef struct _miIndexed {
+ Bool color;
+ CARD32 rgba[MI_MAX_INDEXED];
+ miIndexType ent[32768];
+} miIndexedRec, *miIndexedPtr;
+
+#define miCvtR8G8B8to15(s) ((((s) >> 3) & 0x001f) | \
+ (((s) >> 6) & 0x03e0) | \
+ (((s) >> 9) & 0x7c00))
+#define miIndexToEnt15(mif,rgb15) ((mif)->ent[(rgb15)])
+#define miIndexToEnt24(mif,rgb24) miIndexToEnt15((mif),miCvtR8G8B8to15((rgb24)))
+
+#define miIndexToEntY24(mif,rgb24) ((mif)->ent[CvtR8G8B8toY15((rgb24))])
+
+extern _X_EXPORT int
+ miCreatePicture(PicturePtr pPicture);
+
+extern _X_EXPORT void
+ miDestroyPicture(PicturePtr pPicture);
+
+extern _X_EXPORT void
+ miCompositeSourceValidate(PicturePtr pPicture);
+
+extern _X_EXPORT Bool
+
+miComputeCompositeRegion(RegionPtr pRegion,
+ PicturePtr pSrc,
+ PicturePtr pMask,
+ PicturePtr pDst,
+ INT16 xSrc,
+ INT16 ySrc,
+ INT16 xMask,
+ INT16 yMask,
+ INT16 xDst, INT16 yDst, CARD16 width, CARD16 height);
+
+extern _X_EXPORT Bool
+ miPictureInit(ScreenPtr pScreen, PictFormatPtr formats, int nformats);
+
+extern _X_EXPORT Bool
+ miRealizeGlyph(ScreenPtr pScreen, GlyphPtr glyph);
+
+extern _X_EXPORT void
+ miUnrealizeGlyph(ScreenPtr pScreen, GlyphPtr glyph);
+
+extern _X_EXPORT void
+
+miGlyphs(CARD8 op,
+ PicturePtr pSrc,
+ PicturePtr pDst,
+ PictFormatPtr maskFormat,
+ INT16 xSrc,
+ INT16 ySrc, int nlist, GlyphListPtr list, GlyphPtr * glyphs);
+
+extern _X_EXPORT void
+ miRenderColorToPixel(PictFormatPtr pPict, xRenderColor * color, CARD32 *pixel);
+
+extern _X_EXPORT void
+ miRenderPixelToColor(PictFormatPtr pPict, CARD32 pixel, xRenderColor * color);
+
+extern _X_EXPORT Bool
+ miIsSolidAlpha(PicturePtr pSrc);
+
+extern _X_EXPORT void
+
+miCompositeRects(CARD8 op,
+ PicturePtr pDst,
+ xRenderColor * color, int nRect, xRectangle *rects);
+
+extern _X_EXPORT void
+ miTrapezoidBounds(int ntrap, xTrapezoid * traps, BoxPtr box);
+
+extern _X_EXPORT void
+ miPointFixedBounds(int npoint, xPointFixed * points, BoxPtr bounds);
+
+extern _X_EXPORT void
+ miTriangleBounds(int ntri, xTriangle * tris, BoxPtr bounds);
+
+extern _X_EXPORT Bool
+ miInitIndexed(ScreenPtr pScreen, PictFormatPtr pFormat);
+
+extern _X_EXPORT void
+ miCloseIndexed(ScreenPtr pScreen, PictFormatPtr pFormat);
+
+extern _X_EXPORT void
+
+miUpdateIndexed(ScreenPtr pScreen,
+ PictFormatPtr pFormat, int ndef, xColorItem * pdef);
+
+#endif /* _MIPICT_H_ */
diff --git a/prebuilt/xlibre/usr/include/xorg/mipointer.h b/prebuilt/xlibre/usr/include/xorg/mipointer.h
new file mode 100644
index 0000000..ba1710a
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/mipointer.h
@@ -0,0 +1,129 @@
+/*
+
+Copyright 1989, 1998 The Open Group
+
+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.
+
+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
+OPEN GROUP 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.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+*/
+
+#ifndef MIPOINTER_H
+#define MIPOINTER_H
+
+#include "cursor.h"
+#include "input.h"
+#include "privates.h"
+
+typedef struct _miPointerSpriteFuncRec {
+ Bool (*RealizeCursor) (DeviceIntPtr /* pDev */ ,
+ ScreenPtr /* pScr */ ,
+ CursorPtr /* pCurs */
+ );
+ Bool (*UnrealizeCursor) (DeviceIntPtr /* pDev */ ,
+ ScreenPtr /* pScr */ ,
+ CursorPtr /* pCurs */
+ );
+ void (*SetCursor) (DeviceIntPtr /* pDev */ ,
+ ScreenPtr /* pScr */ ,
+ CursorPtr /* pCurs */ ,
+ int /* x */ ,
+ int /* y */
+ );
+ void (*MoveCursor) (DeviceIntPtr /* pDev */ ,
+ ScreenPtr /* pScr */ ,
+ int /* x */ ,
+ int /* y */
+ );
+ Bool (*DeviceCursorInitialize) (DeviceIntPtr /* pDev */ ,
+ ScreenPtr /* pScr */
+ );
+ void (*DeviceCursorCleanup) (DeviceIntPtr /* pDev */ ,
+ ScreenPtr /* pScr */
+ );
+} miPointerSpriteFuncRec, *miPointerSpriteFuncPtr;
+
+typedef struct _miPointerScreenFuncRec {
+ Bool (*CursorOffScreen) (ScreenPtr * /* ppScr */ ,
+ int * /* px */ ,
+ int * /* py */
+ );
+ void (*CrossScreen) (ScreenPtr /* pScr */ ,
+ int /* entering */
+ );
+ void (*WarpCursor) (DeviceIntPtr /*pDev */ ,
+ ScreenPtr /* pScr */ ,
+ int /* x */ ,
+ int /* y */
+ );
+} miPointerScreenFuncRec, *miPointerScreenFuncPtr;
+
+extern _X_EXPORT Bool miDCInitialize(ScreenPtr /*pScreen */ ,
+ miPointerScreenFuncPtr /*screenFuncs */
+ );
+
+extern _X_EXPORT ScreenPtr
+miPointerGetScreen(DeviceIntPtr pDev);
+
+/* Returns the current cursor position. */
+extern _X_EXPORT void
+miPointerGetPosition(DeviceIntPtr pDev, int *x, int *y);
+
+/* Moves the cursor to the specified position. May clip the coordinates:
+ * x and y are modified in-place. */
+extern _X_EXPORT ScreenPtr
+miPointerSetPosition(DeviceIntPtr pDev, int mode, double *x, double *y,
+ int *nevents, InternalEvent *events);
+
+extern _X_EXPORT DevPrivateKeyRec miPointerScreenKeyRec;
+
+#define miPointerScreenKey (&miPointerScreenKeyRec)
+
+/**
+ * @brief initialize pointer cursor with custom handling
+ *
+ * For DDX'es that need their own handling of pointer cursors,
+ * and can't use the generic "soft cursor" that's created via
+ * miDCInitialize().
+ *
+ * That can be the case on certain video HW with it's own sprite support,
+ * or on remote display protocols like RDP, where the client get the cursor
+ * pixmaps sent over the wire and is responsible for painting it on his side.
+ *
+ * Overwrites ScreenPtr vectors:
+ *
+ * ConstrainCursor, CursorLimits, DisplayCursor, RealizeCursor,
+ * UnrealizeCursor, SetCursorPosition, RecolorCursor, DeviceCursorCleanup
+ * DeviceCursorInitialize
+ *
+ * Hooks to ScreenPtr vectors: CloseScreen
+ *
+ * @param pScreen pointer to ScreenRec the pointer handling applies to
+ * @param spireFuncs pointer to miPointerSpriteFuncPtr call vectors
+ * @param screenFuncs pointer to miPointerScreenFuncPtr call vectors
+ * @param waitForUpdate TRUE if MI shouldn't redraw the pointer immediately,
+ but wait for somebody else triggering it explicitly
+ * @return TRUE on success, FALSE usually indicates allocation failure
+ */
+_X_EXPORT Bool
+miPointerInitialize(ScreenPtr pScreen,
+ miPointerSpriteFuncPtr spriteFuncs,
+ miPointerScreenFuncPtr screenFuncs,
+ Bool waitForUpdate);
+
+#endif /* MIPOINTER_H */
diff --git a/prebuilt/xlibre/usr/include/xorg/mipointrst.h b/prebuilt/xlibre/usr/include/xorg/mipointrst.h
new file mode 100644
index 0000000..7419ac1
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/mipointrst.h
@@ -0,0 +1,44 @@
+/*
+ * mipointrst.h
+ *
+ */
+
+/*
+
+Copyright 1989, 1998 The Open Group
+
+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.
+
+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
+OPEN GROUP 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.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+*/
+
+#ifndef MIPOINTRST_H
+#define MIPOINTRST_H
+
+#include "mipointer.h"
+#include "scrnintstr.h"
+
+typedef struct {
+ miPointerSpriteFuncPtr spriteFuncs; /* sprite-specific methods */
+ miPointerScreenFuncPtr screenFuncs; /* screen-specific methods */
+ CloseScreenProcPtr CloseScreen;
+ Bool waitForUpdate; /* don't move cursor from input thread */
+ Bool showTransparent; /* show empty cursors */
+} miPointerScreenRec, *miPointerScreenPtr;
+#endif /* MIPOINTRST_H */
diff --git a/prebuilt/xlibre/usr/include/xorg/misc.h b/prebuilt/xlibre/usr/include/xorg/misc.h
new file mode 100644
index 0000000..d3b7088
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/misc.h
@@ -0,0 +1,306 @@
+/***********************************************************
+
+Copyright 1987, 1998 The Open Group
+
+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.
+
+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
+OPEN GROUP 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.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+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 Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL 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.
+
+Copyright 1992, 1993 Data General Corporation;
+Copyright 1992, 1993 OMRON Corporation
+
+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
+neither the name OMRON or DATA GENERAL be used in advertising or publicity
+pertaining to distribution of the software without specific, written prior
+permission of the party whose name is to be used. Neither OMRON or
+DATA GENERAL make any representation about the suitability of this software
+for any purpose. It is provided "as is" without express or implied warranty.
+
+OMRON AND DATA GENERAL EACH DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
+SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
+IN NO EVENT SHALL OMRON OR DATA GENERAL 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 MISC_H
+#define MISC_H 1
+/*
+ * X internal definitions
+ *
+ */
+
+#include
+#include
+#include
+#include
+#include
+
+#include
+#include
+#include
+
+#ifndef MAXSCREENS
+#define MAXSCREENS 16
+#endif
+#ifndef MAXGPUSCREENS
+#define MAXGPUSCREENS 16
+#endif
+#define MAXFORMATS 8
+#ifndef MAXDEVICES
+#define MAXDEVICES 256 /* input devices */
+#endif
+#define GPU_SCREEN_OFFSET 256
+
+/* 128 event opcodes for core + extension events, excluding GE */
+#define MAXEVENTS 128
+#define EXTENSION_EVENT_BASE 64
+#define EXTENSION_BASE 128
+
+typedef uint32_t ATOM;
+
+/* @brief generic X return code
+ *
+ * this type is should be used instead of plain int for all functions
+ * returning and X error code (that's possibly sent to the client),
+ * in order to make return value semantics clear to the humen reader.
+ *
+ * part of public SDK / driver API.
+ */
+typedef int XRetCode;
+
+#ifndef TRUE
+#define TRUE 1
+#define FALSE 0
+#endif
+
+#include "os.h" /* for ALLOCATE_LOCAL and DEALLOCATE_LOCAL */
+#include /* for bcopy, bzero, and bcmp */
+
+#define NullBox ((BoxPtr)0)
+
+#undef min
+#undef max
+/* @deprecated */
+#define min(a, b) (((a) < (b)) ? (a) : (b))
+#define max(a, b) (((a) > (b)) ? (a) : (b))
+/* abs() is a function, not a macro; include the file declaring
+ * it in case we haven't done that yet.
+ */
+/* this assumes b > 0 */
+#define modulus(a, b, d) if (((d) = (a) % (b)) < 0) (d) += (b)
+
+/* XXX Not for modules */
+#include
+#if !defined(MAXSHORT) || !defined(MINSHORT) || \
+ !defined(MAXINT) || !defined(MININT)
+/*
+ * Some implementations #define these through , so preclude
+ * #include'ing it later.
+ */
+
+#include
+#undef MAXSHORT
+#define MAXSHORT SHRT_MAX
+#undef MINSHORT
+#define MINSHORT SHRT_MIN
+#undef MAXINT
+#define MAXINT INT_MAX
+#undef MININT
+#define MININT INT_MIN
+
+#include
+#include
+#include /* for fopen, etc... */
+
+#endif
+
+/**
+ * Calculate the number of bytes needed to hold bits.
+ * @param bits The minimum number of bits needed.
+ * @return The number of bytes needed to hold bits.
+ */
+static inline int
+bits_to_bytes(const int bits)
+{
+ return ((bits + 7) >> 3);
+}
+
+/**
+ * Calculate the number of 4-byte units needed to hold the given number of
+ * bytes.
+ * @param bytes The minimum number of bytes needed.
+ * @return The number of 4-byte units needed to hold bytes.
+ */
+static inline CARD32
+bytes_to_int32(const size_t bytes)
+{
+ return (CARD32)(((bytes) + 3) >> 2);
+}
+
+/**
+ * Calculate the number of bytes (in multiples of 4) needed to hold bytes.
+ * @param bytes The minimum number of bytes needed.
+ * @return The closest multiple of 4 that is equal or higher than bytes.
+ */
+static inline int
+pad_to_int32(const int bytes)
+{
+ return (((bytes) + 3) & ~3);
+}
+
+/**
+ * Calculate padding needed to bring the number of bytes to an even
+ * multiple of 4.
+ * @param bytes The minimum number of bytes needed.
+ * @return The bytes of padding needed to arrive at the closest multiple of 4
+ * that is equal or higher than bytes.
+ */
+static inline int
+padding_for_int32(const int bytes)
+{
+ return ((-bytes) & 3);
+}
+
+/* some macros to help swap requests, replies, and events */
+
+#define LengthRestS(stuff) \
+ ((client->req_len << 1) - (sizeof(*(stuff)) >> 1))
+
+#define SwapRestS(stuff) \
+ SwapShorts((short *)((stuff) + 1), LengthRestS((stuff)))
+
+#if defined(__GNUC__) && ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
+void __attribute__ ((error("wrong sized variable passed to swap")))
+wrong_size(void);
+#else
+static inline void
+wrong_size(void)
+{
+}
+#endif
+
+#if !(defined(__GNUC__))
+static inline int
+__builtin_constant_p(int x)
+{
+ return 0;
+}
+#endif
+
+static inline uint64_t
+bswap_64(uint64_t x)
+{
+ return (((x & 0xFF00000000000000ull) >> 56) |
+ ((x & 0x00FF000000000000ull) >> 40) |
+ ((x & 0x0000FF0000000000ull) >> 24) |
+ ((x & 0x000000FF00000000ull) >> 8) |
+ ((x & 0x00000000FF000000ull) << 8) |
+ ((x & 0x0000000000FF0000ull) << 24) |
+ ((x & 0x000000000000FF00ull) << 40) |
+ ((x & 0x00000000000000FFull) << 56));
+}
+
+#define swapll(x) do { \
+ if (sizeof(*(x)) != 8) \
+ wrong_size(); \
+ *(x) = bswap_64(*(x)); \
+ } while (0)
+
+static inline uint32_t
+bswap_32(uint32_t x)
+{
+ return (((x & 0xFF000000) >> 24) |
+ ((x & 0x00FF0000) >> 8) |
+ ((x & 0x0000FF00) << 8) |
+ ((x & 0x000000FF) << 24));
+}
+
+#define swapl(x) do { \
+ if (sizeof(*(x)) != 4) \
+ wrong_size(); \
+ *(x) = bswap_32(*(x)); \
+ } while (0)
+
+static inline uint16_t
+bswap_16(uint16_t x)
+{
+ return (((x & 0xFF00) >> 8) |
+ ((x & 0x00FF) << 8));
+}
+
+#define swaps(x) do { \
+ if (sizeof(*(x)) != 2) \
+ wrong_size(); \
+ *(x) = bswap_16(*(x)); \
+ } while (0)
+
+/* copy 32-bit value from src to dst byteswapping on the way */
+#define cpswapl(src, dst) do { \
+ if (sizeof((src)) != 4 || sizeof((dst)) != 4) \
+ wrong_size(); \
+ (dst) = bswap_32((src)); \
+ } while (0)
+
+/* copy short from src to dst byteswapping on the way */
+#define cpswaps(src, dst) do { \
+ if (sizeof((src)) != 2 || sizeof((dst)) != 2) \
+ wrong_size(); \
+ (dst) = bswap_16((src)); \
+ } while (0)
+
+extern _X_EXPORT void SwapShorts(short *list, unsigned long count);
+
+typedef struct _xPoint *DDXPointPtr;
+typedef struct pixman_box16 *BoxPtr;
+typedef struct _xEvent *xEventPtr;
+typedef struct _xRectangle *xRectanglePtr;
+typedef struct _GrabRec *GrabPtr;
+
+typedef unsigned long x_server_generation_t;
+
+extern _X_EXPORT unsigned long globalSerialNumber;
+extern _X_EXPORT x_server_generation_t serverGeneration;
+
+#endif /* MISC_H */
diff --git a/prebuilt/xlibre/usr/include/xorg/miscstruct.h b/prebuilt/xlibre/usr/include/xorg/miscstruct.h
new file mode 100644
index 0000000..589a6cb
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/miscstruct.h
@@ -0,0 +1,65 @@
+/***********************************************************
+
+Copyright 1987, 1998 The Open Group
+
+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.
+
+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
+OPEN GROUP 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.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+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 Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL 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 MISCSTRUCT_H
+#define MISCSTRUCT_H 1
+
+#include "misc.h"
+#include
+#include
+
+typedef xPoint DDXPointRec;
+
+typedef struct pixman_box16 BoxRec;
+
+typedef union _DevUnion {
+ void *ptr;
+ long val;
+ unsigned long uval;
+ void *(*fptr) (void);
+} DevUnion;
+
+#endif /* MISCSTRUCT_H */
diff --git a/prebuilt/xlibre/usr/include/xorg/mistruct.h b/prebuilt/xlibre/usr/include/xorg/mistruct.h
new file mode 100644
index 0000000..e7ba8eb
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/mistruct.h
@@ -0,0 +1,62 @@
+/***********************************************************
+
+Copyright 1987, 1998 The Open Group
+
+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.
+
+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
+OPEN GROUP 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.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+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 Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL 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 MISTRUCT_H
+#define MISTRUCT_H
+
+#include "mi.h"
+#include "regionstr.h"
+
+/* information about dashes */
+typedef struct _miDash {
+ xPoint pt;
+ int e1, e2; /* keep these, so we don't have to do it again */
+ int e; /* bresenham error term for this point on line */
+ int which;
+ int newLine; /* 0 if part of same original line as previous dash */
+} miDashRec;
+
+#endif /* MISTRUCT_H */
diff --git a/prebuilt/xlibre/usr/include/xorg/misync.h b/prebuilt/xlibre/usr/include/xorg/misync.h
new file mode 100644
index 0000000..c8f4a3a
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/misync.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright © 2010 NVIDIA Corporation
+ *
+ * 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 (including the next
+ * paragraph) 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 AUTHORS OR COPYRIGHT HOLDERS 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 _MISYNC_H_
+#define _MISYNC_H_
+
+#include "screenint.h"
+
+typedef struct _SyncObject SyncObject;
+typedef struct _SyncFence SyncFence;
+typedef struct _SyncTrigger SyncTrigger;
+
+typedef void (*SyncScreenCreateFenceFunc) (ScreenPtr pScreen,
+ SyncFence * pFence,
+ Bool initially_triggered);
+typedef void (*SyncScreenDestroyFenceFunc) (ScreenPtr pScreen,
+ SyncFence * pFence);
+
+typedef struct _syncScreenFuncs {
+ SyncScreenCreateFenceFunc CreateFence;
+ SyncScreenDestroyFenceFunc DestroyFence;
+} SyncScreenFuncsRec, *SyncScreenFuncsPtr;
+
+extern _X_EXPORT void
+miSyncScreenCreateFence(ScreenPtr pScreen, SyncFence * pFence,
+ Bool initially_triggered);
+extern _X_EXPORT void
+ miSyncScreenDestroyFence(ScreenPtr pScreen, SyncFence * pFence);
+
+typedef void (*SyncFenceSetTriggeredFunc) (SyncFence * pFence);
+typedef void (*SyncFenceResetFunc) (SyncFence * pFence);
+typedef Bool (*SyncFenceCheckTriggeredFunc) (SyncFence * pFence);
+typedef void (*SyncFenceAddTriggerFunc) (SyncTrigger * pTrigger);
+typedef void (*SyncFenceDeleteTriggerFunc) (SyncTrigger * pTrigger);
+
+typedef struct _syncFenceFuncs {
+ SyncFenceSetTriggeredFunc SetTriggered;
+ SyncFenceResetFunc Reset;
+ SyncFenceCheckTriggeredFunc CheckTriggered;
+ SyncFenceAddTriggerFunc AddTrigger;
+ SyncFenceDeleteTriggerFunc DeleteTrigger;
+} SyncFenceFuncsRec, *SyncFenceFuncsPtr;
+
+extern _X_EXPORT void
+miSyncInitFence(ScreenPtr pScreen, SyncFence * pFence,
+ Bool initially_triggered);
+
+extern _X_EXPORT void
+ miSyncDestroyFence(SyncFence * pFence);
+
+extern _X_EXPORT void
+ miSyncTriggerFence(SyncFence * pFence);
+
+extern _X_EXPORT SyncScreenFuncsPtr miSyncGetScreenFuncs(ScreenPtr pScreen);
+extern _X_EXPORT Bool
+ miSyncSetup(ScreenPtr pScreen);
+
+#endif /* _MISYNC_H_ */
diff --git a/prebuilt/xlibre/usr/include/xorg/misyncfd.h b/prebuilt/xlibre/usr/include/xorg/misyncfd.h
new file mode 100644
index 0000000..d083067
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/misyncfd.h
@@ -0,0 +1,48 @@
+/*
+ * Copyright © 2013 Keith Packard
+ *
+ * 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 _MISYNCFD_H_
+#define _MISYNCFD_H_
+
+#include
+#include
+
+typedef int (*SyncScreenCreateFenceFromFdFunc) (ScreenPtr screen,
+ SyncFence *fence,
+ int fd,
+ Bool initially_triggered);
+
+typedef int (*SyncScreenGetFenceFdFunc) (ScreenPtr screen,
+ SyncFence *fence);
+
+#define SYNC_FD_SCREEN_FUNCS_VERSION 1
+
+typedef struct _syncFdScreenFuncs {
+ int version;
+ SyncScreenCreateFenceFromFdFunc CreateFenceFromFd;
+ SyncScreenGetFenceFdFunc GetFenceFd;
+} SyncFdScreenFuncsRec, *SyncFdScreenFuncsPtr;
+
+extern _X_EXPORT Bool miSyncFdScreenInit(ScreenPtr pScreen,
+ const SyncFdScreenFuncsRec *funcs);
+
+#endif /* _MISYNCFD_H_ */
diff --git a/prebuilt/xlibre/usr/include/xorg/misyncshm.h b/prebuilt/xlibre/usr/include/xorg/misyncshm.h
new file mode 100644
index 0000000..29c6fa8
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/misyncshm.h
@@ -0,0 +1,31 @@
+/*
+ * Copyright © 2013 Keith Packard
+ *
+ * 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 _MISYNCSHM_H_
+#define _MISYNCSHM_H_
+
+#include
+#include
+
+extern _X_EXPORT Bool miSyncShmScreenInit(ScreenPtr pScreen);
+
+#endif /* _MISYNCSHM_H_ */
diff --git a/prebuilt/xlibre/usr/include/xorg/misyncstr.h b/prebuilt/xlibre/usr/include/xorg/misyncstr.h
new file mode 100644
index 0000000..60055fc
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/misyncstr.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright © 2010 NVIDIA Corporation
+ *
+ * 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 (including the next
+ * paragraph) 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 AUTHORS OR COPYRIGHT HOLDERS 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 _MISYNCSTR_H_
+#define _MISYNCSTR_H_
+
+#include
+
+#include "xlibre_ptrtypes.h"
+#include "dix.h"
+#include "misync.h"
+#include "scrnintstr.h"
+#include
+
+/* Sync object types */
+#define SYNC_COUNTER 0
+#define SYNC_FENCE 1
+
+struct _SyncObject {
+ ClientPtr client; /* Owning client. 0 for system counters */
+ struct _SyncTriggerList *pTriglist; /* list of triggers */
+ XID id; /* resource ID */
+ unsigned char type; /* SYNC_* */
+ unsigned char initialized; /* FALSE if created but not initialized */
+ Bool beingDestroyed; /* in process of going away */
+};
+
+typedef struct _SyncCounter {
+ SyncObject sync; /* Common sync object data */
+ int64_t value; /* counter value */
+ struct _SysCounterInfo *pSysCounterInfo; /* NULL if not a system counter */
+} SyncCounter;
+
+struct _SyncFence {
+ SyncObject sync; /* Common sync object data */
+ ScreenPtr pScreen; /* Screen of this fence object */
+ SyncFenceFuncsRec funcs; /* Funcs for performing ops on fence */
+ Bool triggered; /* fence state */
+ PrivateRec *devPrivates; /* driver-specific per-fence data */
+};
+
+struct _SyncTrigger {
+ SyncObject *pSync;
+ int64_t wait_value; /* wait value */
+ unsigned int value_type; /* Absolute or Relative */
+ unsigned int test_type; /* transition or Comparison type */
+ int64_t test_value; /* trigger event threshold value */
+ Bool (*CheckTrigger)(struct _SyncTrigger *pTrigger,
+ int64_t newval);
+ void (*TriggerFired)(struct _SyncTrigger *pTrigger);
+ void (*CounterDestroyed)(struct _SyncTrigger *pTrigger);
+};
+
+typedef struct _SyncTriggerList {
+ SyncTrigger *pTrigger;
+ struct _SyncTriggerList *next;
+} SyncTriggerList;
+
+#endif /* _MISYNCSTR_H_ */
diff --git a/prebuilt/xlibre/usr/include/xorg/mizerarc.h b/prebuilt/xlibre/usr/include/xorg/mizerarc.h
new file mode 100644
index 0000000..31f5596
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/mizerarc.h
@@ -0,0 +1,132 @@
+/************************************************************
+
+Copyright 1989, 1998 The Open Group
+
+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.
+
+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
+OPEN GROUP 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.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+********************************************************/
+
+#ifndef XSERVER_MIZERARC_H
+#define XSERVER_MIZERARC_H
+
+#include
+#include
+
+typedef struct {
+ int x;
+ int y;
+ int mask;
+} miZeroArcPtRec;
+
+typedef struct {
+ int x, y, k1, k3, a, b, d, dx, dy;
+ int alpha, beta;
+ int xorg, yorg;
+ int xorgo, yorgo;
+ int w, h;
+ int initialMask;
+ miZeroArcPtRec start, altstart, end, altend;
+ int firstx, firsty;
+ int startAngle, endAngle;
+} miZeroArcRec;
+
+#define miCanZeroArc(arc) (((arc)->width == (arc)->height) || \
+ (((arc)->width <= 800) && ((arc)->height <= 800)))
+
+#define MIARCSETUP() \
+ x = info.x; \
+ y = info.y; \
+ k1 = info.k1; \
+ k3 = info.k3; \
+ a = info.a; \
+ b = info.b; \
+ d = info.d; \
+ dx = info.dx; \
+ dy = info.dy
+
+#define MIARCOCTANTSHIFT(clause) \
+ if (a < 0) \
+ { \
+ if (y == info.h) \
+ { \
+ d = -1; \
+ a = b = k1 = 0; \
+ } \
+ else \
+ { \
+ dx = (k1 << 1) - k3; \
+ k1 = dx - k1; \
+ k3 = -k3; \
+ b = b + a - (k1 >> 1); \
+ d = b + ((-a) >> 1) - d + (k3 >> 3); \
+ if (dx < 0) \
+ a = -((-dx) >> 1) - a; \
+ else \
+ a = (dx >> 1) - a; \
+ dx = 0; \
+ dy = 1; \
+ clause \
+ } \
+ }
+
+#define MIARCSTEP(move1,move2) \
+ b -= k1; \
+ if (d < 0) \
+ { \
+ x += dx; \
+ y += dy; \
+ a += k1; \
+ d += b; \
+ move1 \
+ } \
+ else \
+ { \
+ x++; \
+ y++; \
+ a += k3; \
+ d -= a; \
+ move2 \
+ }
+
+#define MIARCCIRCLESTEP(clause) \
+ b -= k1; \
+ x++; \
+ if (d < 0) \
+ { \
+ a += k1; \
+ d += b; \
+ } \
+ else \
+ { \
+ y++; \
+ a += k3; \
+ d -= a; \
+ clause \
+ }
+
+/* mizerarc.c */
+
+extern _X_EXPORT Bool miZeroArcSetup(xArc * /*arc */ ,
+ miZeroArcRec * /*info */ ,
+ Bool /*ok360 */
+ );
+
+#endif /* XSERVER_MIZERARC_H */
diff --git a/prebuilt/xlibre/usr/include/xorg/opaque.h b/prebuilt/xlibre/usr/include/xorg/opaque.h
new file mode 100644
index 0000000..b924cfa
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/opaque.h
@@ -0,0 +1,38 @@
+/*
+
+Copyright 1987, 1998 The Open Group
+
+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.
+
+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 OPEN GROUP 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.
+
+Except as contained in this notice, the name of The Open Group shall
+not be used in advertising or otherwise to promote the sale, use or
+other dealings in this Software without prior written authorization
+from The Open Group.
+
+*/
+
+#ifndef OPAQUE_H
+#define OPAQUE_H
+
+#include
+
+#include "globals.h"
+
+extern _X_EXPORT Bool bgNoneRoot;
+
+#endif /* OPAQUE_H */
diff --git a/prebuilt/xlibre/usr/include/xorg/optionstr.h b/prebuilt/xlibre/usr/include/xorg/optionstr.h
new file mode 100644
index 0000000..2189790
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/optionstr.h
@@ -0,0 +1,12 @@
+#ifndef OPTIONSTR_H_
+#define OPTIONSTR_H_
+
+struct _InputOption {
+ GenericListRec list;
+ char *opt_name;
+ char *opt_val;
+ int opt_used;
+ char *opt_comment;
+};
+
+#endif /* INPUTSTRUCT_H */
diff --git a/prebuilt/xlibre/usr/include/xorg/os.h b/prebuilt/xlibre/usr/include/xorg/os.h
new file mode 100644
index 0000000..aa5b3cf
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/os.h
@@ -0,0 +1,313 @@
+/***********************************************************
+
+Copyright 1987, 1998 The Open Group
+
+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.
+
+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
+OPEN GROUP 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.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+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 Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL 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 OS_H
+#define OS_H
+
+#include
+#include
+#include
+#include
+#ifdef MONOTONIC_CLOCK
+#include
+#endif
+
+#include
+
+#include "xlibre_ptrtypes.h"
+#include "callback.h"
+#include "misc.h"
+
+/*
+ * @brief macro for specifying non-null arguments
+ *
+ * part of public SDK / driver API
+ */
+#ifndef _X_ATTRIBUTE_NONNULL_ARG
+#define _X_ATTRIBUTE_NONNULL_ARG(...) __attribute__((nonnull(__VA_ARGS__)))
+#endif
+
+#ifndef _X_ATTRIBUTE_VPRINTF
+# if defined(__GNUC__) && (__GNUC__ >= 2) && !defined(__clang__)
+# define _X_ATTRIBUTE_VPRINTF(fmt, firstarg) \
+ __attribute__((__format__(gnu_printf, fmt, firstarg)))
+# else
+# define _X_ATTRIBUTE_VPRINTF(fmt, firstarg) _X_ATTRIBUTE_PRINTF(fmt,firstarg)
+# endif
+#endif
+
+#define SCREEN_SAVER_ON 0
+#define SCREEN_SAVER_OFF 1
+#define SCREEN_SAVER_FORCER 2
+#define SCREEN_SAVER_CYCLE 3
+
+#ifndef MAX_REQUEST_SIZE
+#define MAX_REQUEST_SIZE 65535
+#endif
+
+typedef struct _NewClientRec *NewClientPtr;
+
+#ifndef xnfalloc
+#define xnfalloc(size) XNFalloc((unsigned long)(size))
+#define xnfcalloc(_num, _size) XNFcallocarray((_num), (_size))
+#define xnfrealloc(ptr, size) XNFrealloc((void *)(ptr), (unsigned long)(size))
+
+#define xstrdup(s) Xstrdup((s))
+#define xnfstrdup(s) XNFstrdup((s))
+#endif
+
+#include
+#include
+
+extern _X_EXPORT int ReadFdFromClient(ClientPtr client);
+
+/**
+ * @brief write @p count bytes from @p buf into the client's output buffer
+ *
+ * @deprecated Legacy entry point, kept for ABI compatibility. Drivers and
+ * external modules should not write to clients directly; this
+ * remains exported only for existing out-of-tree users. In-tree
+ * code uses the internal dixWriteToClient() worker instead.
+ *
+ * @param who the client to write to
+ * @param count number of bytes to write
+ * @param buf data to write
+ * @return number of bytes buffered, 0 on no-op, -1 on error
+ */
+extern _X_EXPORT int WriteToClient(ClientPtr /*who */ , int /*count */ ,
+ const void * /*buf */ );
+
+typedef void (*NotifyFdProcPtr)(int fd, int ready, void *data);
+
+#include "fd_notify.h"
+
+extern _X_EXPORT Bool SetNotifyFd(int fd, NotifyFdProcPtr notify_fd, int mask, void *data);
+
+static inline void RemoveNotifyFd(int fd)
+{
+ (void) SetNotifyFd(fd, NULL, X_NOTIFY_NONE, NULL);
+}
+
+extern _X_EXPORT void IgnoreClient(ClientPtr /*client */ );
+
+extern _X_EXPORT void AttendClient(ClientPtr /*client */ );
+
+extern _X_EXPORT CARD32 GetTimeInMillis(void);
+extern _X_EXPORT CARD64 GetTimeInMicros(void);
+
+extern _X_EXPORT void AdjustWaitForDelay(void *waitTime, int newdelay);
+
+typedef struct _OsTimerRec *OsTimerPtr;
+
+typedef CARD32 (*OsTimerCallback) (OsTimerPtr timer,
+ CARD32 time,
+ void *arg);
+
+#define TimerAbsolute (1<<0)
+#define TimerForceOld (1<<1)
+
+extern _X_EXPORT OsTimerPtr TimerSet(OsTimerPtr timer,
+ int flags,
+ CARD32 millis,
+ OsTimerCallback func,
+ void *arg);
+
+extern _X_EXPORT void TimerCancel(OsTimerPtr /* pTimer */ );
+extern _X_EXPORT void TimerFree(OsTimerPtr /* pTimer */ );
+
+extern _X_EXPORT void GiveUp(int /*sig */ );
+
+/*
+ * This function malloc(3)s buffer, terminating the server if there is not
+ * enough memory.
+ */
+extern _X_EXPORT void *
+XNFalloc(unsigned long /*amount */ ) __attribute__((returns_nonnull));
+
+/*
+ * This function calloc(3)s buffer, terminating the server if there is not
+ * enough memory.
+ */
+extern _X_EXPORT void *
+XNFcalloc(unsigned long /*amount */ ) _X_DEPRECATED;
+
+/*
+ * This function calloc(3)s buffer, terminating the server if there is not
+ * enough memory or the arguments overflow when multiplied
+ */
+extern _X_EXPORT void *
+XNFcallocarray(size_t nmemb, size_t size) __attribute__((returns_nonnull));
+
+/*
+ * This function realloc(3)s passed buffer, terminating the server if there is
+ * not enough memory.
+ */
+extern _X_EXPORT void *
+XNFrealloc(void * /*ptr */ , unsigned long /*amount */ );
+
+/*
+ * This function strdup(3)s passed string. The only difference from the library
+ * function that it is safe to pass NULL, as NULL will be returned.
+ */
+extern _X_EXPORT char *
+Xstrdup(const char *s);
+
+/*
+ * This function strdup(3)s passed string, terminating the server if there is
+ * not enough memory. If NULL is passed to this function, NULL is returned.
+ */
+extern _X_EXPORT char *
+XNFstrdup(const char *s);
+
+/* Include new X*asprintf API */
+#include "Xprintf.h"
+
+typedef int (*OsSigWrapperPtr) (int /* sig */ );
+
+extern _X_EXPORT OsSigWrapperPtr
+OsRegisterSigWrapper(OsSigWrapperPtr newWrap);
+
+extern _X_EXPORT Bool
+PrivsElevated(void);
+
+extern _X_EXPORT int
+GetClientFd(ClientPtr);
+
+/* stuff for FlushCallback */
+extern _X_EXPORT CallbackListPtr FlushCallback;
+
+extern _X_EXPORT int
+TimeSinceLastInputEvent(void);
+
+/* Function fallbacks provided by AC_REPLACE_FUNCS in configure.ac */
+
+#ifndef HAVE_REALLOCARRAY
+#define reallocarray xreallocarray
+extern _X_EXPORT void *
+reallocarray(void *optr, size_t nmemb, size_t size);
+#endif
+
+#ifndef HAVE_STRLCPY
+extern _X_EXPORT size_t
+strlcpy(char * _X_RESTRICT_KYWD dst, const char * _X_RESTRICT_KYWD src, size_t siz);
+extern _X_EXPORT size_t
+strlcat(char * _X_RESTRICT_KYWD dst, const char * _X_RESTRICT_KYWD src, size_t siz);
+#endif
+
+#ifndef HAVE_STRNDUP
+extern _X_EXPORT char *
+strndup(const char *str, size_t n);
+#endif
+
+#ifndef HAVE_TIMINGSAFE_MEMCMP
+extern _X_EXPORT int
+timingsafe_memcmp(const void *b1, const void *b2, size_t len);
+#endif
+
+/* Flags for log messages. */
+typedef enum {
+ X_PROBED, /* Value was probed */
+ X_CONFIG, /* Value was given in the config file */
+ X_DEFAULT, /* Value is a default */
+ X_CMDLINE, /* Value was given on the command line */
+ X_NOTICE, /* Notice */
+ X_ERROR, /* Error message */
+ X_WARNING, /* Warning message */
+ X_INFO, /* Informational message */
+ X_NONE, /* No prefix */
+ X_NOT_IMPLEMENTED, /* Not implemented */
+ X_DEBUG, /* Debug message */
+ X_UNKNOWN = -1 /* unknown -- this must always be last */
+} MessageType;
+
+extern _X_EXPORT void
+LogVMessageVerb(MessageType type, int verb, const char *format, va_list args)
+_X_ATTRIBUTE_PRINTF(3, 0);
+extern _X_EXPORT void
+LogMessageVerb(MessageType type, int verb, const char *format, ...)
+_X_ATTRIBUTE_PRINTF(3, 4);
+extern _X_EXPORT void
+LogMessage(MessageType type, const char *format, ...)
+_X_ATTRIBUTE_PRINTF(2, 3);
+
+extern _X_EXPORT void
+LogHdrMessageVerb(MessageType type, int verb,
+ const char *msg_format, va_list msg_args,
+ const char *hdr_format, ...)
+_X_ATTRIBUTE_PRINTF(3, 0)
+_X_ATTRIBUTE_PRINTF(5, 6);
+
+extern _X_EXPORT void
+FatalError(const char *f, ...)
+_X_ATTRIBUTE_PRINTF(1, 2)
+ _X_NORETURN;
+
+extern _X_EXPORT void
+ErrorF(const char *f, ...)
+_X_ATTRIBUTE_PRINTF(1, 2);
+
+extern _X_EXPORT void
+xorg_backtrace(void);
+
+/* should not be used anymore, just for backwards compat with drivers */
+#define LogVMessageVerbSigSafe(...) LogVMessageVerb(__VA_ARGS__)
+#define LogMessageVerbSigSafe(...) LogMessageVerb(__VA_ARGS__)
+#define ErrorFSigSafe(...) ErrorF(__VA_ARGS__)
+#define VErrorFSigSafe(...) VErrorF(__VA_ARGS__)
+#define VErrorF(...) LogVMessageVerb(X_NONE, -1, __VA_ARGS__)
+
+/* only for backwards compat with drivers that haven't kept up yet
+ (xf86-video-intel)
+
+ @todo revise after next stable release
+*/
+_X_DEPRECATED
+static inline int System(const char* cmdline)
+{
+ return system(cmdline);
+}
+
+#endif /* OS_H */
diff --git a/prebuilt/xlibre/usr/include/xorg/picture.h b/prebuilt/xlibre/usr/include/xorg/picture.h
new file mode 100644
index 0000000..d219ed0
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/picture.h
@@ -0,0 +1,215 @@
+/*
+ *
+ * Copyright © 2000 SuSE, 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 SuSE not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission. SuSE makes no representations about the
+ * suitability of this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ *
+ * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE
+ * 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.
+ *
+ * Author: Keith Packard, SuSE, Inc.
+ */
+
+#ifndef _PICTURE_H_
+#define _PICTURE_H_
+
+#include "privates.h"
+
+#include
+
+typedef struct _DirectFormat *DirectFormatPtr;
+typedef struct _PictFormat *PictFormatPtr;
+typedef struct _Picture *PicturePtr;
+
+/*
+ * While the protocol is generous in format support, the
+ * sample implementation allows only packed RGB and GBR
+ * representations for data to simplify software rendering,
+ */
+#define PICT_FORMAT(bpp,type,a,r,g,b) PIXMAN_FORMAT((bpp), (type), (a), (r), (g), (b))
+
+/*
+ * gray/color formats use a visual index instead of argb
+ */
+#define PICT_VISFORMAT(bpp,type,vi) (((bpp) << 24) | \
+ ((type) << 16) | \
+ ((vi)))
+
+#define PICT_FORMAT_BPP(f) PIXMAN_FORMAT_BPP((f))
+#define PICT_FORMAT_TYPE(f) PIXMAN_FORMAT_TYPE((f))
+#define PICT_FORMAT_A(f) PIXMAN_FORMAT_A((f))
+#define PICT_FORMAT_R(f) PIXMAN_FORMAT_R((f))
+#define PICT_FORMAT_G(f) PIXMAN_FORMAT_G((f))
+#define PICT_FORMAT_B(f) PIXMAN_FORMAT_B((f))
+#define PICT_FORMAT_RGB(f) PIXMAN_FORMAT_RGB((f))
+#define PICT_FORMAT_VIS(f) PIXMAN_FORMAT_VIS((f))
+
+#define PICT_TYPE_OTHER PIXMAN_TYPE_OTHER
+#define PICT_TYPE_A PIXMAN_TYPE_A
+#define PICT_TYPE_ARGB PIXMAN_TYPE_ARGB
+#define PICT_TYPE_ABGR PIXMAN_TYPE_ABGR
+#define PICT_TYPE_COLOR PIXMAN_TYPE_COLOR
+#define PICT_TYPE_GRAY PIXMAN_TYPE_GRAY
+#define PICT_TYPE_BGRA PIXMAN_TYPE_BGRA
+
+#define PICT_FORMAT_COLOR(f) PIXMAN_FORMAT_COLOR((f))
+
+typedef pixman_format_code_t PictFormatShort;
+
+#define PICT_a2r10g10b10 PIXMAN_a2r10g10b10
+#define PICT_x2r10g10b10 PIXMAN_x2r10g10b10
+#define PICT_a2b10g10r10 PIXMAN_a2b10g10r10
+#define PICT_x2b10g10r10 PIXMAN_x2b10g10r10
+#define PICT_a8r8g8b8 PIXMAN_a8r8g8b8
+#define PICT_x8r8g8b8 PIXMAN_x8r8g8b8
+#define PICT_a8b8g8r8 PIXMAN_a8b8g8r8
+#define PICT_x8b8g8r8 PIXMAN_x8b8g8r8
+#define PICT_b8g8r8a8 PIXMAN_b8g8r8a8
+#define PICT_b8g8r8x8 PIXMAN_b8g8r8x8
+#define PICT_r8g8b8 PIXMAN_r8g8b8
+#define PICT_b8g8r8 PIXMAN_b8g8r8
+#define PICT_r5g6b5 PIXMAN_r5g6b5
+#define PICT_b5g6r5 PIXMAN_b5g6r5
+#define PICT_a1r5g5b5 PIXMAN_a1r5g5b5
+#define PICT_x1r5g5b5 PIXMAN_x1r5g5b5
+#define PICT_a1b5g5r5 PIXMAN_a1b5g5r5
+#define PICT_x1b5g5r5 PIXMAN_x1b5g5r5
+#define PICT_a4r4g4b4 PIXMAN_a4r4g4b4
+#define PICT_x4r4g4b4 PIXMAN_x4r4g4b4
+#define PICT_a4b4g4r4 PIXMAN_a4b4g4r4
+#define PICT_x4b4g4r4 PIXMAN_x4b4g4r4
+#define PICT_a8 PIXMAN_a8
+#define PICT_r3g3b2 PIXMAN_r3g3b2
+#define PICT_b2g3r3 PIXMAN_b2g3r3
+#define PICT_a2r2g2b2 PIXMAN_a2r2g2b2
+#define PICT_a2b2g2r2 PIXMAN_a2b2g2r2
+#define PICT_c8 PIXMAN_c8
+#define PICT_g8 PIXMAN_g8
+#define PICT_x4a4 PIXMAN_x4a4
+#define PICT_x4c4 PIXMAN_x4c4
+#define PICT_x4g4 PIXMAN_x4g4
+#define PICT_a4 PIXMAN_a4
+#define PICT_r1g2b1 PIXMAN_r1g2b1
+#define PICT_b1g2r1 PIXMAN_b1g2r1
+#define PICT_a1r1g1b1 PIXMAN_a1r1g1b1
+#define PICT_a1b1g1r1 PIXMAN_a1b1g1r1
+#define PICT_c4 PIXMAN_c4
+#define PICT_g4 PIXMAN_g4
+#define PICT_a1 PIXMAN_a1
+#define PICT_g1 PIXMAN_g1
+#define PICT_yuv2 PIXMAN_yuy2
+
+/*
+ * For dynamic indexed visuals (GrayScale and PseudoColor), these control the
+ * selection of colors allocated for drawing to Pictures. The default
+ * policy depends on the size of the colormap:
+ *
+ * Size Default Policy
+ * ----------------------------
+ * < 64 PolicyMono
+ * < 256 PolicyGray
+ * 256 PolicyColor (only on PseudoColor)
+ *
+ * The actual allocation code lives in miindex.c, and so is
+ * ostensibly server dependent, but that code does:
+ *
+ * PolicyMono Allocate no additional colors, use black and white
+ * PolicyGray Allocate 13 gray levels (11 cells used)
+ * PolicyColor Allocate a 4x4x4 cube and 13 gray levels (71 cells used)
+ * PolicyAll Allocate as big a cube as possible, fill with gray (all)
+ *
+ * Here's a picture to help understand how many colors are
+ * actually allocated (this is just the gray ramp):
+ *
+ * gray level
+ * all 0000 1555 2aaa 4000 5555 6aaa 8000 9555 aaaa bfff d555 eaaa ffff
+ * b/w 0000 ffff
+ * 4x4x4 5555 aaaa
+ * extra 1555 2aaa 4000 6aaa 8000 9555 bfff d555 eaaa
+ *
+ * The default colormap supplies two gray levels (black/white), the
+ * 4x4x4 cube allocates another two and nine more are allocated to fill
+ * in the 13 levels. When the 4x4x4 cube is not allocated, a total of
+ * 11 cells are allocated.
+ */
+
+#define PictureCmapPolicyInvalid -1
+#define PictureCmapPolicyDefault 0
+#define PictureCmapPolicyMono 1
+#define PictureCmapPolicyGray 2
+#define PictureCmapPolicyColor 3
+#define PictureCmapPolicyAll 4
+
+extern int PictureCmapPolicy;
+
+extern int PictureParseCmapPolicy(const char *name);
+
+extern int RenderErrBase;
+
+/* Fixed point updates from Carl Worth, USC, Information Sciences Institute */
+
+typedef pixman_fixed_32_32_t xFixed_32_32;
+
+typedef pixman_fixed_48_16_t xFixed_48_16;
+
+#define MAX_FIXED_48_16 pixman_max_fixed_48_16
+#define MIN_FIXED_48_16 pixman_min_fixed_48_16
+
+typedef pixman_fixed_1_31_t xFixed_1_31;
+typedef pixman_fixed_1_16_t xFixed_1_16;
+typedef pixman_fixed_16_16_t xFixed_16_16;
+
+/*
+ * An unadorned "xFixed" is the same as xFixed_16_16,
+ * (since it's quite common in the code)
+ */
+typedef pixman_fixed_t xFixed;
+
+#define XFIXED_BITS 16
+
+#define xFixedToInt(f) pixman_fixed_to_int((f))
+#define IntToxFixed(i) pixman_int_to_fixed((i))
+#define xFixedE pixman_fixed_e
+#define xFixed1 pixman_fixed_1
+#define xFixed1MinusE pixman_fixed_1_minus_e
+#define xFixedFrac(f) pixman_fixed_frac((f))
+#define xFixedFloor(f) pixman_fixed_floor((f))
+#define xFixedCeil(f) pixman_fixed_ceil((f))
+
+#define xFixedFraction(f) pixman_fixed_fraction((f))
+#define xFixedMod2(f) pixman_fixed_mod2((f))
+
+/* whether 't' is a well defined not obviously empty trapezoid */
+#define xTrapezoidValid(t) ((t)->left.p1.y != (t)->left.p2.y && \
+ (t)->right.p1.y != (t)->right.p2.y && \
+ ((t)->bottom > (t)->top))
+
+/*
+ * Standard NTSC luminance conversions:
+ *
+ * y = r * 0.299 + g * 0.587 + b * 0.114
+ *
+ * Approximate this for a bit more speed:
+ *
+ * y = (r * 153 + g * 301 + b * 58) / 512
+ *
+ * This gives 17 bits of luminance; to get 15 bits, lop the low two
+ */
+
+#define CvtR8G8B8toY15(s) (((((s) >> 16) & 0xff) * 153 + \
+ (((s) >> 8) & 0xff) * 301 + \
+ (((s) ) & 0xff) * 58) >> 2)
+
+#endif /* _PICTURE_H_ */
diff --git a/prebuilt/xlibre/usr/include/xorg/picturestr.h b/prebuilt/xlibre/usr/include/xorg/picturestr.h
new file mode 100644
index 0000000..349f6f7
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/picturestr.h
@@ -0,0 +1,534 @@
+/*
+ * Copyright © 2000 SuSE, 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 SuSE not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission. SuSE makes no representations about the
+ * suitability of this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ *
+ * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE
+ * 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.
+ *
+ * Author: Keith Packard, SuSE, Inc.
+ */
+
+#ifndef _PICTURESTR_H_
+#define _PICTURESTR_H_
+
+#include
+#include "scrnintstr.h"
+#include "glyphstr.h"
+#include "resource.h"
+#include "privates.h"
+
+typedef struct _DirectFormat {
+ CARD16 red, redMask;
+ CARD16 green, greenMask;
+ CARD16 blue, blueMask;
+ CARD16 alpha, alphaMask;
+} DirectFormatRec;
+
+typedef struct _IndexFormat {
+ VisualID vid;
+ ColormapPtr pColormap;
+ int nvalues;
+ xIndexValue *pValues;
+ void *devPrivate;
+} IndexFormatRec;
+
+typedef struct _PictFormat {
+ CARD32 id;
+ CARD32 format; /* except bpp */
+ unsigned char type;
+ unsigned char depth;
+ DirectFormatRec direct;
+ IndexFormatRec index;
+} PictFormatRec;
+
+typedef struct pixman_vector PictVector, *PictVectorPtr;
+typedef struct pixman_transform PictTransform, *PictTransformPtr;
+
+#define SourcePictTypeSolidFill 0
+#define SourcePictTypeLinear 1
+#define SourcePictTypeRadial 2
+#define SourcePictTypeConical 3
+
+typedef struct _PictSolidFill {
+ unsigned int type;
+ CARD32 color;
+ xRenderColor fullcolor;
+} PictSolidFill, *PictSolidFillPtr;
+
+typedef struct _PictGradientStop {
+ xFixed x;
+ xRenderColor color;
+} PictGradientStop, *PictGradientStopPtr;
+
+typedef struct _PictGradient {
+ unsigned int type;
+ int nstops;
+ PictGradientStopPtr stops;
+} PictGradient, *PictGradientPtr;
+
+typedef struct _PictLinearGradient {
+ unsigned int type;
+ int nstops;
+ PictGradientStopPtr stops;
+ xPointFixed p1;
+ xPointFixed p2;
+} PictLinearGradient, *PictLinearGradientPtr;
+
+typedef struct _PictCircle {
+ xFixed x;
+ xFixed y;
+ xFixed radius;
+} PictCircle, *PictCirclePtr;
+
+typedef struct _PictRadialGradient {
+ unsigned int type;
+ int nstops;
+ PictGradientStopPtr stops;
+ PictCircle c1;
+ PictCircle c2;
+} PictRadialGradient, *PictRadialGradientPtr;
+
+typedef struct _PictConicalGradient {
+ unsigned int type;
+ int nstops;
+ PictGradientStopPtr stops;
+ xPointFixed center;
+ xFixed angle;
+} PictConicalGradient, *PictConicalGradientPtr;
+
+typedef union _SourcePict {
+ unsigned int type;
+ PictSolidFill solidFill;
+ PictGradient gradient;
+ PictLinearGradient linear;
+ PictRadialGradient radial;
+ PictConicalGradient conical;
+} SourcePict, *SourcePictPtr;
+
+typedef struct _Picture {
+ DrawablePtr pDrawable;
+ PictFormatPtr pFormat;
+ pixman_format_code_t format; /* PIXMAN_FORMAT */
+ int refcnt;
+ CARD32 id;
+ unsigned int repeat:1;
+ unsigned int graphicsExposures:1;
+ unsigned int subWindowMode:1;
+ unsigned int polyEdge:1;
+ unsigned int polyMode:1;
+ unsigned int freeCompClip:1;
+ unsigned int componentAlpha:1;
+ unsigned int repeatType:2;
+ unsigned int filter:3;
+ unsigned int stateChanges:CPLastBit;
+ unsigned int unused:18 - CPLastBit;
+
+ PicturePtr pNext; /* chain on same drawable */
+
+ PicturePtr alphaMap;
+ xPoint alphaOrigin;
+
+ xPoint clipOrigin;
+ RegionPtr clientClip;
+
+ unsigned long serialNumber;
+
+ RegionPtr pCompositeClip;
+
+ PrivateRec *devPrivates;
+
+ PictTransform *transform;
+
+ SourcePictPtr pSourcePict;
+ xFixed *filter_params;
+ int filter_nparams;
+} PictureRec;
+
+typedef Bool (*PictFilterValidateParamsProcPtr) (ScreenPtr pScreen, int id,
+ xFixed * params, int nparams,
+ int *width, int *height);
+typedef struct {
+ char *name;
+ int id;
+ PictFilterValidateParamsProcPtr ValidateParams;
+ int width, height;
+} PictFilterRec, *PictFilterPtr;
+
+#define PictFilterNearest 0
+#define PictFilterBilinear 1
+
+#define PictFilterFast 2
+#define PictFilterGood 3
+#define PictFilterBest 4
+
+#define PictFilterConvolution 5
+/* if you add an 8th filter, expand the filter bitfield above */
+
+typedef struct {
+ char *alias;
+ int alias_id;
+ int filter_id;
+} PictFilterAliasRec, *PictFilterAliasPtr;
+
+typedef int (*CreatePictureProcPtr) (PicturePtr pPicture);
+typedef void (*DestroyPictureProcPtr) (PicturePtr pPicture);
+typedef int (*ChangePictureClipProcPtr) (PicturePtr pPicture,
+ int clipType, void *value, int n);
+typedef void (*DestroyPictureClipProcPtr) (PicturePtr pPicture);
+
+typedef int (*ChangePictureTransformProcPtr) (PicturePtr pPicture,
+ PictTransform * transform);
+
+typedef int (*ChangePictureFilterProcPtr) (PicturePtr pPicture,
+ int filter,
+ xFixed * params, int nparams);
+
+typedef void (*DestroyPictureFilterProcPtr) (PicturePtr pPicture);
+
+typedef void (*ChangePictureProcPtr) (PicturePtr pPicture, Mask mask);
+typedef void (*ValidatePictureProcPtr) (PicturePtr pPicture, Mask mask);
+typedef void (*CompositeProcPtr) (CARD8 op,
+ PicturePtr pSrc,
+ PicturePtr pMask,
+ PicturePtr pDst,
+ INT16 xSrc,
+ INT16 ySrc,
+ INT16 xMask,
+ INT16 yMask,
+ INT16 xDst,
+ INT16 yDst, CARD16 width, CARD16 height);
+
+typedef void (*GlyphsProcPtr) (CARD8 op,
+ PicturePtr pSrc,
+ PicturePtr pDst,
+ PictFormatPtr maskFormat,
+ INT16 xSrc,
+ INT16 ySrc,
+ int nlists,
+ GlyphListPtr lists, GlyphPtr * glyphs);
+
+typedef void (*CompositeRectsProcPtr) (CARD8 op,
+ PicturePtr pDst,
+ xRenderColor * color,
+ int nRect, xRectangle *rects);
+
+typedef void (*RasterizeTrapezoidProcPtr) (PicturePtr pMask,
+ xTrapezoid * trap,
+ int x_off, int y_off);
+
+typedef void (*TrapezoidsProcPtr) (CARD8 op,
+ PicturePtr pSrc,
+ PicturePtr pDst,
+ PictFormatPtr maskFormat,
+ INT16 xSrc,
+ INT16 ySrc, int ntrap, xTrapezoid * traps);
+
+typedef void (*TrianglesProcPtr) (CARD8 op,
+ PicturePtr pSrc,
+ PicturePtr pDst,
+ PictFormatPtr maskFormat,
+ INT16 xSrc,
+ INT16 ySrc, int ntri, xTriangle * tris);
+
+typedef void (*TriStripProcPtr) (CARD8 op,
+ PicturePtr pSrc,
+ PicturePtr pDst,
+ PictFormatPtr maskFormat,
+ INT16 xSrc,
+ INT16 ySrc, int npoint, xPointFixed * points);
+
+typedef void (*TriFanProcPtr) (CARD8 op,
+ PicturePtr pSrc,
+ PicturePtr pDst,
+ PictFormatPtr maskFormat,
+ INT16 xSrc,
+ INT16 ySrc, int npoint, xPointFixed * points);
+
+typedef Bool (*InitIndexedProcPtr) (ScreenPtr pScreen, PictFormatPtr pFormat);
+
+typedef void (*CloseIndexedProcPtr) (ScreenPtr pScreen, PictFormatPtr pFormat);
+
+typedef void (*UpdateIndexedProcPtr) (ScreenPtr pScreen,
+ PictFormatPtr pFormat,
+ int ndef, xColorItem * pdef);
+
+typedef void (*AddTrapsProcPtr) (PicturePtr pPicture,
+ INT16 xOff,
+ INT16 yOff, int ntrap, xTrap * traps);
+
+typedef void (*AddTrianglesProcPtr) (PicturePtr pPicture,
+ INT16 xOff,
+ INT16 yOff, int ntri, xTriangle * tris);
+
+typedef Bool (*RealizeGlyphProcPtr) (ScreenPtr pScreen, GlyphPtr glyph);
+
+typedef void (*UnrealizeGlyphProcPtr) (ScreenPtr pScreen, GlyphPtr glyph);
+
+typedef struct _PictureScreen {
+ PictFormatPtr formats;
+ PictFormatPtr fallback;
+ int nformats;
+
+ CreatePictureProcPtr CreatePicture;
+ DestroyPictureProcPtr DestroyPicture;
+ ChangePictureClipProcPtr ChangePictureClip;
+ DestroyPictureClipProcPtr DestroyPictureClip;
+
+ ChangePictureProcPtr ChangePicture;
+ ValidatePictureProcPtr ValidatePicture;
+
+ CompositeProcPtr Composite;
+ GlyphsProcPtr Glyphs; /* unused */
+ CompositeRectsProcPtr CompositeRects;
+
+ void *_dummy1; // required in place of a removed field for ABI compatibility
+ void *_dummy2; // required in place of a removed field for ABI compatibility
+
+ StoreColorsProcPtr StoreColors;
+
+ InitIndexedProcPtr InitIndexed;
+ CloseIndexedProcPtr CloseIndexed;
+ UpdateIndexedProcPtr UpdateIndexed;
+
+ int subpixel;
+
+ PictFilterPtr filters;
+ int nfilters;
+ PictFilterAliasPtr filterAliases;
+ int nfilterAliases;
+
+ /**
+ * Called immediately after a picture's transform is changed through the
+ * SetPictureTransform request. Not called for source-only pictures.
+ */
+ ChangePictureTransformProcPtr ChangePictureTransform;
+
+ /**
+ * Called immediately after a picture's transform is changed through the
+ * SetPictureFilter request. Not called for source-only pictures.
+ */
+ ChangePictureFilterProcPtr ChangePictureFilter;
+
+ DestroyPictureFilterProcPtr DestroyPictureFilter;
+
+ TrapezoidsProcPtr Trapezoids;
+ TrianglesProcPtr Triangles;
+
+ RasterizeTrapezoidProcPtr RasterizeTrapezoid;
+
+ AddTrianglesProcPtr AddTriangles;
+
+ AddTrapsProcPtr AddTraps;
+
+ RealizeGlyphProcPtr RealizeGlyph;
+ UnrealizeGlyphProcPtr UnrealizeGlyph;
+
+#define PICTURE_SCREEN_VERSION 2
+ TriStripProcPtr TriStrip;
+ TriFanProcPtr TriFan;
+} PictureScreenRec, *PictureScreenPtr;
+
+extern _X_EXPORT DevPrivateKeyRec PictureScreenPrivateKeyRec;
+extern _X_EXPORT DevPrivateKeyRec PictureWindowPrivateKeyRec;
+
+#define GetPictureScreen(s) ((PictureScreenPtr)dixLookupPrivate(&(s)->devPrivates, &PictureScreenPrivateKeyRec))
+#define GetPictureScreenIfSet(s) (dixPrivateKeyRegistered(&PictureScreenPrivateKeyRec) ? GetPictureScreen((s)) : NULL)
+#define SetPictureScreen(s,p) dixSetPrivate(&(s)->devPrivates, &PictureScreenPrivateKeyRec, (p))
+#define GetPictureWindow(w) ((PicturePtr)dixLookupPrivate(&(w)->devPrivates, &PictureWindowPrivateKeyRec))
+#define SetPictureWindow(w,p) dixSetPrivate(&(w)->devPrivates, &PictureWindowPrivateKeyRec, (p))
+
+extern _X_EXPORT PictFormatPtr
+ PictureWindowFormat(WindowPtr pWindow);
+
+extern _X_EXPORT Bool
+ PictureSetSubpixelOrder(ScreenPtr pScreen, int subpixel);
+
+extern _X_EXPORT int
+ PictureGetSubpixelOrder(ScreenPtr pScreen);
+
+extern _X_EXPORT PictFormatPtr
+PictureMatchVisual(ScreenPtr pScreen, int depth, VisualPtr pVisual);
+
+extern _X_EXPORT PictFormatPtr
+PictureMatchFormat(ScreenPtr pScreen, int depth, CARD32 format);
+
+extern _X_EXPORT Bool
+ PictureInit(ScreenPtr pScreen, PictFormatPtr formats, int nformats);
+
+extern _X_EXPORT int
+ PictureGetFilterId(const char *filter, int len, Bool makeit);
+
+extern _X_EXPORT char *PictureGetFilterName(int id);
+
+extern _X_EXPORT int
+PictureAddFilter(ScreenPtr pScreen,
+ const char *filter,
+ PictFilterValidateParamsProcPtr ValidateParams,
+ int width, int height);
+
+extern _X_EXPORT Bool
+PictureSetFilterAlias(ScreenPtr pScreen, const char *filter, const char *alias);
+
+extern _X_EXPORT Bool
+ PictureSetDefaultFilters(ScreenPtr pScreen);
+
+extern _X_EXPORT void
+ PictureResetFilters(ScreenPtr pScreen);
+
+extern _X_EXPORT PictFilterPtr
+PictureFindFilter(ScreenPtr pScreen, char *name, int len);
+
+extern _X_EXPORT int
+SetPicturePictFilter(PicturePtr pPicture, PictFilterPtr pFilter,
+ xFixed * params, int nparams);
+
+extern _X_EXPORT int
+SetPictureFilter(PicturePtr pPicture, char *name, int len,
+ xFixed * params, int nparams);
+
+extern _X_EXPORT Bool
+ PictureFinishInit(void);
+
+extern _X_EXPORT PicturePtr
+CreatePicture(Picture pid,
+ DrawablePtr pDrawable,
+ PictFormatPtr pFormat,
+ Mask mask, XID *list, ClientPtr client, int *error);
+
+extern _X_EXPORT int
+ChangePicture(PicturePtr pPicture,
+ Mask vmask, XID *vlist, DevUnion *ulist, ClientPtr client);
+
+extern _X_EXPORT int
+
+SetPictureClipRects(PicturePtr pPicture,
+ int xOrigin, int yOrigin, int nRect, xRectangle *rects);
+
+extern _X_EXPORT int
+SetPictureClipRegion(PicturePtr pPicture,
+ int xOrigin, int yOrigin, RegionPtr pRegion);
+
+extern _X_EXPORT int
+ SetPictureTransform(PicturePtr pPicture, PictTransform * transform);
+
+extern _X_EXPORT void
+ ValidatePicture(PicturePtr pPicture);
+
+extern _X_EXPORT int
+ FreePicture(void *pPicture, XID pid);
+
+extern _X_EXPORT void
+CompositePicture(CARD8 op,
+ PicturePtr pSrc,
+ PicturePtr pMask,
+ PicturePtr pDst,
+ INT16 xSrc,
+ INT16 ySrc,
+ INT16 xMask,
+ INT16 yMask,
+ INT16 xDst, INT16 yDst, CARD16 width, CARD16 height);
+
+extern _X_EXPORT void
+CompositeGlyphs(CARD8 op,
+ PicturePtr pSrc,
+ PicturePtr pDst,
+ PictFormatPtr maskFormat,
+ INT16 xSrc,
+ INT16 ySrc, int nlist, GlyphListPtr lists, GlyphPtr * glyphs);
+
+extern _X_EXPORT void
+CompositeRects(CARD8 op,
+ PicturePtr pDst,
+ xRenderColor * color, int nRect, xRectangle *rects);
+
+extern _X_EXPORT void
+CompositeTrapezoids(CARD8 op,
+ PicturePtr pSrc,
+ PicturePtr pDst,
+ PictFormatPtr maskFormat,
+ INT16 xSrc, INT16 ySrc, int ntrap, xTrapezoid * traps);
+
+extern _X_EXPORT void
+CompositeTriangles(CARD8 op,
+ PicturePtr pSrc,
+ PicturePtr pDst,
+ PictFormatPtr maskFormat,
+ INT16 xSrc,
+ INT16 ySrc, int ntriangles, xTriangle * triangles);
+
+extern _X_EXPORT void
+CompositeTriStrip(CARD8 op,
+ PicturePtr pSrc,
+ PicturePtr pDst,
+ PictFormatPtr maskFormat,
+ INT16 xSrc, INT16 ySrc, int npoints, xPointFixed * points);
+
+extern _X_EXPORT void
+CompositeTriFan(CARD8 op,
+ PicturePtr pSrc,
+ PicturePtr pDst,
+ PictFormatPtr maskFormat,
+ INT16 xSrc, INT16 ySrc, int npoints, xPointFixed * points);
+
+extern _X_EXPORT void
+AddTraps(PicturePtr pPicture,
+ INT16 xOff, INT16 yOff, int ntraps, xTrap * traps);
+
+extern _X_EXPORT PicturePtr
+CreateSolidPicture(Picture pid, xRenderColor * color, int *error);
+
+extern _X_EXPORT PicturePtr
+CreateLinearGradientPicture(Picture pid,
+ xPointFixed * p1,
+ xPointFixed * p2,
+ int nStops,
+ xFixed * stops, xRenderColor * colors, int *error);
+
+extern _X_EXPORT PicturePtr
+CreateRadialGradientPicture(Picture pid,
+ xPointFixed * inner,
+ xPointFixed * outer,
+ xFixed innerRadius,
+ xFixed outerRadius,
+ int nStops,
+ xFixed * stops, xRenderColor * colors, int *error);
+
+extern _X_EXPORT PicturePtr
+CreateConicalGradientPicture(Picture pid,
+ xPointFixed * center,
+ xFixed angle,
+ int nStops,
+ xFixed * stops, xRenderColor * colors, int *error);
+
+/*
+ * matrix.c
+ */
+
+extern _X_EXPORT void
+PictTransform_from_xRenderTransform(PictTransformPtr pict,
+ xRenderTransform * render);
+
+extern _X_EXPORT void
+xRenderTransform_from_PictTransform(xRenderTransform * render,
+ PictTransformPtr pict);
+
+extern _X_EXPORT Bool
+ PictureTransformPoint(PictTransformPtr transform, PictVectorPtr vector);
+
+extern _X_EXPORT Bool
+ PictureTransformPoint3d(PictTransformPtr transform, PictVectorPtr vector);
+
+#endif /* _PICTURESTR_H_ */
diff --git a/prebuilt/xlibre/usr/include/xorg/pixmap.h b/prebuilt/xlibre/usr/include/xorg/pixmap.h
new file mode 100644
index 0000000..6833766
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/pixmap.h
@@ -0,0 +1,140 @@
+/***********************************************************
+
+Copyright 1987, 1998 The Open Group
+
+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.
+
+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
+OPEN GROUP 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.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+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 Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL 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 PIXMAP_H
+#define PIXMAP_H
+
+#include "misc.h"
+#include "screenint.h"
+#include "regionstr.h"
+#include
+/* types for Drawable */
+#define DRAWABLE_WINDOW 0
+#define DRAWABLE_PIXMAP 1
+#define UNDRAWABLE_WINDOW 2
+
+/* corresponding type masks for dixLookupDrawable() */
+#define M_DRAWABLE_WINDOW (1<<0)
+#define M_DRAWABLE_PIXMAP (1<<1)
+#define M_UNDRAWABLE_WINDOW (1<<2)
+#define M_ANY (-1)
+#define M_WINDOW (M_DRAWABLE_WINDOW|M_UNDRAWABLE_WINDOW)
+#define M_DRAWABLE (M_DRAWABLE_WINDOW|M_DRAWABLE_PIXMAP)
+#define M_UNDRAWABLE (M_UNDRAWABLE_WINDOW)
+
+/* flags to PaintWindow() */
+#define PW_BACKGROUND 0
+#define PW_BORDER 1
+
+#define NullPixmap ((PixmapPtr)0)
+
+typedef struct _Drawable *DrawablePtr;
+typedef struct _Pixmap *PixmapPtr;
+
+typedef struct _PixmapDirtyUpdate *PixmapDirtyUpdatePtr;
+
+typedef union _PixUnion {
+ PixmapPtr pixmap;
+ unsigned long pixel;
+} PixUnion;
+
+#define SamePixUnion(a,b,isPixel)\
+ ((isPixel) ? (a).pixel == (b).pixel : (a).pixmap == (b).pixmap)
+
+#define EqualPixUnion(as, a, bs, b) \
+ ((as) == (bs) && (SamePixUnion ((a), (b), (as))))
+
+#define OnScreenDrawable(type) \
+ ((type) == DRAWABLE_WINDOW)
+
+#define WindowDrawable(type) \
+ (((type) == DRAWABLE_WINDOW) || ((type) == UNDRAWABLE_WINDOW))
+
+extern _X_EXPORT PixmapPtr GetScratchPixmapHeader(ScreenPtr pScreen,
+ int width,
+ int height,
+ int depth,
+ int bitsPerPixel,
+ int devKind,
+ void *pPixData);
+
+extern _X_EXPORT void FreeScratchPixmapHeader(PixmapPtr /*pPixmap */ );
+
+extern _X_EXPORT Bool PixmapScreenInit(ScreenPtr /*pScreen */ );
+
+extern _X_EXPORT PixmapPtr AllocatePixmap(ScreenPtr /*pScreen */ ,
+ int /*pixDataSize */ );
+
+extern _X_EXPORT void FreePixmap(PixmapPtr /*pPixmap */ );
+
+extern _X_EXPORT PixmapPtr
+PixmapShareToSecondary(PixmapPtr pixmap, ScreenPtr secondary);
+
+extern _X_EXPORT void
+PixmapUnshareSecondaryPixmap(PixmapPtr secondary_pixmap);
+
+#define HAS_DIRTYTRACKING_ROTATION 1
+#define HAS_DIRTYTRACKING_DRAWABLE_SRC 1
+extern _X_EXPORT Bool
+PixmapStartDirtyTracking(DrawablePtr src,
+ PixmapPtr slave_dst,
+ int x, int y, int dst_x, int dst_y,
+ Rotation rotation);
+
+extern _X_EXPORT Bool
+PixmapStopDirtyTracking(DrawablePtr src, PixmapPtr slave_dst);
+
+/* helper function, drivers can do this themselves if they can do it more
+ efficiently */
+extern _X_EXPORT Bool
+PixmapSyncDirtyHelper(PixmapDirtyUpdatePtr dirty);
+
+extern _X_EXPORT void
+PixmapDirtyCopyArea(PixmapPtr dst, DrawablePtr src,
+ int x, int y, int dst_x, int dst_y,
+ RegionPtr dirty_region);
+
+#endif /* PIXMAP_H */
diff --git a/prebuilt/xlibre/usr/include/xorg/pixmapstr.h b/prebuilt/xlibre/usr/include/xorg/pixmapstr.h
new file mode 100644
index 0000000..6390462
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/pixmapstr.h
@@ -0,0 +1,110 @@
+/***********************************************************
+
+Copyright 1987, 1998 The Open Group
+
+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.
+
+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
+OPEN GROUP 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.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+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 Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL 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 PIXMAPSTRUCT_H
+#define PIXMAPSTRUCT_H
+#include "pixmap.h"
+#include "screenint.h"
+#include "regionstr.h"
+#include "privates.h"
+#include "damage.h"
+#include
+#include "picturestr.h"
+
+typedef struct _Drawable {
+ unsigned char type; /* DRAWABLE_ */
+ unsigned char class; /* specific to type */
+ unsigned char depth;
+ unsigned char bitsPerPixel;
+ XID id; /* resource id */
+ short x; /* window: screen absolute, pixmap: 0 */
+ short y; /* window: screen absolute, pixmap: 0 */
+ unsigned short width;
+ unsigned short height;
+ ScreenPtr pScreen;
+ unsigned long serialNumber;
+} DrawableRec;
+
+/*
+ * PIXMAP -- device dependent
+ */
+
+typedef struct _Pixmap {
+ DrawableRec drawable;
+ PrivateRec *devPrivates;
+ int refcnt;
+ int devKind; /* This is the pitch of the pixmap, typically width*bpp/8. */
+ DevUnion devPrivate; /* When !NULL, devPrivate.ptr points to the raw pixel data. */
+ short screen_x;
+ short screen_y;
+ unsigned usage_hint; /* see CREATE_PIXMAP_USAGE_* */
+
+ PixmapPtr primary_pixmap; /* pointer to primary copy of pixmap for pixmap sharing */
+} PixmapRec;
+
+typedef struct _PixmapDirtyUpdate {
+ DrawablePtr src; /* Root window / shared pixmap */
+ PixmapPtr secondary_dst; /* Shared / scanout pixmap */
+ int x, y;
+ DamagePtr damage;
+ struct xorg_list ent;
+ int dst_x, dst_y;
+ Rotation rotation;
+ PictTransform transform;
+ struct pixman_f_transform f_transform, f_inverse;
+} PixmapDirtyUpdateRec;
+
+static inline void
+PixmapRegionInit(RegionPtr region, PixmapPtr pixmap)
+{
+ BoxRec box = {
+ .x2 = (int16_t)pixmap->drawable.width,
+ .y2 = (int16_t)pixmap->drawable.height,
+ };
+ RegionInit(region, &box, 1);
+}
+
+#endif /* PIXMAPSTRUCT_H */
diff --git a/prebuilt/xlibre/usr/include/xorg/present.h b/prebuilt/xlibre/usr/include/xorg/present.h
new file mode 100644
index 0000000..a4abf55
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/present.h
@@ -0,0 +1,162 @@
+/*
+ * Copyright © 2013 Keith Packard
+ *
+ * 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 _PRESENT_H_
+#define _PRESENT_H_
+
+#include
+#include
+#include
+
+#include "randrstr.h"
+
+typedef enum {
+ PRESENT_FLIP_REASON_UNKNOWN,
+ PRESENT_FLIP_REASON_BUFFER_FORMAT,
+
+ /* Don't add new flip reasons after the TearFree ones, since it's expected
+ * that the TearFree reasons are the highest ones in order to allow doing
+ * `reason >= PRESENT_FLIP_REASON_DRIVER_TEARFREE` to check if a reason is
+ * PRESENT_FLIP_REASON_DRIVER_TEARFREE{_FLIPPING}.
+ */
+ PRESENT_FLIP_REASON_DRIVER_TEARFREE,
+ PRESENT_FLIP_REASON_DRIVER_TEARFREE_FLIPPING
+} PresentFlipReason;
+
+typedef struct present_vblank present_vblank_rec, *present_vblank_ptr;
+
+/* Return the current CRTC for 'window'.
+ */
+typedef RRCrtcPtr (*present_get_crtc_ptr) (WindowPtr window);
+
+/* Return the current ust/msc for 'crtc'
+ */
+typedef int (*present_get_ust_msc_ptr) (RRCrtcPtr crtc, uint64_t *ust, uint64_t *msc);
+typedef int (*present_wnmd_get_ust_msc_ptr) (WindowPtr window, uint64_t *ust, uint64_t *msc);
+
+/* Queue callback on 'crtc' for time 'msc'. Call present_event_notify with 'event_id'
+ * at or after 'msc'. Return false if it didn't happen (which might occur if 'crtc'
+ * is not currently generating vblanks).
+ */
+typedef Bool (*present_queue_vblank_ptr) (RRCrtcPtr crtc,
+ uint64_t event_id,
+ uint64_t msc);
+typedef Bool (*present_wnmd_queue_vblank_ptr) (WindowPtr window,
+ RRCrtcPtr crtc,
+ uint64_t event_id,
+ uint64_t msc);
+
+/* Abort pending vblank. The extension is no longer interested in
+ * 'event_id' which was to be notified at 'msc'. If possible, the
+ * driver is free to de-queue the notification.
+ */
+typedef void (*present_abort_vblank_ptr) (RRCrtcPtr crtc, uint64_t event_id, uint64_t msc);
+typedef void (*present_wnmd_abort_vblank_ptr) (WindowPtr window,
+ RRCrtcPtr crtc,
+ uint64_t event_id,
+ uint64_t msc);
+
+/* Flush pending drawing on 'window' to the hardware.
+ */
+typedef void (*present_flush_ptr) (WindowPtr window);
+
+/* Check if 'pixmap' is suitable for flipping to 'window'.
+ */
+typedef Bool (*present_check_flip_ptr) (RRCrtcPtr crtc, WindowPtr window, PixmapPtr pixmap, Bool sync_flip);
+
+/* Same as 'check_flip' but it can return a 'reason' why the flip would fail.
+ */
+typedef Bool (*present_check_flip2_ptr) (RRCrtcPtr crtc, WindowPtr window, PixmapPtr pixmap, Bool sync_flip, PresentFlipReason *reason);
+
+/* Flip pixmap, return false if it didn't happen.
+ *
+ * 'crtc' is to be used for any necessary synchronization.
+ *
+ * 'sync_flip' requests that the flip be performed at the next
+ * vertical blank interval to avoid tearing artifacts. If false, the
+ * flip should be performed as soon as possible.
+ *
+ * present_event_notify should be called with 'event_id' when the flip
+ * occurs
+ */
+typedef Bool (*present_flip_ptr) (RRCrtcPtr crtc,
+ uint64_t event_id,
+ uint64_t target_msc,
+ PixmapPtr pixmap,
+ Bool sync_flip);
+/* Flip pixmap for window, return false if it didn't happen.
+ *
+ * Like present_flip_ptr, additionally with:
+ *
+ * 'window' used for synchronization.
+ *
+ */
+typedef Bool (*present_wnmd_flip_ptr) (WindowPtr window,
+ RRCrtcPtr crtc,
+ uint64_t event_id,
+ uint64_t target_msc,
+ PixmapPtr pixmap,
+ Bool sync_flip,
+ RegionPtr damage);
+
+/* "unflip" back to the regular screen scanout buffer
+ *
+ * present_event_notify should be called with 'event_id' when the unflip occurs.
+ */
+typedef void (*present_unflip_ptr) (ScreenPtr screen,
+ uint64_t event_id);
+
+/* Doing flips has been discontinued.
+ *
+ * Inform driver for potential cleanup on its side.
+ */
+typedef void (*present_wnmd_flips_stop_ptr) (WindowPtr window);
+
+#define PRESENT_SCREEN_INFO_VERSION 1
+
+typedef struct present_screen_info {
+ uint32_t version;
+
+ present_get_crtc_ptr get_crtc;
+ present_get_ust_msc_ptr get_ust_msc;
+ present_queue_vblank_ptr queue_vblank;
+ present_abort_vblank_ptr abort_vblank;
+ present_flush_ptr flush;
+ uint32_t capabilities;
+ present_check_flip_ptr check_flip;
+ present_flip_ptr flip;
+ present_unflip_ptr unflip;
+ present_check_flip2_ptr check_flip2;
+
+} present_screen_info_rec, *present_screen_info_ptr;
+
+/*
+ * Called when 'event_id' occurs. 'ust' and 'msc' indicate when the
+ * event actually happened
+ */
+extern _X_EXPORT void
+present_event_notify(uint64_t event_id, uint64_t ust, uint64_t msc);
+
+extern _X_EXPORT Bool
+present_screen_init(ScreenPtr screen, present_screen_info_ptr info);
+
+#endif /* _PRESENT_H_ */
diff --git a/prebuilt/xlibre/usr/include/xorg/privates.h b/prebuilt/xlibre/usr/include/xorg/privates.h
new file mode 100644
index 0000000..cd2a8c3
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/privates.h
@@ -0,0 +1,378 @@
+/***********************************************************
+
+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
+AUTHOR 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 PRIVATES_H
+#define PRIVATES_H 1
+
+#include
+#include
+#include
+#include
+#include "misc.h"
+
+/*****************************************************************
+ * STUFF FOR PRIVATES
+ *****************************************************************/
+
+typedef struct _Private PrivateRec, *PrivatePtr;
+
+/* WARNING: the values, as well as the total number are part of public ABI.
+ Adding a new one will lead to increased size as well as different field
+ offsets within ScreenRec.
+*/
+typedef enum {
+ /* XSELinux uses the same private keys for numerous objects
+
+ This black magic - keys of this type have very special handling:
+ their corresponding space is allocated at the top of the private
+ areas, in *several* object types (see xselinux_private[] array),
+ and xselinux uses the same keys for all object types
+ */
+ PRIVATE_XSELINUX,
+
+ /* Otherwise, you get a private in just the requested structure
+ */
+ /* These can have objects created before all of the keys are registered */
+ PRIVATE_SCREEN,
+ PRIVATE_EXTENSION,
+ PRIVATE_COLORMAP,
+ PRIVATE_DEVICE,
+
+ /* These cannot have any objects before all relevant keys are registered */
+ PRIVATE_CLIENT,
+ PRIVATE_PROPERTY,
+ PRIVATE_SELECTION,
+ PRIVATE_WINDOW,
+ PRIVATE_PIXMAP,
+ PRIVATE_GC,
+ PRIVATE_CURSOR,
+ PRIVATE_CURSOR_BITS,
+
+ /* extension privates */
+ PRIVATE_GLYPH,
+ PRIVATE_GLYPHSET,
+ PRIVATE_PICTURE,
+ PRIVATE_SYNC_FENCE,
+
+ /* last private type */
+ PRIVATE_LAST,
+} DevPrivateType;
+
+typedef struct _DevPrivateKeyRec {
+ int offset;
+ int size;
+ Bool initialized;
+ Bool allocated;
+ DevPrivateType type;
+ struct _DevPrivateKeyRec *next;
+} DevPrivateKeyRec, *DevPrivateKey;
+
+typedef struct _DevPrivateSetRec {
+ DevPrivateKey key;
+ unsigned offset;
+ int created;
+ int allocated;
+} DevPrivateSetRec, *DevPrivateSetPtr;
+
+typedef struct _DevScreenPrivateKeyRec {
+ DevPrivateKeyRec screenKey;
+} DevScreenPrivateKeyRec, *DevScreenPrivateKeyPtr;
+
+/*
+ * Let drivers know how to initialize private keys
+ */
+
+#define HAS_DEVPRIVATEKEYREC 1
+#define HAS_DIXREGISTERPRIVATEKEY 1
+
+/*
+ * @brief Register a new private index for the private type.
+ *
+ * This initializes the specified key and optionally requests pre-allocated
+ * private space for your driver/module. If you request no extra space, you
+ * may set and get a single pointer value using this private key. Otherwise,
+ * you can get the address of the extra space and store whatever data you like
+ * there.
+ *
+ * Maybe called multiple times on the same key, but the size and type must
+ * match or the server will abort.
+ *
+ * Note: this may move around the private storage area to different address,
+ * thus any pointers taken by GetPrivateAddr() et al have to be considered
+ * invalid after calling this function.
+ *
+ * @param key pointer to key (will be written to)
+ * @param type the object type the key is used for
+ * @param size size of the storage reserved for that key (zero => void*)
+ * @return FALSE if it fails to allocate memory during its operation.
+ */
+_X_EXPORT Bool dixRegisterPrivateKey(DevPrivateKey key, DevPrivateType type, unsigned size);
+
+/*
+ * Check whether a private key has been registered
+ */
+static inline Bool
+dixPrivateKeyRegistered(DevPrivateKey key)
+{
+ return key->initialized;
+}
+
+/*
+ * Get the address of the private storage.
+ *
+ * For keys with pre-defined storage, this gets the base of that storage
+ * Otherwise, it returns the place where the private pointer is stored.
+ */
+static inline void *
+dixGetPrivateAddr(PrivatePtr *privates, const DevPrivateKey key)
+{
+ assert(key->initialized);
+ return (char *) (*privates) + key->offset;
+}
+
+/*
+ * Fetch a private pointer stored in the object
+ *
+ * Returns the pointer stored with dixSetPrivate.
+ * This must only be used with keys that have
+ * no pre-defined storage
+ */
+static inline void *
+dixGetPrivate(PrivatePtr *privates, const DevPrivateKey key)
+{
+ assert(key->size == 0);
+ return *(void **) dixGetPrivateAddr(privates, key);
+}
+
+/*
+ * Associate 'val' with 'key' in 'privates' so that later calls to
+ * dixLookupPrivate(privates, key) will return 'val'.
+ */
+static inline void
+dixSetPrivate(PrivatePtr *privates, const DevPrivateKey key, void *val)
+{
+ assert(key->size == 0);
+ *(void **) dixGetPrivateAddr(privates, key) = val;
+}
+
+#include "dix.h"
+#include "resource.h"
+
+/*
+ * Lookup a pointer to the private record.
+ *
+ * For privates with defined storage, return the address of the
+ * storage. For privates without defined storage, return the pointer
+ * contents
+ */
+static inline void *
+dixLookupPrivate(PrivatePtr *privates, const DevPrivateKey key)
+{
+ if (key->size)
+ return dixGetPrivateAddr(privates, key);
+ else
+ return dixGetPrivate(privates, key);
+}
+
+/*
+ * Look up the address of the pointer to the storage
+ *
+ * This returns the place where the private pointer is stored,
+ * which is only valid for privates without predefined storage.
+ */
+static inline void **
+dixLookupPrivateAddr(PrivatePtr *privates, const DevPrivateKey key)
+{
+ assert(key->size == 0);
+ return (void **) dixGetPrivateAddr(privates, key);
+}
+
+extern _X_EXPORT Bool
+
+dixRegisterScreenPrivateKey(DevScreenPrivateKeyPtr key, ScreenPtr pScreen,
+ DevPrivateType type, unsigned size);
+
+extern _X_EXPORT DevPrivateKey
+ _dixGetScreenPrivateKey(const DevScreenPrivateKeyPtr key, ScreenPtr pScreen);
+
+static inline void *
+dixGetScreenPrivateAddr(PrivatePtr *privates, const DevScreenPrivateKeyPtr key,
+ ScreenPtr pScreen)
+{
+ return dixGetPrivateAddr(privates, _dixGetScreenPrivateKey(key, pScreen));
+}
+
+static inline void *
+dixGetScreenPrivate(PrivatePtr *privates, const DevScreenPrivateKeyPtr key,
+ ScreenPtr pScreen)
+{
+ return dixGetPrivate(privates, _dixGetScreenPrivateKey(key, pScreen));
+}
+
+static inline void
+dixSetScreenPrivate(PrivatePtr *privates, const DevScreenPrivateKeyPtr key,
+ ScreenPtr pScreen, void *val)
+{
+ dixSetPrivate(privates, _dixGetScreenPrivateKey(key, pScreen), val);
+}
+
+static inline void *
+dixLookupScreenPrivate(PrivatePtr *privates, const DevScreenPrivateKeyPtr key,
+ ScreenPtr pScreen)
+{
+ return dixLookupPrivate(privates, _dixGetScreenPrivateKey(key, pScreen));
+}
+
+static inline void **
+dixLookupScreenPrivateAddr(PrivatePtr *privates, const DevScreenPrivateKeyPtr key,
+ ScreenPtr pScreen)
+{
+ return dixLookupPrivateAddr(privates,
+ _dixGetScreenPrivateKey(key, pScreen));
+}
+
+/*
+ * These functions relate to allocations related to a specific screen;
+ * space will only be available for objects allocated for use on that
+ * screen. As such, only objects which are related directly to a specific
+ * screen are candidates for allocation this way, this includes
+ * windows, pixmaps, gcs, pictures and colormaps. This key is
+ * used just like any other key using dixGetPrivate and friends.
+ *
+ * This is distinctly different from the ScreenPrivateKeys above which
+ * allocate space in global objects like cursor bits for a specific
+ * screen, allowing multiple screen-related chunks of storage in a
+ * single global object.
+ */
+
+#define HAVE_SCREEN_SPECIFIC_PRIVATE_KEYS 1
+
+extern _X_EXPORT Bool
+dixRegisterScreenSpecificPrivateKey(ScreenPtr pScreen, DevPrivateKey key,
+ DevPrivateType type, unsigned size);
+
+/* Clean up screen-specific privates before CloseScreen */
+extern void
+dixFreeScreenSpecificPrivates(ScreenPtr pScreen);
+
+/* Initialize screen-specific privates in AddScreen */
+extern void
+dixInitScreenSpecificPrivates(ScreenPtr pScreen);
+
+/* is this private created - so hotplug can avoid crashing */
+Bool dixPrivatesCreated(DevPrivateType type);
+
+extern _X_EXPORT void *
+_dixAllocateScreenObjectWithPrivates(ScreenPtr pScreen,
+ unsigned size,
+ unsigned offset,
+ DevPrivateType type);
+
+#define dixAllocateScreenObjectWithPrivates(s, t, type) _dixAllocateScreenObjectWithPrivates((s), sizeof(t), offsetof(t, devPrivates), (type))
+
+extern _X_EXPORT int
+dixScreenSpecificPrivatesSize(ScreenPtr pScreen, DevPrivateType type);
+
+extern _X_EXPORT void
+_dixInitScreenPrivates(ScreenPtr pScreen, PrivatePtr *privates, void *addr, DevPrivateType type);
+
+#define dixInitScreenPrivates(s, o, v, type) _dixInitScreenPrivates((s), &(o)->devPrivates, (v), (type));
+
+/*
+ * Allocates private data separately from main object.
+ *
+ * For objects created during server initialization, this allows those
+ * privates to be re-allocated as new private keys are registered.
+ *
+ * This includes screens, the serverClient, default colormaps and
+ * extensions entries.
+ */
+extern _X_EXPORT Bool
+ dixAllocatePrivates(PrivatePtr *privates, DevPrivateType type);
+
+/*
+ * Frees separately allocated private data
+ */
+extern _X_EXPORT void
+ dixFreePrivates(PrivatePtr privates, DevPrivateType type);
+
+/*
+ * Initialize privates by zeroing them
+ */
+extern _X_EXPORT void
+_dixInitPrivates(PrivatePtr *privates, void *addr, DevPrivateType type);
+
+#define dixInitPrivates(o, v, type) _dixInitPrivates(&(o)->devPrivates, (v), (type));
+
+/*
+ * Clean up privates
+ */
+extern _X_EXPORT void
+ _dixFiniPrivates(PrivatePtr privates, DevPrivateType type);
+
+#define dixFiniPrivates(o,t) _dixFiniPrivates((o)->devPrivates,(t))
+
+/*
+ * Allocates private data at object creation time. Required
+ * for almost all objects, except for the list described
+ * above for dixAllocatePrivates.
+ */
+extern _X_EXPORT void *_dixAllocateObjectWithPrivates(unsigned size,
+ unsigned clear,
+ unsigned offset,
+ DevPrivateType type);
+
+#define dixAllocateObjectWithPrivates(t, type) (t *) _dixAllocateObjectWithPrivates(sizeof(t), sizeof(t), offsetof(t, devPrivates), (type))
+
+extern _X_EXPORT void
+
+_dixFreeObjectWithPrivates(void *object, PrivatePtr privates,
+ DevPrivateType type);
+
+#define dixFreeObjectWithPrivates(o,t) _dixFreeObjectWithPrivates((o), (o)->devPrivates, (t))
+
+/*
+ * Return size of privates for the specified type
+ */
+extern _X_EXPORT int
+ dixPrivatesSize(DevPrivateType type);
+
+/*
+ * Dump out private stats to ErrorF
+ */
+extern void
+ dixPrivateUsage(void);
+
+/*
+ * Resets the privates subsystem. dixResetPrivates is called from the main loop
+ * before each server generation. This function must only be called by main().
+ */
+extern _X_EXPORT void
+ dixResetPrivates(void);
+
+/*
+ * Looks up the offset where the devPrivates field is located.
+ *
+ * Returns -1 if the specified resource has no dev privates.
+ * The position of the devPrivates field varies by structure
+ * and calling code might only know the resource type, not the
+ * structure definition.
+ */
+extern _X_EXPORT int
+ dixLookupPrivateOffset(RESTYPE type);
+
+/*
+ * Convenience macro for adding an offset to an object pointer
+ * when making a call to one of the devPrivates functions
+ */
+#define DEVPRIV_AT(ptr, offset) ((PrivatePtr *)((char *)(ptr) + (offset)))
+
+#endif /* PRIVATES_H */
diff --git a/prebuilt/xlibre/usr/include/xorg/property.h b/prebuilt/xlibre/usr/include/xorg/property.h
new file mode 100644
index 0000000..73f5110
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/property.h
@@ -0,0 +1,63 @@
+/***********************************************************
+
+Copyright 1987, 1998 The Open Group
+
+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.
+
+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
+OPEN GROUP 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.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+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 Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL 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 PROPERTY_H
+#define PROPERTY_H
+
+#include "xlibre_ptrtypes.h"
+#include "window.h"
+
+extern _X_EXPORT int dixChangeWindowProperty(ClientPtr pClient,
+ WindowPtr pWin,
+ Atom property,
+ Atom type,
+ int format,
+ int mode,
+ unsigned long len,
+ const void *value,
+ Bool sendevent);
+
+#endif /* PROPERTY_H */
diff --git a/prebuilt/xlibre/usr/include/xorg/ptrveloc.h b/prebuilt/xlibre/usr/include/xorg/ptrveloc.h
new file mode 100644
index 0000000..6a22581
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/ptrveloc.h
@@ -0,0 +1,91 @@
+/*
+ *
+ * Copyright © 2006-2011 Simon Thum simon dot thum at gmx dot de
+ *
+ * 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 (including the next
+ * paragraph) 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 AUTHORS OR COPYRIGHT HOLDERS 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 POINTERVELOCITY_H
+#define POINTERVELOCITY_H
+
+#include
+
+/* constants for acceleration profiles */
+
+#define AccelProfileNone -1
+#define AccelProfileClassic 0
+#define AccelProfileDeviceSpecific 1
+#define AccelProfilePolynomial 2
+#define AccelProfileSmoothLinear 3
+#define AccelProfileSimple 4
+#define AccelProfilePower 5
+#define AccelProfileLinear 6
+#define AccelProfileSmoothLimited 7
+#define AccelProfileLAST AccelProfileSmoothLimited
+
+/* fwd */
+struct _DeviceVelocityRec;
+
+/**
+ * profile
+ * returns actual acceleration depending on velocity, acceleration control,...
+ */
+typedef double (*PointerAccelerationProfileFunc)
+ (DeviceIntPtr dev, struct _DeviceVelocityRec * vel,
+ double velocity, double threshold, double accelCoeff);
+
+typedef struct _MotionTracker MotionTracker, *MotionTrackerPtr;
+
+/**
+ * Contains all data needed to implement mouse ballistics
+ */
+typedef struct _DeviceVelocityRec {
+ MotionTrackerPtr tracker;
+ int num_tracker;
+ int cur_tracker; /* current index */
+ double velocity; /* velocity as guessed by algorithm */
+ double last_velocity; /* previous velocity estimate */
+ double last_dx; /* last time-difference */
+ double last_dy; /* phase of last/current estimate */
+ double corr_mul; /* config: multiply this into velocity */
+ double const_acceleration; /* config: (recipr.) const deceleration */
+ double min_acceleration; /* config: minimum acceleration */
+ short reset_time; /* config: reset non-visible state after # ms */
+ short use_softening; /* config: use softening of mouse values */
+ double max_rel_diff; /* config: max. relative difference */
+ double max_diff; /* config: max. difference */
+ int initial_range; /* config: max. offset used as initial velocity */
+ Bool average_accel; /* config: average acceleration over velocity */
+ PointerAccelerationProfileFunc Profile;
+ PointerAccelerationProfileFunc deviceSpecificProfile;
+ void *profile_private; /* extended data, see SetAccelerationProfile() */
+ struct { /* to be able to query this information */
+ int profile_number;
+ } statistics;
+} DeviceVelocityRec, *DeviceVelocityPtr;
+
+extern _X_EXPORT DeviceVelocityPtr
+GetDevicePredictableAccelData(DeviceIntPtr dev);
+
+extern _X_EXPORT void
+SetDeviceSpecificAccelerationProfile(DeviceVelocityPtr vel,
+ PointerAccelerationProfileFunc profile);
+
+#endif /* POINTERVELOCITY_H */
diff --git a/prebuilt/xlibre/usr/include/xorg/randrstr.h b/prebuilt/xlibre/usr/include/xorg/randrstr.h
new file mode 100644
index 0000000..c0810e6
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/randrstr.h
@@ -0,0 +1,830 @@
+/*
+ * Copyright © 2000 Compaq Computer Corporation
+ * Copyright © 2002 Hewlett-Packard Company
+ * Copyright © 2006 Intel Corporation
+ * Copyright © 2008 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.
+ *
+ * Author: Jim Gettys, Hewlett-Packard Company, Inc.
+ * Keith Packard, Intel Corporation
+ */
+#ifndef _RANDRSTR_H_
+#define _RANDRSTR_H_
+
+#include
+#include
+
+#include "xlibre_ptrtypes.h"
+#include "misc.h"
+#include "os.h"
+#include "dixstruct.h"
+#include "resource.h"
+#include "scrnintstr.h"
+#include "windowstr.h"
+#include "pixmapstr.h"
+#include "extnsionst.h"
+#include "servermd.h"
+#include "rrtransform.h"
+#include
+#include
+#include /* we share subpixel order information */
+#include "picturestr.h"
+#include
+
+/* required for ABI compatibility for now */
+#define RANDR_10_INTERFACE 1
+#define RANDR_12_INTERFACE 1
+#define RANDR_13_INTERFACE 1 /* requires RANDR_12_INTERFACE */
+#define RANDR_GET_CRTC_INTERFACE 1
+
+#define RANDR_INTERFACE_VERSION 0x0104
+
+typedef XID RRMode;
+typedef XID RROutput;
+typedef XID RRCrtc;
+typedef XID RRProvider;
+typedef XID RRLease;
+
+/*
+ * Modeline for a monitor. Name follows directly after this struct
+ */
+
+#define RRModeName(pMode) ((char *) ((pMode) + 1))
+typedef struct _rrMode RRModeRec, *RRModePtr;
+typedef struct _rrPropertyValue RRPropertyValueRec, *RRPropertyValuePtr;
+typedef struct _rrProperty RRPropertyRec, *RRPropertyPtr;
+typedef struct _rrCrtc RRCrtcRec, *RRCrtcPtr;
+typedef struct _rrOutput RROutputRec, *RROutputPtr;
+typedef struct _rrProvider RRProviderRec, *RRProviderPtr;
+typedef struct _rrMonitor RRMonitorRec, *RRMonitorPtr;
+typedef struct _rrLease RRLeaseRec, *RRLeasePtr;
+
+struct _rrMode {
+ int refcnt;
+ xRRModeInfo mode;
+ char *name;
+ ScreenPtr userScreen;
+};
+
+struct _rrPropertyValue {
+ Atom type; /* ignored by server */
+ short format; /* format of data for swapping - 8,16,32 */
+ long size; /* size of data in (format/8) bytes */
+ void *data; /* private to client */
+};
+
+struct _rrProperty {
+ RRPropertyPtr next;
+ ATOM propertyName;
+ Bool is_pending;
+ Bool range;
+ Bool immutable;
+ int num_valid;
+ INT32 *valid_values;
+ RRPropertyValueRec current, pending;
+};
+
+struct _rrCrtc {
+ RRCrtc id;
+ ScreenPtr pScreen;
+ RRModePtr mode;
+ int x, y;
+ Rotation rotation;
+ Rotation rotations;
+ Bool changed;
+ int numOutputs;
+ RROutputPtr *outputs;
+ int gammaSize;
+ CARD16 *gammaRed;
+ CARD16 *gammaBlue;
+ CARD16 *gammaGreen;
+ void *devPrivate;
+ Bool transforms;
+ RRTransformRec client_pending_transform;
+ RRTransformRec client_current_transform;
+ PictTransform transform;
+ struct pixman_f_transform f_transform;
+ struct pixman_f_transform f_inverse;
+
+ PixmapPtr scanout_pixmap;
+ PixmapPtr scanout_pixmap_back;
+};
+
+struct _rrOutput {
+ RROutput id;
+ ScreenPtr pScreen;
+ char *name;
+ int nameLength;
+ CARD8 connection;
+ CARD8 subpixelOrder;
+ int mmWidth;
+ int mmHeight;
+ RRCrtcPtr crtc;
+ int numCrtcs;
+ RRCrtcPtr *crtcs;
+ int numClones;
+ RROutputPtr *clones;
+ int numModes;
+ int numPreferred;
+ RRModePtr *modes;
+ int numUserModes;
+ RRModePtr *userModes;
+ Bool changed;
+ Bool nonDesktop;
+ RRPropertyPtr properties;
+ Bool pendingProperties;
+ void *devPrivate;
+};
+
+struct _rrProvider {
+ RRProvider id;
+ ScreenPtr pScreen;
+ uint32_t capabilities;
+ char *name;
+ int nameLength;
+ RRPropertyPtr properties;
+ Bool pendingProperties;
+ Bool changed;
+ struct _rrProvider *offload_sink;
+ struct _rrProvider *output_source;
+};
+
+typedef struct _rrMonitorGeometry {
+ BoxRec box;
+ CARD32 mmWidth;
+ CARD32 mmHeight;
+} RRMonitorGeometryRec, *RRMonitorGeometryPtr;
+
+struct _rrMonitor {
+ Atom name;
+ ScreenPtr pScreen;
+ int numOutputs;
+ RROutput *outputs;
+ Bool primary;
+ Bool automatic;
+ RRMonitorGeometryRec geometry;
+};
+
+typedef enum _rrLeaseState { RRLeaseCreating, RRLeaseRunning, RRLeaseTerminating } RRLeaseState;
+
+struct _rrLease {
+ struct xorg_list list;
+ ScreenPtr screen;
+ RRLease id;
+ RRLeaseState state;
+ void *devPrivate;
+ int numCrtcs;
+ RRCrtcPtr *crtcs;
+ int numOutputs;
+ RROutputPtr *outputs;
+};
+
+typedef Bool (*RRScreenSetSizeProcPtr) (ScreenPtr pScreen,
+ CARD16 width,
+ CARD16 height,
+ CARD32 mmWidth, CARD32 mmHeight);
+
+typedef Bool (*RRCrtcSetProcPtr) (ScreenPtr pScreen,
+ RRCrtcPtr crtc,
+ RRModePtr mode,
+ int x,
+ int y,
+ Rotation rotation,
+ int numOutputs, RROutputPtr * outputs);
+
+typedef void (*RRCrtcGetProcPtr) (ScreenPtr pScreen,
+ RRCrtcPtr crtc,
+ xRRGetCrtcInfoReply *rep);
+
+typedef Bool (*RRCrtcSetGammaProcPtr) (ScreenPtr pScreen, RRCrtcPtr crtc);
+
+typedef Bool (*RRCrtcGetGammaProcPtr) (ScreenPtr pScreen, RRCrtcPtr crtc);
+
+typedef Bool (*RROutputSetPropertyProcPtr) (ScreenPtr pScreen,
+ RROutputPtr output,
+ Atom property,
+ RRPropertyValuePtr value);
+
+typedef Bool (*RROutputValidateModeProcPtr) (ScreenPtr pScreen,
+ RROutputPtr output,
+ RRModePtr mode);
+
+typedef void (*RRModeDestroyProcPtr) (ScreenPtr pScreen, RRModePtr mode);
+
+#if RANDR_13_INTERFACE
+typedef Bool (*RROutputGetPropertyProcPtr) (ScreenPtr pScreen,
+ RROutputPtr output, Atom property);
+typedef Bool (*RRGetPanningProcPtr) (ScreenPtr pScrn,
+ RRCrtcPtr crtc,
+ BoxPtr totalArea,
+ BoxPtr trackingArea, INT16 *border);
+typedef Bool (*RRSetPanningProcPtr) (ScreenPtr pScrn,
+ RRCrtcPtr crtc,
+ BoxPtr totalArea,
+ BoxPtr trackingArea, INT16 *border);
+
+#endif /* RANDR_13_INTERFACE */
+
+typedef Bool (*RRProviderGetPropertyProcPtr) (ScreenPtr pScreen,
+ RRProviderPtr provider, Atom property);
+typedef Bool (*RRProviderSetPropertyProcPtr) (ScreenPtr pScreen,
+ RRProviderPtr provider,
+ Atom property,
+ RRPropertyValuePtr value);
+
+typedef Bool (*RRGetInfoProcPtr) (ScreenPtr pScreen, Rotation * rotations);
+typedef Bool (*RRCloseScreenProcPtr) (ScreenPtr pScreen);
+
+typedef Bool (*RRProviderSetOutputSourceProcPtr)(ScreenPtr pScreen,
+ RRProviderPtr provider,
+ RRProviderPtr output_source);
+
+typedef Bool (*RRProviderSetOffloadSinkProcPtr)(ScreenPtr pScreen,
+ RRProviderPtr provider,
+ RRProviderPtr offload_sink);
+
+
+typedef void (*RRProviderDestroyProcPtr)(ScreenPtr pScreen,
+ RRProviderPtr provider);
+
+/* Additions for 1.6 */
+
+typedef int (*RRCreateLeaseProcPtr)(ScreenPtr screen,
+ RRLeasePtr lease,
+ int *fd);
+
+typedef void (*RRTerminateLeaseProcPtr)(ScreenPtr screen,
+ RRLeasePtr lease);
+
+typedef int (*RRRequestLeaseProcPtr)(ClientPtr client,
+ ScreenPtr screen,
+ RRLeasePtr lease);
+
+typedef void (*RRGetLeaseProcPtr)(ClientPtr client,
+ ScreenPtr screen,
+ RRLeasePtr *lease,
+ int *fd);
+
+/* These are for 1.0 compatibility */
+
+typedef struct _rrRefresh {
+ CARD16 rate;
+ RRModePtr mode;
+} RRScreenRate, *RRScreenRatePtr;
+
+typedef struct _rrScreenSize {
+ int id;
+ short width, height;
+ short mmWidth, mmHeight;
+ int nRates;
+ RRScreenRatePtr pRates;
+} RRScreenSize, *RRScreenSizePtr;
+
+typedef Bool (*RRSetConfigProcPtr) (ScreenPtr pScreen,
+ Rotation rotation,
+ int rate, RRScreenSizePtr pSize);
+
+typedef Bool (*RRCrtcSetScanoutPixmapProcPtr)(RRCrtcPtr crtc, PixmapPtr pixmap);
+
+typedef Bool (*RRStartFlippingPixmapTrackingProcPtr)(RRCrtcPtr, DrawablePtr,
+ PixmapPtr, PixmapPtr,
+ int x, int y,
+ int dst_x, int dst_y,
+ Rotation rotation);
+
+typedef Bool (*RREnableSharedPixmapFlippingProcPtr)(RRCrtcPtr,
+ PixmapPtr front,
+ PixmapPtr back);
+
+typedef void (*RRDisableSharedPixmapFlippingProcPtr)(RRCrtcPtr);
+
+
+typedef struct _rrScrPriv {
+ /*
+ * 'public' part of the structure; DDXen fill this in
+ * as they initialize
+ */
+ RRSetConfigProcPtr rrSetConfig;
+ RRGetInfoProcPtr rrGetInfo;
+ RRScreenSetSizeProcPtr rrScreenSetSize;
+ RRCrtcSetProcPtr rrCrtcSet;
+ RRCrtcSetGammaProcPtr rrCrtcSetGamma;
+ RRCrtcGetGammaProcPtr rrCrtcGetGamma;
+ RROutputSetPropertyProcPtr rrOutputSetProperty;
+ RROutputValidateModeProcPtr rrOutputValidateMode;
+ RRModeDestroyProcPtr rrModeDestroy;
+#if RANDR_13_INTERFACE
+ RROutputGetPropertyProcPtr rrOutputGetProperty;
+ RRGetPanningProcPtr rrGetPanning;
+ RRSetPanningProcPtr rrSetPanning;
+#endif
+ /* TODO #if RANDR_15_INTERFACE */
+ RRCrtcSetScanoutPixmapProcPtr rrCrtcSetScanoutPixmap;
+
+ RRStartFlippingPixmapTrackingProcPtr rrStartFlippingPixmapTracking;
+ RREnableSharedPixmapFlippingProcPtr rrEnableSharedPixmapFlipping;
+ RRDisableSharedPixmapFlippingProcPtr rrDisableSharedPixmapFlipping;
+
+ RRProviderSetOutputSourceProcPtr rrProviderSetOutputSource;
+ RRProviderSetOffloadSinkProcPtr rrProviderSetOffloadSink;
+ RRProviderGetPropertyProcPtr rrProviderGetProperty;
+ RRProviderSetPropertyProcPtr rrProviderSetProperty;
+
+ RRCreateLeaseProcPtr rrCreateLease;
+ RRTerminateLeaseProcPtr rrTerminateLease;
+
+ /*
+ * Private part of the structure; not considered part of the ABI
+ */
+ TimeStamp lastSetTime; /* last changed by client */
+ TimeStamp lastConfigTime; /* possible configs changed */
+ RRCloseScreenProcPtr CloseScreen;
+
+ Bool changed; /* some config changed */
+ Bool configChanged; /* configuration changed */
+ Bool layoutChanged; /* screen layout changed */
+ Bool resourcesChanged; /* screen resources change */
+ Bool leasesChanged; /* leases change */
+
+ CARD16 minWidth, minHeight;
+ CARD16 maxWidth, maxHeight;
+ CARD16 width, height; /* last known screen size */
+ CARD16 mmWidth, mmHeight; /* last known screen size */
+
+ int numOutputs;
+ RROutputPtr *outputs;
+ RROutputPtr primaryOutput;
+
+ int numCrtcs;
+ RRCrtcPtr *crtcs;
+
+ /* Last known pointer position */
+ RRCrtcPtr pointerCrtc;
+
+ /*
+ * Configuration information
+ */
+ Rotation rotations;
+ CARD16 reqWidth, reqHeight;
+
+ int nSizes;
+ RRScreenSizePtr pSizes;
+
+ Rotation rotation;
+ int rate;
+ int size;
+
+ Bool discontiguous;
+
+ RRProviderPtr provider;
+
+ RRProviderDestroyProcPtr rrProviderDestroy;
+
+ int numMonitors;
+ RRMonitorPtr *monitors;
+
+ struct xorg_list leases;
+
+ RRRequestLeaseProcPtr rrRequestLease;
+ RRGetLeaseProcPtr rrGetLease;
+
+ RRCrtcGetProcPtr rrCrtcGet;
+} rrScrPrivRec, *rrScrPrivPtr;
+
+extern _X_EXPORT DevPrivateKeyRec rrPrivKeyRec;
+
+#define rrPrivKey (&rrPrivKeyRec)
+
+#define rrGetScrPriv(pScr) ((rrScrPrivPtr)dixLookupPrivate(&(pScr)->devPrivates, rrPrivKey))
+#define rrScrPriv(pScr) rrScrPrivPtr pScrPriv = rrGetScrPriv((pScr))
+#define SetRRScreen(s,p) dixSetPrivate(&(s)->devPrivates, rrPrivKey, (p))
+
+/*
+ * each window has a list of clients requesting
+ * RRNotify events. Each client has a resource
+ * for each window it selects RRNotify input for,
+ * this resource is used to delete the RRNotifyRec
+ * entry from the per-window queue.
+ */
+
+typedef struct _RREvent *RREventPtr;
+
+typedef struct _RREvent {
+ RREventPtr next;
+ ClientPtr client;
+ WindowPtr window;
+ XID clientResource;
+ int mask;
+} RREventRec;
+
+typedef struct _RRTimes {
+ TimeStamp setTime;
+ TimeStamp configTime;
+} RRTimesRec, *RRTimesPtr;
+
+typedef struct _RRClient {
+ int major_version;
+ int minor_version;
+/* RRTimesRec times[0]; */
+} RRClientRec, *RRClientPtr;
+
+/*
+ * Set the range of sizes for the screen
+ */
+extern _X_EXPORT void
+
+RRScreenSetSizeRange(ScreenPtr pScreen,
+ CARD16 minWidth,
+ CARD16 minHeight, CARD16 maxWidth, CARD16 maxHeight);
+
+/* rrscreen.c */
+/*
+ * Notify the extension that the screen size has been changed.
+ * The driver is responsible for calling this whenever it has changed
+ * the size of the screen
+ */
+extern _X_EXPORT void
+ RRScreenSizeNotify(ScreenPtr pScreen);
+
+/*
+ * Request that the screen be resized
+ */
+extern _X_EXPORT Bool
+
+RRScreenSizeSet(ScreenPtr pScreen,
+ CARD16 width, CARD16 height, CARD32 mmWidth, CARD32 mmHeight);
+
+/*
+ * Send ConfigureNotify event to root window when 'something' happens
+ */
+extern _X_EXPORT void
+ RRSendConfigNotify(ScreenPtr pScreen);
+
+/* randr.c */
+/* set a screen change on the primary screen */
+extern _X_EXPORT void
+RRSetChanged(ScreenPtr pScreen);
+
+/*
+ * Send all pending events
+ */
+extern _X_EXPORT void
+ RRTellChanged(ScreenPtr pScreen);
+
+/*
+ * Poll the driver for changed information
+ */
+extern _X_EXPORT Bool
+ RRGetInfo(ScreenPtr pScreen, Bool force_query);
+
+extern _X_EXPORT Bool RRScreenInit(ScreenPtr pScreen);
+
+extern _X_EXPORT RROutputPtr RRFirstOutput(ScreenPtr pScreen);
+
+/*
+ * This is the old interface, deprecated but left
+ * around for compatibility
+ */
+
+/*
+ * Then, register the specific size with the screen
+ */
+
+extern _X_EXPORT RRScreenSizePtr
+RRRegisterSize(ScreenPtr pScreen,
+ short width, short height, short mmWidth, short mmHeight);
+
+extern _X_EXPORT Bool
+ RRRegisterRate(ScreenPtr pScreen, RRScreenSizePtr pSize, int rate);
+
+/*
+ * Finally, set the current configuration of the screen
+ */
+
+extern _X_EXPORT void
+
+RRSetCurrentConfig(ScreenPtr pScreen,
+ Rotation rotation, int rate, RRScreenSizePtr pSize);
+
+/* rrcrtc.c */
+
+/*
+ * Create a CRTC
+ */
+extern _X_EXPORT RRCrtcPtr RRCrtcCreate(ScreenPtr pScreen, void *devPrivate);
+
+/*
+ * Set the allowed rotations on a CRTC
+ */
+extern _X_EXPORT void
+ RRCrtcSetRotations(RRCrtcPtr crtc, Rotation rotations);
+
+/*
+ * Notify the extension that the Crtc has been reconfigured,
+ * the driver calls this whenever it has updated the mode
+ */
+extern _X_EXPORT Bool
+RRCrtcNotify(RRCrtcPtr crtc,
+ RRModePtr mode,
+ int x,
+ int y,
+ Rotation rotation,
+ RRTransformPtr transform, int numOutputs, RROutputPtr * outputs);
+
+/*
+ * Request that the Crtc be reconfigured
+ */
+extern _X_EXPORT Bool
+RRCrtcSet(RRCrtcPtr crtc,
+ RRModePtr mode,
+ int x,
+ int y, Rotation rotation, int numOutput, RROutputPtr * outputs);
+
+/*
+ * Request that the Crtc gamma be changed
+ */
+
+extern _X_EXPORT Bool
+ RRCrtcGammaSet(RRCrtcPtr crtc, CARD16 *red, CARD16 *green, CARD16 *blue);
+
+/*
+ * Set the size of the gamma table at server startup time
+ */
+
+extern _X_EXPORT Bool
+ RRCrtcGammaSetSize(RRCrtcPtr crtc, int size);
+
+/* rrmode.c */
+/*
+ * Find, and if necessary, create a mode
+ */
+
+extern _X_EXPORT RRModePtr RRModeGet(xRRModeInfo * modeInfo, const char *name);
+
+/*
+ * Destroy a mode.
+ */
+
+extern _X_EXPORT void
+ RRModeDestroy(RRModePtr mode);
+
+/* rroutput.c */
+
+/*
+ * Notify the output of some change. configChanged indicates whether
+ * any external configuration (mode list, clones, connected status)
+ * has changed, or whether the change was strictly internal
+ * (which crtc is in use)
+ */
+extern _X_EXPORT void
+ RROutputChanged(RROutputPtr output, Bool configChanged);
+
+/*
+ * Create an output
+ */
+
+extern _X_EXPORT RROutputPtr
+RROutputCreate(ScreenPtr pScreen,
+ const char *name, int nameLength, void *devPrivate);
+
+/*
+ * Notify extension that output parameters have been changed
+ */
+extern _X_EXPORT Bool
+ RROutputSetClones(RROutputPtr output, RROutputPtr * clones, int numClones);
+
+extern _X_EXPORT Bool
+RROutputSetModes(RROutputPtr output,
+ RRModePtr * modes, int numModes, int numPreferred);
+
+extern _X_EXPORT Bool
+ RROutputSetCrtcs(RROutputPtr output, RRCrtcPtr * crtcs, int numCrtcs);
+
+extern _X_EXPORT Bool
+ RROutputSetConnection(RROutputPtr output, CARD8 connection);
+
+extern _X_EXPORT Bool
+ RROutputSetPhysicalSize(RROutputPtr output, int mmWidth, int mmHeight);
+
+extern _X_EXPORT void
+ RROutputDestroy(RROutputPtr output);
+
+extern _X_EXPORT void
+ RRDeleteOutputProperty(RROutputPtr output, Atom property);
+
+extern _X_EXPORT Bool
+ RRPostPendingProperties(RROutputPtr output);
+
+extern _X_EXPORT int
+RRChangeOutputProperty(RROutputPtr output, Atom property, Atom type,
+ int format, int mode, unsigned long len,
+ const void *value, Bool sendevent, Bool pending);
+
+extern _X_EXPORT int
+RRConfigureOutputProperty(RROutputPtr output, Atom property,
+ Bool pending, Bool range, Bool immutable,
+ int num_values, const INT32 *values);
+
+/* rrprovider.c */
+#define PRIME_SYNC_PROP "PRIME Synchronization"
+
+
+/* *just* for backwards compat with legacy proprietary NVidia driver */
+
+extern _X_EXPORT RESTYPE RRCrtcType; /* X resource type: Randr CRTC */
+extern _X_EXPORT RESTYPE RRModeType; /* X resource type: Randr MODE */
+extern _X_EXPORT RESTYPE RROutputType; /* X resource type: Randr OUTPUT */
+
+/*
+ * Set non-desktop property on given output. This flag should be TRUE on
+ * outputs where usual desktops shouldn't expand onto (eg. head displays,
+ * additional display bars in various handhelds, etc)
+ */
+_X_EXPORT /* just for Nvidia legacy */
+Bool RROutputSetNonDesktop(RROutputPtr output, Bool non_desktop);
+
+/*
+ * Return the area of the frame buffer scanned out by the crtc,
+ * taking into account the current mode and rotation
+ *
+ * @param crtc the CRTC to query
+ * @param width return buffer for width value
+ * @param height return buffer for height value
+ */
+_X_EXPORT /* just for Nvidia legacy */
+void RRCrtcGetScanoutSize(RRCrtcPtr crtc, int *width, int *height);
+
+/*
+ * Retrieve CRTCs current transform
+ *
+ * @param crtc the CRTC to query
+ * @return pointer to CRTCs current transform
+ */
+_X_EXPORT /* just for Nvidia legacy */
+RRTransformPtr RRCrtcGetTransform(RRCrtcPtr crtc);
+
+/*
+ * Detach and free a scanout pixmap
+ *
+ * @param crtc the CRTC to act on
+ */
+_X_EXPORT /* just for Nvidia legacy */
+void RRCrtcDetachScanoutPixmap(RRCrtcPtr crtc);
+
+/*
+ * Create / allocate new provider structure
+ *
+ * @param pScreen the screen the provider belongs to
+ * @param name name of the provider (counted string)
+ * @param nameLen size of the provider name
+ * @return new provider structure, or NULL on failure
+ */
+_X_EXPORT /* just for Nvidia legacy */
+RRProviderPtr RRProviderCreate(ScreenPtr pScreen, const char *name,
+ int nameLen);
+
+/*
+ * Set provider capabilities field
+ *
+ * @param provider the provider whose capabilities are to be set
+ * @param capabilities the new capabilities
+ */
+_X_EXPORT /* just for Nvidia legacy */
+void RRProviderSetCapabilities(RRProviderPtr provider, uint32_t capabilities);
+
+/*
+ * Check whether client is operating on recent enough protocol version
+ * to know about refresh rates. This has influence on reply packet formats
+ *
+ * @param pClient the client to check
+ * @return TRUE if client using recent enough protocol version
+ */
+_X_EXPORT /* just for Nvidia legacy */
+Bool RRClientKnowsRates(ClientPtr pClient);
+
+/*
+ * Set filter on transform structure
+ */
+_X_EXPORT /* just for Nvidia legacy */
+Bool RRTransformSetFilter(RRTransformPtr dst, PictFilterPtr filter,
+ xFixed *params, int nparams, int width, int height);
+
+/*
+ * Set whether transforms are allowed on a CRTC
+ *
+ * @param crtc the CRTC to set the flag on
+ * @param transforms TRUE if transforms are allowed
+ */
+_X_EXPORT /* just for Nvidia legacy */
+void RRCrtcSetTransformSupport(RRCrtcPtr crtc, Bool transforms);
+
+/*
+ * Set subpixel order on given output
+ *
+ * @param output the output to set subpixel order on
+ * @param order subpixel order value to set
+ */
+_X_EXPORT /* just for Nvidia legacy */
+void RROutputSetSubpixelOrder(RROutputPtr output, int order);
+
+/*
+ * Retrieve output property value
+ *
+ * @param output the output to query
+ * @param property Atom ID of the property to retrieve
+ * @param pending retrieve pending instead of current value
+ * @return pointer to property value or NULL (if not found)
+ */
+_X_EXPORT /* just for Nvidia legacy */
+RRPropertyValuePtr RRGetOutputProperty(RROutputPtr output, Atom property, Bool pending);
+
+#endif /* _RANDRSTR_H_ */
+
+/*
+
+randr extension implementation structure
+
+Query state:
+ ProcRRGetScreenInfo/ProcRRGetScreenResources
+ RRGetInfo
+
+ • Request configuration from driver, either 1.0 or 1.2 style
+ • These functions only record state changes, all
+ other actions are pended until RRTellChanged is called
+
+ ->rrGetInfo
+ 1.0:
+ RRRegisterSize
+ RRRegisterRate
+ RRSetCurrentConfig
+ 1.2:
+ RRScreenSetSizeRange
+ RROutputSetCrtcs
+ RRModeGet
+ RROutputSetModes
+ RROutputSetConnection
+ RROutputSetSubpixelOrder
+ RROutputSetClones
+ RRCrtcNotify
+
+ • Must delay scanning configuration until after ->rrGetInfo returns
+ because some drivers will call SetCurrentConfig in the middle
+ of the ->rrGetInfo operation.
+
+ 1.0:
+
+ • Scan old configuration, mirror to new structures
+
+ RRScanOldConfig
+ RRCrtcCreate
+ RROutputCreate
+ RROutputSetCrtcs
+ RROutputSetConnection
+ RROutputSetSubpixelOrder
+ RROldModeAdd • This adds modes one-at-a-time
+ RRModeGet
+ RRCrtcNotify
+
+ • send events, reset pointer if necessary
+
+ RRTellChanged
+ WalkTree (sending events)
+
+ • when layout has changed:
+ RRPointerScreenConfigured
+ RRSendConfigNotify
+
+Asynchronous state setting (1.2 only)
+ When setting state asynchronously, the driver invokes the
+ ->rrGetInfo function and then calls RRTellChanged to flush
+ the changes to the clients and reset pointer if necessary
+
+Set state
+
+ ProcRRSetScreenConfig
+ RRCrtcSet
+ 1.2:
+ ->rrCrtcSet
+ RRCrtcNotify
+ 1.0:
+ ->rrSetConfig
+ RRCrtcNotify
+ RRTellChanged
+ */
diff --git a/prebuilt/xlibre/usr/include/xorg/region.h b/prebuilt/xlibre/usr/include/xorg/region.h
new file mode 100644
index 0000000..14d283f
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/region.h
@@ -0,0 +1,52 @@
+/***********************************************************
+
+Copyright 1987, 1998 The Open Group
+
+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.
+
+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
+OPEN GROUP 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.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+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 Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL 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 REGION_H
+#define REGION_H
+
+#include "regionstr.h"
+
+#endif /* REGION_H */
diff --git a/prebuilt/xlibre/usr/include/xorg/regionstr.h b/prebuilt/xlibre/usr/include/xorg/regionstr.h
new file mode 100644
index 0000000..73b5efd
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/regionstr.h
@@ -0,0 +1,367 @@
+/***********************************************************
+
+Copyright 1987, 1998 The Open Group
+
+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.
+
+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
+OPEN GROUP 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.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+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 Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL 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 REGIONSTRUCT_H
+#define REGIONSTRUCT_H
+
+typedef struct pixman_region16 RegionRec, *RegionPtr;
+
+#include "miscstruct.h"
+
+/* Return values from RectIn() */
+
+#define rgnOUT 0
+#define rgnIN 1
+#define rgnPART 2
+
+#define NullRegion ((RegionPtr)0)
+
+/*
+ * clip region
+ */
+
+typedef struct pixman_region16_data RegDataRec, *RegDataPtr;
+
+extern _X_EXPORT BoxRec RegionEmptyBox;
+extern _X_EXPORT RegDataRec RegionEmptyData;
+extern _X_EXPORT RegDataRec RegionBrokenData;
+static inline Bool
+RegionNil(RegionPtr reg)
+{
+ return ((reg)->data && !(reg)->data->numRects);
+}
+
+/* not a region */
+
+static inline Bool
+RegionNar(RegionPtr reg)
+{
+ return ((reg)->data == &RegionBrokenData);
+}
+
+static inline int
+RegionNumRects(RegionPtr reg)
+{
+ return (int)(reg->data ? reg->data->numRects : 1);
+}
+
+static inline int
+RegionSize(RegionPtr reg)
+{
+ return (int)(reg->data ? reg->data->size : 0);
+}
+
+static inline BoxPtr
+RegionRects(RegionPtr reg)
+{
+ return ((reg)->data ? (BoxPtr) ((reg)->data + 1) : &(reg)->extents);
+}
+
+static inline BoxPtr
+RegionBoxptr(RegionPtr reg)
+{
+ return ((BoxPtr) ((reg)->data + 1));
+}
+
+static inline BoxPtr
+RegionBox(RegionPtr reg, int i)
+{
+ return (&RegionBoxptr(reg)[i]);
+}
+
+static inline BoxPtr
+RegionTop(RegionPtr reg)
+{
+ return RegionBox(reg, (int)reg->data->numRects);
+}
+
+static inline BoxPtr
+RegionEnd(RegionPtr reg)
+{
+ return RegionBox(reg, (int)reg->data->numRects - 1);
+}
+
+static inline size_t
+RegionSizeof(size_t n)
+{
+ if (n < ((INT_MAX - sizeof(RegDataRec)) / sizeof(BoxRec)))
+ return (sizeof(RegDataRec) + ((n) * sizeof(BoxRec)));
+ else
+ return 0;
+}
+
+static inline void
+RegionInit(RegionPtr _pReg, BoxPtr _rect, size_t _size)
+{
+ if ((_rect) != NULL) {
+ (_pReg)->extents = *(_rect);
+ (_pReg)->data = (RegDataPtr) NULL;
+ }
+ else {
+ size_t rgnSize;
+ (_pReg)->extents = RegionEmptyBox;
+ if (((_size) > 1) && ((rgnSize = RegionSizeof(_size)) > 0) &&
+ (((_pReg)->data = (RegDataPtr) calloc(1, rgnSize)) != NULL)) {
+ (_pReg)->data->size = (long)(_size);
+ (_pReg)->data->numRects = 0;
+ }
+ else
+ (_pReg)->data = &RegionEmptyData;
+ }
+}
+
+static inline Bool
+RegionInitBoxes(RegionPtr pReg, BoxPtr boxes, int nBoxes)
+{
+ return pixman_region_init_rects(pReg, boxes, nBoxes);
+}
+
+static inline void
+RegionUninit(RegionPtr _pReg)
+{
+ if ((_pReg)->data && (_pReg)->data->size) {
+ if ((_pReg)->data != &RegionEmptyData)
+ free((_pReg)->data);
+ (_pReg)->data = NULL;
+ }
+}
+
+static inline void
+RegionReset(RegionPtr _pReg, BoxPtr _pBox)
+{
+ (_pReg)->extents = *(_pBox);
+ RegionUninit(_pReg);
+ (_pReg)->data = (RegDataPtr) NULL;
+}
+
+static inline Bool
+RegionNotEmpty(RegionPtr _pReg)
+{
+ return !RegionNil(_pReg);
+}
+
+static inline Bool
+RegionBroken(RegionPtr _pReg)
+{
+ return RegionNar(_pReg);
+}
+
+static inline void
+RegionEmpty(RegionPtr _pReg)
+{
+ RegionUninit(_pReg);
+ (_pReg)->extents.x2 = (_pReg)->extents.x1;
+ (_pReg)->extents.y2 = (_pReg)->extents.y1;
+ (_pReg)->data = &RegionEmptyData;
+}
+
+static inline BoxPtr
+RegionExtents(RegionPtr _pReg)
+{
+ return (&(_pReg)->extents);
+}
+
+static inline void
+RegionNull(RegionPtr _pReg)
+{
+ (_pReg)->extents = RegionEmptyBox;
+ (_pReg)->data = &RegionEmptyData;
+}
+
+extern _X_EXPORT void InitRegions(void);
+
+extern _X_EXPORT RegionPtr RegionCreate(BoxPtr /*rect */ ,
+ int /*size */ );
+
+extern _X_EXPORT void RegionDestroy(RegionPtr /*pReg */ );
+
+extern _X_EXPORT RegionPtr RegionDuplicate(RegionPtr /* pOld */);
+
+static inline Bool
+RegionCopy(RegionPtr dst, RegionPtr src)
+{
+ return pixman_region_copy(dst, src);
+}
+
+static inline Bool
+RegionIntersect(RegionPtr newReg, /* destination Region */
+ RegionPtr reg1, RegionPtr reg2 /* source regions */
+ )
+{
+ return pixman_region_intersect(newReg, reg1, reg2);
+}
+
+static inline Bool
+RegionUnion(RegionPtr newReg, /* destination Region */
+ RegionPtr reg1, RegionPtr reg2 /* source regions */
+ )
+{
+ return pixman_region_union(newReg, reg1, reg2);
+}
+
+extern _X_EXPORT Bool RegionAppend(RegionPtr /*dstrgn */ ,
+ RegionPtr /*rgn */ );
+
+extern _X_EXPORT Bool RegionValidate(RegionPtr /*badreg */ ,
+ Bool * /*pOverlap */ );
+
+extern _X_EXPORT RegionPtr RegionFromRects(int /*nrects */ ,
+ xRectanglePtr /*prect */ ,
+ int /*ctype */ );
+
+/*-
+ *-----------------------------------------------------------------------
+ * Subtract --
+ * Subtract regS from regM and leave the result in regD.
+ * S stands for subtrahend, M for minuend and D for difference.
+ *
+ * Results:
+ * TRUE if successful.
+ *
+ * Side Effects:
+ * regD is overwritten.
+ *
+ *-----------------------------------------------------------------------
+ */
+static inline Bool
+RegionSubtract(RegionPtr regD, RegionPtr regM, RegionPtr regS)
+{
+ return pixman_region_subtract(regD, regM, regS);
+}
+
+/*-
+ *-----------------------------------------------------------------------
+ * Inverse --
+ * Take a region and a box and return a region that is everything
+ * in the box but not in the region. The careful reader will note
+ * that this is the same as subtracting the region from the box...
+ *
+ * Results:
+ * TRUE.
+ *
+ * Side Effects:
+ * newReg is overwritten.
+ *
+ *-----------------------------------------------------------------------
+ */
+
+static inline Bool
+RegionInverse(RegionPtr newReg, /* Destination region */
+ RegionPtr reg1, /* Region to invert */
+ BoxPtr invRect /* Bounding box for inversion */
+ )
+{
+ return pixman_region_inverse(newReg, reg1, invRect);
+}
+
+static inline int
+RegionContainsRect(RegionPtr region, BoxPtr prect)
+{
+ return pixman_region_contains_rectangle(region, prect);
+}
+
+/* TranslateRegion(pReg, x, y)
+ translates in place
+*/
+
+static inline void
+RegionTranslate(RegionPtr pReg, int x, int y)
+{
+ pixman_region_translate(pReg, x, y);
+}
+
+extern _X_EXPORT Bool RegionBreak(RegionPtr /*pReg */ );
+
+static inline Bool
+RegionContainsPoint(RegionPtr pReg, int x, int y, BoxPtr box /* "return" value */
+ )
+{
+ return pixman_region_contains_point(pReg, x, y, box);
+}
+
+static inline Bool
+RegionEqual(RegionPtr reg1, RegionPtr reg2)
+{
+ return pixman_region_equal(reg1, reg2);
+}
+
+extern _X_EXPORT Bool RegionRectAlloc(RegionPtr /*pRgn */ ,
+ int /*n */
+ );
+
+#ifdef DEBUG
+extern _X_EXPORT Bool RegionIsValid(RegionPtr /*prgn */
+ );
+#endif
+
+extern _X_EXPORT void RegionPrint(RegionPtr /*pReg */ );
+
+#define INCLUDE_LEGACY_REGION_DEFINES
+#ifdef INCLUDE_LEGACY_REGION_DEFINES
+
+#define REGION_NIL RegionNil
+#define REGION_NUM_RECTS RegionNumRects
+#define REGION_RECTS RegionRects
+#define REGION_CREATE(pScreen, r, s) RegionCreate((r),(s))
+#define REGION_COPY(pScreen, d, r) RegionCopy((d), (r))
+#define REGION_DESTROY(pScreen, r) RegionDestroy((r))
+#define REGION_INTERSECT(pScreen, res, r1, r2) RegionIntersect((res), (r1), (r2))
+#define REGION_UNION(pScreen, res, r1, r2) RegionUnion((res), (r1), (r2))
+#define REGION_SUBTRACT(pScreen, res, r1, r2) RegionSubtract((res), (r1), (r2))
+#define REGION_TRANSLATE(pScreen, r, x, y) RegionTranslate((r), (x), (y))
+#define RECT_IN_REGION(pScreen, r, b) RegionContainsRect((r), (b))
+#define REGION_EQUAL(pScreen, r1, r2) RegionEqual((r1), (r2))
+#define RECTS_TO_REGION(pScreen, n, r, c) RegionFromRects((n), (r), (c))
+#define REGION_INIT(pScreen, r, b, s) RegionInit((r), (b), (s))
+#define REGION_UNINIT(pScreen, r) RegionUninit((r))
+#define REGION_RESET(pScreen, r, b) RegionReset((r), (b))
+#define REGION_NOTEMPTY(pScreen, r) RegionNotEmpty((r))
+#define REGION_EMPTY(pScreen, r) RegionEmpty((r))
+#define REGION_EXTENTS(pScreen, r) RegionExtents((r))
+#define REGION_NULL(pScreen, r) RegionNull((r))
+
+#endif /* INCLUDE_LEGACY_REGION_DEFINES */
+#endif /* REGIONSTRUCT_H */
diff --git a/prebuilt/xlibre/usr/include/xorg/resource.h b/prebuilt/xlibre/usr/include/xorg/resource.h
new file mode 100644
index 0000000..783a4f2
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/resource.h
@@ -0,0 +1,248 @@
+/***********************************************************
+
+Copyright 1987, 1989, 1998 The Open Group
+
+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.
+
+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
+OPEN GROUP 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.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+Copyright 1987, 1989 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+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 Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL 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 RESOURCE_H
+#define RESOURCE_H 1
+
+#include "xlibre_ptrtypes.h"
+
+#include "callback.h"
+#include "misc.h"
+#include "dixaccess.h"
+
+/*****************************************************************
+ * STUFF FOR RESOURCES
+ *****************************************************************/
+
+/* classes for Resource routines */
+
+typedef uint32_t RESTYPE;
+
+#define RC_VANILLA ((RESTYPE)0)
+#define RC_CACHED ((RESTYPE)1<<31)
+#define RC_DRAWABLE ((RESTYPE)1<<30)
+/* Use class RC_NEVERRETAIN for resources that should not be retained
+ * regardless of the close down mode when the client dies. (A client's
+ * event selections on objects that it doesn't own are good candidates.)
+ * Extensions can use this too!
+ */
+#define RC_NEVERRETAIN ((RESTYPE)1<<29)
+#define RC_LASTPREDEF RC_NEVERRETAIN
+#define RC_ANY (~(RESTYPE)0)
+
+/* types for Resource routines */
+
+// prevent namespace clash with Windows
+#define X11_RESTYPE_NONE ((RESTYPE)0)
+#define X11_RESTYPE_WINDOW ((RESTYPE)1|RC_DRAWABLE)
+#define X11_RESTYPE_PIXMAP ((RESTYPE)2|RC_DRAWABLE)
+#define X11_RESTYPE_GC ((RESTYPE)3)
+#define X11_RESTYPE_FONT ((RESTYPE)4)
+#define X11_RESTYPE_CURSOR ((RESTYPE)5)
+#define X11_RESTYPE_COLORMAP ((RESTYPE)6)
+#define X11_RESTYPE_CMAPENTRY ((RESTYPE)7)
+#define X11_RESTYPE_OTHERCLIENT ((RESTYPE)8|RC_NEVERRETAIN)
+#define X11_RESTYPE_PASSIVEGRAB ((RESTYPE)9|RC_NEVERRETAIN)
+#define X11_RESTYPE_LASTPREDEF ((RESTYPE)9)
+
+#define RT_WINDOW X11_RESTYPE_WINDOW
+#define RT_PIXMAP X11_RESTYPE_PIXMAP
+#define RT_GC X11_RESTYPE_GC
+#undef RT_FONT
+#undef RT_CURSOR
+#define RT_FONT X11_RESTYPE_FONT
+#define RT_CURSOR X11_RESTYPE_CURSOR
+#define RT_COLORMAP X11_RESTYPE_COLORMAP
+#define RT_CMAPENTRY X11_RESTYPE_CMAPENTRY
+#define RT_OTHERCLIENT X11_RESTYPE_OTHERCLIENT
+#define RT_PASSIVEGRAB X11_RESTYPE_PASSIVEGRAB
+#define RT_LASTPREDEF X11_RESTYPE_LASTPREDEF
+#define RT_NONE X11_RESTYPE_NONE
+
+
+extern _X_EXPORT unsigned int ResourceClientBits(void);
+
+#define BAD_RESOURCE 0xe0000000
+
+typedef int (*DeleteType) (void *value,
+ XID id);
+
+typedef void (*FindResType) (void *value,
+ XID id,
+ void *cdata);
+
+typedef void (*FindAllRes) (void *value,
+ XID id,
+ RESTYPE type,
+ void *cdata);
+
+typedef Bool (*FindComplexResType) (void *value,
+ XID id,
+ void *cdata);
+
+/* Structure for estimating resource memory usage. Memory usage
+ * consists of space allocated for the resource itself and of
+ * references to other resources. Currently the most important use for
+ * this structure is to estimate pixmap usage of different resources
+ * more accurately. */
+typedef struct {
+ /* Size of resource itself. Zero if not implemented. */
+ unsigned long resourceSize;
+ /* Size attributed to pixmap references from the resource. */
+ unsigned long pixmapRefSize;
+ /* Number of references to this resource; typically 1 */
+ unsigned long refCnt;
+} ResourceSizeRec, *ResourceSizePtr;
+
+typedef void (*SizeType)(void *value,
+ XID id,
+ ResourceSizePtr size);
+
+extern _X_EXPORT RESTYPE CreateNewResourceType(DeleteType deleteFunc,
+ const char *name);
+
+typedef void (*FindTypeSubResources)(void *value,
+ FindAllRes func,
+ void *cdata);
+
+extern _X_EXPORT SizeType GetResourceTypeSizeFunc(
+ RESTYPE /*type*/);
+
+extern _X_EXPORT void SetResourceTypeFindSubResFunc(
+ RESTYPE /*type*/, FindTypeSubResources /*findFunc*/);
+
+extern _X_EXPORT void SetResourceTypeSizeFunc(
+ RESTYPE /*type*/, SizeType /*sizeFunc*/);
+
+extern _X_EXPORT void SetResourceTypeErrorValue(
+ RESTYPE /*type*/, int /*errorValue*/);
+
+extern _X_EXPORT RESTYPE CreateNewResourceClass(void);
+
+extern _X_EXPORT Bool InitClientResources(ClientPtr /*client */ );
+
+extern _X_EXPORT XID FakeClientID(int /*client */ );
+
+/* Quartz support on Mac OS X uses the CarbonCore
+ framework whose AddResource function conflicts here. */
+#ifdef __APPLE__
+#define AddResource Darwin_X_AddResource
+#endif
+extern _X_EXPORT Bool AddResource(XID id,
+ RESTYPE type,
+ void *value);
+
+extern _X_EXPORT void FreeResource(XID /*id */ ,
+ RESTYPE /*skipDeleteFuncType */ );
+
+extern _X_EXPORT void FreeResourceByType(XID /*id */ ,
+ RESTYPE /*type */ ,
+ Bool /*skipFree */ );
+
+extern _X_EXPORT Bool ChangeResourceValue(XID id,
+ RESTYPE rtype,
+ void *value);
+
+extern _X_EXPORT void FindClientResourcesByType(ClientPtr client,
+ RESTYPE type,
+ FindResType func,
+ void *cdata);
+
+extern _X_EXPORT void FindAllClientResources(ClientPtr client,
+ FindAllRes func,
+ void *cdata);
+
+/** @brief Iterate through all subresources of a resource.
+
+ @note The XID argument provided to the FindAllRes function
+ may be 0 for subresources that don't have an XID */
+extern _X_EXPORT void FindSubResources(void *resource,
+ RESTYPE type,
+ FindAllRes func,
+ void *cdata);
+
+extern _X_EXPORT void FreeClientNeverRetainResources(ClientPtr /*client */ );
+
+extern _X_EXPORT void FreeClientResources(ClientPtr /*client */ );
+
+extern _X_EXPORT void FreeAllResources(void);
+
+extern _X_EXPORT Bool LegalNewID(XID /*id */ ,
+ ClientPtr /*client */ );
+
+extern _X_EXPORT void *LookupClientResourceComplex(ClientPtr client,
+ RESTYPE type,
+ FindComplexResType func,
+ void *cdata);
+
+extern _X_EXPORT int dixLookupResourceByType(void **result,
+ XID id,
+ RESTYPE rtype,
+ ClientPtr client,
+ Mask access_mode);
+
+extern _X_EXPORT int dixLookupResourceByClass(void **result,
+ XID id,
+ RESTYPE rclass,
+ ClientPtr client,
+ Mask access_mode);
+
+extern _X_EXPORT RESTYPE lastResourceType;
+extern _X_EXPORT RESTYPE TypeMask;
+
+/*
+ * @brief allocate a XID (resource ID) for the server itself
+ *
+ * This is mostly for resource types that don't have their own API yet
+ * The XID is allocated within server's ID space and then can be used
+ * for registering a resource with it (@see AddResource())
+ *
+ * @obsoletes FakeClientID
+ * @return XID the newly allocated XID
+ */
+_X_EXPORT XID dixAllocServerXID(void);
+
+#endif /* RESOURCE_H */
diff --git a/prebuilt/xlibre/usr/include/xorg/rgb.h b/prebuilt/xlibre/usr/include/xorg/rgb.h
new file mode 100644
index 0000000..449bc54
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/rgb.h
@@ -0,0 +1,52 @@
+/***********************************************************
+
+Copyright 1987, 1998 The Open Group
+
+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.
+
+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
+OPEN GROUP 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.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+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 Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL 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 RGB_H
+#define RGB_H
+typedef struct _RGB {
+ unsigned short red, green, blue;
+} RGB;
+#endif /* RGB_H */
diff --git a/prebuilt/xlibre/usr/include/xorg/rrtransform.h b/prebuilt/xlibre/usr/include/xorg/rrtransform.h
new file mode 100644
index 0000000..0a03e11
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/rrtransform.h
@@ -0,0 +1,61 @@
+/*
+ * Copyright © 2007 Keith Packard
+ *
+ * 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 _RRTRANSFORM_H_
+#define _RRTRANSFORM_H_
+
+#include
+#include "picturestr.h"
+
+typedef struct _rrTransform RRTransformRec, *RRTransformPtr;
+
+struct _rrTransform {
+ PictTransform transform;
+ struct pixman_f_transform f_transform;
+ struct pixman_f_transform f_inverse;
+ PictFilterPtr filter;
+ xFixed *params;
+ int nparams;
+ int width;
+ int height;
+};
+
+/*
+ * Compute the complete transformation matrix including
+ * client-specified transform, rotation/reflection values and the crtc
+ * offset.
+ *
+ * Return TRUE if the resulting transform is not a simple translation.
+ */
+extern _X_EXPORT Bool
+
+RRTransformCompute(int x,
+ int y,
+ int width,
+ int height,
+ Rotation rotation,
+ RRTransformPtr rr_transform,
+ PictTransformPtr transform,
+ struct pixman_f_transform *f_transform,
+ struct pixman_f_transform *f_inverse);
+
+#endif /* _RRTRANSFORM_H_ */
diff --git a/prebuilt/xlibre/usr/include/xorg/sarea.h b/prebuilt/xlibre/usr/include/xorg/sarea.h
new file mode 100644
index 0000000..1bef242
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/sarea.h
@@ -0,0 +1,96 @@
+/**
+ * \file sarea.h
+ * SAREA definitions.
+ *
+ * \author Kevin E. Martin
+ * \author Jens Owen
+ * \author Rickard E. (Rik) Faith
+ */
+
+/*
+ * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
+ * Copyright 2000 VA Linux Systems, Inc.
+ * All Rights Reserved.
+ *
+ * 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, sub license, 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 (including the
+ * next paragraph) 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 NON-INFRINGEMENT.
+ * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS 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 _SAREA_H_
+#define _SAREA_H_
+
+#include "xf86drm.h"
+
+/* SAREA area needs to be at least a page */
+#if defined(__alpha__)
+#define SAREA_MAX 0x2000
+#elif defined(__ia64__)
+#define SAREA_MAX 0x10000 /* 64kB */
+#else
+/* Intel 830M driver needs at least 8k SAREA */
+#define SAREA_MAX 0x2000
+#endif
+
+#define SAREA_MAX_DRAWABLES 256
+
+#define SAREA_DRAWABLE_CLAIMED_ENTRY 0x80000000
+
+/**
+ * SAREA per drawable information.
+ *
+ * \sa _XF86DRISAREA.
+ */
+typedef struct _XF86DRISAREADrawable {
+ unsigned int stamp;
+ unsigned int flags;
+} XF86DRISAREADrawableRec, *XF86DRISAREADrawablePtr;
+
+/**
+ * SAREA frame information.
+ *
+ * \sa _XF86DRISAREA.
+ */
+typedef struct _XF86DRISAREAFrame {
+ unsigned int x;
+ unsigned int y;
+ unsigned int width;
+ unsigned int height;
+ unsigned int fullscreen;
+} XF86DRISAREAFrameRec, *XF86DRISAREAFramePtr;
+
+/**
+ * SAREA definition.
+ */
+typedef struct _XF86DRISAREA {
+ /** first thing is always the DRM locking structure */
+ drmLock lock;
+ /** \todo Use readers/writer lock for drawable_lock */
+ drmLock drawable_lock;
+ XF86DRISAREADrawableRec drawableTable[SAREA_MAX_DRAWABLES];
+ XF86DRISAREAFrameRec frame;
+ drm_context_t dummy_context;
+} XF86DRISAREARec, *XF86DRISAREAPtr;
+
+typedef struct _XF86DRILSAREA {
+ drmLock lock;
+ drmLock otherLocks[31];
+} XF86DRILSAREARec, *XF86DRILSAREAPtr;
+
+#endif
diff --git a/prebuilt/xlibre/usr/include/xorg/screenint.h b/prebuilt/xlibre/usr/include/xorg/screenint.h
new file mode 100644
index 0000000..fc31304
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/screenint.h
@@ -0,0 +1,62 @@
+/***********************************************************
+
+Copyright 1987, 1998 The Open Group
+
+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.
+
+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
+OPEN GROUP 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.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+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 Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL 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 SCREENINT_H
+#define SCREENINT_H
+
+#include "misc.h"
+
+typedef struct _PixmapFormat *PixmapFormatPtr;
+typedef struct _Visual *VisualPtr;
+typedef struct _Depth *DepthPtr;
+typedef struct _Screen *ScreenPtr;
+
+extern _X_EXPORT void AttachOutputGPU(ScreenPtr pScreen, ScreenPtr newScreen);
+extern _X_EXPORT void DetachOutputGPU(ScreenPtr output);
+
+typedef struct _ColormapRec *ColormapPtr;
+
+#endif /* SCREENINT_H */
diff --git a/prebuilt/xlibre/usr/include/xorg/scrnintstr.h b/prebuilt/xlibre/usr/include/xorg/scrnintstr.h
new file mode 100644
index 0000000..49278ee
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/scrnintstr.h
@@ -0,0 +1,741 @@
+/***********************************************************
+
+Copyright 1987, 1998 The Open Group
+
+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.
+
+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
+OPEN GROUP 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.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+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 Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL 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 SCREENINTSTRUCT_H
+#define SCREENINTSTRUCT_H
+
+#include "xlibre_ptrtypes.h"
+#include "screenint.h"
+#include "regionstr.h"
+#include "colormap.h"
+#include "cursor.h"
+#include "validate.h"
+#include
+#include "dix.h"
+#include "privates.h"
+#include
+
+typedef struct _PixmapFormat {
+ unsigned char depth;
+ unsigned char bitsPerPixel;
+ unsigned char scanlinePad;
+} PixmapFormatRec;
+
+typedef struct _Visual {
+ VisualID vid;
+ short class;
+ short bitsPerRGBValue;
+ short ColormapEntries;
+ short nplanes; /* = log2 (ColormapEntries). This does not
+ * imply that the screen has this many planes.
+ * it may have more or fewer */
+ unsigned long redMask, greenMask, blueMask;
+ int offsetRed, offsetGreen, offsetBlue;
+} VisualRec;
+
+typedef struct _Depth {
+ unsigned char depth;
+ short numVids;
+ VisualID *vids; /* block of visual ids for this depth */
+} DepthRec;
+
+typedef struct _ScreenSaverStuff {
+ WindowPtr pWindow;
+ XID wid;
+ char blanked;
+ Bool (*ExternalScreenSaver) (ScreenPtr /*pScreen */ ,
+ int /*xstate */ ,
+ Bool /*force */ );
+} ScreenSaverStuffRec, *ScreenSaverStuffPtr;
+
+typedef enum {
+ WINDOW_VRR_DISABLED = 0,
+ WINDOW_VRR_ENABLED,
+} WindowVRRMode;
+
+/*
+ * There is a typedef for each screen function pointer so that code that
+ * needs to declare a screen function pointer (e.g. in a screen private
+ * or as a local variable) can easily do so and retain full type checking.
+ */
+
+typedef Bool (*CloseScreenProcPtr) (ScreenPtr /*pScreen */ );
+
+typedef void (*QueryBestSizeProcPtr) (int /*class */ ,
+ unsigned short * /*pwidth */ ,
+ unsigned short * /*pheight */ ,
+ ScreenPtr /*pScreen */ );
+
+typedef Bool (*SaveScreenProcPtr) (ScreenPtr /*pScreen */ ,
+ int /*on */ );
+
+typedef void (*GetImageProcPtr) (DrawablePtr /*pDrawable */ ,
+ int /*sx */ ,
+ int /*sy */ ,
+ int /*w */ ,
+ int /*h */ ,
+ unsigned int /*format */ ,
+ unsigned long /*planeMask */ ,
+ char * /*pdstLine */ );
+
+typedef void (*GetSpansProcPtr) (DrawablePtr /*pDrawable */ ,
+ int /*wMax */ ,
+ DDXPointPtr /*ppt */ ,
+ int * /*pwidth */ ,
+ int /*nspans */ ,
+ char * /*pdstStart */ );
+
+typedef void (*SourceValidateProcPtr) (DrawablePtr /*pDrawable */ ,
+ int /*x */ ,
+ int /*y */ ,
+ int /*width */ ,
+ int /*height */ ,
+ unsigned int /*subWindowMode */ );
+
+typedef Bool (*CreateWindowProcPtr) (WindowPtr /*pWindow */ );
+
+typedef Bool (*DestroyWindowProcPtr) (WindowPtr /*pWindow */ );
+
+typedef Bool (*PositionWindowProcPtr) (WindowPtr /*pWindow */ ,
+ int /*x */ ,
+ int /*y */ );
+
+typedef Bool (*ChangeWindowAttributesProcPtr) (WindowPtr /*pWindow */ ,
+ unsigned long /*mask */ );
+
+typedef Bool (*RealizeWindowProcPtr) (WindowPtr /*pWindow */ );
+
+typedef Bool (*UnrealizeWindowProcPtr) (WindowPtr /*pWindow */ );
+
+typedef void (*RestackWindowProcPtr) (WindowPtr /*pWindow */ ,
+ WindowPtr /*pOldNextSib */ );
+
+typedef int (*ValidateTreeProcPtr) (WindowPtr /*pParent */ ,
+ WindowPtr /*pChild */ ,
+ VTKind /*kind */ );
+
+typedef void (*PostValidateTreeProcPtr) (WindowPtr /*pParent */ ,
+ WindowPtr /*pChild */ ,
+ VTKind /*kind */ );
+
+typedef void (*WindowExposuresProcPtr) (WindowPtr /*pWindow */ ,
+ RegionPtr /*prgn */);
+
+typedef void (*PaintWindowProcPtr) (WindowPtr /*pWindow*/,
+ RegionPtr /*pRegion*/,
+ int /*what*/);
+
+typedef void (*CopyWindowProcPtr) (WindowPtr /*pWindow */ ,
+ xPoint /*ptOldOrg */ ,
+ RegionPtr /*prgnSrc */ );
+
+typedef void (*ClearToBackgroundProcPtr) (WindowPtr /*pWindow */ ,
+ int /*x */ ,
+ int /*y */ ,
+ int /*w */ ,
+ int /*h */ ,
+ Bool /*generateExposures */ );
+
+typedef void (*ClipNotifyProcPtr) (WindowPtr /*pWindow */ ,
+ int /*dx */ ,
+ int /*dy */ );
+
+typedef void (*SetWindowVRRModeProcPtr) (WindowPtr pWindow, WindowVRRMode mode);
+
+/* pixmap will exist only for the duration of the current rendering operation */
+#define CREATE_PIXMAP_USAGE_SCRATCH 1
+/* pixmap will be the backing pixmap for a redirected window */
+#define CREATE_PIXMAP_USAGE_BACKING_PIXMAP 2
+/* pixmap will contain a glyph */
+#define CREATE_PIXMAP_USAGE_GLYPH_PICTURE 3
+/* pixmap will be shared */
+#define CREATE_PIXMAP_USAGE_SHARED 4
+
+typedef PixmapPtr (*CreatePixmapProcPtr) (ScreenPtr /*pScreen */ ,
+ int /*width */ ,
+ int /*height */ ,
+ int /*depth */ ,
+ unsigned /*usage_hint */ );
+
+typedef Bool (*DestroyPixmapProcPtr) (PixmapPtr /*pPixmap */ );
+
+typedef Bool (*RealizeFontProcPtr) (ScreenPtr /*pScreen */ ,
+ FontPtr /*pFont */ );
+
+typedef Bool (*UnrealizeFontProcPtr) (ScreenPtr /*pScreen */ ,
+ FontPtr /*pFont */ );
+
+typedef void (*ConstrainCursorProcPtr) (DeviceIntPtr /*pDev */ ,
+ ScreenPtr /*pScreen */ ,
+ BoxPtr /*pBox */ );
+
+typedef void (*CursorLimitsProcPtr) (DeviceIntPtr /* pDev */ ,
+ ScreenPtr /*pScreen */ ,
+ CursorPtr /*pCursor */ ,
+ BoxPtr /*pHotBox */ ,
+ BoxPtr /*pTopLeftBox */ );
+
+typedef Bool (*DisplayCursorProcPtr) (DeviceIntPtr /* pDev */ ,
+ ScreenPtr /*pScreen */ ,
+ CursorPtr /*pCursor */ );
+
+typedef Bool (*RealizeCursorProcPtr) (DeviceIntPtr /* pDev */ ,
+ ScreenPtr /*pScreen */ ,
+ CursorPtr /*pCursor */ );
+
+typedef Bool (*UnrealizeCursorProcPtr) (DeviceIntPtr /* pDev */ ,
+ ScreenPtr /*pScreen */ ,
+ CursorPtr /*pCursor */ );
+
+typedef void (*RecolorCursorProcPtr) (DeviceIntPtr /* pDev */ ,
+ ScreenPtr /*pScreen */ ,
+ CursorPtr /*pCursor */ ,
+ Bool /*displayed */ );
+
+typedef Bool (*SetCursorPositionProcPtr) (DeviceIntPtr /* pDev */ ,
+ ScreenPtr /*pScreen */ ,
+ int /*x */ ,
+ int /*y */ ,
+ Bool /*generateEvent */ );
+
+typedef void (*CursorWarpedToProcPtr) (DeviceIntPtr /* pDev */ ,
+ ScreenPtr /*pScreen */ ,
+ ClientPtr /*pClient */ ,
+ WindowPtr /*pWindow */ ,
+ SpritePtr /*pSprite */ ,
+ int /*x */ ,
+ int /*y */ );
+
+typedef void (*CursorConfinedToProcPtr) (DeviceIntPtr /* pDev */ ,
+ ScreenPtr /*pScreen */ ,
+ WindowPtr /*pWindow */ );
+
+typedef Bool (*CreateGCProcPtr) (GCPtr /*pGC */ );
+
+typedef Bool (*CreateColormapProcPtr) (ColormapPtr /*pColormap */ );
+
+typedef void (*DestroyColormapProcPtr) (ColormapPtr /*pColormap */ );
+
+typedef void (*InstallColormapProcPtr) (ColormapPtr /*pColormap */ );
+
+typedef void (*UninstallColormapProcPtr) (ColormapPtr /*pColormap */ );
+
+typedef int (*ListInstalledColormapsProcPtr) (ScreenPtr /*pScreen */ ,
+ XID * /*pmaps */ );
+
+typedef void (*StoreColorsProcPtr) (ColormapPtr /*pColormap */ ,
+ int /*ndef */ ,
+ xColorItem * /*pdef */ );
+
+typedef void (*ResolveColorProcPtr) (unsigned short * /*pred */ ,
+ unsigned short * /*pgreen */ ,
+ unsigned short * /*pblue */ ,
+ VisualPtr /*pVisual */ );
+
+typedef RegionPtr (*BitmapToRegionProcPtr) (PixmapPtr /*pPix */ );
+
+typedef void (*ScreenBlockHandlerProcPtr) (ScreenPtr pScreen,
+ void *timeout);
+
+/* result has three possible values:
+ * < 0 - error
+ * = 0 - timeout
+ * > 0 - activity
+ */
+typedef void (*ScreenWakeupHandlerProcPtr) (ScreenPtr pScreen,
+ int result);
+
+typedef Bool (*CreateScreenResourcesProcPtr) (ScreenPtr /*pScreen */ );
+
+typedef Bool (*ModifyPixmapHeaderProcPtr) (PixmapPtr pPixmap,
+ int width,
+ int height,
+ int depth,
+ int bitsPerPixel,
+ int devKind,
+ void *pPixData);
+
+typedef PixmapPtr (*GetWindowPixmapProcPtr) (WindowPtr /*pWin */ );
+
+typedef void (*SetWindowPixmapProcPtr) (WindowPtr /*pWin */ ,
+ PixmapPtr /*pPix */ );
+
+typedef PixmapPtr (*GetScreenPixmapProcPtr) (ScreenPtr /*pScreen */ );
+
+typedef void (*SetScreenPixmapProcPtr) (PixmapPtr /*pPix */ );
+
+typedef void (*MarkWindowProcPtr) (WindowPtr /*pWin */ );
+
+typedef Bool (*MarkOverlappedWindowsProcPtr) (WindowPtr /*parent */ ,
+ WindowPtr /*firstChild */ ,
+ WindowPtr * /*pLayerWin */ );
+
+typedef int (*ConfigNotifyProcPtr) (WindowPtr /*pWin */ ,
+ int /*x */ ,
+ int /*y */ ,
+ int /*w */ ,
+ int /*h */ ,
+ int /*bw */ ,
+ WindowPtr /*pSib */ );
+
+typedef void (*MoveWindowProcPtr) (WindowPtr /*pWin */ ,
+ int /*x */ ,
+ int /*y */ ,
+ WindowPtr /*pSib */ ,
+ VTKind /*kind */ );
+
+typedef void (*ResizeWindowProcPtr) (WindowPtr /*pWin */ ,
+ int /*x */ ,
+ int /*y */ ,
+ unsigned int /*w */ ,
+ unsigned int /*h */ ,
+ WindowPtr /*pSib */
+ );
+
+typedef WindowPtr (*GetLayerWindowProcPtr) (WindowPtr /*pWin */
+ );
+
+typedef void (*HandleExposuresProcPtr) (WindowPtr /*pWin */ );
+
+typedef void (*ReparentWindowProcPtr) (WindowPtr /*pWin */ ,
+ WindowPtr /*pPriorParent */ );
+
+typedef void (*SetShapeProcPtr) (WindowPtr /*pWin */ ,
+ int /* kind */ );
+
+typedef void (*ChangeBorderWidthProcPtr) (WindowPtr /*pWin */ ,
+ unsigned int /*width */ );
+
+typedef void (*MarkUnrealizedWindowProcPtr) (WindowPtr /*pChild */ ,
+ WindowPtr /*pWin */ ,
+ Bool /*fromConfigure */ );
+
+typedef Bool (*DeviceCursorInitializeProcPtr) (DeviceIntPtr /* pDev */ ,
+ ScreenPtr /* pScreen */ );
+
+typedef void (*DeviceCursorCleanupProcPtr) (DeviceIntPtr /* pDev */ ,
+ ScreenPtr /* pScreen */ );
+
+typedef void (*ConstrainCursorHarderProcPtr) (DeviceIntPtr, ScreenPtr, int,
+ int *, int *);
+
+
+typedef Bool (*SharePixmapBackingProcPtr)(PixmapPtr, ScreenPtr, void **);
+
+typedef Bool (*SetSharedPixmapBackingProcPtr)(PixmapPtr, void *);
+
+#define HAS_SYNC_SHARED_PIXMAP 1
+/* The SyncSharedPixmap hook has two purposes:
+ *
+ * 1. If the primary driver has it, the secondary driver can use it to
+ * synchronize the shared pixmap contents with the screen pixmap.
+ * 2. If the secondary driver has it, the primary driver can expect the secondary
+ * driver to call the primary screen's SyncSharedPixmap hook, so the primary
+ * driver doesn't have to synchronize the shared pixmap contents itself,
+ * e.g. from the BlockHandler.
+ *
+ * A driver must only set the hook if it handles both cases correctly.
+ *
+ * The argument is the secondary screen's pixmap_dirty_list entry, the hook is
+ * responsible for finding the corresponding entry in the primary screen's
+ * pixmap_dirty_list.
+ */
+typedef void (*SyncSharedPixmapProcPtr)(PixmapDirtyUpdatePtr);
+
+typedef Bool (*StartPixmapTrackingProcPtr)(DrawablePtr, PixmapPtr,
+ int x, int y,
+ int dst_x, int dst_y,
+ Rotation rotation);
+
+typedef Bool (*PresentSharedPixmapProcPtr)(PixmapPtr);
+
+typedef Bool (*RequestSharedPixmapNotifyDamageProcPtr)(PixmapPtr);
+
+typedef Bool (*StopPixmapTrackingProcPtr)(DrawablePtr, PixmapPtr);
+
+typedef Bool (*StopFlippingPixmapTrackingProcPtr)(DrawablePtr,
+ PixmapPtr, PixmapPtr);
+
+typedef Bool (*SharedPixmapNotifyDamageProcPtr)(PixmapPtr);
+
+typedef Bool (*ReplaceScanoutPixmapProcPtr)(DrawablePtr, PixmapPtr, Bool);
+
+typedef WindowPtr (*XYToWindowProcPtr)(ScreenPtr pScreen,
+ SpritePtr pSprite, int x, int y);
+
+typedef int (*NameWindowPixmapProcPtr)(WindowPtr, PixmapPtr, CARD32);
+
+typedef void (*DPMSProcPtr)(ScreenPtr pScreen, int level);
+
+/* Wrapping Screen procedures
+
+ There are a few modules in the X server which dynamically add and
+ remove themselves from various screen procedure call chains.
+
+ For example, the BlockHandler is dynamically modified by:
+
+ * xf86Rotate
+ * miSprite
+ * composite
+ * render (for animated cursors)
+
+ Correctly manipulating this chain is complicated by the fact that
+ the chain is constructed through a sequence of screen private
+ structures, each holding the next screen->proc pointer.
+
+ To add a module to a screen->proc chain is fairly simple; just save
+ the current screen->proc value in the module screen private
+ and store the module's function in the screen->proc location.
+
+ Removing a screen proc is a bit trickier. It seems like all you
+ need to do is set the screen->proc pointer back to the value saved
+ in your screen private. However, if some other module has come
+ along and wrapped on top of you, then the right place to store the
+ previous screen->proc value is actually in the wrapping module's
+ screen private structure(!). Of course, you have no idea what
+ other module may have wrapped on top, nor could you poke inside
+ its screen private in any case.
+
+ To make this work, we restrict the unwrapping process to happen
+ during the invocation of the screen proc itself, and then we
+ require the screen proc to take some care when manipulating the
+ screen proc functions pointers.
+
+ The requirements are:
+
+ 1) The screen proc must set the screen->proc pointer back to the
+ value saved in its screen private before calling outside its
+ module.
+
+ 2a) If the screen proc wants to be remove itself from the chain,
+ it must not manipulate screen->proc pointer again before
+ returning.
+
+ 2b) If the screen proc wants to remain in the chain, it must:
+
+ 2b.1) Re-fetch the screen->proc pointer and store that in
+ its screen private. This ensures that any changes
+ to the chain will be preserved.
+
+ 2b.2) Set screen->proc back to itself
+
+ One key requirement here is that these steps must wrap not just
+ any invocation of the nested screen->proc value, but must nest
+ essentially any calls outside the current module. This ensures
+ that other modules can reliably manipulate screen->proc wrapping
+ using these same rules.
+
+ For example, the animated cursor code in render has two macros,
+ Wrap and Unwrap.
+
+ #define Unwrap(as,s,elt) ((s)->elt = (as)->elt)
+
+ Unwrap takes the screen private (as), the screen (s) and the
+ member name (elt), and restores screen->proc to that saved in the
+ screen private.
+
+ #define Wrap(as,s,elt,func) (((as)->elt = (s)->elt), (s)->elt = func)
+
+ Wrap takes the screen private (as), the screen (s), the member
+ name (elt) and the wrapping function (func). It saves the
+ current screen->proc value in the screen private, and then sets the
+ screen->proc to the local wrapping function.
+
+ Within each of these functions, there's a pretty simple pattern:
+
+ Unwrap(as, pScreen, UnrealizeCursor);
+
+ // Do local stuff, including possibly calling down through
+ // pScreen->UnrealizeCursor
+
+ Wrap(as, pScreen, UnrealizeCursor, AnimCurUnrealizeCursor);
+
+ The wrapping block handler is a bit different; it does the Unwrap,
+ the local operations, and then only re-Wraps if the hook is still
+ required. Unwrap occurs at the top of each function, just after
+ entry, and Wrap occurs at the bottom of each function, just
+ before returning.
+
+ DestroyWindow() should NOT be wrapped anymore
+ use dixScreenHookWindowDestroy() instead.
+ */
+
+typedef struct _Screen {
+ int myNum; /* index of this instance in Screens[] */
+ ATOM id;
+ short x, y, width, height;
+ short mmWidth, mmHeight;
+ short numDepths;
+ unsigned char rootDepth;
+ DepthPtr allowedDepths;
+ unsigned long rootVisual;
+ unsigned long defColormap;
+ short minInstalledCmaps, maxInstalledCmaps;
+ char backingStoreSupport, saveUnderSupport;
+ unsigned long whitePixel, blackPixel;
+ GCPtr GCperDepth[MAXFORMATS + 1];
+ /* next field is a stipple to use as default in a GC. we don't build
+ * default tiles of all depths because they are likely to be of a color
+ * different from the default fg pixel, so we don't win anything by
+ * building a standard one.
+ */
+ PixmapPtr defaultStipple;
+ void *devPrivate;
+ short numVisuals;
+ VisualPtr visuals;
+ WindowPtr root;
+ ScreenSaverStuffRec screensaver;
+
+ DevPrivateSetRec screenSpecificPrivates[PRIVATE_LAST];
+
+ /* Random screen procedures */
+
+ CloseScreenProcPtr CloseScreen;
+ QueryBestSizeProcPtr QueryBestSize;
+ SaveScreenProcPtr SaveScreen;
+ GetImageProcPtr GetImage;
+ GetSpansProcPtr GetSpans;
+ SourceValidateProcPtr SourceValidate;
+
+ /* Window Procedures */
+
+ CreateWindowProcPtr CreateWindow;
+ DestroyWindowProcPtr DestroyWindow;
+ PositionWindowProcPtr PositionWindow;
+ ChangeWindowAttributesProcPtr ChangeWindowAttributes;
+ RealizeWindowProcPtr RealizeWindow;
+ UnrealizeWindowProcPtr UnrealizeWindow;
+ ValidateTreeProcPtr ValidateTree;
+ PostValidateTreeProcPtr PostValidateTree;
+ WindowExposuresProcPtr WindowExposures;
+ CopyWindowProcPtr CopyWindow;
+ ClearToBackgroundProcPtr ClearToBackground;
+ ClipNotifyProcPtr ClipNotify;
+ RestackWindowProcPtr RestackWindow;
+ PaintWindowProcPtr PaintWindow;
+
+ /* Pixmap procedures */
+
+ CreatePixmapProcPtr CreatePixmap;
+ DestroyPixmapProcPtr DestroyPixmap;
+
+ /* Font procedures */
+
+ RealizeFontProcPtr RealizeFont;
+ UnrealizeFontProcPtr UnrealizeFont;
+
+ /* Cursor Procedures */
+
+ ConstrainCursorProcPtr ConstrainCursor;
+ ConstrainCursorHarderProcPtr ConstrainCursorHarder;
+ CursorLimitsProcPtr CursorLimits;
+ DisplayCursorProcPtr DisplayCursor;
+ RealizeCursorProcPtr RealizeCursor;
+ UnrealizeCursorProcPtr UnrealizeCursor;
+ RecolorCursorProcPtr RecolorCursor;
+ SetCursorPositionProcPtr SetCursorPosition;
+ CursorWarpedToProcPtr CursorWarpedTo;
+ CursorConfinedToProcPtr CursorConfinedTo;
+
+ /* GC procedures */
+
+ CreateGCProcPtr CreateGC;
+
+ /* Colormap procedures */
+
+ CreateColormapProcPtr CreateColormap;
+ DestroyColormapProcPtr DestroyColormap;
+ InstallColormapProcPtr InstallColormap;
+ UninstallColormapProcPtr UninstallColormap;
+ ListInstalledColormapsProcPtr ListInstalledColormaps;
+ StoreColorsProcPtr StoreColors;
+ ResolveColorProcPtr ResolveColor;
+
+ /* Region procedures */
+
+ BitmapToRegionProcPtr BitmapToRegion;
+
+ /* os layer procedures */
+
+ ScreenBlockHandlerProcPtr BlockHandler;
+ ScreenWakeupHandlerProcPtr WakeupHandler;
+
+ /* anybody can get a piece of this array */
+ PrivateRec *devPrivates;
+
+ CreateScreenResourcesProcPtr CreateScreenResources;
+ ModifyPixmapHeaderProcPtr ModifyPixmapHeader;
+
+ GetWindowPixmapProcPtr GetWindowPixmap;
+ SetWindowPixmapProcPtr SetWindowPixmap;
+ GetScreenPixmapProcPtr GetScreenPixmap;
+ SetScreenPixmapProcPtr SetScreenPixmap;
+ NameWindowPixmapProcPtr NameWindowPixmap;
+
+#ifdef CONFIG_LEGACY_NVIDIA_PADDING
+ /* This field is used by the 470 and 390 proprietary nvidia DDX driver, and should always be NULL */
+ void* reserved_for_nvidia_470_and_390;
+#endif
+
+ unsigned int totalPixmapSize;
+
+ MarkWindowProcPtr MarkWindow;
+ MarkOverlappedWindowsProcPtr MarkOverlappedWindows;
+ ConfigNotifyProcPtr ConfigNotify;
+ MoveWindowProcPtr MoveWindow;
+ ResizeWindowProcPtr ResizeWindow;
+ GetLayerWindowProcPtr GetLayerWindow;
+ HandleExposuresProcPtr HandleExposures;
+ ReparentWindowProcPtr ReparentWindow;
+
+ SetShapeProcPtr SetShape;
+
+ ChangeBorderWidthProcPtr ChangeBorderWidth;
+ MarkUnrealizedWindowProcPtr MarkUnrealizedWindow;
+
+ /* Device cursor procedures */
+ DeviceCursorInitializeProcPtr DeviceCursorInitialize;
+ DeviceCursorCleanupProcPtr DeviceCursorCleanup;
+
+ /* set it in driver side if X server can copy the framebuffer content.
+ * Meant to be used together with '-background none' option, avoiding
+ * malicious users to steal framebuffer's content if that would be the
+ * default */
+ Bool canDoBGNoneRoot;
+
+ Bool isGPU;
+
+ /* Info on this screen's secondarys (if any) */
+ struct xorg_list secondary_list;
+ struct xorg_list secondary_head;
+ int output_secondarys;
+ /* Info for when this screen is a secondary */
+ ScreenPtr current_primary;
+ Bool is_output_secondary;
+ Bool is_offload_secondary;
+
+ SharePixmapBackingProcPtr SharePixmapBacking;
+ SetSharedPixmapBackingProcPtr SetSharedPixmapBacking;
+
+ StartPixmapTrackingProcPtr StartPixmapTracking;
+ StopPixmapTrackingProcPtr StopPixmapTracking;
+ SyncSharedPixmapProcPtr SyncSharedPixmap;
+
+ SharedPixmapNotifyDamageProcPtr SharedPixmapNotifyDamage;
+ RequestSharedPixmapNotifyDamageProcPtr RequestSharedPixmapNotifyDamage;
+ PresentSharedPixmapProcPtr PresentSharedPixmap;
+ StopFlippingPixmapTrackingProcPtr StopFlippingPixmapTracking;
+
+ struct xorg_list pixmap_dirty_list;
+
+ ReplaceScanoutPixmapProcPtr ReplaceScanoutPixmap;
+ XYToWindowProcPtr XYToWindow;
+ DPMSProcPtr DPMS;
+
+ /* ===== below here is PRIVATE ==== drivers MUST NEVER touch it ===== */
+
+ /* additional window destructors (replaces wrapping DestroyWindow).
+ should NOT be touched outside of DIX core */
+ CallbackListPtr hookWindowDestroy;
+
+ /* additional window position notify hooks (replaces wrapping PositionWindow)
+ should NOT be touched outside of DIX core */
+ CallbackListPtr hookWindowPosition;
+
+ /* additional screen close notify hooks (replaces wrapping CloseScreen)
+ should NOT be touched outside of DIX core */
+ CallbackListPtr hookClose;
+
+ /* additional pixmap destroy notify hooks (replaces wrapping DestroyPixmap)
+ should NOT be touched outside of DIX core */
+ CallbackListPtr hookPixmapDestroy;
+
+ /* hooks run right after SUCCESSFUL CreateScreenResources
+ should NOT be touched outside of DIX core */
+ CallbackListPtr hookPostCreateResources;
+
+ SetWindowVRRModeProcPtr SetWindowVRRMode;
+
+ /* additional screen post-close notify hooks (replaces wrapping CloseScreen)
+ should NOT be touched outside of DIX core */
+ CallbackListPtr hookPostClose;
+
+ /* xfixes cursor hiding -- this might deserve further optimization */
+ struct {
+ DisplayCursorProcPtr DisplayCursor; /* original proc (for wrapping) */
+ struct _CursorHideCountRec *pCursorHideCounts;
+ } xfixes;
+} ScreenRec;
+
+static inline RegionPtr
+BitmapToRegion(ScreenPtr _pScreen, PixmapPtr pPix)
+{
+ return (*(_pScreen)->BitmapToRegion) (pPix); /* no mi version?! */
+}
+
+typedef struct _ScreenInfo {
+ int imageByteOrder;
+ int bitmapScanlineUnit;
+ int bitmapScanlinePad;
+ int bitmapBitOrder;
+ int numPixmapFormats;
+ PixmapFormatRec formats[MAXFORMATS];
+ int numScreens;
+ ScreenPtr screens[MAXSCREENS];
+ int numGPUScreens;
+ ScreenPtr gpuscreens[MAXGPUSCREENS];
+ int x; /* origin */
+ int y; /* origin */
+ int width; /* total width of all screens together */
+ int height; /* total height of all screens together */
+
+ /* beyond here, NOT part of ABI */
+ int numRoots; /* client-visible numer, usually equals numScreens, except for Xinerama etc */
+} ScreenInfo;
+
+extern _X_EXPORT ScreenInfo screenInfo;
+
+#endif /* SCREENINTSTRUCT_H */
diff --git a/prebuilt/xlibre/usr/include/xorg/servermd.h b/prebuilt/xlibre/usr/include/xorg/servermd.h
new file mode 100644
index 0000000..ffb8f6a
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/servermd.h
@@ -0,0 +1,107 @@
+/***********************************************************
+
+Copyright 1987, 1998 The Open Group
+
+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.
+
+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
+OPEN GROUP 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.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+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 Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL 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 SERVERMD_H
+#define SERVERMD_H 1
+
+#include
+#include /* for X_LITTLE_ENDIAN/X_BIG_ENDIAN */
+
+#if X_BYTE_ORDER == X_LITTLE_ENDIAN
+#define IMAGE_BYTE_ORDER LSBFirst
+#define BITMAP_BIT_ORDER LSBFirst
+#elif X_BYTE_ORDER == X_BIG_ENDIAN
+#define IMAGE_BYTE_ORDER MSBFirst
+#define BITMAP_BIT_ORDER MSBFirst
+#else
+#error "Too weird to live."
+#endif
+
+#define BITMAP_SCANLINE_PAD 32
+#define LOG2_BITMAP_PAD 5
+#define LOG2_BYTES_PER_SCANLINE_PAD 2
+
+#include
+/*
+ * This returns the number of padding units, for depth d and width w.
+ * For bitmaps this can be calculated with the macros above.
+ * Other depths require either grovelling over the formats field of the
+ * screenInfo or hardwired constants.
+ */
+
+typedef struct _PaddingInfo {
+ int padRoundUp; /* pixels per pad unit - 1 */
+ int padPixelsLog2; /* log 2 (pixels per pad unit) */
+ int padBytesLog2; /* log 2 (bytes per pad unit) */
+ int notPower2; /* bitsPerPixel not a power of 2 */
+ int bytesPerPixel; /* only set when notPower2 is TRUE */
+ int bitsPerPixel; /* bits per pixel */
+} PaddingInfo;
+extern _X_EXPORT PaddingInfo PixmapWidthPaddingInfo[];
+
+/* The only portable way to get the bpp from the depth is to look it up */
+#define BitsPerPixel(d) (PixmapWidthPaddingInfo[d].bitsPerPixel)
+
+#define PixmapWidthInPadUnits(w, d) \
+ (PixmapWidthPaddingInfo[d].notPower2 ? \
+ (((int)(w) * PixmapWidthPaddingInfo[d].bytesPerPixel + \
+ PixmapWidthPaddingInfo[d].bytesPerPixel) >> \
+ PixmapWidthPaddingInfo[d].padBytesLog2) : \
+ ((int)((w) + PixmapWidthPaddingInfo[d].padRoundUp) >> \
+ PixmapWidthPaddingInfo[d].padPixelsLog2))
+
+/*
+ * Return the number of bytes to which a scanline of the given
+ * depth and width will be padded.
+ */
+#define PixmapBytePad(w, d) \
+ (PixmapWidthInPadUnits(w, d) << PixmapWidthPaddingInfo[d].padBytesLog2)
+
+static inline size_t BitmapBytePad(size_t w) {
+ return ((((w) + BITMAP_SCANLINE_PAD - 1) >> LOG2_BITMAP_PAD) << LOG2_BYTES_PER_SCANLINE_PAD);
+}
+
+#endif /* SERVERMD_H */
diff --git a/prebuilt/xlibre/usr/include/xorg/shadow.h b/prebuilt/xlibre/usr/include/xorg/shadow.h
new file mode 100644
index 0000000..88587b1
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/shadow.h
@@ -0,0 +1,155 @@
+/*
+ *
+ * Copyright © 2000 Keith Packard
+ *
+ * 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 Keith Packard not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. Keith Packard makes no
+ * representations about the suitability of this software for any purpose. It
+ * is provided "as is" without express or implied warranty.
+ *
+ * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL KEITH PACKARD 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 _SHADOW_H_
+#define _SHADOW_H_
+
+#include "scrnintstr.h"
+
+#include "picturestr.h"
+
+#include "damage.h"
+#include "damagestr.h"
+typedef struct _shadowBuf *shadowBufPtr;
+
+typedef void (*ShadowUpdateProc) (ScreenPtr pScreen, shadowBufPtr pBuf);
+
+#define SHADOW_WINDOW_RELOCATE 1
+#define SHADOW_WINDOW_READ 2
+#define SHADOW_WINDOW_WRITE 4
+
+typedef void *(*ShadowWindowProc) (ScreenPtr pScreen,
+ CARD32 row,
+ CARD32 offset,
+ int mode, CARD32 *size, void *closure);
+
+typedef struct _shadowBuf {
+ DamagePtr pDamage;
+ ShadowUpdateProc update;
+ ShadowWindowProc window;
+ PixmapPtr pPixmap;
+ void *closure;
+ int randr;
+
+ /* screen wrappers */
+ GetImageProcPtr GetImage;
+ void *_dummy1; // required in place of a removed field for ABI compatibility
+ ScreenBlockHandlerProcPtr BlockHandler;
+} shadowBufRec;
+
+/* Match defines from randr extension */
+#define SHADOW_ROTATE_0 1
+#define SHADOW_ROTATE_90 2
+#define SHADOW_ROTATE_180 4
+#define SHADOW_ROTATE_270 8
+#define SHADOW_ROTATE_ALL (SHADOW_ROTATE_0|SHADOW_ROTATE_90|\
+ SHADOW_ROTATE_180|SHADOW_ROTATE_270)
+#define SHADOW_REFLECT_X 16
+#define SHADOW_REFLECT_Y 32
+#define SHADOW_REFLECT_ALL (SHADOW_REFLECT_X|SHADOW_REFLECT_Y)
+
+extern _X_EXPORT Bool
+ shadowSetup(ScreenPtr pScreen);
+
+extern _X_EXPORT Bool
+
+shadowAdd(ScreenPtr pScreen,
+ PixmapPtr pPixmap,
+ ShadowUpdateProc update,
+ ShadowWindowProc window, int randr, void *closure);
+
+extern _X_EXPORT void
+ shadowRemove(ScreenPtr pScreen, PixmapPtr pPixmap);
+
+extern _X_EXPORT void
+ shadowUpdateAfb4(ScreenPtr pScreen, shadowBufPtr pBuf);
+
+extern _X_EXPORT void
+ shadowUpdateAfb8(ScreenPtr pScreen, shadowBufPtr pBuf);
+
+extern _X_EXPORT void
+ shadowUpdateIplan2p4(ScreenPtr pScreen, shadowBufPtr pBuf);
+
+extern _X_EXPORT void
+ shadowUpdateIplan2p8(ScreenPtr pScreen, shadowBufPtr pBuf);
+
+extern _X_EXPORT void
+ shadowUpdatePacked(ScreenPtr pScreen, shadowBufPtr pBuf);
+
+extern _X_EXPORT void
+ shadowUpdatePlanar4(ScreenPtr pScreen, shadowBufPtr pBuf);
+
+extern _X_EXPORT void
+ shadowUpdatePlanar4x8(ScreenPtr pScreen, shadowBufPtr pBuf);
+
+extern _X_EXPORT void
+ shadowUpdateRotatePacked(ScreenPtr pScreen, shadowBufPtr pBuf);
+
+extern _X_EXPORT void
+ shadowUpdateRotate8_90(ScreenPtr pScreen, shadowBufPtr pBuf);
+
+extern _X_EXPORT void
+ shadowUpdateRotate16_90(ScreenPtr pScreen, shadowBufPtr pBuf);
+
+extern _X_EXPORT void
+ shadowUpdateRotate16_90YX(ScreenPtr pScreen, shadowBufPtr pBuf);
+
+extern _X_EXPORT void
+ shadowUpdateRotate32_90(ScreenPtr pScreen, shadowBufPtr pBuf);
+
+extern _X_EXPORT void
+ shadowUpdateRotate8_180(ScreenPtr pScreen, shadowBufPtr pBuf);
+
+extern _X_EXPORT void
+ shadowUpdateRotate16_180(ScreenPtr pScreen, shadowBufPtr pBuf);
+
+extern _X_EXPORT void
+ shadowUpdateRotate32_180(ScreenPtr pScreen, shadowBufPtr pBuf);
+
+extern _X_EXPORT void
+ shadowUpdateRotate8_270(ScreenPtr pScreen, shadowBufPtr pBuf);
+
+extern _X_EXPORT void
+ shadowUpdateRotate16_270(ScreenPtr pScreen, shadowBufPtr pBuf);
+
+extern _X_EXPORT void
+ shadowUpdateRotate16_270YX(ScreenPtr pScreen, shadowBufPtr pBuf);
+
+extern _X_EXPORT void
+ shadowUpdateRotate32_270(ScreenPtr pScreen, shadowBufPtr pBuf);
+
+extern _X_EXPORT void
+ shadowUpdateRotate8(ScreenPtr pScreen, shadowBufPtr pBuf);
+
+extern _X_EXPORT void
+ shadowUpdateRotate16(ScreenPtr pScreen, shadowBufPtr pBuf);
+
+extern _X_EXPORT void
+ shadowUpdateRotate32(ScreenPtr pScreen, shadowBufPtr pBuf);
+
+extern _X_EXPORT void
+ shadowUpdate32to24(ScreenPtr pScreen, shadowBufPtr pBuf);
+
+typedef void (*shadowUpdateProc) (ScreenPtr, shadowBufPtr);
+
+#endif /* _SHADOW_H_ */
diff --git a/prebuilt/xlibre/usr/include/xorg/shadowfb.h b/prebuilt/xlibre/usr/include/xorg/shadowfb.h
new file mode 100644
index 0000000..b3dd448
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/shadowfb.h
@@ -0,0 +1,39 @@
+
+#ifndef _SHADOWFB_H
+#define _SHADOWFB_H
+
+#include "xf86str.h"
+
+/*
+ * User defined callback function. Passed a pointer to the ScrnInfo struct,
+ * the number of dirty rectangles, and a pointer to the first dirty rectangle
+ * in the array.
+ */
+typedef void (*RefreshAreaFuncPtr) (ScrnInfoPtr, int, BoxPtr);
+
+/*
+ * ShadowFBInit initializes the shadowfb subsystem. refreshArea is a pointer
+ * to a user supplied callback function. This function will be called after
+ * any operation that modifies the framebuffer. The newly dirtied rectangles
+ * are passed to the callback.
+ *
+ * Returns FALSE in the event of an error.
+ */
+extern _X_EXPORT Bool
+ ShadowFBInit(ScreenPtr pScreen, RefreshAreaFuncPtr refreshArea);
+
+/*
+ * ShadowFBInit2 is a more featureful refinement of the original shadowfb.
+ * ShadowFBInit2 allows you to specify two callbacks, one to be called
+ * immediately before an operation that modifies the framebuffer, and another
+ * to be called immediately after.
+ *
+ * Returns FALSE in the event of an error
+ */
+extern _X_EXPORT Bool
+
+ShadowFBInit2(ScreenPtr pScreen,
+ RefreshAreaFuncPtr preRefreshArea,
+ RefreshAreaFuncPtr postRefreshArea);
+
+#endif /* _SHADOWFB_H */
diff --git a/prebuilt/xlibre/usr/include/xorg/shmint.h b/prebuilt/xlibre/usr/include/xorg/shmint.h
new file mode 100644
index 0000000..1cd8a77
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/shmint.h
@@ -0,0 +1,76 @@
+/*
+ * Copyright © 2003 Keith Packard
+ *
+ * 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 Keith Packard not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. Keith Packard makes no
+ * representations about the suitability of this software for any purpose. It
+ * is provided "as is" without express or implied warranty.
+ *
+ * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL KEITH PACKARD 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 _SHMINT_H_
+#define _SHMINT_H_
+
+#include
+#include
+
+#include "screenint.h"
+#include "pixmap.h"
+#include "gc.h"
+
+#define XSHM_PUT_IMAGE_ARGS \
+ DrawablePtr /* dst */, \
+ GCPtr /* pGC */, \
+ int /* depth */, \
+ unsigned int /* format */, \
+ int /* w */, \
+ int /* h */, \
+ int /* sx */, \
+ int /* sy */, \
+ int /* sw */, \
+ int /* sh */, \
+ int /* dx */, \
+ int /* dy */, \
+ char * /* data */
+
+#define XSHM_CREATE_PIXMAP_ARGS \
+ ScreenPtr /* pScreen */, \
+ int /* width */, \
+ int /* height */, \
+ int /* depth */, \
+ char * /* addr */
+
+typedef struct _ShmFuncs {
+ PixmapPtr (*CreatePixmap) (XSHM_CREATE_PIXMAP_ARGS);
+ void (*PutImage) (XSHM_PUT_IMAGE_ARGS);
+} ShmFuncs, *ShmFuncsPtr;
+
+#if XTRANS_SEND_FDS
+#define SHM_FD_PASSING 1
+#endif
+
+#ifdef SHM_FD_PASSING
+#define SHMDESC_IS_FD(shmdesc) ((shmdesc)->is_fd)
+#else
+#define SHMDESC_IS_FD(shmdesc) (0)
+#endif
+
+_X_EXPORT void ShmRegisterFuncs(ScreenPtr pScreen, ShmFuncsPtr funcs);
+_X_EXPORT void ShmRegisterFbFuncs(ScreenPtr pScreen);
+
+extern _X_EXPORT int ShmCompletionCode;
+extern _X_EXPORT int BadShmSegCode;
+
+#endif /* _SHMINT_H_ */
diff --git a/prebuilt/xlibre/usr/include/xorg/syncsdk.h b/prebuilt/xlibre/usr/include/xorg/syncsdk.h
new file mode 100644
index 0000000..82299cf
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/syncsdk.h
@@ -0,0 +1,49 @@
+/*
+ * Copyright © 2010 NVIDIA Corporation
+ *
+ * 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 (including the next
+ * paragraph) 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 AUTHORS OR COPYRIGHT HOLDERS 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 _SYNCSDK_H_
+#define _SYNCSDK_H_
+
+#include "misync.h"
+
+extern _X_EXPORT int
+ SyncVerifyFence(SyncFence ** ppFence, XID fid, ClientPtr client, Mask mode);
+
+extern _X_EXPORT SyncObject*
+ SyncCreate(ClientPtr client, XID id, unsigned char type);
+
+#define VERIFY_SYNC_FENCE(pFence, fid, client, mode) \
+ do { \
+ int rc; \
+ rc = SyncVerifyFence(&(pFence), (fid), (client), (mode)); \
+ if (Success != rc) return rc; \
+ } while (0)
+
+#define VERIFY_SYNC_FENCE_OR_NONE(pFence, fid, client, mode) \
+ do { \
+ (pFence) = 0; \
+ if (None != (fid)) \
+ VERIFY_SYNC_FENCE((pFence), (fid), (client), (mode)); \
+ } while (0)
+
+#endif /* _SYNCSDK_H_ */
diff --git a/prebuilt/xlibre/usr/include/xorg/validate.h b/prebuilt/xlibre/usr/include/xorg/validate.h
new file mode 100644
index 0000000..8fcc8b8
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/validate.h
@@ -0,0 +1,40 @@
+
+/*
+
+Copyright 1989, 1998 The Open Group
+
+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.
+
+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
+OPEN GROUP 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.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+*/
+
+#ifndef VALIDATE_H
+#define VALIDATE_H
+
+#include "miscstruct.h"
+#include "regionstr.h"
+
+typedef enum { VTOther, VTStack, VTMove, VTUnmap, VTMap, VTBroken } VTKind;
+
+/* union _MiValidate is now device dependent; see mivalidate.h for an example */
+typedef union _MiValidate *ValidatePtr;
+
+#define UnmapValData ((ValidatePtr)1)
+
+#endif /* VALIDATE_H */
diff --git a/prebuilt/xlibre/usr/include/xorg/vgaHW.h b/prebuilt/xlibre/usr/include/xorg/vgaHW.h
new file mode 100644
index 0000000..f03024a
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/vgaHW.h
@@ -0,0 +1,217 @@
+
+/*
+ * Copyright (c) 1997,1998 The XFree86 Project, Inc.
+ *
+ * Loosely based on code bearing the following copyright:
+ *
+ * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany.
+ *
+ * Author: Dirk Hohndel
+ */
+
+#ifndef _VGAHW_H
+#define _VGAHW_H
+
+#include
+#include "misc.h"
+#include "input.h"
+#include "scrnintstr.h"
+
+#include "xf86str.h"
+#include "xf86Pci.h"
+
+#include "xf86DDC.h"
+
+#include "globals.h"
+#include
+
+extern _X_EXPORT int vgaHWGetIndex(void);
+
+/*
+ * access macro
+ */
+#define VGAHWPTR(p) ((vgaHWPtr)((p)->privates[vgaHWGetIndex()].ptr))
+
+/* Standard VGA registers */
+#define VGA_ATTR_INDEX 0x3C0
+#define VGA_ATTR_DATA_W 0x3C0
+#define VGA_ATTR_DATA_R 0x3C1
+#define VGA_IN_STAT_0 0x3C2 /* read */
+#define VGA_MISC_OUT_W 0x3C2 /* write */
+#define VGA_ENABLE 0x3C3
+#define VGA_SEQ_INDEX 0x3C4
+#define VGA_SEQ_DATA 0x3C5
+#define VGA_DAC_MASK 0x3C6
+#define VGA_DAC_READ_ADDR 0x3C7
+#define VGA_DAC_WRITE_ADDR 0x3C8
+#define VGA_DAC_DATA 0x3C9
+#define VGA_FEATURE_R 0x3CA /* read */
+#define VGA_MISC_OUT_R 0x3CC /* read */
+#define VGA_GRAPH_INDEX 0x3CE
+#define VGA_GRAPH_DATA 0x3CF
+
+#define VGA_IOBASE_MONO 0x3B0
+#define VGA_IOBASE_COLOR 0x3D0
+
+#define VGA_CRTC_INDEX_OFFSET 0x04
+#define VGA_CRTC_DATA_OFFSET 0x05
+#define VGA_IN_STAT_1_OFFSET 0x0A /* read */
+#define VGA_FEATURE_W_OFFSET 0x0A /* write */
+
+/* default number of VGA registers stored internally */
+#define VGA_NUM_CRTC 25
+#define VGA_NUM_SEQ 5
+#define VGA_NUM_GFX 9
+#define VGA_NUM_ATTR 21
+
+/* Flags for vgaHWSave() and vgaHWRestore() */
+#define VGA_SR_MODE 0x01
+#define VGA_SR_FONTS 0x02
+#define VGA_SR_CMAP 0x04
+#define VGA_SR_ALL (VGA_SR_MODE | VGA_SR_FONTS | VGA_SR_CMAP)
+
+/* Defaults for the VGA memory window */
+#define VGA_DEFAULT_PHYS_ADDR 0xA0000
+#define VGA_DEFAULT_MEM_SIZE (64 * 1024)
+
+/*
+ * vgaRegRec contains settings of standard VGA registers.
+ */
+typedef struct {
+ unsigned char MiscOutReg; /* */
+ unsigned char *CRTC; /* Crtc Controller */
+ unsigned char *Sequencer; /* Video Sequencer */
+ unsigned char *Graphics; /* Video Graphics */
+ unsigned char *Attribute; /* Video Attribute */
+ unsigned char DAC[768]; /* Internal Colorlookuptable */
+ unsigned char numCRTC; /* number of CRTC registers, def=VGA_NUM_CRTC */
+ unsigned char numSequencer; /* number of seq registers, def=VGA_NUM_SEQ */
+ unsigned char numGraphics; /* number of gfx registers, def=VGA_NUM_GFX */
+ unsigned char numAttribute; /* number of attr registers, def=VGA_NUM_ATTR */
+} vgaRegRec, *vgaRegPtr;
+
+typedef struct _vgaHWRec *vgaHWPtr;
+
+typedef void (*vgaHWWriteIndexProcPtr) (vgaHWPtr hwp, CARD8 indx, CARD8 value);
+typedef CARD8 (*vgaHWReadIndexProcPtr) (vgaHWPtr hwp, CARD8 indx);
+typedef void (*vgaHWWriteProcPtr) (vgaHWPtr hwp, CARD8 value);
+typedef CARD8 (*vgaHWReadProcPtr) (vgaHWPtr hwp);
+typedef void (*vgaHWMiscProcPtr) (vgaHWPtr hwp);
+
+/*
+ * vgaHWRec contains per-screen information required by the vgahw module.
+ *
+ * Note, the palette referred to by the paletteEnabled, enablePalette and
+ * disablePalette is the 16-entry (+overscan) EGA-compatible palette accessed
+ * via the first 17 attribute registers and not the main 8-bit palette.
+ */
+typedef struct _vgaHWRec {
+ void *Base; /* Address of "VGA" memory */
+ int MapSize; /* Size of "VGA" memory */
+ unsigned long MapPhys; /* phys location of VGA mem */
+ int IOBase; /* I/O Base address */
+ CARD8 *MMIOBase; /* Pointer to MMIO start */
+ int MMIOOffset; /* base + offset + vgareg
+ = mmioreg */
+ void *FontInfo1; /* save area for fonts in
+ plane 2 */
+ void *FontInfo2; /* save area for fonts in
+ plane 3 */
+ void *TextInfo; /* save area for text */
+ vgaRegRec SavedReg; /* saved registers */
+ vgaRegRec ModeReg; /* register settings for
+ current mode */
+ Bool ShowOverscan;
+ Bool paletteEnabled;
+ Bool cmapSaved;
+ ScrnInfoPtr pScrn;
+ vgaHWWriteIndexProcPtr writeCrtc;
+ vgaHWReadIndexProcPtr readCrtc;
+ vgaHWWriteIndexProcPtr writeGr;
+ vgaHWReadIndexProcPtr readGr;
+ vgaHWReadProcPtr readST00;
+ vgaHWReadProcPtr readST01;
+ vgaHWReadProcPtr readFCR;
+ vgaHWWriteProcPtr writeFCR;
+ vgaHWWriteIndexProcPtr writeAttr;
+ vgaHWReadIndexProcPtr readAttr;
+ vgaHWWriteIndexProcPtr writeSeq;
+ vgaHWReadIndexProcPtr readSeq;
+ vgaHWWriteProcPtr writeMiscOut;
+ vgaHWReadProcPtr readMiscOut;
+ vgaHWMiscProcPtr enablePalette;
+ vgaHWMiscProcPtr disablePalette;
+ vgaHWWriteProcPtr writeDacMask;
+ vgaHWReadProcPtr readDacMask;
+ vgaHWWriteProcPtr writeDacWriteAddr;
+ vgaHWWriteProcPtr writeDacReadAddr;
+ vgaHWWriteProcPtr writeDacData;
+ vgaHWReadProcPtr readDacData;
+ void *ddc;
+ struct pci_io_handle *io;
+ vgaHWReadProcPtr readEnable;
+ vgaHWWriteProcPtr writeEnable;
+ struct pci_device *dev;
+} vgaHWRec;
+
+/* Some macros that VGA drivers can use in their ChipProbe() function */
+#define OVERSCAN 0x11 /* Index of OverScan register */
+
+/* Flags that define how overscan correction should take place */
+#define KGA_FIX_OVERSCAN 1 /* overcan correction required */
+#define KGA_ENABLE_ON_ZERO 2 /* if possible enable display at beginning */
+ /* of next scanline/frame */
+#define KGA_BE_TOT_DEC 4 /* always fix problem by setting blank end */
+ /* to total - 1 */
+#define BIT_PLANE 3 /* Which plane we write to in mono mode */
+#define BITS_PER_GUN 6
+#define COLORMAP_SIZE 256
+
+#define DACDelay(hw) \
+ do { \
+ (hw)->readST01((hw)); \
+ (hw)->readST01((hw)); \
+ } while (0)
+
+/* Function Prototypes */
+
+/* vgaHW.c */
+extern _X_EXPORT void vgaHWSetStdFuncs(vgaHWPtr hwp);
+extern _X_EXPORT void vgaHWSetMmioFuncs(vgaHWPtr hwp, CARD8 *base, int offset);
+extern _X_EXPORT void vgaHWProtect(ScrnInfoPtr pScrn, Bool on);
+extern _X_EXPORT Bool vgaHWSaveScreen(ScreenPtr pScreen, int mode);
+extern _X_EXPORT void vgaHWBlankScreen(ScrnInfoPtr pScrn, Bool on);
+extern _X_EXPORT void vgaHWSeqReset(vgaHWPtr hwp, Bool start);
+_X_EXPORT void vgaHWRestoreFonts(ScrnInfoPtr pScrnInfo, vgaRegPtr restore);
+_X_EXPORT void vgaHWRestore(ScrnInfoPtr pScrnInfo, vgaRegPtr restore, int flags);
+_X_EXPORT void vgaHWSaveFonts(ScrnInfoPtr pScrnInfo, vgaRegPtr save);
+_X_EXPORT void vgaHWSave(ScrnInfoPtr pScrnInfo, vgaRegPtr save, int flags);
+extern _X_EXPORT Bool vgaHWInit(ScrnInfoPtr scrnp, DisplayModePtr mode);
+extern _X_EXPORT Bool vgaHWCopyReg(vgaRegPtr dst, vgaRegPtr src);
+extern _X_EXPORT Bool vgaHWGetHWRec(ScrnInfoPtr scrp);
+extern _X_EXPORT void vgaHWFreeHWRec(ScrnInfoPtr scrp);
+extern _X_EXPORT Bool vgaHWMapMem(ScrnInfoPtr scrp);
+extern _X_EXPORT void vgaHWUnmapMem(ScrnInfoPtr scrp);
+extern _X_EXPORT void vgaHWGetIOBase(vgaHWPtr hwp);
+extern _X_EXPORT void vgaHWLock(vgaHWPtr hwp);
+extern _X_EXPORT void vgaHWUnlock(vgaHWPtr hwp);
+extern _X_EXPORT void vgaHWEnable(vgaHWPtr hwp);
+extern _X_EXPORT void vgaHWDPMSSet(ScrnInfoPtr pScrn, int PowerManagementMode,
+ int flags);
+extern _X_EXPORT Bool vgaHWHandleColormaps(ScreenPtr pScreen);
+extern _X_EXPORT void vgaHWddc1SetSpeed(ScrnInfoPtr pScrn, xf86ddcSpeed speed);
+extern _X_EXPORT CARD32 vgaHWHBlankKGA(DisplayModePtr mode, vgaRegPtr regp,
+ int nBits, unsigned int Flags);
+extern _X_EXPORT CARD32 vgaHWVBlankKGA(DisplayModePtr mode, vgaRegPtr regp,
+ int nBits, unsigned int Flags);
+extern _X_EXPORT Bool vgaHWAllocDefaultRegs(vgaRegPtr regp);
+
+extern _X_EXPORT DDC1SetSpeedProc vgaHWddc1SetSpeedWeak(void);
+extern _X_EXPORT void xf86GetClocks(ScrnInfoPtr pScrn, int num,
+ Bool (*ClockFunc) (ScrnInfoPtr, int),
+ void (*ProtectRegs) (ScrnInfoPtr, Bool),
+ void (*BlankScreen) (ScrnInfoPtr, Bool),
+ unsigned long vertsyncreg, int maskval,
+ int knownclkindex, int knownclkvalue);
+
+#endif /* _VGAHW_H */
diff --git a/prebuilt/xlibre/usr/include/xorg/vndserver.h b/prebuilt/xlibre/usr/include/xorg/vndserver.h
new file mode 100644
index 0000000..181288c
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/vndserver.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2016, NVIDIA CORPORATION.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and/or associated documentation files (the
+ * "Materials"), to deal in the Materials without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Materials, and to
+ * permit persons to whom the Materials are furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * unaltered in all copies or substantial portions of the Materials.
+ * Any additions, deletions, or changes to the original source files
+ * must be clearly indicated in accompanying documentation.
+ *
+ * If only executable code is distributed, then the accompanying
+ * documentation must state that "this software is based in part on the
+ * work of the Khronos Group."
+ *
+ * THE MATERIALS ARE 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 AUTHORS OR COPYRIGHT HOLDERS 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
+ * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+ */
+
+#ifndef VNDSERVER_H
+#define VNDSERVER_H
+
+#include
+#include "glxvndabi.h"
+
+#define GLXContextID CARD32
+#define GLXDrawable CARD32
+
+_X_EXPORT const GlxServerExports *glvndGetExports(void);
+
+#endif // VNDSERVER_H
diff --git a/prebuilt/xlibre/usr/include/xorg/wfbrename.h b/prebuilt/xlibre/usr/include/xorg/wfbrename.h
new file mode 100644
index 0000000..6765dbc
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/wfbrename.h
@@ -0,0 +1,125 @@
+#ifndef XSERVER_WFBRENAME_H
+#define XSERVER_WFBRENAME_H
+
+#define fbAddTraps wfbAddTraps
+#define fbAddTriangles wfbAddTriangles
+#define fbAllocatePrivates wfbAllocatePrivates
+#define fbArc16 wfbArc16
+#define fbArc32 wfbArc32
+#define fbArc8 wfbArc8
+#define fbBlt wfbBlt
+#define fbBltOne wfbBltOne
+#define fbBltPlane wfbBltPlane
+#define fbBltStip wfbBltStip
+#define fbBres wfbBres
+#define fbBresDash wfbBresDash
+#define fbBresDash16 wfbBresDash16
+#define fbBresDash32 wfbBresDash32
+#define fbBresDash8 wfbBresDash8
+#define fbBresFill wfbBresFill
+#define fbBresFillDash wfbBresFillDash
+#define fbBresSolid wfbBresSolid
+#define fbBresSolid16 wfbBresSolid16
+#define fbBresSolid32 wfbBresSolid32
+#define fbBresSolid8 wfbBresSolid8
+#define fbChangeWindowAttributes wfbChangeWindowAttributes
+#define fbClearVisualTypes wfbClearVisualTypes
+#define fbCloseScreen wfbCloseScreen
+#define fbComposite wfbComposite
+#define fbCopy1toN wfbCopy1toN
+#define fbCopyArea wfbCopyArea
+#define fbCopyNto1 wfbCopyNto1
+#define fbCopyNtoN wfbCopyNtoN
+#define fbCopyPlane wfbCopyPlane
+#define fbCopyRegion wfbCopyRegion
+#define fbCopyWindow wfbCopyWindow
+#define fbCopyWindowProc wfbCopyWindowProc
+#define fbCreateDefColormap wfbCreateDefColormap
+#define fbCreateGC wfbCreateGC
+#define fbCreatePixmap wfbCreatePixmap
+#define fbCreateWindow wfbCreateWindow
+#define fbDestroyGlyphCache wfbDestroyGlyphCache
+#define fbDestroyPixmap wfbDestroyPixmap
+#define fbDestroyWindow wfbDestroyWindow
+#define fbDoCopy wfbDoCopy
+#define fbDots wfbDots
+#define fbDots16 wfbDots16
+#define fbDots32 wfbDots32
+#define fbDots8 wfbDots8
+#define fbEvenTile wfbEvenTile
+#define fbExpandDirectColors wfbExpandDirectColors
+#define fbFill wfbFill
+#define fbFillRegionSolid wfbFillRegionSolid
+#define fbFillSpans wfbFillSpans
+#define fbFixCoordModePrevious wfbFixCoordModePrevious
+#define fbGCFuncs wfbGCFuncs
+#define fbGCOps wfbGCOps
+#define fbGetGCPrivateKey wfbGetGCPrivateKey
+#define fbGetImage wfbGetImage
+#define fbGetScreenPrivateKey wfbGetScreenPrivateKey
+#define fbGetSpans wfbGetSpans
+#define _fbGetWindowPixmap _wfbGetWindowPixmap
+#define fbGlyph16 wfbGlyph16
+#define fbGlyph32 wfbGlyph32
+#define fbGlyph8 wfbGlyph8
+#define fbImageGlyphBlt wfbImageGlyphBlt
+#define fbIn wfbIn
+#define fbInitializeColormap wfbInitializeColormap
+#define fbInitVisuals wfbInitVisuals
+#define fbListInstalledColormaps wfbListInstalledColormaps
+#define FbMergeRopBits wFbMergeRopBits
+#define fbOddTile wfbOddTile
+#define fbOver wfbOver
+#define fbOverlayFinishScreenInit wfbOverlayFinishScreenInit
+#define fbOverlayGeneration wfbOverlayGeneration
+#define fbOverlayGetScreenPrivateKey wfbOverlayGetScreenPrivateKey
+#define fbPadPixmap wfbPadPixmap
+#define fbPictureInit wfbPictureInit
+#define fbPixmapToRegion wfbPixmapToRegion
+#define fbPolyArc wfbPolyArc
+#define fbPolyFillRect wfbPolyFillRect
+#define fbPolyGlyphBlt wfbPolyGlyphBlt
+#define fbPolyLine wfbPolyLine
+#define fbPolyline16 wfbPolyline16
+#define fbPolyline32 wfbPolyline32
+#define fbPolyline8 wfbPolyline8
+#define fbPolyPoint wfbPolyPoint
+#define fbPolySegment wfbPolySegment
+#define fbPolySegment16 wfbPolySegment16
+#define fbPolySegment32 wfbPolySegment32
+#define fbPolySegment8 wfbPolySegment8
+#define fbPositionWindow wfbPositionWindow
+#define fbPushFill wfbPushFill
+#define fbPushImage wfbPushImage
+#define fbPushPattern wfbPushPattern
+#define fbPushPixels wfbPushPixels
+#define fbPutImage wfbPutImage
+#define fbPutXYImage wfbPutXYImage
+#define fbPutZImage wfbPutZImage
+#define fbQueryBestSize wfbQueryBestSize
+#define fbRasterizeTrapezoid wfbRasterizeTrapezoid
+#define fbRealizeFont wfbRealizeFont
+#define fbReplicatePixel wfbReplicatePixel
+#define fbResolveColor wfbResolveColor
+#define fbScreenPrivateKeyRec wfbScreenPrivateKeyRec
+#define fbSegment wfbSegment
+#define fbSelectBres wfbSelectBres
+#define fbSetSpans wfbSetSpans
+#define fbSetupScreen wfbSetupScreen
+#define fbSetVisualTypes wfbSetVisualTypes
+#define fbSetVisualTypesAndMasks wfbSetVisualTypesAndMasks
+#define _fbSetWindowPixmap _wfbSetWindowPixmap
+#define fbSolid wfbSolid
+#define fbSolidBoxClipped wfbSolidBoxClipped
+#define fbTile wfbTile
+#define fbTrapezoids wfbTrapezoids
+#define fbTriangles wfbTriangles
+#define fbUninstallColormap wfbUninstallColormap
+#define fbUnrealizeWindow wfbUnrealizeWindow
+#define fbUnrealizeFont wfbUnrealizeFont
+#define fbValidateGC wfbValidateGC
+#define fbWinPrivateKeyRec wfbWinPrivateKeyRec
+#define free_pixman_pict wfb_free_pixman_pict
+#define image_from_pict wfb_image_from_pict
+
+#endif /* XSERVER_WFBRENAME_H */
diff --git a/prebuilt/xlibre/usr/include/xorg/window.h b/prebuilt/xlibre/usr/include/xorg/window.h
new file mode 100644
index 0000000..6487fb6
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/window.h
@@ -0,0 +1,217 @@
+/***********************************************************
+
+Copyright 1987, 1998 The Open Group
+
+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.
+
+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
+OPEN GROUP 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.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+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 Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL 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 WINDOW_H
+#define WINDOW_H
+
+#include
+
+#include "xlibre_ptrtypes.h"
+#include "misc.h"
+#include "regionstr.h"
+#include "screenint.h"
+
+#define TOTALLY_OBSCURED 0
+#define UNOBSCURED 1
+#define OBSCURED 2
+
+#define VisibilityNotViewable 3
+
+/* return values for tree-walking callback procedures */
+#define WT_STOPWALKING 0
+#define WT_WALKCHILDREN 1
+#define WT_DONTWALKCHILDREN 2
+#define WT_NOMATCH 3
+#define NullWindow ((WindowPtr) 0)
+
+/* Forward declaration, we can't include input.h here */
+struct _Cursor;
+
+typedef struct _BackingStore *BackingStorePtr;
+typedef struct _Property *PropertyPtr;
+
+enum RootClipMode {
+ ROOT_CLIP_NONE = 0, /**< resize the root window to 0x0 */
+ ROOT_CLIP_FULL = 1, /**< resize the root window to fit screen */
+ ROOT_CLIP_INPUT_ONLY = 2, /**< as above, but no rendering to screen */
+};
+
+typedef int (*VisitWindowProcPtr) (WindowPtr pWin,
+ void *data);
+
+extern _X_EXPORT int TraverseTree(WindowPtr pWin,
+ VisitWindowProcPtr func,
+ void *data);
+
+extern _X_EXPORT int WalkTree(ScreenPtr pScreen,
+ VisitWindowProcPtr func,
+ void *data);
+
+extern _X_EXPORT Bool CreateRootWindow(ScreenPtr /*pScreen */ );
+
+extern _X_EXPORT void InitRootWindow(WindowPtr /*pWin */ );
+
+typedef WindowPtr (*RealChildHeadProc) (WindowPtr pWin);
+
+extern _X_EXPORT void RegisterRealChildHeadProc(RealChildHeadProc proc);
+
+extern _X_EXPORT WindowPtr RealChildHead(WindowPtr /*pWin */ );
+
+extern _X_EXPORT int DeleteWindow(void *pWin,
+ XID wid);
+
+extern _X_EXPORT int DestroySubwindows(WindowPtr /*pWin */ ,
+ ClientPtr /*client */ );
+
+/* Quartz support on Mac OS X uses the HIToolbox
+ framework whose ChangeWindowAttributes function conflicts here. */
+#ifdef __APPLE__
+#define ChangeWindowAttributes Darwin_X_ChangeWindowAttributes
+#endif
+extern _X_EXPORT int ChangeWindowAttributes(WindowPtr /*pWin */ ,
+ Mask /*vmask */ ,
+ XID * /*vlist */ ,
+ ClientPtr /*client */ );
+
+extern _X_EXPORT int ChangeWindowDeviceCursor(WindowPtr /*pWin */ ,
+ DeviceIntPtr /*pDev */ ,
+ struct _Cursor * /*pCursor */ );
+
+extern _X_EXPORT struct _Cursor *WindowGetDeviceCursor(WindowPtr /*pWin */ ,
+ DeviceIntPtr
+ /*pDev */ );
+
+/* Quartz support on Mac OS X uses the HIToolbox
+ framework whose GetWindowAttributes function conflicts here. */
+#ifdef __APPLE__
+#define GetWindowAttributes(w,c,x) Darwin_X_GetWindowAttributes((w),(c),(x))
+extern void Darwin_X_GetWindowAttributes(
+#else
+extern _X_EXPORT void GetWindowAttributes(
+#endif
+ WindowPtr /*pWin */ ,
+ ClientPtr /*client */ ,
+ xGetWindowAttributesReply *
+ /* wa */ );
+
+extern _X_EXPORT void GravityTranslate(int /*x */ ,
+ int /*y */ ,
+ int /*oldx */ ,
+ int /*oldy */ ,
+ int /*dw */ ,
+ int /*dh */ ,
+ unsigned /*gravity */ ,
+ int * /*destx */ ,
+ int * /*desty */ );
+
+extern _X_EXPORT int ConfigureWindow(WindowPtr /*pWin */ ,
+ Mask /*mask */ ,
+ XID * /*vlist */ ,
+ ClientPtr /*client */ );
+
+extern _X_EXPORT int CirculateWindow(WindowPtr /*pParent */ ,
+ int /*direction */ ,
+ ClientPtr /*client */ );
+
+extern _X_EXPORT int ReparentWindow(WindowPtr /*pWin */ ,
+ WindowPtr /*pParent */ ,
+ int /*x */ ,
+ int /*y */ ,
+ ClientPtr /*client */ );
+
+extern _X_EXPORT int MapWindow(WindowPtr /*pWin */ ,
+ ClientPtr /*client */ );
+
+extern _X_EXPORT void MapSubwindows(WindowPtr /*pParent */ ,
+ ClientPtr /*client */ );
+
+extern _X_EXPORT int UnmapWindow(WindowPtr /*pWin */ ,
+ Bool /*fromConfigure */ );
+
+extern _X_EXPORT void UnmapSubwindows(WindowPtr /*pWin */ );
+
+extern _X_EXPORT void HandleSaveSet(ClientPtr /*client */ );
+
+extern _X_EXPORT Bool PointInWindowIsVisible(WindowPtr /*pWin */ ,
+ int /*x */ ,
+ int /*y */ );
+
+extern _X_EXPORT RegionPtr NotClippedByChildren(WindowPtr /*pWin */ );
+
+extern _X_EXPORT void SendVisibilityNotify(WindowPtr /*pWin */ );
+
+extern _X_EXPORT int dixSaveScreens(ClientPtr client, int on, int mode);
+
+extern _X_EXPORT int SaveScreens(int on, int mode);
+
+extern _X_EXPORT WindowPtr FindWindowWithOptional(WindowPtr /*w */ );
+
+extern _X_EXPORT void CheckWindowOptionalNeed(WindowPtr /*w */ );
+
+extern _X_EXPORT WindowPtr MoveWindowInStack(WindowPtr /*pWin */ ,
+ WindowPtr /*pNextSib */ );
+
+extern _X_EXPORT void SetWinSize(WindowPtr /*pWin */ );
+
+extern _X_EXPORT void SetBorderSize(WindowPtr /*pWin */ );
+
+extern _X_EXPORT void ResizeChildrenWinSize(WindowPtr /*pWin */ ,
+ int /*dx */ ,
+ int /*dy */ ,
+ int /*dw */ ,
+ int /*dh */ );
+
+extern _X_EXPORT void SendShapeNotify(WindowPtr /* pWin */ ,
+ int /* which */);
+
+extern _X_EXPORT RegionPtr CreateBoundingShape(WindowPtr /* pWin */ );
+
+extern _X_EXPORT RegionPtr CreateClipShape(WindowPtr /* pWin */ );
+
+extern _X_EXPORT void SetRootClip(ScreenPtr pScreen, int enable);
+
+extern _X_EXPORT VisualPtr WindowGetVisual(WindowPtr /*pWin*/);
+#endif /* WINDOW_H */
diff --git a/prebuilt/xlibre/usr/include/xorg/windowstr.h b/prebuilt/xlibre/usr/include/xorg/windowstr.h
new file mode 100644
index 0000000..d7fbb3c
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/windowstr.h
@@ -0,0 +1,175 @@
+/***********************************************************
+
+Copyright 1987, 1998 The Open Group
+
+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.
+
+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
+OPEN GROUP 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.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+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 Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL 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 WINDOWSTRUCT_H
+#define WINDOWSTRUCT_H
+
+#include "xlibre_ptrtypes.h"
+#include "window.h"
+#include "pixmapstr.h"
+#include "regionstr.h"
+#include "cursor.h"
+#include "property.h"
+#include "resource.h" /* for ROOT_WINDOW_ID_BASE */
+#include "dix.h"
+#include "privates.h"
+#include "miscstruct.h"
+#include
+#include "opaque.h"
+
+
+/* used as NULL-terminated list */
+typedef struct _DevCursorNode {
+ CursorPtr cursor;
+ DeviceIntPtr dev;
+ struct _DevCursorNode *next;
+} DevCursNodeRec, *DevCursNodePtr, *DevCursorList;
+
+typedef struct _WindowOpt {
+ CursorPtr cursor; /* default: window.cursorNone */
+ VisualID visual; /* default: same as parent */
+ Colormap colormap; /* default: same as parent */
+ Mask dontPropagateMask; /* default: window.dontPropagate */
+ Mask otherEventMasks; /* default: 0 */
+ struct _OtherClients *otherClients; /* default: NULL */
+ struct _GrabRec *passiveGrabs; /* default: NULL */
+ CARD32 backingBitPlanes; /* default: ~0L */
+ CARD32 backingPixel; /* default: 0 */
+ RegionPtr boundingShape; /* default: NULL */
+ RegionPtr clipShape; /* default: NULL */
+ RegionPtr inputShape; /* default: NULL */
+ struct _OtherInputMasks *inputMasks; /* default: NULL */
+ DevCursorList deviceCursors; /* default: NULL */
+} WindowOptRec, *WindowOptPtr;
+
+#define BackgroundPixel 2L
+#define BackgroundPixmap 3L
+
+/*
+ * The redirectDraw field can have one of three values:
+ *
+ * RedirectDrawNone
+ * A normal window; painted into the same pixmap as the parent
+ * and clipping parent and siblings to its geometry. These
+ * windows get a clip list equal to the intersection of their
+ * geometry with the parent geometry, minus the geometry
+ * of overlapping None and Clipped siblings.
+ * RedirectDrawAutomatic
+ * A redirected window which clips parent and sibling drawing.
+ * Contents for these windows are manage inside the server.
+ * These windows get an internal clip list equal to their
+ * geometry.
+ * RedirectDrawManual
+ * A redirected window which does not clip parent and sibling
+ * drawing; the window must be represented within the parent
+ * geometry by the client performing the redirection management.
+ * Contents for these windows are managed outside the server.
+ * These windows get an internal clip list equal to their
+ * geometry.
+ */
+
+#define RedirectDrawNone 0
+#define RedirectDrawAutomatic 1
+#define RedirectDrawManual 2
+
+struct _Window {
+ DrawableRec drawable;
+ PrivateRec *devPrivates;
+ WindowPtr parent; /* ancestor chain */
+ WindowPtr nextSib; /* next lower sibling */
+ WindowPtr prevSib; /* next higher sibling */
+ WindowPtr firstChild; /* top-most child */
+ WindowPtr lastChild; /* bottom-most child */
+ RegionRec clipList; /* clipping rectangle for output */
+ RegionRec borderClip; /* NotClippedByChildren + border */
+ union _MiValidate *valdata;
+ RegionRec winSize;
+ RegionRec borderSize;
+ xPoint origin; /* position relative to parent */
+ unsigned short borderWidth;
+ unsigned short deliverableEvents; /* all masks from all clients */
+ Mask eventMask; /* mask from the creating client */
+ PixUnion background;
+ PixUnion border;
+ WindowOptPtr optional;
+ unsigned backgroundState:2; /* None, Relative, Pixel, Pixmap */
+ unsigned borderIsPixel:1;
+ unsigned cursorIsNone:1; /* else real cursor (might inherit) */
+ unsigned backingStore:2;
+ unsigned saveUnder:1;
+ unsigned bitGravity:4;
+ unsigned winGravity:4;
+ unsigned overrideRedirect:1;
+ unsigned visibility:2;
+ unsigned mapped:1;
+ unsigned realized:1; /* ancestors are all mapped */
+ unsigned viewable:1; /* realized && InputOutput */
+ unsigned dontPropagate:3; /* index into DontPropagateMasks */
+ unsigned redirectDraw:2; /* COMPOSITE rendering redirect */
+ unsigned forcedBG:1; /* must have an opaque background */
+ unsigned unhittable:1; /* doesn't hit-test, for rootless */
+ unsigned damagedDescendants:1; /* some descendants are damaged */
+ unsigned inhibitBGPaint:1; /* paint the background? */
+
+ PropertyPtr properties; /* default: NULL */
+};
+
+extern _X_EXPORT Mask DontPropagateMasks[];
+
+#define wBorderWidth(w) ((int) (w)->borderWidth)
+
+static inline PropertyPtr wUserProps(WindowPtr pWin) { return pWin->properties; }
+
+/* true when w needs a border drawn. */
+
+#define HasBorder(w) ((w)->borderWidth || wClipShape((w)))
+
+#define SCREEN_IS_BLANKED 0
+#define SCREEN_ISNT_SAVED 1
+#define SCREEN_IS_TILED 2
+#define SCREEN_IS_BLACK 3
+
+#endif /* WINDOWSTRUCT_H */
diff --git a/prebuilt/xlibre/usr/include/xorg/xaarop.h b/prebuilt/xlibre/usr/include/xorg/xaarop.h
new file mode 100644
index 0000000..5b1a35c
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/xaarop.h
@@ -0,0 +1,268 @@
+#ifndef _XAAROP_H
+#define _XAAROP_H
+
+#define ROP_DST 0x00000001
+#define ROP_SRC 0x00000002
+#define ROP_PAT 0x00000004
+
+#define ROP_0 0x00
+#define ROP_DPSoon 0x01
+#define ROP_DPSona 0x02
+#define ROP_PSon 0x03
+#define ROP_SDPona 0x04
+#define ROP_DPon 0x05
+#define ROP_PDSxnon 0x06
+#define ROP_PDSaon 0x07
+#define ROP_SDPnaa 0x08
+#define ROP_PDSxon 0x09
+#define ROP_DPna 0x0A
+#define ROP_PSDnaon 0x0B
+#define ROP_SPna 0x0C
+#define ROP_PDSnaon 0x0D
+#define ROP_PDSonon 0x0E
+#define ROP_Pn 0x0F
+#define ROP_PDSona 0x10
+#define ROP_DSon 0x11
+#define ROP_SDPxnon 0x12
+#define ROP_SDPaon 0x13
+#define ROP_DPSxnon 0x14
+#define ROP_DPSaon 0x15
+#define ROP_PSDPSanaxx 0x16
+#define ROP_SSPxDSxaxn 0x17
+#define ROP_SPxPDxa 0x18
+#define ROP_SDPSanaxn 0x19
+#define ROP_PDSPaox 0x1A
+#define ROP_SDPSxaxn 0x1B
+#define ROP_PSDPaox 0x1C
+#define ROP_DSPDxaxn 0x1D
+#define ROP_PDSox 0x1E
+#define ROP_PDSoan 0x1F
+#define ROP_DPSnaa 0x20
+#define ROP_SDPxon 0x21
+#define ROP_DSna 0x22
+#define ROP_SPDnaon 0x23
+#define ROP_SPxDSxa 0x24
+#define ROP_PDSPanaxn 0x25
+#define ROP_SDPSaox 0x26
+#define ROP_SDPSxnox 0x27
+#define ROP_DPSxa 0x28
+#define ROP_PSDPSaoxxn 0x29
+#define ROP_DPSana 0x2A
+#define ROP_SSPxPDxaxn 0x2B
+#define ROP_SPDSoax 0x2C
+#define ROP_PSDnox 0x2D
+#define ROP_PSDPxox 0x2E
+#define ROP_PSDnoan 0x2F
+#define ROP_PSna 0x30
+#define ROP_SDPnaon 0x31
+#define ROP_SDPSoox 0x32
+#define ROP_Sn 0x33
+#define ROP_SPDSaox 0x34
+#define ROP_SPDSxnox 0x35
+#define ROP_SDPox 0x36
+#define ROP_SDPoan 0x37
+#define ROP_PSDPoax 0x38
+#define ROP_SPDnox 0x39
+#define ROP_SPDSxox 0x3A
+#define ROP_SPDnoan 0x3B
+#define ROP_PSx 0x3C
+#define ROP_SPDSonox 0x3D
+#define ROP_SPDSnaox 0x3E
+#define ROP_PSan 0x3F
+#define ROP_PSDnaa 0x40
+#define ROP_DPSxon 0x41
+#define ROP_SDxPDxa 0x42
+#define ROP_SPDSanaxn 0x43
+#define ROP_SDna 0x44
+#define ROP_DPSnaon 0x45
+#define ROP_DSPDaox 0x46
+#define ROP_PSDPxaxn 0x47
+#define ROP_SDPxa 0x48
+#define ROP_PDSPDaoxxn 0x49
+#define ROP_DPSDoax 0x4A
+#define ROP_PDSnox 0x4B
+#define ROP_SDPana 0x4C
+#define ROP_SSPxDSxoxn 0x4D
+#define ROP_PDSPxox 0x4E
+#define ROP_PDSnoan 0x4F
+#define ROP_PDna 0x50
+#define ROP_DSPnaon 0x51
+#define ROP_DPSDaox 0x52
+#define ROP_SPDSxaxn 0x53
+#define ROP_DPSonon 0x54
+#define ROP_Dn 0x55
+#define ROP_DPSox 0x56
+#define ROP_DPSoan 0x57
+#define ROP_PDSPoax 0x58
+#define ROP_DPSnox 0x59
+#define ROP_DPx 0x5A
+#define ROP_DPSDonox 0x5B
+#define ROP_DPSDxox 0x5C
+#define ROP_DPSnoan 0x5D
+#define ROP_DPSDnaox 0x5E
+#define ROP_DPan 0x5F
+#define ROP_PDSxa 0x60
+#define ROP_DSPDSaoxxn 0x61
+#define ROP_DSPDoax 0x62
+#define ROP_SDPnox 0x63
+#define ROP_SDPSoax 0x64
+#define ROP_DSPnox 0x65
+#define ROP_DSx 0x66
+#define ROP_SDPSonox 0x67
+#define ROP_DSPDSonoxxn 0x68
+#define ROP_PDSxxn 0x69
+#define ROP_DPSax 0x6A
+#define ROP_PSDPSoaxxn 0x6B
+#define ROP_SDPax 0x6C
+#define ROP_PDSPDoaxxn 0x6D
+#define ROP_SDPSnoax 0x6E
+#define ROP_PDSxnan 0x6F
+#define ROP_PDSana 0x70
+#define ROP_SSDxPDxaxn 0x71
+#define ROP_SDPSxox 0x72
+#define ROP_SDPnoan 0x73
+#define ROP_DSPDxox 0x74
+#define ROP_DSPnoan 0x75
+#define ROP_SDPSnaox 0x76
+#define ROP_DSan 0x77
+#define ROP_PDSax 0x78
+#define ROP_DSPDSoaxxn 0x79
+#define ROP_DPSDnoax 0x7A
+#define ROP_SDPxnan 0x7B
+#define ROP_SPDSnoax 0x7C
+#define ROP_DPSxnan 0x7D
+#define ROP_SPxDSxo 0x7E
+#define ROP_DPSaan 0x7F
+#define ROP_DPSaa 0x80
+#define ROP_SPxDSxon 0x81
+#define ROP_DPSxna 0x82
+#define ROP_SPDSnoaxn 0x83
+#define ROP_SDPxna 0x84
+#define ROP_PDSPnoaxn 0x85
+#define ROP_DSPDSoaxx 0x86
+#define ROP_PDSaxn 0x87
+#define ROP_DSa 0x88
+#define ROP_SDPSnaoxn 0x89
+#define ROP_DSPnoa 0x8A
+#define ROP_DSPDxoxn 0x8B
+#define ROP_SDPnoa 0x8C
+#define ROP_SDPSxoxn 0x8D
+#define ROP_SSDxPDxax 0x8E
+#define ROP_PDSanan 0x8F
+#define ROP_PDSxna 0x90
+#define ROP_SDPSnoaxn 0x91
+#define ROP_DPSDPoaxx 0x92
+#define ROP_SPDaxn 0x93
+#define ROP_PSDPSoaxx 0x94
+#define ROP_DPSaxn 0x95
+#define ROP_DPSxx 0x96
+#define ROP_PSDPSonoxx 0x97
+#define ROP_SDPSonoxn 0x98
+#define ROP_DSxn 0x99
+#define ROP_DPSnax 0x9A
+#define ROP_SDPSoaxn 0x9B
+#define ROP_SPDnax 0x9C
+#define ROP_DSPDoaxn 0x9D
+#define ROP_DSPDSaoxx 0x9E
+#define ROP_PDSxan 0x9F
+#define ROP_DPa 0xA0
+#define ROP_PDSPnaoxn 0xA1
+#define ROP_DPSnoa 0xA2
+#define ROP_DPSDxoxn 0xA3
+#define ROP_PDSPonoxn 0xA4
+#define ROP_PDxn 0xA5
+#define ROP_DSPnax 0xA6
+#define ROP_PDSPoaxn 0xA7
+#define ROP_DPSoa 0xA8
+#define ROP_DPSoxn 0xA9
+#define ROP_D 0xAA
+#define ROP_DPSono 0xAB
+#define ROP_SPDSxax 0xAC
+#define ROP_DPSDaoxn 0xAD
+#define ROP_DSPnao 0xAE
+#define ROP_DPno 0xAF
+#define ROP_PDSnoa 0xB0
+#define ROP_PDSPxoxn 0xB1
+#define ROP_SSPxDSxox 0xB2
+#define ROP_SDPanan 0xB3
+#define ROP_PSDnax 0xB4
+#define ROP_DPSDoaxn 0xB5
+#define ROP_DPSDPaoxx 0xB6
+#define ROP_SDPxan 0xB7
+#define ROP_PSDPxax 0xB8
+#define ROP_DSPDaoxn 0xB9
+#define ROP_DPSnao 0xBA
+#define ROP_DSno 0xBB
+#define ROP_SPDSanax 0xBC
+#define ROP_SDxPDxan 0xBD
+#define ROP_DPSxo 0xBE
+#define ROP_DPSano 0xBF
+#define ROP_Psa 0xC0
+#define ROP_SPDSnaoxn 0xC1
+#define ROP_SPDSonoxn 0xC2
+#define ROP_PSxn 0xC3
+#define ROP_SPDnoa 0xC4
+#define ROP_SPDSxoxn 0xC5
+#define ROP_SDPnax 0xC6
+#define ROP_PSDPoaxn 0xC7
+#define ROP_SDPoa 0xC8
+#define ROP_SPDoxn 0xC9
+#define ROP_DPSDxax 0xCA
+#define ROP_SPDSaoxn 0xCB
+#define ROP_S 0xCC
+#define ROP_SDPono 0xCD
+#define ROP_SDPnao 0xCE
+#define ROP_SPno 0xCF
+#define ROP_PSDnoa 0xD0
+#define ROP_PSDPxoxn 0xD1
+#define ROP_PDSnax 0xD2
+#define ROP_SPDSoaxn 0xD3
+#define ROP_SSPxPDxax 0xD4
+#define ROP_DPSanan 0xD5
+#define ROP_PSDPSaoxx 0xD6
+#define ROP_DPSxan 0xD7
+#define ROP_PDSPxax 0xD8
+#define ROP_SDPSaoxn 0xD9
+#define ROP_DPSDanax 0xDA
+#define ROP_SPxDSxan 0xDB
+#define ROP_SPDnao 0xDC
+#define ROP_SDno 0xDD
+#define ROP_SDPxo 0xDE
+#define ROP_SDPano 0xDF
+#define ROP_PDSoa 0xE0
+#define ROP_PDSoxn 0xE1
+#define ROP_DSPDxax 0xE2
+#define ROP_PSDPaoxn 0xE3
+#define ROP_SDPSxax 0xE4
+#define ROP_PDSPaoxn 0xE5
+#define ROP_SDPSanax 0xE6
+#define ROP_SPxPDxan 0xE7
+#define ROP_SSPxDSxax 0xE8
+#define ROP_DSPDSanaxxn 0xE9
+#define ROP_DPSao 0xEA
+#define ROP_DPSxno 0xEB
+#define ROP_SDPao 0xEC
+#define ROP_SDPxno 0xED
+#define ROP_DSo 0xEE
+#define ROP_SDPnoo 0xEF
+#define ROP_P 0xF0
+#define ROP_PDSono 0xF1
+#define ROP_PDSnao 0xF2
+#define ROP_PSno 0xF3
+#define ROP_PSDnao 0xF4
+#define ROP_PDno 0xF5
+#define ROP_PDSxo 0xF6
+#define ROP_PDSano 0xF7
+#define ROP_PDSao 0xF8
+#define ROP_PDSxno 0xF9
+#define ROP_DPo 0xFA
+#define ROP_DPSnoo 0xFB
+#define ROP_PSo 0xFC
+#define ROP_PSDnoo 0xFD
+#define ROP_DPSoo 0xFE
+#define ROP_1 0xFF
+
+#define NO_SRC_ROP(rop) \
+ (((rop) == GXnoop) || ((rop) == GXset) || ((rop) == GXclear) || ((rop) == GXinvert))
+
+#endif /* _XAAROP_H */
diff --git a/prebuilt/xlibre/usr/include/xorg/xf86.h b/prebuilt/xlibre/usr/include/xorg/xf86.h
new file mode 100644
index 0000000..d122b79
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/xf86.h
@@ -0,0 +1,284 @@
+/*
+ * Copyright (c) 1997-2003 by The XFree86 Project, 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.
+ *
+ * Except as contained in this notice, the name of the copyright holder(s)
+ * and author(s) shall not be used in advertising or otherwise to promote
+ * the sale, use or other dealings in this Software without prior written
+ * authorization from the copyright holder(s) and author(s).
+ */
+
+/*
+ * This file contains declarations for public XFree86 functions and variables,
+ * and definitions of public macros.
+ *
+ * "public" means available to video drivers.
+ */
+
+#ifndef _XF86_H
+#define _XF86_H
+
+#include "xlibre_ptrtypes.h"
+#include "xf86str.h"
+#include "xf86Opt.h"
+#include
+#include
+#include
+
+/* General parameters */
+extern _X_EXPORT Bool xorgHWAccess;
+
+extern _X_EXPORT DevPrivateKeyRec xf86ScreenKeyRec;
+
+#define xf86ScreenKey (&xf86ScreenKeyRec)
+
+extern _X_EXPORT ScrnInfoPtr *xf86Screens; /* List of pointers to ScrnInfoRecs */
+extern _X_EXPORT const unsigned char byte_reversed[256];
+
+#define XF86SCRNINFO(p) xf86ScreenToScrn((p))
+
+/* Compatibility functions for pre-input-thread drivers */
+static inline _X_DEPRECATED int xf86BlockSIGIO(void) { input_lock(); return 0; }
+static inline _X_DEPRECATED void xf86UnblockSIGIO(_X_UNUSED int wasset) { input_unlock(); }
+
+/* PCI related */
+#ifdef XSERVER_LIBPCIACCESS
+#include
+extern _X_EXPORT Bool xf86CheckPciSlot(const struct pci_device *);
+extern _X_EXPORT int xf86ClaimPciSlot(struct pci_device *, DriverPtr drvp,
+ int chipset, GDevPtr dev, Bool active);
+extern _X_EXPORT void xf86UnclaimPciSlot(struct pci_device *, GDevPtr dev);
+extern _X_EXPORT Bool xf86ParsePciBusString(const char *busID, int *bus,
+ int *device, int *func);
+extern _X_EXPORT Bool xf86IsPrimaryPci(struct pci_device *pPci);
+extern _X_EXPORT Bool xf86CheckPciMemBase(struct pci_device *pPci,
+ memType base);
+extern _X_EXPORT struct pci_device *xf86GetPciInfoForEntity(int entityIndex);
+extern _X_EXPORT int xf86MatchPciInstances(const char *driverName,
+ int vendorID, SymTabPtr chipsets,
+ PciChipsets * PCIchipsets,
+ GDevPtr * devList, int numDevs,
+ DriverPtr drvp, int **foundEntities);
+extern _X_EXPORT ScrnInfoPtr xf86ConfigPciEntity(ScrnInfoPtr pScrn,
+ int scrnFlag, int entityIndex,
+ PciChipsets * p_chip,
+ void *dummy, EntityProc init,
+ EntityProc enter,
+ EntityProc leave,
+ void *private);
+#endif
+
+/* xf86Bus.c */
+
+extern _X_EXPORT int xf86ClaimFbSlot(DriverPtr drvp, int chipset, GDevPtr dev,
+ Bool active);
+extern _X_EXPORT int xf86ClaimNoSlot(DriverPtr drvp, int chipset, GDevPtr dev,
+ Bool active);
+extern _X_EXPORT void xf86AddEntityToScreen(ScrnInfoPtr pScrn, int entityIndex);
+extern _X_EXPORT void xf86SetEntityInstanceForScreen(ScrnInfoPtr pScrn,
+ int entityIndex,
+ int instance);
+extern _X_EXPORT int xf86GetNumEntityInstances(int entityIndex);
+extern _X_EXPORT GDevPtr xf86GetDevFromEntity(int entityIndex, int instance);
+extern _X_EXPORT EntityInfoPtr xf86GetEntityInfo(int entityIndex);
+
+#define xf86SetLastScrnFlag(e, s) do { } while (0)
+
+extern _X_EXPORT Bool xf86IsEntityShared(int entityIndex);
+extern _X_EXPORT void xf86SetEntityShared(int entityIndex);
+extern _X_EXPORT Bool xf86IsEntitySharable(int entityIndex);
+extern _X_EXPORT void xf86SetEntitySharable(int entityIndex);
+extern _X_EXPORT Bool xf86IsPrimInitDone(int entityIndex);
+extern _X_EXPORT void xf86SetPrimInitDone(int entityIndex);
+extern _X_EXPORT void xf86ClearPrimInitDone(int entityIndex);
+extern _X_EXPORT int xf86AllocateEntityPrivateIndex(void);
+extern _X_EXPORT DevUnion *xf86GetEntityPrivate(int entityIndex, int privIndex);
+
+/* xf86Configure.c */
+extern _X_EXPORT GDevPtr xf86AddBusDeviceToConfigure(const char *driver,
+ BusType bus, void *busData,
+ int chipset);
+
+/* xf86Cursor.c */
+
+extern _X_EXPORT void xf86SetViewport(ScreenPtr pScreen, int x, int y);
+extern _X_EXPORT Bool xf86SwitchMode(ScreenPtr pScreen, DisplayModePtr mode);
+extern _X_EXPORT void *xf86GetPointerScreenFuncs(void);
+extern _X_EXPORT void xf86ReconfigureLayout(void);
+
+/* xf86DPMS.c */
+
+extern _X_EXPORT Bool xf86DPMSInit(ScreenPtr pScreen, DPMSSetProcPtr set,
+ int flags);
+
+/* xf86DGA.c */
+
+#ifdef XFreeXDGA
+extern _X_EXPORT Bool DGAInit(ScreenPtr pScreen, DGAFunctionPtr funcs,
+ DGAModePtr modes, int num);
+extern _X_EXPORT Bool DGAReInitModes(ScreenPtr pScreen, DGAModePtr modes,
+ int num);
+extern _X_EXPORT xf86SetDGAModeProc xf86SetDGAMode;
+#endif
+
+/* xf86Events.c */
+
+typedef struct _InputInfoRec *InputInfoPtr;
+
+extern _X_EXPORT void SetTimeSinceLastInputEvent(void);
+extern _X_EXPORT void *xf86AddGeneralHandler(int fd, InputHandlerProc proc,
+ void *data);
+extern _X_EXPORT int xf86RemoveGeneralHandler(void *handler);
+
+/* xf86Helper.c */
+
+extern _X_EXPORT void xf86AddDriver(DriverPtr driver, void *module,
+ int flags);
+extern _X_EXPORT ScrnInfoPtr xf86AllocateScreen(DriverPtr drv, int flags);
+extern _X_EXPORT int xf86AllocateScrnInfoPrivateIndex(void);
+extern _X_EXPORT Bool xf86SetDepthBpp(ScrnInfoPtr scrp, int depth, int bpp,
+ int fbbpp, int depth24flags);
+extern _X_EXPORT void xf86PrintDepthBpp(ScrnInfoPtr scrp);
+extern _X_EXPORT Bool xf86SetWeight(ScrnInfoPtr scrp, rgb weight, rgb mask);
+extern _X_EXPORT Bool xf86SetDefaultVisual(ScrnInfoPtr scrp, int visual);
+extern _X_EXPORT Bool xf86SetGamma(ScrnInfoPtr scrp, Gamma newGamma);
+extern _X_EXPORT void xf86SetDpi(ScrnInfoPtr pScrn, int x, int y);
+extern _X_EXPORT void xf86SetBlackWhitePixels(ScreenPtr pScreen);
+extern _X_EXPORT void xf86EnableDisableFBAccess(ScrnInfoPtr pScrn, Bool enable);
+extern _X_EXPORT void
+xf86VDrvMsgVerb(int scrnIndex, MessageType type, int verb,
+ const char *format, va_list args)
+_X_ATTRIBUTE_PRINTF(4, 0);
+extern _X_EXPORT void
+xf86DrvMsgVerb(int scrnIndex, MessageType type, int verb,
+ const char *format, ...)
+_X_ATTRIBUTE_PRINTF(4, 5);
+extern _X_EXPORT void
+xf86DrvMsg(int scrnIndex, MessageType type, const char *format, ...)
+_X_ATTRIBUTE_PRINTF(3, 4);
+extern _X_EXPORT void
+xf86ErrorFVerb(int verb, const char *format, ...)
+_X_ATTRIBUTE_PRINTF(2, 3);
+extern _X_EXPORT void
+xf86ErrorF(const char *format, ...)
+_X_ATTRIBUTE_PRINTF(1, 2);
+extern _X_EXPORT const char *
+xf86TokenToString(SymTabPtr table, int token);
+extern _X_EXPORT int
+xf86StringToToken(SymTabPtr table, const char *string);
+extern _X_EXPORT void
+xf86ShowClocks(ScrnInfoPtr scrp, MessageType from);
+extern _X_EXPORT void
+xf86PrintChipsets(const char *drvname, const char *drvmsg, SymTabPtr chips);
+extern _X_EXPORT int
+xf86MatchDevice(const char *drivername, GDevPtr ** driversectlist);
+extern _X_EXPORT const char *
+xf86GetVisualName(int visual);
+extern _X_EXPORT int
+xf86GetVerbosity(void);
+extern _X_EXPORT Gamma
+xf86GetGamma(void);
+extern _X_EXPORT Bool
+xf86ServerIsExiting(void);
+extern _X_EXPORT Bool
+xf86ServerIsOnlyDetecting(void);
+extern _X_EXPORT Bool
+xf86GetAllowMouseOpenFail(void);
+extern _X_EXPORT CARD32
+xorgGetVersion(void);
+extern _X_EXPORT CARD32
+xf86GetModuleVersion(void *module);
+extern _X_EXPORT void *
+xf86LoadDrvSubModule(DriverPtr drv, const char *name);
+extern _X_EXPORT void *
+xf86LoadSubModule(ScrnInfoPtr pScrn, const char *name);
+extern _X_EXPORT void *
+xf86LoadOneModule(const char *name, void *optlist);
+extern _X_EXPORT void
+xf86UnloadSubModule(void *mod);
+extern _X_EXPORT Bool
+xf86LoaderCheckSymbol(const char *name);
+extern _X_EXPORT void
+xf86SetBackingStore(ScreenPtr pScreen);
+extern _X_EXPORT void
+xf86SetSilkenMouse(ScreenPtr pScreen);
+extern _X_EXPORT ScrnInfoPtr
+xf86ConfigFbEntity(ScrnInfoPtr pScrn, int scrnFlag,
+ int entityIndex, EntityProc init,
+ EntityProc enter, EntityProc leave, void *private);
+
+extern _X_EXPORT Bool
+xf86IsUnblank(int mode);
+
+/* xf86Init.c */
+
+extern _X_EXPORT PixmapFormatPtr
+xf86GetPixFormat(ScrnInfoPtr pScrn, int depth);
+extern _X_EXPORT int
+xf86GetBppFromDepth(ScrnInfoPtr pScrn, int depth);
+
+/* xf86Mode.c */
+
+extern _X_EXPORT ModeStatus
+xf86CheckModeForMonitor(DisplayModePtr mode, MonPtr monitor);
+extern _X_EXPORT int
+xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes,
+ const char **modeNames, ClockRangePtr clockRanges,
+ int *linePitches, int minPitch, int maxPitch,
+ int minHeight, int maxHeight, int pitchInc,
+ int virtualX, int virtualY, int apertureSize,
+ LookupModeFlags strategy);
+extern _X_EXPORT void
+xf86DeleteMode(DisplayModePtr * modeList, DisplayModePtr mode);
+extern _X_EXPORT void
+xf86PruneDriverModes(ScrnInfoPtr scrp);
+extern _X_EXPORT void
+xf86SetCrtcForModes(ScrnInfoPtr scrp, int adjustFlags);
+extern _X_EXPORT void
+xf86PrintModes(ScrnInfoPtr scrp);
+
+/* xf86Option.c */
+
+extern _X_EXPORT void
+xf86CollectOptions(ScrnInfoPtr pScrn, XF86OptionPtr extraOpts);
+
+/* convert ScreenPtr to ScrnInfoPtr */
+extern _X_EXPORT ScrnInfoPtr xf86ScreenToScrn(ScreenPtr pScreen);
+/* convert ScrnInfoPtr to ScreenPtr */
+extern _X_EXPORT ScreenPtr xf86ScrnToScreen(ScrnInfoPtr pScrn);
+
+#define XF86_HAS_SCRN_CONV 1 /* define for drivers to use in api compat */
+
+#define XF86_SCRN_INTERFACE 1 /* define for drivers to use in api compat */
+
+/* flags passed to xf86 allocate screen */
+#define XF86_ALLOCATE_GPU_SCREEN 1
+
+/* only for backwards (source) compatibility */
+#define xf86MsgVerb LogMessageVerb
+#define xf86Msg(type, ...) LogMessageVerb((type), 1, __VA_ARGS__)
+
+/*
+ * retrieve file descriptor to opened console device.
+ * only for some legacy keyboard drivers (xf86-input-keyboard)
+ */
+_X_EXPORT int xf86GetConsoleFd(void);
+
+#endif /* _XF86_H */
diff --git a/prebuilt/xlibre/usr/include/xorg/xf86Crtc.h b/prebuilt/xlibre/usr/include/xorg/xf86Crtc.h
new file mode 100644
index 0000000..4237bd8
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/xf86Crtc.h
@@ -0,0 +1,1142 @@
+/*
+ * Copyright © 2006 Keith Packard
+ * Copyright © 2011 Aaron Plattner
+ *
+ * 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 _XF86CRTC_H_
+#define _XF86CRTC_H_
+
+#include
+#include "randrstr.h"
+#include "xf86Modes.h"
+#include "xf86Cursor.h"
+#include "xf86i2c.h"
+#include "damage.h"
+#include "picturestr.h"
+
+/* Compat definitions for older X Servers. */
+#ifndef M_T_PREFERRED
+#define M_T_PREFERRED 0x08
+#endif
+#ifndef M_T_DRIVER
+#define M_T_DRIVER 0x40
+#endif
+#ifndef M_T_USERPREF
+#define M_T_USERPREF 0x80
+#endif
+#ifndef HARDWARE_CURSOR_ARGB
+#define HARDWARE_CURSOR_ARGB 0x00004000
+#endif
+
+typedef struct _xf86Crtc xf86CrtcRec, *xf86CrtcPtr;
+typedef struct _xf86Output xf86OutputRec, *xf86OutputPtr;
+typedef struct _xf86Lease xf86LeaseRec, *xf86LeasePtr;
+
+/* define a standard for connector types */
+typedef enum _xf86ConnectorType {
+ XF86ConnectorNone,
+ XF86ConnectorVGA,
+ XF86ConnectorDVI_I,
+ XF86ConnectorDVI_D,
+ XF86ConnectorDVI_A,
+ XF86ConnectorComposite,
+ XF86ConnectorSvideo,
+ XF86ConnectorComponent,
+ XF86ConnectorLFP,
+ XF86ConnectorProprietary,
+ XF86ConnectorHDMI,
+ XF86ConnectorDisplayPort,
+} xf86ConnectorType;
+
+typedef enum _xf86OutputStatus {
+ XF86OutputStatusConnected,
+ XF86OutputStatusDisconnected,
+ XF86OutputStatusUnknown
+} xf86OutputStatus;
+
+typedef enum _xf86DriverTransforms {
+ XF86DriverTransformNone = 0,
+ XF86DriverTransformOutput = 1 << 0,
+ XF86DriverTransformCursorImage = 1 << 1,
+ XF86DriverTransformCursorPosition = 1 << 2,
+} xf86DriverTransforms;
+
+
+struct xf86CrtcTileInfo {
+ uint32_t group_id;
+ uint32_t flags;
+ uint32_t num_h_tile;
+ uint32_t num_v_tile;
+ uint32_t tile_h_loc;
+ uint32_t tile_v_loc;
+ uint32_t tile_h_size;
+ uint32_t tile_v_size;
+};
+
+typedef struct _xf86CrtcFuncs {
+ /**
+ * Turns the crtc on/off, or sets intermediate power levels if available.
+ *
+ * Unsupported intermediate modes drop to the lower power setting. If the
+ * mode is DPMSModeOff, the crtc must be disabled sufficiently for it to
+ * be safe to call mode_set.
+ */
+ void
+ (*dpms) (xf86CrtcPtr crtc, int mode);
+
+ /**
+ * Saves the crtc's state for restoration on VT switch.
+ */
+ void
+ (*save) (xf86CrtcPtr crtc);
+
+ /**
+ * Restore's the crtc's state at VT switch.
+ */
+ void
+ (*restore) (xf86CrtcPtr crtc);
+
+ /**
+ * Lock CRTC prior to mode setting, mostly for DRI.
+ * Returns whether unlock is needed
+ */
+ Bool
+ (*lock) (xf86CrtcPtr crtc);
+
+ /**
+ * Unlock CRTC after mode setting, mostly for DRI
+ */
+ void
+ (*unlock) (xf86CrtcPtr crtc);
+
+ /**
+ * Callback to adjust the mode to be set in the CRTC.
+ *
+ * This allows a CRTC to adjust the clock or even the entire set of
+ * timings, which is used for panels with fixed timings or for
+ * buses with clock limitations.
+ */
+ Bool
+ (*mode_fixup) (xf86CrtcPtr crtc,
+ DisplayModePtr mode, DisplayModePtr adjusted_mode);
+
+ /**
+ * Prepare CRTC for an upcoming mode set.
+ */
+ void
+ (*prepare) (xf86CrtcPtr crtc);
+
+ /**
+ * Callback for setting up a video mode after fixups have been made.
+ */
+ void
+ (*mode_set) (xf86CrtcPtr crtc,
+ DisplayModePtr mode,
+ DisplayModePtr adjusted_mode, int x, int y);
+
+ /**
+ * Commit mode changes to a CRTC
+ */
+ void
+ (*commit) (xf86CrtcPtr crtc);
+
+ /* Set the color ramps for the CRTC to the given values. */
+ void
+ (*gamma_set) (xf86CrtcPtr crtc, CARD16 *red, CARD16 *green, CARD16 *blue,
+ int size);
+
+ /**
+ * Allocate the shadow area, delay the pixmap creation until needed
+ */
+ void *(*shadow_allocate) (xf86CrtcPtr crtc, int width, int height);
+
+ /**
+ * Create shadow pixmap for rotation support
+ */
+ PixmapPtr
+ (*shadow_create) (xf86CrtcPtr crtc, void *data, int width, int height);
+
+ /**
+ * Destroy shadow pixmap
+ */
+ void
+ (*shadow_destroy) (xf86CrtcPtr crtc, PixmapPtr pPixmap, void *data);
+
+ /**
+ * Set cursor colors
+ */
+ void
+ (*set_cursor_colors) (xf86CrtcPtr crtc, int bg, int fg);
+
+ /**
+ * Set cursor position
+ */
+ void
+ (*set_cursor_position) (xf86CrtcPtr crtc, int x, int y);
+
+ /**
+ * Show cursor
+ */
+ void
+ (*show_cursor) (xf86CrtcPtr crtc);
+ Bool
+ (*show_cursor_check) (xf86CrtcPtr crtc);
+
+ /**
+ * Hide cursor
+ */
+ void
+ (*hide_cursor) (xf86CrtcPtr crtc);
+
+ /**
+ * Load monochrome image
+ */
+ void
+ (*load_cursor_image) (xf86CrtcPtr crtc, CARD8 *image);
+ Bool
+ (*load_cursor_image_check) (xf86CrtcPtr crtc, CARD8 *image);
+
+ /**
+ * Load ARGB image
+ */
+ void
+ (*load_cursor_argb) (xf86CrtcPtr crtc, CARD32 *image);
+ Bool
+ (*load_cursor_argb_check) (xf86CrtcPtr crtc, CARD32 *image);
+
+ /**
+ * Clean up driver-specific bits of the crtc
+ */
+ void
+ (*destroy) (xf86CrtcPtr crtc);
+
+ /**
+ * Less fine-grained mode setting entry point for kernel modesetting
+ */
+ Bool
+ (*set_mode_major) (xf86CrtcPtr crtc, DisplayModePtr mode,
+ Rotation rotation, int x, int y);
+
+ /**
+ * Callback for panning. Doesn't change the mode.
+ * Added in ABI version 2
+ */
+ void
+ (*set_origin) (xf86CrtcPtr crtc, int x, int y);
+
+ /**
+ */
+ Bool
+ (*set_scanout_pixmap)(xf86CrtcPtr crtc, PixmapPtr pixmap);
+
+} xf86CrtcFuncsRec, *xf86CrtcFuncsPtr;
+
+#define XF86_CRTC_VERSION 8
+
+struct _xf86Crtc {
+ /**
+ * ABI versioning
+ */
+ int version;
+
+ /**
+ * Associated ScrnInfo
+ */
+ ScrnInfoPtr scrn;
+
+ /**
+ * Desired state of this CRTC
+ *
+ * Set when this CRTC should be driving one or more outputs
+ */
+ Bool enabled;
+
+ /**
+ * Active mode
+ *
+ * This reflects the mode as set in the CRTC currently
+ * It will be cleared when the VT is not active or
+ * during server startup
+ */
+ DisplayModeRec mode;
+ Rotation rotation;
+ PixmapPtr rotatedPixmap;
+ void *rotatedData;
+
+ /**
+ * Position on screen
+ *
+ * Locates this CRTC within the frame buffer
+ */
+ int x, y;
+
+ /**
+ * Desired mode
+ *
+ * This is set to the requested mode, independent of
+ * whether the VT is active. In particular, it receives
+ * the startup configured mode and saves the active mode
+ * on VT switch.
+ */
+ DisplayModeRec desiredMode;
+ Rotation desiredRotation;
+ int desiredX, desiredY;
+
+ /** crtc-specific functions */
+ const xf86CrtcFuncsRec *funcs;
+
+ /**
+ * Driver private
+ *
+ * Holds driver-private information
+ */
+ void *driver_private;
+
+ /**
+ * RandR crtc
+ *
+ * When RandR 1.2 is available, this
+ * points at the associated crtc object
+ */
+ RRCrtcPtr randr_crtc;
+
+ /**
+ * Current cursor is ARGB
+ */
+ Bool cursor_argb;
+ /**
+ * Track whether cursor is within CRTC range
+ */
+ Bool cursor_in_range;
+ /**
+ * Track state of cursor associated with this CRTC
+ */
+ Bool cursor_shown;
+
+ /**
+ * Current transformation matrix
+ */
+ PictTransform crtc_to_framebuffer;
+ /* framebuffer_to_crtc was removed in ABI 2 */
+ struct pixman_f_transform f_crtc_to_framebuffer; /* ABI 2 */
+ struct pixman_f_transform f_framebuffer_to_crtc; /* ABI 2 */
+ PictFilterPtr filter; /* ABI 2 */
+ xFixed *params; /* ABI 2 */
+ int nparams; /* ABI 2 */
+ int filter_width; /* ABI 2 */
+ int filter_height; /* ABI 2 */
+ Bool transform_in_use;
+ RRTransformRec transform; /* ABI 2 */
+ Bool transformPresent; /* ABI 2 */
+ RRTransformRec desiredTransform; /* ABI 2 */
+ Bool desiredTransformPresent; /* ABI 2 */
+ /**
+ * Bounding box in screen space
+ */
+ BoxRec bounds;
+ /**
+ * Panning:
+ * TotalArea: total panning area, larger than CRTC's size
+ * TrackingArea: Area of the pointer for which the CRTC is panned
+ * border: Borders of the displayed CRTC area which induces panning if the pointer reaches them
+ * Added in ABI version 2
+ */
+ BoxRec panningTotalArea;
+ BoxRec panningTrackingArea;
+ INT16 panningBorder[4];
+
+ /**
+ * Current gamma, especially useful after initial config.
+ * Added in ABI version 3
+ */
+ CARD16 *gamma_red;
+ CARD16 *gamma_green;
+ CARD16 *gamma_blue;
+ int gamma_size;
+
+ /**
+ * Actual state of this CRTC
+ *
+ * Set to TRUE after modesetting, set to FALSE if no outputs are connected
+ * Added in ABI version 3
+ */
+ Bool active;
+ /**
+ * Clear the shadow
+ */
+ Bool shadowClear;
+
+ /**
+ * Indicates that the driver is handling some or all transforms:
+ *
+ * XF86DriverTransformOutput: The driver handles the output transform, so
+ * the shadow surface should be disabled. The driver writes this field
+ * before calling xf86CrtcRotate to indicate that it is handling the
+ * transform (including rotation and reflection).
+ *
+ * XF86DriverTransformCursorImage: Setting this flag causes the server to
+ * pass the untransformed cursor image to the driver hook.
+ *
+ * XF86DriverTransformCursorPosition: Setting this flag causes the server
+ * to pass the untransformed cursor position to the driver hook.
+ *
+ * Added in ABI version 4, changed to xf86DriverTransforms in ABI version 7
+ */
+ xf86DriverTransforms driverIsPerformingTransform;
+
+ /* Added in ABI version 5
+ */
+ PixmapPtr current_scanout;
+
+ /* Added in ABI version 6
+ */
+ PixmapPtr current_scanout_back;
+};
+
+typedef struct _xf86OutputFuncs {
+ /**
+ * Called to allow the output a chance to create properties after the
+ * RandR objects have been created.
+ */
+ void
+ (*create_resources) (xf86OutputPtr output);
+
+ /**
+ * Turns the output on/off, or sets intermediate power levels if available.
+ *
+ * Unsupported intermediate modes drop to the lower power setting. If the
+ * mode is DPMSModeOff, the output must be disabled, as the DPLL may be
+ * disabled afterwards.
+ */
+ void
+ (*dpms) (xf86OutputPtr output, int mode);
+
+ /**
+ * Saves the output's state for restoration on VT switch.
+ */
+ void
+ (*save) (xf86OutputPtr output);
+
+ /**
+ * Restore's the output's state at VT switch.
+ */
+ void
+ (*restore) (xf86OutputPtr output);
+
+ /**
+ * Callback for testing a video mode for a given output.
+ *
+ * This function should only check for cases where a mode can't be supported
+ * on the output specifically, and not represent generic CRTC limitations.
+ *
+ * \return MODE_OK if the mode is valid, or another MODE_* otherwise.
+ */
+ int
+ (*mode_valid) (xf86OutputPtr output, DisplayModePtr pMode);
+
+ /**
+ * Callback to adjust the mode to be set in the CRTC.
+ *
+ * This allows an output to adjust the clock or even the entire set of
+ * timings, which is used for panels with fixed timings or for
+ * buses with clock limitations.
+ */
+ Bool
+ (*mode_fixup) (xf86OutputPtr output,
+ DisplayModePtr mode, DisplayModePtr adjusted_mode);
+
+ /**
+ * Callback for preparing mode changes on an output
+ */
+ void
+ (*prepare) (xf86OutputPtr output);
+
+ /**
+ * Callback for committing mode changes on an output
+ */
+ void
+ (*commit) (xf86OutputPtr output);
+
+ /**
+ * Callback for setting up a video mode after fixups have been made.
+ *
+ * This is only called while the output is disabled. The dpms callback
+ * must be all that's necessary for the output, to turn the output on
+ * after this function is called.
+ */
+ void
+ (*mode_set) (xf86OutputPtr output,
+ DisplayModePtr mode, DisplayModePtr adjusted_mode);
+
+ /**
+ * Probe for a connected output, and return detect_status.
+ */
+ xf86OutputStatus(*detect) (xf86OutputPtr output);
+
+ /**
+ * Query the device for the modes it provides.
+ *
+ * This function may also update MonInfo, mm_width, and mm_height.
+ *
+ * \return singly-linked list of modes or NULL if no modes found.
+ */
+ DisplayModePtr(*get_modes) (xf86OutputPtr output);
+
+ /**
+ * Callback when an output's property has changed.
+ */
+ Bool
+ (*set_property) (xf86OutputPtr output,
+ Atom property, RRPropertyValuePtr value);
+#ifdef RANDR_13_INTERFACE
+ /**
+ * Callback to get an updated property value
+ */
+ Bool
+ (*get_property) (xf86OutputPtr output, Atom property);
+#endif
+#ifdef RANDR_GET_CRTC_INTERFACE
+ /**
+ * Callback to get current CRTC for a given output
+ */
+ xf86CrtcPtr(*get_crtc) (xf86OutputPtr output);
+#endif
+ /**
+ * Clean up driver-specific bits of the output
+ */
+ void
+ (*destroy) (xf86OutputPtr output);
+} xf86OutputFuncsRec, *xf86OutputFuncsPtr;
+
+#define XF86_OUTPUT_VERSION 3
+
+struct _xf86Output {
+ /**
+ * ABI versioning
+ */
+ int version;
+
+ /**
+ * Associated ScrnInfo
+ */
+ ScrnInfoPtr scrn;
+
+ /**
+ * Currently connected crtc (if any)
+ *
+ * If this output is not in use, this field will be NULL.
+ */
+ xf86CrtcPtr crtc;
+
+ /**
+ * Possible CRTCs for this output as a mask of crtc indices
+ */
+ CARD32 possible_crtcs;
+
+ /**
+ * Possible outputs to share the same CRTC as a mask of output indices
+ */
+ CARD32 possible_clones;
+
+ /**
+ * Whether this output can support interlaced modes
+ */
+ Bool interlaceAllowed;
+
+ /**
+ * Whether this output can support double scan modes
+ */
+ Bool doubleScanAllowed;
+
+ /**
+ * List of available modes on this output.
+ *
+ * This should be the list from get_modes(), plus perhaps additional
+ * compatible modes added later.
+ */
+ DisplayModePtr probed_modes;
+
+ /**
+ * Options parsed from the related monitor section
+ */
+ OptionInfoPtr options;
+
+ /**
+ * Configured monitor section
+ */
+ XF86ConfMonitorPtr conf_monitor;
+
+ /**
+ * Desired initial position
+ */
+ int initial_x, initial_y;
+
+ /**
+ * Desired initial rotation
+ */
+ Rotation initial_rotation;
+
+ /**
+ * Current connection status
+ *
+ * This indicates whether a monitor is known to be connected
+ * to this output or not, or whether there is no way to tell
+ */
+ xf86OutputStatus status;
+
+ /** EDID monitor information */
+ xf86MonPtr MonInfo;
+
+ /** subpixel order */
+ int subpixel_order;
+
+ /** Physical size of the currently attached output device. */
+ int mm_width, mm_height;
+
+ /** Output name */
+ char *name;
+
+ /** output-specific functions */
+ const xf86OutputFuncsRec *funcs;
+
+ /** driver private information */
+ void *driver_private;
+
+ /** Whether to use the old per-screen Monitor config section */
+ Bool use_screen_monitor;
+
+ /** For pre-init, whether the output should be excluded from the
+ * desktop when there are other viable outputs to use
+ */
+ Bool non_desktop;
+
+ /**
+ * RandR 1.2 output structure.
+ *
+ * When RandR 1.2 is available, this points at the associated
+ * RandR output structure and is created when this output is created
+ */
+ RROutputPtr randr_output;
+ /**
+ * Desired initial panning
+ * Added in ABI version 2
+ */
+ BoxRec initialTotalArea;
+ BoxRec initialTrackingArea;
+ INT16 initialBorder[4];
+
+ struct xf86CrtcTileInfo tile_info;
+};
+
+typedef struct _xf86ProviderFuncs {
+ /**
+ * Called to allow the provider a chance to create properties after the
+ * RandR objects have been created.
+ */
+ void
+ (*create_resources) (ScrnInfoPtr scrn);
+
+ /**
+ * Callback when an provider's property has changed.
+ */
+ Bool
+ (*set_property) (ScrnInfoPtr scrn,
+ Atom property, RRPropertyValuePtr value);
+
+ /**
+ * Callback to get an updated property value
+ */
+ Bool
+ (*get_property) (ScrnInfoPtr provider, Atom property);
+
+} xf86ProviderFuncsRec, *xf86ProviderFuncsPtr;
+
+#define XF86_LEASE_VERSION 1
+
+struct _xf86Lease {
+ /**
+ * ABI versioning
+ */
+ int version;
+
+ /**
+ * Associated ScrnInfo
+ */
+ ScrnInfoPtr scrn;
+
+ /**
+ * Driver private
+ */
+ void *driver_private;
+
+ /**
+ * RandR lease
+ */
+ RRLeasePtr randr_lease;
+
+ /*
+ * Contents of the lease
+ */
+
+ /**
+ * Number of leased CRTCs
+ */
+ int num_crtc;
+
+ /**
+ * Number of leased outputs
+ */
+ int num_output;
+
+ /**
+ * Array of pointers to leased CRTCs
+ */
+ RRCrtcPtr *crtcs;
+
+ /**
+ * Array of pointers to leased outputs
+ */
+ RROutputPtr *outputs;
+};
+
+typedef struct _xf86CrtcConfigFuncs {
+ /**
+ * Requests that the driver resize the screen.
+ *
+ * The driver is responsible for updating scrn->virtualX and scrn->virtualY.
+ * If the requested size cannot be set, the driver should leave those values
+ * alone and return FALSE.
+ *
+ * A naive driver that cannot reallocate the screen may simply change
+ * virtual[XY]. A more advanced driver will want to also change the
+ * devPrivate.ptr and devKind of the screen pixmap, update any offscreen
+ * pixmaps it may have moved, and change pScrn->displayWidth.
+ */
+ Bool
+ (*resize) (ScrnInfoPtr scrn, int width, int height);
+
+ /**
+ * Requests that the driver create a lease
+ */
+ int (*create_lease)(RRLeasePtr lease, int *fd);
+
+ /**
+ * Ask the driver to terminate a lease, freeing all
+ * driver resources
+ */
+ void (*terminate_lease)(RRLeasePtr lease);
+} xf86CrtcConfigFuncsRec, *xf86CrtcConfigFuncsPtr;
+
+/*
+ * The driver calls this when it detects that a lease
+ * has been terminated
+ */
+extern _X_EXPORT void
+xf86CrtcLeaseTerminated(RRLeasePtr lease);
+
+extern _X_EXPORT void
+xf86CrtcLeaseStarted(RRLeasePtr lease);
+
+typedef void (*xf86_crtc_notify_proc_ptr) (ScreenPtr pScreen);
+
+typedef struct _xf86CrtcConfig {
+ int num_output;
+ xf86OutputPtr *output;
+ /**
+ * compat_output is used whenever we deal
+ * with legacy code that only understands a single
+ * output. pScrn->modes will be loaded from this output,
+ * adjust frame will whack this output, etc.
+ */
+ int compat_output;
+
+ int num_crtc;
+ xf86CrtcPtr *crtc;
+
+ int minWidth, minHeight;
+ int maxWidth, maxHeight;
+
+ /* For crtc-based rotation */
+ DamagePtr rotation_damage;
+ Bool rotation_damage_registered;
+
+ /* DGA */
+ unsigned int dga_flags;
+ unsigned long dga_address;
+ DGAModePtr dga_modes;
+ int dga_nmode;
+ int dga_width, dga_height, dga_stride;
+ DisplayModePtr dga_save_mode;
+
+ const xf86CrtcConfigFuncsRec *funcs;
+
+ CreateScreenResourcesProcPtr CreateScreenResources;
+
+ void *_dummy1; // required in place of a removed field for ABI compatibility
+
+ /* Cursor information */
+ xf86CursorInfoPtr cursor_info;
+ CursorPtr cursor;
+ CARD8 *cursor_image;
+ Bool cursor_on;
+ CARD32 cursor_fg, cursor_bg;
+
+ /**
+ * Options parsed from the related device section
+ */
+ OptionInfoPtr options;
+
+ Bool debug_modes;
+
+ /* wrap screen BlockHandler for rotation */
+ ScreenBlockHandlerProcPtr BlockHandler;
+
+ /* callback when crtc configuration changes */
+ xf86_crtc_notify_proc_ptr xf86_crtc_notify;
+
+ char *name;
+ const xf86ProviderFuncsRec *provider_funcs;
+ RRProviderPtr randr_provider;
+} xf86CrtcConfigRec, *xf86CrtcConfigPtr;
+
+extern _X_EXPORT int xf86CrtcConfigPrivateIndex;
+
+#define XF86_CRTC_CONFIG_PTR(p) ((xf86CrtcConfigPtr) ((p)->privates[xf86CrtcConfigPrivateIndex].ptr))
+
+static _X_INLINE xf86OutputPtr
+xf86CompatOutput(ScrnInfoPtr pScrn)
+{
+ xf86CrtcConfigPtr config;
+
+ if (xf86CrtcConfigPrivateIndex == -1)
+ return NULL;
+ config = XF86_CRTC_CONFIG_PTR(pScrn);
+ if ((config == NULL) || (config->compat_output < 0))
+ return NULL;
+ return config->output[config->compat_output];
+}
+
+static _X_INLINE xf86CrtcPtr
+xf86CompatCrtc(ScrnInfoPtr pScrn)
+{
+ xf86OutputPtr compat_output = xf86CompatOutput(pScrn);
+
+ if (!compat_output)
+ return NULL;
+ return compat_output->crtc;
+}
+
+static _X_INLINE RRCrtcPtr
+xf86CompatRRCrtc(ScrnInfoPtr pScrn)
+{
+ xf86CrtcPtr compat_crtc = xf86CompatCrtc(pScrn);
+
+ if (!compat_crtc)
+ return NULL;
+ return compat_crtc->randr_crtc;
+}
+
+/*
+ * Initialize xf86CrtcConfig structure
+ */
+
+extern _X_EXPORT void
+ xf86CrtcConfigInit(ScrnInfoPtr scrn, const xf86CrtcConfigFuncsRec * funcs);
+
+extern _X_EXPORT void
+
+xf86CrtcSetSizeRange(ScrnInfoPtr scrn,
+ int minWidth, int minHeight, int maxWidth, int maxHeight);
+
+/*
+ * Crtc functions
+ */
+extern _X_EXPORT xf86CrtcPtr
+xf86CrtcCreate(ScrnInfoPtr scrn, const xf86CrtcFuncsRec * funcs);
+
+extern _X_EXPORT void
+ xf86CrtcDestroy(xf86CrtcPtr crtc);
+
+/**
+ * Sets the given video mode on the given crtc
+ */
+
+extern _X_EXPORT Bool
+
+xf86CrtcSetModeTransform(xf86CrtcPtr crtc, DisplayModePtr mode,
+ Rotation rotation, RRTransformPtr transform, int x,
+ int y);
+
+extern _X_EXPORT Bool
+
+xf86CrtcSetMode(xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotation,
+ int x, int y);
+
+extern _X_EXPORT void
+ xf86CrtcSetOrigin(xf86CrtcPtr crtc, int x, int y);
+
+/*
+ * Assign crtc rotation during mode set
+ */
+extern _X_EXPORT Bool
+ xf86CrtcRotate(xf86CrtcPtr crtc);
+
+extern _X_EXPORT void
+ xf86RotateCrtcRedisplay(xf86CrtcPtr crtc, PixmapPtr dst_pixmap,
+ DrawableRec *src_drawable, RegionPtr region,
+ Bool transform_src);
+
+/*
+ * Clean up any rotation data, used when a crtc is turned off
+ * as well as when rotation is disabled.
+ */
+extern _X_EXPORT void
+ xf86RotateDestroy(xf86CrtcPtr crtc);
+
+/*
+ * free shadow memory allocated for all crtcs
+ */
+extern _X_EXPORT void
+ xf86RotateFreeShadow(ScrnInfoPtr pScrn);
+
+/*
+ * Clean up rotation during CloseScreen
+ */
+extern _X_EXPORT void
+ xf86RotateCloseScreen(ScreenPtr pScreen);
+
+/**
+ * Return whether any output is assigned to the crtc
+ */
+extern _X_EXPORT Bool
+ xf86CrtcInUse(xf86CrtcPtr crtc);
+
+/*
+ * Output functions
+ */
+extern _X_EXPORT xf86OutputPtr
+xf86OutputCreate(ScrnInfoPtr scrn,
+ const xf86OutputFuncsRec * funcs, const char *name);
+
+extern _X_EXPORT void
+ xf86OutputUseScreenMonitor(xf86OutputPtr output, Bool use_screen_monitor);
+
+extern _X_EXPORT Bool
+ xf86OutputRename(xf86OutputPtr output, const char *name);
+
+extern _X_EXPORT void
+ xf86OutputDestroy(xf86OutputPtr output);
+
+extern _X_EXPORT void
+ xf86ProbeOutputModes(ScrnInfoPtr pScrn, int maxX, int maxY);
+
+extern _X_EXPORT void
+ xf86SetScrnInfoModes(ScrnInfoPtr pScrn);
+
+#ifdef RANDR_13_INTERFACE
+#define ScreenInitRetType int
+#else
+#define ScreenInitRetType Bool
+#endif
+
+extern _X_EXPORT ScreenInitRetType xf86CrtcScreenInit(ScreenPtr pScreen);
+
+extern _X_EXPORT void
+xf86AssignNoOutputInitialSize(ScrnInfoPtr scrn, const OptionInfoRec *options,
+ int *no_output_width, int *no_output_height);
+
+extern _X_EXPORT Bool
+ xf86InitialConfiguration(ScrnInfoPtr pScrn, Bool canGrow);
+
+extern _X_EXPORT void
+ xf86DPMSSet(ScrnInfoPtr pScrn, int PowerManagementMode, int flags);
+
+extern _X_EXPORT Bool
+ xf86SaveScreen(ScreenPtr pScreen, int mode);
+
+extern _X_EXPORT void
+ xf86DisableUnusedFunctions(ScrnInfoPtr pScrn);
+
+extern _X_EXPORT DisplayModePtr
+xf86OutputFindClosestMode(xf86OutputPtr output, DisplayModePtr desired);
+
+extern _X_EXPORT Bool
+
+xf86SetSingleMode(ScrnInfoPtr pScrn, DisplayModePtr desired, Rotation rotation);
+
+/**
+ * Set the EDID information for the specified output
+ */
+extern _X_EXPORT void
+ xf86OutputSetEDID(xf86OutputPtr output, xf86MonPtr edid_mon);
+
+/**
+ * Set the TILE information for the specified output
+ */
+extern _X_EXPORT void
+xf86OutputSetTile(xf86OutputPtr output, struct xf86CrtcTileInfo *tile_info);
+
+extern _X_EXPORT Bool
+xf86OutputParseKMSTile(const char *tile_data, int tile_length, struct xf86CrtcTileInfo *tile_info);
+
+/**
+ * Return the list of modes supported by the EDID information
+ * stored in 'output'
+ */
+extern _X_EXPORT DisplayModePtr xf86OutputGetEDIDModes(xf86OutputPtr output);
+
+extern _X_EXPORT xf86MonPtr
+xf86OutputGetEDID(xf86OutputPtr output, I2CBusPtr pDDCBus);
+
+/**
+ * Initialize dga for this screen
+ */
+
+#ifdef XFreeXDGA
+extern _X_EXPORT Bool
+ xf86DiDGAInit(ScreenPtr pScreen, unsigned long dga_address);
+
+/* this is the real function, used only internally */
+_X_INTERNAL Bool
+ _xf86_di_dga_init_internal(ScreenPtr pScreen);
+
+/**
+ * Re-initialize dga for this screen (as when the set of modes changes)
+ */
+
+extern _X_EXPORT Bool
+ xf86DiDGAReInit(ScreenPtr pScreen);
+#endif
+
+/* This is the real function, used only internally */
+_X_INTERNAL Bool
+ _xf86_di_dga_reinit_internal(ScreenPtr pScreen);
+
+/*
+ * Set the subpixel order reported for the screen using
+ * the information from the outputs
+ */
+
+extern _X_EXPORT void
+ xf86CrtcSetScreenSubpixelOrder(ScreenPtr pScreen);
+
+/*
+ * Get a standard string name for a connector type
+ */
+extern _X_EXPORT const char *xf86ConnectorGetName(xf86ConnectorType connector);
+
+/*
+ * Using the desired mode information in each crtc, set
+ * modes (used in EnterVT functions, or at server startup)
+ */
+
+extern _X_EXPORT Bool
+ xf86SetDesiredModes(ScrnInfoPtr pScrn);
+
+/**
+ * Initialize the CRTC-based cursor code. CRTC function vectors must
+ * contain relevant cursor setting functions.
+ *
+ * Driver should call this from ScreenInit function
+ */
+extern _X_EXPORT Bool
+ xf86_cursors_init(ScreenPtr screen, int max_width, int max_height, int flags);
+
+/**
+ * Superseded by xf86CursorResetCursor, which is getting called
+ * automatically when necessary.
+ */
+static _X_INLINE _X_DEPRECATED void xf86_reload_cursors(ScreenPtr screen) {}
+
+/**
+ * Called from EnterVT to turn the cursors back on
+ */
+extern _X_EXPORT Bool
+ xf86_show_cursors(ScrnInfoPtr scrn);
+
+/**
+ * Called by the driver to turn a single crtc's cursor off
+ */
+extern _X_EXPORT void
+xf86_crtc_hide_cursor(xf86CrtcPtr crtc);
+
+/**
+ * Called by the driver to turn a single crtc's cursor on
+ */
+extern _X_EXPORT Bool
+xf86_crtc_show_cursor(xf86CrtcPtr crtc);
+
+/**
+ * Called by the driver to turn cursors off
+ */
+extern _X_EXPORT void
+ xf86_hide_cursors(ScrnInfoPtr scrn);
+
+/**
+ * Clean up CRTC-based cursor code. Driver must call this at CloseScreen time.
+ */
+extern _X_EXPORT void
+ xf86_cursors_fini(ScreenPtr screen);
+
+#ifdef XV
+/*
+ * For overlay video, compute the relevant CRTC and
+ * clip video to that.
+ * wraps xf86XVClipVideoHelper()
+ */
+
+extern _X_EXPORT Bool
+
+xf86_crtc_clip_video_helper(ScrnInfoPtr pScrn,
+ xf86CrtcPtr * crtc_ret,
+ xf86CrtcPtr desired_crtc,
+ BoxPtr dst,
+ INT32 *xa,
+ INT32 *xb,
+ INT32 *ya,
+ INT32 *yb,
+ RegionPtr reg, INT32 width, INT32 height);
+#endif
+
+extern _X_EXPORT xf86_crtc_notify_proc_ptr
+xf86_wrap_crtc_notify(ScreenPtr pScreen, xf86_crtc_notify_proc_ptr new);
+
+extern _X_EXPORT void
+ xf86_unwrap_crtc_notify(ScreenPtr pScreen, xf86_crtc_notify_proc_ptr old);
+
+extern _X_EXPORT void
+ xf86_crtc_notify(ScreenPtr pScreen);
+
+/**
+ * Gamma
+ */
+
+extern _X_EXPORT Bool
+ xf86_crtc_supports_gamma(ScrnInfoPtr pScrn);
+
+extern _X_EXPORT void
+xf86ProviderSetup(ScrnInfoPtr scrn,
+ const xf86ProviderFuncsRec * funcs, const char *name);
+
+extern _X_EXPORT void
+xf86DetachAllCrtc(ScrnInfoPtr scrn);
+
+Bool xf86OutputForceEnabled(xf86OutputPtr output);
+#endif /* _XF86CRTC_H_ */
diff --git a/prebuilt/xlibre/usr/include/xorg/xf86Cursor.h b/prebuilt/xlibre/usr/include/xorg/xf86Cursor.h
new file mode 100644
index 0000000..11a03b6
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/xf86Cursor.h
@@ -0,0 +1,98 @@
+
+#ifndef _XF86CURSOR_H
+#define _XF86CURSOR_H
+
+#include "xf86str.h"
+#include "mipointer.h"
+
+typedef struct _xf86CursorInfoRec {
+ ScrnInfoPtr pScrn;
+ int Flags;
+ int MaxWidth;
+ int MaxHeight;
+ void (*SetCursorColors) (ScrnInfoPtr pScrn, int bg, int fg);
+ void (*SetCursorPosition) (ScrnInfoPtr pScrn, int x, int y);
+ void (*LoadCursorImage) (ScrnInfoPtr pScrn, unsigned char *bits);
+ Bool (*LoadCursorImageCheck) (ScrnInfoPtr pScrn, unsigned char *bits);
+ void (*HideCursor) (ScrnInfoPtr pScrn);
+ void (*ShowCursor) (ScrnInfoPtr pScrn);
+ Bool (*ShowCursorCheck) (ScrnInfoPtr pScrn);
+ unsigned char *(*RealizeCursor) (struct _xf86CursorInfoRec *, CursorPtr);
+ Bool (*UseHWCursor) (ScreenPtr, CursorPtr);
+
+ Bool (*UseHWCursorARGB) (ScreenPtr, CursorPtr);
+ void (*LoadCursorARGB) (ScrnInfoPtr, CursorPtr);
+ Bool (*LoadCursorARGBCheck) (ScrnInfoPtr, CursorPtr);
+
+} xf86CursorInfoRec, *xf86CursorInfoPtr;
+
+static inline Bool
+xf86DriverHasLoadCursorImage(xf86CursorInfoPtr infoPtr)
+{
+ return infoPtr->LoadCursorImageCheck || infoPtr->LoadCursorImage;
+}
+
+static inline Bool
+xf86DriverLoadCursorImage(xf86CursorInfoPtr infoPtr, unsigned char *bits)
+{
+ if(infoPtr->LoadCursorImageCheck)
+ return infoPtr->LoadCursorImageCheck(infoPtr->pScrn, bits);
+ infoPtr->LoadCursorImage(infoPtr->pScrn, bits);
+ return TRUE;
+}
+
+static inline Bool
+xf86DriverHasShowCursor(xf86CursorInfoPtr infoPtr)
+{
+ return infoPtr->ShowCursorCheck || infoPtr->ShowCursor;
+}
+
+static inline Bool
+xf86DriverShowCursor(xf86CursorInfoPtr infoPtr)
+{
+ if(infoPtr->ShowCursorCheck)
+ return infoPtr->ShowCursorCheck(infoPtr->pScrn);
+ infoPtr->ShowCursor(infoPtr->pScrn);
+ return TRUE;
+}
+
+static inline Bool
+xf86DriverHasLoadCursorARGB(xf86CursorInfoPtr infoPtr)
+{
+ return infoPtr->LoadCursorARGBCheck || infoPtr->LoadCursorARGB;
+}
+
+static inline Bool
+xf86DriverLoadCursorARGB(xf86CursorInfoPtr infoPtr, CursorPtr pCursor)
+{
+ if(infoPtr->LoadCursorARGBCheck)
+ return infoPtr->LoadCursorARGBCheck(infoPtr->pScrn, pCursor);
+ infoPtr->LoadCursorARGB(infoPtr->pScrn, pCursor);
+ return TRUE;
+}
+
+extern _X_EXPORT Bool xf86InitCursor(ScreenPtr pScreen,
+ xf86CursorInfoPtr infoPtr);
+extern _X_EXPORT xf86CursorInfoPtr xf86CreateCursorInfoRec(void);
+extern _X_EXPORT void xf86DestroyCursorInfoRec(xf86CursorInfoPtr);
+extern _X_EXPORT void xf86CursorResetCursor(ScreenPtr pScreen);
+extern _X_EXPORT void xf86ForceHWCursor(ScreenPtr pScreen, Bool on);
+extern _X_EXPORT CursorPtr xf86CurrentCursor(ScreenPtr pScreen);
+
+#define HARDWARE_CURSOR_INVERT_MASK 0x00000001
+#define HARDWARE_CURSOR_AND_SOURCE_WITH_MASK 0x00000002
+#define HARDWARE_CURSOR_SWAP_SOURCE_AND_MASK 0x00000004
+#define HARDWARE_CURSOR_SOURCE_MASK_NOT_INTERLEAVED 0x00000008
+#define HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_1 0x00000010
+#define HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_8 0x00000020
+#define HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_16 0x00000040
+#define HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_32 0x00000080
+#define HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_64 0x00000100
+#define HARDWARE_CURSOR_TRUECOLOR_AT_8BPP 0x00000200
+#define HARDWARE_CURSOR_BIT_ORDER_MSBFIRST 0x00000400
+#define HARDWARE_CURSOR_NIBBLE_SWAPPED 0x00000800
+#define HARDWARE_CURSOR_SHOW_TRANSPARENT 0x00001000
+#define HARDWARE_CURSOR_UPDATE_UNHIDDEN 0x00002000
+#define HARDWARE_CURSOR_ARGB 0x00004000
+
+#endif /* _XF86CURSOR_H */
diff --git a/prebuilt/xlibre/usr/include/xorg/xf86DDC.h b/prebuilt/xlibre/usr/include/xorg/xf86DDC.h
new file mode 100644
index 0000000..7972a1c
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/xf86DDC.h
@@ -0,0 +1,66 @@
+
+/* xf86DDC.h
+ *
+ * This file contains all information to interpret a standard EDIC block
+ * transmitted by a display device via DDC (Display Data Channel). So far
+ * there is no information to deal with optional EDID blocks.
+ * DDC is a Trademark of VESA (Video Electronics Standard Association).
+ *
+ * Copyright 1998 by Egbert Eich
+ */
+
+#ifndef XF86_DDC_H
+#define XF86_DDC_H
+
+#include "edid.h"
+#include "xf86i2c.h"
+#include "xf86str.h"
+
+/* speed up / slow down */
+typedef enum {
+ DDC_SLOW,
+ DDC_FAST
+} xf86ddcSpeed;
+
+typedef void (*DDC1SetSpeedProc) (ScrnInfoPtr, xf86ddcSpeed);
+
+extern _X_EXPORT xf86MonPtr xf86DoEDID_DDC1(ScrnInfoPtr pScrn,
+ DDC1SetSpeedProc DDC1SetSpeed,
+ unsigned
+ int (*DDC1Read) (ScrnInfoPtr)
+ );
+
+extern _X_EXPORT xf86MonPtr xf86DoEDID_DDC2(ScrnInfoPtr pScrn, I2CBusPtr pBus);
+
+extern _X_EXPORT xf86MonPtr xf86DoEEDID(ScrnInfoPtr pScrn, I2CBusPtr pBus, Bool);
+
+extern _X_EXPORT xf86MonPtr xf86PrintEDID(xf86MonPtr monPtr);
+
+extern _X_EXPORT xf86MonPtr xf86InterpretEDID(int screenIndex, uint8_t * block);
+
+extern _X_EXPORT xf86MonPtr xf86InterpretEEDID(int screenIndex, uint8_t * block);
+
+extern _X_EXPORT Bool xf86SetDDCproperties(ScrnInfoPtr pScreen, xf86MonPtr DDC);
+
+/**
+ * @brief xf86DoInterpretHDRMetadata fill hdr structure using raw edid data
+ * This function is necessary because xf86InterpretEDID have no indication if this whole EDID or not
+ * @param monPtr
+ * @return true if colorimetry & hdr static metadata is found
+ */
+_X_EXPORT bool xf86DoInterpretHDRMetadata(xf86MonPtr monPtr);
+
+/*
+ * parse EDID block and return a newly allocated xf86Monitor
+ *
+ * the data block will be copied into the structure (actually right after the struct)
+ * and thus automatically be freed when the returned struct is freed.
+ *
+ * @param screenIndex index of the screen, will be recorded in the xf86Monitor
+ * @param block the EDID block to parse
+ * @param size size of the EDID block (128 or larger for extended types)
+ * @return newly allocated xf86MonRec or NULL on failure
+ */
+_X_EXPORT xf86MonPtr xf86ParseEDID(ScrnInfoPtr pScreen, uint8_t *block, size_t size);
+
+#endif
diff --git a/prebuilt/xlibre/usr/include/xorg/xf86Modes.h b/prebuilt/xlibre/usr/include/xorg/xf86Modes.h
new file mode 100644
index 0000000..5458918
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/xf86Modes.h
@@ -0,0 +1,117 @@
+/*
+ * Copyright © 2006 Intel Corporation
+ *
+ * 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 (including the next
+ * paragraph) 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 AUTHORS OR COPYRIGHT HOLDERS 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.
+ *
+ * Authors:
+ * Eric Anholt
+ *
+ */
+
+#ifndef _XF86MODES_H_
+#define _XF86MODES_H_
+
+#include
+#include
+#include
+
+#include "xf86.h"
+#include "xorgVersion.h"
+#include "edid.h"
+#include "xf86Parser.h"
+
+extern _X_EXPORT double xf86ModeHSync(const DisplayModeRec * mode);
+extern _X_EXPORT double xf86ModeVRefresh(const DisplayModeRec * mode);
+extern _X_EXPORT unsigned int xf86ModeBandwidth(DisplayModePtr mode, int depth);
+
+extern _X_EXPORT int
+ xf86ModeWidth(const DisplayModeRec * mode, Rotation rotation);
+
+extern _X_EXPORT int
+ xf86ModeHeight(const DisplayModeRec * mode, Rotation rotation);
+
+extern _X_EXPORT DisplayModePtr xf86DuplicateMode(const DisplayModeRec * pMode);
+extern _X_EXPORT DisplayModePtr xf86DuplicateModes(ScrnInfoPtr pScrn,
+ DisplayModePtr modeList);
+extern _X_EXPORT void xf86SetModeDefaultName(DisplayModePtr mode);
+extern _X_EXPORT void xf86SetModeCrtc(DisplayModePtr p, int adjustFlags);
+extern _X_EXPORT Bool xf86ModesEqual(const DisplayModeRec * pMode1,
+ const DisplayModeRec * pMode2);
+extern _X_EXPORT void xf86PrintModeline(int scrnIndex, DisplayModePtr mode);
+extern _X_EXPORT DisplayModePtr xf86ModesAdd(DisplayModePtr modes,
+ DisplayModePtr new);
+
+extern _X_EXPORT DisplayModePtr xf86DDCGetModes(int scrnIndex, xf86MonPtr DDC);
+extern _X_EXPORT DisplayModePtr xf86CVTMode(int HDisplay, int VDisplay,
+ float VRefresh, Bool Reduced,
+ Bool Interlaced);
+extern _X_EXPORT DisplayModePtr xf86GTFMode(int h_pixels, int v_lines,
+ float freq, int interlaced,
+ int margins);
+
+extern _X_EXPORT Bool
+ xf86ModeIsReduced(const DisplayModeRec * mode);
+
+extern _X_EXPORT void
+ xf86ValidateModesFlags(ScrnInfoPtr pScrn, DisplayModePtr modeList, int flags);
+
+extern _X_EXPORT void
+
+xf86ValidateModesClocks(ScrnInfoPtr pScrn, DisplayModePtr modeList,
+ int *min, int *max, int n_ranges);
+
+extern _X_EXPORT void
+
+xf86ValidateModesSize(ScrnInfoPtr pScrn, DisplayModePtr modeList,
+ int maxX, int maxY, int maxPitch);
+
+extern _X_EXPORT void
+ xf86ValidateModesSync(ScrnInfoPtr pScrn, DisplayModePtr modeList, MonPtr mon);
+
+extern _X_EXPORT void
+
+xf86ValidateModesBandwidth(ScrnInfoPtr pScrn, DisplayModePtr modeList,
+ unsigned int bandwidth, int depth);
+
+extern _X_EXPORT void
+ xf86ValidateModesReducedBlanking(ScrnInfoPtr pScrn, DisplayModePtr modeList);
+
+extern _X_EXPORT void
+
+xf86PruneInvalidModes(ScrnInfoPtr pScrn, DisplayModePtr * modeList,
+ Bool verbose);
+
+extern _X_EXPORT DisplayModePtr xf86PruneDuplicateModes(DisplayModePtr modes);
+
+extern _X_EXPORT void
+ xf86ValidateModesUserConfig(ScrnInfoPtr pScrn, DisplayModePtr modeList);
+
+extern _X_EXPORT DisplayModePtr
+xf86GetMonitorModes(ScrnInfoPtr pScrn, XF86ConfMonitorPtr conf_monitor);
+
+extern _X_EXPORT DisplayModePtr xf86GetDefaultModes(void);
+
+extern _X_EXPORT void
+xf86SaveModeContents(DisplayModePtr intern, const DisplayModeRec *mode);
+
+extern _X_EXPORT void
+ xf86DDCApplyQuirks(int scrnIndex, xf86MonPtr DDC);
+
+#endif /* _XF86MODES_H_ */
diff --git a/prebuilt/xlibre/usr/include/xorg/xf86Module.h b/prebuilt/xlibre/usr/include/xorg/xf86Module.h
new file mode 100644
index 0000000..2bd6bdb
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/xf86Module.h
@@ -0,0 +1,240 @@
+/*
+ * Copyright (c) 1997-2003 by The XFree86 Project, 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.
+ *
+ * Except as contained in this notice, the name of the copyright holder(s)
+ * and author(s) shall not be used in advertising or otherwise to promote
+ * the sale, use or other dealings in this Software without prior written
+ * authorization from the copyright holder(s) and author(s).
+ */
+
+/*
+ * This file contains the parts of the loader interface that are visible
+ * to modules. This is the only loader-related header that modules should
+ * include.
+ *
+ * It should include a bare minimum of other headers.
+ *
+ * Longer term, the module/loader code should probably live directly under
+ * Xserver/.
+ *
+ * XXX This file arguably belongs in xfree86/loader/.
+ */
+
+#ifndef _XF86MODULE_H
+#define _XF86MODULE_H
+
+#include
+#include
+#include
+
+#ifndef NULL
+#define NULL ((void *)0)
+#endif
+
+#define DEFAULT_LIST ((char *)-1)
+
+/* Built-in ABI classes. These definitions must not be changed. */
+#define ABI_CLASS_NONE NULL
+#define ABI_CLASS_ANSIC "X.Org ANSI C Emulation"
+#define ABI_CLASS_VIDEODRV "X.Org Video Driver"
+#define ABI_CLASS_XINPUT "X.Org XInput driver"
+#define ABI_CLASS_EXTENSION "X.Org Server Extension"
+
+#define ABI_MINOR_MASK 0x0000FFFF
+#define ABI_MAJOR_MASK 0xFFFF0000
+#define GET_ABI_MINOR(v) ((v) & ABI_MINOR_MASK)
+#define GET_ABI_MAJOR(v) (((v) & ABI_MAJOR_MASK) >> 16)
+#define SET_ABI_VERSION(maj, min) \
+ ((((maj) << 16) & ABI_MAJOR_MASK) | ((min) & ABI_MINOR_MASK))
+
+/*
+ * ABI versions. Each version has a major and minor revision. Modules
+ * using lower minor revisions must work with servers of a higher minor
+ * revision. There is no compatibility between different major revisions.
+ * Whenever the ABI_ANSIC_VERSION is changed, the others must also be
+ * changed. The minor revision mask is 0x0000FFFF and the major revision
+ * mask is 0xFFFF0000.
+ */
+#define ABI_ANSIC_VERSION SET_ABI_VERSION(1, 4)
+
+/* XXX This is a compile-time option that changes abi XXX */
+/* TODO: Remove this toggle in 26.0 */
+#ifdef CONFIG_LEGACY_NVIDIA_PADDING
+#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(28, 1)
+#else
+#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(28, 0)
+#endif
+#define ABI_XINPUT_VERSION SET_ABI_VERSION(26, 0)
+#define ABI_EXTENSION_VERSION SET_ABI_VERSION(11, 0)
+
+/* hack to get both modern and ancient nvidia DDX drivers to work at the same time */
+#define ABI_NVIDIA_VERSION SET_ABI_VERSION(25, 2)
+
+#define MODINFOSTRING1 0xef23fdc5
+#define MODINFOSTRING2 0x10dc023a
+
+#ifndef MODULEVENDORSTRING
+#define MODULEVENDORSTRING "X.Org Foundation"
+#endif
+
+/* Error return codes for errmaj */
+typedef enum {
+ LDR_NOERROR = 0,
+ LDR_NOMEM, /* memory allocation failed */
+ LDR_NOENT, /* Module file does not exist */
+ LDR_NOLOAD, /* type specific loader failed */
+ LDR_ONCEONLY, /* Module should only be loaded once (not an error) */
+ LDR_MISMATCH, /* the module didn't match the spec'd requirements */
+ LDR_BADUSAGE, /* LoadModule is called with bad arguments */
+ LDR_INVALID, /* The module doesn't have a valid ModuleData object */
+ LDR_BADOS, /* The module doesn't support the OS */
+ LDR_MODSPECIFIC /* A module-specific error in the SetupProc */
+} LoaderErrorCode;
+
+/*
+ * Some common module classes. The moduleclass can be used to identify
+ * that modules loaded are of the correct type. This is a finer
+ * classification than the ABI classes even though the default set of
+ * classes have the same names. For example, not all modules that require
+ * the video driver ABI are themselves video drivers.
+ */
+#define MOD_CLASS_NONE NULL
+#define MOD_CLASS_VIDEODRV "X.Org Video Driver"
+#define MOD_CLASS_XINPUT "X.Org XInput Driver"
+#define MOD_CLASS_EXTENSION "X.Org Server Extension"
+
+/* This structure is expected to be returned by the initfunc */
+typedef struct {
+ const char *modname; /* name of module, e.g. "foo" */
+ const char *vendor; /* vendor specific string */
+ CARD32 _modinfo1_; /* constant MODINFOSTRING1/2 to find */
+ CARD32 _modinfo2_; /* infoarea with a binary editor or sign tool */
+ CARD32 xf86version; /* contains XF86_VERSION_CURRENT */
+ CARD8 majorversion; /* module-specific major version */
+ CARD8 minorversion; /* module-specific minor version */
+ CARD16 patchlevel; /* module-specific patch level */
+ const char *abiclass; /* ABI class that the module uses */
+ CARD32 abiversion; /* ABI version */
+ const char *moduleclass; /* module class description */
+ CARD32 checksum[4]; /* contains a digital signature of the */
+ /* version info structure */
+} XF86ModuleVersionInfo;
+
+/*
+ * This structure can be used to callers of LoadModule and LoadSubModule to
+ * specify version and/or ABI requirements.
+ */
+typedef struct {
+ CARD8 majorversion; /* module-specific major version */
+ CARD8 minorversion; /* module-specific minor version */
+ CARD16 patchlevel; /* module-specific patch level */
+ const char *abiclass; /* ABI class that the module uses */
+ CARD32 abiversion; /* ABI version */
+ const char *moduleclass; /* module class */
+} XF86ModReqInfo;
+
+#define MODULE_VERSION_NUMERIC(maj, min, patch) \
+ ((((maj) & 0xFF) << 24) | (((min) & 0xFF) << 16) | ((patch) & 0xFFFF))
+
+/* Prototypes for Loader functions that are exported to modules */
+extern _X_EXPORT void *LoadSubModule(void *, const char *, const char **,
+ const char **, void *,
+ const XF86ModReqInfo *, int *, int *);
+extern _X_EXPORT void *LoaderSymbol(const char *);
+extern _X_EXPORT void *LoaderSymbolFromModule(void *, const char *);
+extern _X_EXPORT void LoaderErrorMsg(const char *, const char *, int, int);
+
+/* deprecated, only kept for backwards compat w/ proprietary NVidia driver */
+extern _X_EXPORT Bool LoaderShouldIgnoreABI(void) _X_DEPRECATED;
+extern _X_EXPORT int LoaderGetABIVersion(const char *abiclass) _X_DEPRECATED;
+
+typedef void *(*ModuleSetupProc) (void *, void *, int *, int *);
+typedef void (*ModuleTearDownProc) (void *);
+
+#define MODULESETUPPROTO(func) void *(func)(void *, void *, int*, int*)
+
+/*
+ * Module information header. Every loadable module needs to export a symbol
+ * of that type, so the loader can call into the module for initialization.
+ * The symbol must be named + "ModuleData".
+ */
+typedef struct {
+ /* must point to structure with version information */
+ XF86ModuleVersionInfo *vers;
+ /* called on module load (if not null) */
+ ModuleSetupProc setup;
+ /* called on module teardown with setup()'s result as parameter (if not null) */
+ ModuleTearDownProc teardown;
+} XF86ModuleData;
+
+/*
+ * declare module version info structure for an input driver module
+ */
+#define XF86_MODULE_VERSION_INPUT(_name, _major, _minor, _patchlevel) \
+ static XF86ModuleVersionInfo modVersion = { \
+ .modname = (_name), \
+ .vendor = MODULEVENDORSTRING, \
+ ._modinfo1_ = MODINFOSTRING1, \
+ ._modinfo2_ = MODINFOSTRING2, \
+ .xf86version = XORG_VERSION_CURRENT, \
+ .majorversion = (_major), \
+ .minorversion = (_minor), \
+ .patchlevel = (_patchlevel), \
+ .abiclass = ABI_CLASS_XINPUT, \
+ .abiversion = ABI_XINPUT_VERSION, \
+ .moduleclass = MOD_CLASS_XINPUT, \
+ };
+
+/*
+ * declare module version info structure for an video driver module
+ */
+#define XF86_MODULE_VERSION_VIDEO(_name, _major, _minor, _patchlevel) \
+ static XF86ModuleVersionInfo modVersion = { \
+ .modname = (_name), \
+ .vendor = MODULEVENDORSTRING, \
+ ._modinfo1_ = MODINFOSTRING1, \
+ ._modinfo2_ = MODINFOSTRING2, \
+ .xf86version = XORG_VERSION_CURRENT, \
+ .majorversion = (_major), \
+ .minorversion = (_minor), \
+ .patchlevel = (_patchlevel), \
+ .abiclass = ABI_CLASS_VIDEODRV, \
+ .abiversion = ABI_VIDEODRV_VERSION, \
+ .moduleclass = MOD_CLASS_VIDEODRV, \
+ };
+
+#define XF86_MODULE_DATA_INPUT(_modname, _setup, _teardown, _name, _major, _minor, _patchlevel) \
+ XF86_MODULE_VERSION_INPUT(_name, _major, _minor, _patchlevel) \
+ _X_EXPORT XF86ModuleData _modname##ModuleData = { \
+ .vers = &modVersion, \
+ .setup = _setup, \
+ .teardown = _teardown, \
+ };
+
+#define XF86_MODULE_DATA_VIDEO(_modname, _setup, _teardown, _name, _major, _minor, _patchlevel) \
+ XF86_MODULE_VERSION_VIDEO(_name, _major, _minor, _patchlevel) \
+ _X_EXPORT XF86ModuleData _modname##ModuleData = { \
+ .vers = &modVersion, \
+ .setup = _setup, \
+ .teardown = _teardown, \
+ };
+
+#endif /* _XF86MODULE_H */
diff --git a/prebuilt/xlibre/usr/include/xorg/xf86Opt.h b/prebuilt/xlibre/usr/include/xorg/xf86Opt.h
new file mode 100644
index 0000000..b9087e2
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/xf86Opt.h
@@ -0,0 +1,145 @@
+/*
+ * Copyright (c) 1998-2003 by The XFree86 Project, 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.
+ *
+ * Except as contained in this notice, the name of the copyright holder(s)
+ * and author(s) shall not be used in advertising or otherwise to promote
+ * the sale, use or other dealings in this Software without prior written
+ * authorization from the copyright holder(s) and author(s).
+ */
+
+/* Option handling things that ModuleSetup procs can use */
+
+#ifndef _XF86_OPT_H_
+#define _XF86_OPT_H_
+
+#include
+#include
+
+#include "xf86Optionstr.h"
+
+typedef struct {
+ double freq;
+ int units;
+} OptFrequency;
+
+typedef union {
+ unsigned long num;
+ const char *str;
+ double realnum;
+ Bool boolean;
+ OptFrequency freq;
+} ValueUnion;
+
+typedef enum {
+ OPTV_NONE = 0,
+ OPTV_INTEGER,
+ OPTV_STRING, /* a non-empty string */
+ OPTV_ANYSTR, /* Any string, including an empty one */
+ OPTV_REAL,
+ OPTV_BOOLEAN,
+ OPTV_PERCENT,
+ OPTV_FREQ
+} OptionValueType;
+
+typedef enum {
+ OPTUNITS_HZ = 1,
+ OPTUNITS_KHZ,
+ OPTUNITS_MHZ
+} OptFreqUnits;
+
+typedef struct {
+ int token;
+ const char *name;
+ OptionValueType type;
+ ValueUnion value;
+ Bool found;
+} OptionInfoRec, *OptionInfoPtr;
+
+extern _X_EXPORT int xf86SetIntOption(XF86OptionPtr optlist, const char *name,
+ int deflt);
+extern _X_EXPORT double xf86SetRealOption(XF86OptionPtr optlist,
+ const char *name, double deflt);
+extern _X_EXPORT char *xf86SetStrOption(XF86OptionPtr optlist, const char *name,
+ const char *deflt);
+extern _X_EXPORT int xf86SetBoolOption(XF86OptionPtr list, const char *name,
+ int deflt);
+extern _X_EXPORT double xf86SetPercentOption(XF86OptionPtr list,
+ const char *name, double deflt);
+extern _X_EXPORT int xf86CheckIntOption(XF86OptionPtr optlist, const char *name,
+ int deflt);
+extern _X_EXPORT char *xf86CheckStrOption(XF86OptionPtr optlist,
+ const char *name, const char *deflt);
+extern _X_EXPORT int xf86CheckBoolOption(XF86OptionPtr list, const char *name,
+ int deflt);
+extern _X_EXPORT double xf86CheckPercentOption(XF86OptionPtr list,
+ const char *name, double deflt);
+extern _X_EXPORT XF86OptionPtr xf86AddNewOption(XF86OptionPtr head,
+ const char *name,
+ const char *val);
+extern _X_EXPORT XF86OptionPtr xf86NextOption(XF86OptionPtr list);
+extern _X_EXPORT XF86OptionPtr xf86OptionListCreate(const char **options,
+ int count, int used);
+extern _X_EXPORT XF86OptionPtr xf86OptionListMerge(XF86OptionPtr head,
+ XF86OptionPtr tail);
+extern _X_EXPORT XF86OptionPtr xf86OptionListDuplicate(XF86OptionPtr list);
+extern _X_EXPORT void xf86OptionListFree(XF86OptionPtr opt);
+extern _X_EXPORT char *xf86OptionName(XF86OptionPtr opt);
+extern _X_EXPORT char *xf86OptionValue(XF86OptionPtr opt);
+extern _X_EXPORT XF86OptionPtr xf86FindOption(XF86OptionPtr options,
+ const char *name);
+extern _X_EXPORT const char *xf86FindOptionValue(XF86OptionPtr options,
+ const char *name);
+extern _X_EXPORT void xf86MarkOptionUsedByName(XF86OptionPtr options,
+ const char *name);
+extern _X_EXPORT void xf86ShowUnusedOptions(int scrnIndex,
+ XF86OptionPtr options);
+extern _X_EXPORT void xf86ProcessOptions(int scrnIndex, XF86OptionPtr options,
+ OptionInfoPtr optinfo);
+extern _X_EXPORT OptionInfoPtr xf86TokenToOptinfo(const OptionInfoRec * table,
+ int token);
+extern _X_EXPORT const char *xf86TokenToOptName(const OptionInfoRec * table,
+ int token);
+extern _X_EXPORT Bool xf86IsOptionSet(const OptionInfoRec * table, int token);
+extern _X_EXPORT const char *xf86GetOptValString(const OptionInfoRec * table,
+ int token);
+extern _X_EXPORT Bool xf86GetOptValInteger(const OptionInfoRec * table,
+ int token, int *value);
+extern _X_EXPORT Bool xf86GetOptValULong(const OptionInfoRec * table, int token,
+ unsigned long *value);
+extern _X_EXPORT Bool xf86GetOptValFreq(const OptionInfoRec * table, int token,
+ OptFreqUnits expectedUnits,
+ double *value);
+extern _X_EXPORT Bool xf86GetOptValBool(const OptionInfoRec * table, int token,
+ Bool *value);
+extern _X_EXPORT Bool xf86ReturnOptValBool(const OptionInfoRec * table,
+ int token, Bool def);
+extern _X_EXPORT int xf86NameCmp(const char *s1, const char *s2);
+extern _X_EXPORT char *xf86NormalizeName(const char *s);
+extern _X_EXPORT XF86OptionPtr xf86ReplaceIntOption(XF86OptionPtr optlist,
+ const char *name,
+ const int val);
+extern _X_EXPORT XF86OptionPtr xf86ReplaceBoolOption(XF86OptionPtr optlist,
+ const char *name,
+ const Bool val);
+extern _X_EXPORT XF86OptionPtr xf86ReplaceStrOption(XF86OptionPtr optlist,
+ const char *name,
+ const char *val);
+#endif
diff --git a/prebuilt/xlibre/usr/include/xorg/xf86Optionstr.h b/prebuilt/xlibre/usr/include/xorg/xf86Optionstr.h
new file mode 100644
index 0000000..4ef917d
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/xf86Optionstr.h
@@ -0,0 +1,42 @@
+/*
+ * Copyright © 2011 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 (including the next
+ * paragraph) 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 AUTHORS OR COPYRIGHT HOLDERS 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 XF86OPTIONSTR_H
+#define XF86OPTIONSTR_H
+#include "list.h"
+
+/*
+ * All options are stored using this data type.
+ */
+typedef struct _XF86OptionRec {
+ GenericListRec list;
+ const char *opt_name;
+ const char *opt_val;
+ int opt_used;
+ const char *opt_comment;
+} XF86OptionRec;
+
+typedef struct _InputOption *XF86OptionPtr;
+
+#endif
diff --git a/prebuilt/xlibre/usr/include/xorg/xf86Optrec.h b/prebuilt/xlibre/usr/include/xorg/xf86Optrec.h
new file mode 100644
index 0000000..8447d7d
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/xf86Optrec.h
@@ -0,0 +1,90 @@
+/*
+ *
+ * Copyright (c) 1997 Metro Link Incorporated
+ *
+ * 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 X CONSORTIUM 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.
+ *
+ * Except as contained in this notice, the name of the Metro Link shall not be
+ * used in advertising or otherwise to promote the sale, use or other dealings
+ * in this Software without prior written authorization from Metro Link.
+ *
+ */
+/*
+ * Copyright (c) 1997-2001 by The XFree86 Project, 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.
+ *
+ * Except as contained in this notice, the name of the copyright holder(s)
+ * and author(s) shall not be used in advertising or otherwise to promote
+ * the sale, use or other dealings in this Software without prior written
+ * authorization from the copyright holder(s) and author(s).
+ */
+
+/*
+ * This file contains the Option Record that is passed between the Parser,
+ * and Module setup procs.
+ */
+#ifndef _xf86Optrec_h_
+#define _xf86Optrec_h_
+
+#include
+#include
+#include "xf86Optionstr.h"
+
+#include
+
+extern _X_EXPORT XF86OptionPtr xf86addNewOption(XF86OptionPtr head, char *name,
+ char *val);
+extern _X_EXPORT XF86OptionPtr xf86optionListDup(XF86OptionPtr opt);
+extern _X_EXPORT void xf86optionListFree(XF86OptionPtr opt);
+extern _X_EXPORT char *xf86optionName(XF86OptionPtr opt);
+extern _X_EXPORT char *xf86optionValue(XF86OptionPtr opt);
+extern _X_EXPORT XF86OptionPtr xf86newOption(char *name, char *value);
+extern _X_EXPORT XF86OptionPtr xf86nextOption(XF86OptionPtr list);
+extern _X_EXPORT XF86OptionPtr xf86findOption(XF86OptionPtr list,
+ const char *name);
+extern _X_EXPORT const char *xf86findOptionValue(XF86OptionPtr list,
+ const char *name);
+extern _X_EXPORT XF86OptionPtr xf86optionListCreate(const char **options,
+ int count, int used);
+extern _X_EXPORT XF86OptionPtr xf86optionListMerge(XF86OptionPtr head,
+ XF86OptionPtr tail);
+extern _X_EXPORT int xf86nameCompare(const char *s1, const char *s2);
+extern _X_EXPORT char *xf86uLongToString(unsigned long i);
+extern _X_EXPORT XF86OptionPtr xf86parseOption(XF86OptionPtr head);
+extern _X_EXPORT void xf86printOptionList(FILE * fp, XF86OptionPtr list,
+ int tabs);
+
+#endif /* _xf86Optrec_h_ */
diff --git a/prebuilt/xlibre/usr/include/xorg/xf86Parser.h b/prebuilt/xlibre/usr/include/xorg/xf86Parser.h
new file mode 100644
index 0000000..b4c33a3
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/xf86Parser.h
@@ -0,0 +1,487 @@
+/*
+ *
+ * Copyright (c) 1997 Metro Link Incorporated
+ *
+ * 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 X CONSORTIUM 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.
+ *
+ * Except as contained in this notice, the name of the Metro Link shall not be
+ * used in advertising or otherwise to promote the sale, use or other dealings
+ * in this Software without prior written authorization from Metro Link.
+ *
+ */
+/*
+ * Copyright (c) 1997-2003 by The XFree86 Project, 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.
+ *
+ * Except as contained in this notice, the name of the copyright holder(s)
+ * and author(s) shall not be used in advertising or otherwise to promote
+ * the sale, use or other dealings in this Software without prior written
+ * authorization from the copyright holder(s) and author(s).
+ */
+
+/*
+ * This file contains the external interfaces for the XFree86 configuration
+ * file parser.
+ */
+#ifndef _xf86Parser_h_
+#define _xf86Parser_h_
+
+#include
+#include "xf86Optrec.h"
+#include "list.h"
+
+#include
+#include
+
+#define HAVE_PARSER_DECLS
+
+typedef struct {
+ char *file_logfile;
+ char *file_modulepath;
+ char *file_fontpath;
+ char *file_comment;
+ char *file_xkbdir;
+} XF86ConfFilesRec, *XF86ConfFilesPtr;
+
+/* Values for load_type */
+#define XF86_LOAD_MODULE 0
+#define XF86_LOAD_DRIVER 1
+#define XF86_DISABLE_MODULE 2
+
+typedef struct {
+ GenericListRec list;
+ int load_type;
+ const char *load_name;
+ XF86OptionPtr load_opt;
+ char *load_comment;
+ int ignore;
+} XF86LoadRec, *XF86LoadPtr;
+
+typedef struct {
+ XF86LoadPtr mod_load_lst;
+ XF86LoadPtr mod_disable_lst;
+ char *mod_comment;
+} XF86ConfModuleRec, *XF86ConfModulePtr;
+
+#define CONF_IMPLICIT_KEYBOARD "Implicit Core Keyboard"
+
+#define CONF_IMPLICIT_POINTER "Implicit Core Pointer"
+
+#define XF86CONF_PHSYNC 0x0001
+#define XF86CONF_NHSYNC 0x0002
+#define XF86CONF_PVSYNC 0x0004
+#define XF86CONF_NVSYNC 0x0008
+#define XF86CONF_INTERLACE 0x0010
+#define XF86CONF_DBLSCAN 0x0020
+#define XF86CONF_CSYNC 0x0040
+#define XF86CONF_PCSYNC 0x0080
+#define XF86CONF_NCSYNC 0x0100
+#define XF86CONF_HSKEW 0x0200 /* hskew provided */
+#define XF86CONF_BCAST 0x0400
+#define XF86CONF_VSCAN 0x1000
+
+typedef struct {
+ GenericListRec list;
+ const char *ml_identifier;
+ int ml_clock;
+ int ml_hdisplay;
+ int ml_hsyncstart;
+ int ml_hsyncend;
+ int ml_htotal;
+ int ml_vdisplay;
+ int ml_vsyncstart;
+ int ml_vsyncend;
+ int ml_vtotal;
+ int ml_vscan;
+ int ml_flags;
+ int ml_hskew;
+ char *ml_comment;
+} XF86ConfModeLineRec, *XF86ConfModeLinePtr;
+
+typedef struct {
+ GenericListRec list;
+ const char *vp_identifier;
+ XF86OptionPtr vp_option_lst;
+ char *vp_comment;
+} XF86ConfVideoPortRec, *XF86ConfVideoPortPtr;
+
+typedef struct {
+ GenericListRec list;
+ const char *va_identifier;
+ const char *va_vendor;
+ const char *va_board;
+ const char *va_busid;
+ const char *va_driver;
+ XF86OptionPtr va_option_lst;
+ XF86ConfVideoPortPtr va_port_lst;
+ const char *va_fwdref;
+ char *va_comment;
+} XF86ConfVideoAdaptorRec, *XF86ConfVideoAdaptorPtr;
+
+#define CONF_MAX_HSYNC 8
+#define CONF_MAX_VREFRESH 8
+
+typedef struct {
+ float hi, lo;
+} parser_range;
+
+typedef struct {
+ int red, green, blue;
+} parser_rgb;
+
+typedef struct {
+ GenericListRec list;
+ const char *modes_identifier;
+ XF86ConfModeLinePtr mon_modeline_lst;
+ char *modes_comment;
+} XF86ConfModesRec, *XF86ConfModesPtr;
+
+typedef struct {
+ GenericListRec list;
+ const char *ml_modes_str;
+ XF86ConfModesPtr ml_modes;
+} XF86ConfModesLinkRec, *XF86ConfModesLinkPtr;
+
+typedef struct {
+ GenericListRec list;
+ const char *mon_identifier;
+ const char *mon_vendor;
+ char *mon_modelname;
+ int mon_width; /* in mm */
+ int mon_height; /* in mm */
+ XF86ConfModeLinePtr mon_modeline_lst;
+ int mon_n_hsync;
+ parser_range mon_hsync[CONF_MAX_HSYNC];
+ int mon_n_vrefresh;
+ parser_range mon_vrefresh[CONF_MAX_VREFRESH];
+ float mon_gamma_red;
+ float mon_gamma_green;
+ float mon_gamma_blue;
+ XF86OptionPtr mon_option_lst;
+ XF86ConfModesLinkPtr mon_modes_sect_lst;
+ char *mon_comment;
+} XF86ConfMonitorRec, *XF86ConfMonitorPtr;
+
+#define CONF_MAXDACSPEEDS 4
+#define CONF_MAXCLOCKS 128
+
+typedef struct {
+ GenericListRec list;
+ const char *dev_identifier;
+ const char *dev_vendor;
+ const char *dev_board;
+ const char *dev_chipset;
+ const char *dev_busid;
+ const char *dev_card;
+ const char *dev_driver;
+ const char *dev_ramdac;
+ int dev_dacSpeeds[CONF_MAXDACSPEEDS];
+ int dev_videoram;
+ unsigned long dev_mem_base;
+ unsigned long dev_io_base;
+ const char *dev_clockchip;
+ int dev_clocks;
+ int dev_clock[CONF_MAXCLOCKS];
+ int dev_chipid;
+ int dev_chiprev;
+ int dev_irq;
+ int dev_screen;
+ XF86OptionPtr dev_option_lst;
+ char *dev_comment;
+ char *match_seat;
+} XF86ConfDeviceRec, *XF86ConfDevicePtr;
+
+typedef struct {
+ GenericListRec list;
+ const char *mode_name;
+} XF86ModeRec, *XF86ModePtr;
+
+typedef struct {
+ GenericListRec list;
+ int disp_frameX0;
+ int disp_frameY0;
+ int disp_virtualX;
+ int disp_virtualY;
+ int disp_depth;
+ int disp_bpp;
+ const char *disp_visual;
+ parser_rgb disp_weight;
+ parser_rgb disp_black;
+ parser_rgb disp_white;
+ XF86ModePtr disp_mode_lst;
+ XF86OptionPtr disp_option_lst;
+ char *disp_comment;
+} XF86ConfDisplayRec, *XF86ConfDisplayPtr;
+
+typedef struct {
+ XF86OptionPtr flg_option_lst;
+ char *flg_comment;
+} XF86ConfFlagsRec, *XF86ConfFlagsPtr;
+
+typedef struct {
+ GenericListRec list;
+ const char *al_adaptor_str;
+ XF86ConfVideoAdaptorPtr al_adaptor;
+} XF86ConfAdaptorLinkRec, *XF86ConfAdaptorLinkPtr;
+
+#define CONF_MAXGPUDEVICES 4
+typedef struct {
+ GenericListRec list;
+ const char *scrn_identifier;
+ const char *scrn_obso_driver;
+ int scrn_defaultdepth;
+ int scrn_defaultbpp;
+ int scrn_defaultfbbpp;
+ const char *scrn_monitor_str;
+ XF86ConfMonitorPtr scrn_monitor;
+ const char *scrn_device_str;
+ XF86ConfDevicePtr scrn_device;
+ XF86ConfAdaptorLinkPtr scrn_adaptor_lst;
+ XF86ConfDisplayPtr scrn_display_lst;
+ XF86OptionPtr scrn_option_lst;
+ char *scrn_comment;
+ int scrn_virtualX, scrn_virtualY;
+ char *match_seat;
+
+ int num_gpu_devices;
+ const char *scrn_gpu_device_str[CONF_MAXGPUDEVICES];
+ XF86ConfDevicePtr scrn_gpu_devices[CONF_MAXGPUDEVICES];
+} XF86ConfScreenRec, *XF86ConfScreenPtr;
+
+typedef struct {
+ GenericListRec list;
+ char *inp_identifier;
+ char *inp_driver;
+ XF86OptionPtr inp_option_lst;
+ char *inp_comment;
+} XF86ConfInputRec, *XF86ConfInputPtr;
+
+typedef struct {
+ GenericListRec list;
+ XF86ConfInputPtr iref_inputdev;
+ char *iref_inputdev_str;
+ XF86OptionPtr iref_option_lst;
+} XF86ConfInputrefRec, *XF86ConfInputrefPtr;
+
+typedef struct {
+ Bool set;
+ Bool val;
+} xf86TriState;
+
+typedef struct {
+ struct xorg_list entry;
+ struct xorg_list patterns;
+ Bool is_negated;
+} xf86MatchGroup;
+
+typedef enum {
+ MATCH_IS_INVALID,
+ MATCH_EXACT,
+ MATCH_EXACT_NOCASE,
+ MATCH_AS_SUBSTRING,
+ MATCH_AS_SUBSTRING_NOCASE,
+ MATCH_AS_FILENAME,
+ MATCH_AS_PATHNAME,
+ MATCH_SUBSTRINGS_SEQUENCE,
+ MATCH_REGEX
+} xf86MatchMode;
+
+typedef struct {
+ struct xorg_list entry;
+ xf86MatchMode mode;
+ Bool is_negated;
+ char *str;
+ regex_t *regex;
+} xf86MatchPattern;
+
+typedef struct {
+ GenericListRec list;
+ char *identifier;
+ char *driver;
+ struct xorg_list match_product;
+ struct xorg_list match_vendor;
+ struct xorg_list match_device;
+ struct xorg_list match_os;
+ struct xorg_list match_pnpid;
+ struct xorg_list match_usbid;
+ struct xorg_list match_driver;
+ struct xorg_list match_tag;
+ struct xorg_list match_layout;
+ xf86TriState is_keyboard;
+ xf86TriState is_pointer;
+ xf86TriState is_joystick;
+ xf86TriState is_tablet;
+ xf86TriState is_tablet_pad;
+ xf86TriState is_touchpad;
+ xf86TriState is_touchscreen;
+ XF86OptionPtr option_lst;
+ char *comment;
+} XF86ConfInputClassRec, *XF86ConfInputClassPtr;
+
+typedef struct {
+ GenericListRec list;
+ char *identifier;
+ char *driver;
+ char *modules;
+ char *modulepath;
+ struct xorg_list match_driver;
+ struct xorg_list match_layout;
+ XF86OptionPtr option_lst;
+ char *comment;
+} XF86ConfOutputClassRec, *XF86ConfOutputClassPtr;
+
+/* Values for adj_where */
+#define CONF_ADJ_OBSOLETE -1
+#define CONF_ADJ_ABSOLUTE 0
+#define CONF_ADJ_RIGHTOF 1
+#define CONF_ADJ_LEFTOF 2
+#define CONF_ADJ_ABOVE 3
+#define CONF_ADJ_BELOW 4
+#define CONF_ADJ_RELATIVE 5
+
+typedef struct {
+ GenericListRec list;
+ int adj_scrnum;
+ XF86ConfScreenPtr adj_screen;
+ const char *adj_screen_str;
+ XF86ConfScreenPtr adj_top;
+ const char *adj_top_str;
+ XF86ConfScreenPtr adj_bottom;
+ const char *adj_bottom_str;
+ XF86ConfScreenPtr adj_left;
+ const char *adj_left_str;
+ XF86ConfScreenPtr adj_right;
+ const char *adj_right_str;
+ int adj_where;
+ int adj_x;
+ int adj_y;
+ const char *adj_refscreen;
+} XF86ConfAdjacencyRec, *XF86ConfAdjacencyPtr;
+
+typedef struct {
+ GenericListRec list;
+ const char *inactive_device_str;
+ XF86ConfDevicePtr inactive_device;
+} XF86ConfInactiveRec, *XF86ConfInactivePtr;
+
+typedef struct {
+ GenericListRec list;
+ const char *lay_identifier;
+ XF86ConfAdjacencyPtr lay_adjacency_lst;
+ XF86ConfInactivePtr lay_inactive_lst;
+ XF86ConfInputrefPtr lay_input_lst;
+ XF86OptionPtr lay_option_lst;
+ char *match_seat;
+ char *lay_comment;
+} XF86ConfLayoutRec, *XF86ConfLayoutPtr;
+
+typedef struct {
+ GenericListRec list;
+ const char *vs_name;
+ const char *vs_identifier;
+ XF86OptionPtr vs_option_lst;
+ char *vs_comment;
+} XF86ConfVendSubRec, *XF86ConfVendSubPtr;
+
+typedef struct {
+ GenericListRec list;
+ const char *vnd_identifier;
+ XF86OptionPtr vnd_option_lst;
+ XF86ConfVendSubPtr vnd_sub_lst;
+ char *vnd_comment;
+} XF86ConfVendorRec, *XF86ConfVendorPtr;
+
+typedef struct {
+ XF86OptionPtr ext_option_lst;
+ char *extensions_comment;
+} XF86ConfExtensionsRec, *XF86ConfExtensionsPtr;
+
+typedef struct {
+ XF86ConfFilesPtr conf_files;
+ XF86ConfModulePtr conf_modules;
+ XF86ConfFlagsPtr conf_flags;
+ XF86ConfVideoAdaptorPtr conf_videoadaptor_lst;
+ XF86ConfModesPtr conf_modes_lst;
+ XF86ConfMonitorPtr conf_monitor_lst;
+ XF86ConfDevicePtr conf_device_lst;
+ XF86ConfScreenPtr conf_screen_lst;
+ XF86ConfInputPtr conf_input_lst;
+ XF86ConfInputClassPtr conf_inputclass_lst;
+ XF86ConfOutputClassPtr conf_outputclass_lst;
+ XF86ConfLayoutPtr conf_layout_lst;
+ XF86ConfVendorPtr conf_vendor_lst;
+ void *padding0;
+ XF86ConfExtensionsPtr conf_extensions;
+ char *conf_comment;
+} XF86ConfigRec, *XF86ConfigPtr;
+
+typedef struct {
+ int token; /* id of the token */
+ const char *name; /* pointer to the LOWERCASED name */
+} xf86ConfigSymTabRec, *xf86ConfigSymTabPtr;
+
+/*
+ * prototypes for public functions
+ */
+extern _X_EXPORT XF86ConfDevicePtr xf86findDevice(const char *ident,
+ XF86ConfDevicePtr p);
+extern _X_EXPORT XF86ConfLayoutPtr xf86findLayout(const char *name,
+ XF86ConfLayoutPtr list);
+extern _X_EXPORT XF86ConfMonitorPtr xf86findMonitor(const char *ident,
+ XF86ConfMonitorPtr p);
+extern _X_EXPORT XF86ConfModesPtr xf86findModes(const char *ident,
+ XF86ConfModesPtr p);
+extern _X_EXPORT XF86ConfModeLinePtr xf86findModeLine(const char *ident,
+ XF86ConfModeLinePtr p);
+extern _X_EXPORT XF86ConfScreenPtr xf86findScreen(const char *ident,
+ XF86ConfScreenPtr p);
+extern _X_EXPORT XF86ConfInputPtr xf86findInput(const char *ident,
+ XF86ConfInputPtr p);
+extern _X_EXPORT XF86ConfInputPtr xf86findInputByDriver(const char *driver,
+ XF86ConfInputPtr p);
+extern _X_EXPORT XF86ConfVideoAdaptorPtr xf86findVideoAdaptor(const char *ident,
+ XF86ConfVideoAdaptorPtr
+ p);
+extern _X_EXPORT GenericListPtr xf86addListItem(GenericListPtr head,
+ GenericListPtr c_new);
+extern _X_EXPORT int xf86itemNotSublist(GenericListPtr list_1,
+ GenericListPtr list_2);
+extern _X_EXPORT int xf86pathIsAbsolute(const char *path);
+extern _X_EXPORT int xf86pathIsSafe(const char *path);
+extern _X_EXPORT char *xf86addComment(char *cur, const char *add);
+extern _X_EXPORT Bool xf86getBoolValue(Bool *val, const char *str);
+
+#endif /* _xf86Parser_h_ */
diff --git a/prebuilt/xlibre/usr/include/xorg/xf86Pci.h b/prebuilt/xlibre/usr/include/xorg/xf86Pci.h
new file mode 100644
index 0000000..6b31616
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/xf86Pci.h
@@ -0,0 +1,234 @@
+/*
+ * Copyright 1998 by Concurrent Computer Corporation
+ *
+ * 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 Concurrent Computer
+ * Corporation not be used in advertising or publicity pertaining to
+ * distribution of the software without specific, written prior
+ * permission. Concurrent Computer Corporation makes no representations
+ * about the suitability of this software for any purpose. It is
+ * provided "as is" without express or implied warranty.
+ *
+ * CONCURRENT COMPUTER CORPORATION DISCLAIMS ALL WARRANTIES WITH REGARD
+ * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS, IN NO EVENT SHALL CONCURRENT COMPUTER CORPORATION 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.
+ *
+ * Copyright 1998 by Metro Link Incorporated
+ *
+ * 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 Metro Link
+ * Incorporated not be used in advertising or publicity pertaining to
+ * distribution of the software without specific, written prior
+ * permission. Metro Link Incorporated makes no representations
+ * about the suitability of this software for any purpose. It is
+ * provided "as is" without express or implied warranty.
+ *
+ * METRO LINK INCORPORATED DISCLAIMS ALL WARRANTIES WITH REGARD
+ * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS, IN NO EVENT SHALL METRO LINK INCORPORATED 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.
+ *
+ * This file is derived in part from the original xf86_PCI.h that included
+ * following copyright message:
+ *
+ * Copyright 1995 by Robin Cutshaw
+ *
+ * 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 names of the above listed copyright holder(s)
+ * not be used in advertising or publicity pertaining to distribution of
+ * the software without specific, written prior permission. The above listed
+ * copyright holder(s) make(s) no representations about the suitability of this
+ * software for any purpose. It is provided "as is" without express or
+ * implied warranty.
+ *
+ * THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM(S) ALL WARRANTIES WITH REGARD
+ * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) 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.
+ *
+ */
+/*
+ * Copyright (c) 1999-2003 by The XFree86 Project, 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.
+ *
+ * Except as contained in this notice, the name of the copyright holder(s)
+ * and author(s) shall not be used in advertising or otherwise to promote
+ * the sale, use or other dealings in this Software without prior written
+ * authorization from the copyright holder(s) and author(s).
+ */
+
+/*
+ * This file contains just the public interface to the PCI code.
+ * Drivers should use this file rather than Pci.h.
+ */
+
+#ifndef _XF86PCI_H
+#define _XF86PCI_H 1
+#include
+#include
+#include "misc.h"
+#include
+
+/*
+ * PCI cfg space definitions (e.g. stuff right out of the PCI spec)
+ */
+
+/* Device identification register */
+#define PCI_ID_REG 0x00
+
+/* Command and status register */
+#define PCI_CMD_STAT_REG 0x04
+#define PCI_CMD_BASE_REG 0x10
+#define PCI_CMD_BIOS_REG 0x30
+#define PCI_CMD_MASK 0xffff
+#define PCI_CMD_IO_ENABLE 0x01
+#define PCI_CMD_MEM_ENABLE 0x02
+#define PCI_CMD_MASTER_ENABLE 0x04
+#define PCI_CMD_SPECIAL_ENABLE 0x08
+#define PCI_CMD_INVALIDATE_ENABLE 0x10
+#define PCI_CMD_PALETTE_ENABLE 0x20
+#define PCI_CMD_PARITY_ENABLE 0x40
+#define PCI_CMD_STEPPING_ENABLE 0x80
+#define PCI_CMD_SERR_ENABLE 0x100
+#define PCI_CMD_BACKTOBACK_ENABLE 0x200
+#define PCI_CMD_BIOS_ENABLE 0x01
+
+/* base class */
+#define PCI_CLASS_REG 0x08
+#define PCI_CLASS_MASK 0xff000000
+#define PCI_CLASS_SHIFT 24
+#define PCI_CLASS_EXTRACT(x) \
+ (((x) & PCI_CLASS_MASK) >> PCI_CLASS_SHIFT)
+
+/* base class values */
+#define PCI_CLASS_PREHISTORIC 0x00
+#define PCI_CLASS_MASS_STORAGE 0x01
+#define PCI_CLASS_NETWORK 0x02
+#define PCI_CLASS_DISPLAY 0x03
+#define PCI_CLASS_MULTIMEDIA 0x04
+#define PCI_CLASS_MEMORY 0x05
+#define PCI_CLASS_BRIDGE 0x06
+#define PCI_CLASS_COMMUNICATIONS 0x07
+#define PCI_CLASS_SYSPERIPH 0x08
+#define PCI_CLASS_INPUT 0x09
+#define PCI_CLASS_DOCKING 0x0a
+#define PCI_CLASS_PROCESSOR 0x0b
+#define PCI_CLASS_SERIALBUS 0x0c
+#define PCI_CLASS_WIRELESS 0x0d
+#define PCI_CLASS_I2O 0x0e
+#define PCI_CLASS_SATELLITE 0x0f
+#define PCI_CLASS_CRYPT 0x10
+#define PCI_CLASS_DATA_ACQUISITION 0x11
+#define PCI_CLASS_UNDEFINED 0xff
+
+/* sub class */
+#define PCI_SUBCLASS_MASK 0x00ff0000
+#define PCI_SUBCLASS_SHIFT 16
+#define PCI_SUBCLASS_EXTRACT(x) \
+ (((x) & PCI_SUBCLASS_MASK) >> PCI_SUBCLASS_SHIFT)
+
+/* Sub class values */
+/* 0x00 prehistoric subclasses */
+#define PCI_SUBCLASS_PREHISTORIC_MISC 0x00
+#define PCI_SUBCLASS_PREHISTORIC_VGA 0x01
+
+/* 0x03 display subclasses */
+#define PCI_SUBCLASS_DISPLAY_VGA 0x00
+#define PCI_SUBCLASS_DISPLAY_XGA 0x01
+#define PCI_SUBCLASS_DISPLAY_MISC 0x80
+
+/* 0x04 multimedia subclasses */
+#define PCI_SUBCLASS_MULTIMEDIA_VIDEO 0x00
+#define PCI_SUBCLASS_MULTIMEDIA_AUDIO 0x01
+#define PCI_SUBCLASS_MULTIMEDIA_MISC 0x80
+
+/* 0x06 bridge subclasses */
+#define PCI_SUBCLASS_BRIDGE_HOST 0x00
+#define PCI_SUBCLASS_BRIDGE_ISA 0x01
+#define PCI_SUBCLASS_BRIDGE_EISA 0x02
+#define PCI_SUBCLASS_BRIDGE_MC 0x03
+#define PCI_SUBCLASS_BRIDGE_PCI 0x04
+#define PCI_SUBCLASS_BRIDGE_PCMCIA 0x05
+#define PCI_SUBCLASS_BRIDGE_NUBUS 0x06
+#define PCI_SUBCLASS_BRIDGE_CARDBUS 0x07
+#define PCI_SUBCLASS_BRIDGE_RACEWAY 0x08
+#define PCI_SUBCLASS_BRIDGE_MISC 0x80
+#define PCI_IF_BRIDGE_PCI_SUBTRACTIVE 0x01
+
+/* 0x0b processor subclasses */
+#define PCI_SUBCLASS_PROCESSOR_386 0x00
+#define PCI_SUBCLASS_PROCESSOR_486 0x01
+#define PCI_SUBCLASS_PROCESSOR_PENTIUM 0x02
+#define PCI_SUBCLASS_PROCESSOR_ALPHA 0x10
+#define PCI_SUBCLASS_PROCESSOR_POWERPC 0x20
+#define PCI_SUBCLASS_PROCESSOR_MIPS 0x30
+#define PCI_SUBCLASS_PROCESSOR_COPROC 0x40
+
+/* PCI-PCI bridge mapping registers */
+#define PCI_PCI_BRIDGE_BUS_REG 0x18
+#define PCI_SUBORDINATE_BUS_MASK 0x00ff0000
+#define PCI_SECONDARY_BUS_MASK 0x0000ff00
+#define PCI_PRIMARY_BUS_MASK 0x000000ff
+
+#define PCI_PCI_BRIDGE_IO_REG 0x1c
+#define PCI_PCI_BRIDGE_MEM_REG 0x20
+#define PCI_PCI_BRIDGE_PMEM_REG 0x24
+
+#define PCI_PCI_BRIDGE_CONTROL_REG 0x3E
+#define PCI_PCI_BRIDGE_PARITY_EN 0x01
+#define PCI_PCI_BRIDGE_SERR_EN 0x02
+#define PCI_PCI_BRIDGE_ISA_EN 0x04
+#define PCI_PCI_BRIDGE_VGA_EN 0x08
+#define PCI_PCI_BRIDGE_MASTER_ABORT_EN 0x20
+#define PCI_PCI_BRIDGE_SECONDARY_RESET 0x40
+#define PCI_PCI_BRIDGE_FAST_B2B_EN 0x80
+
+/* Subsystem identification register */
+#define PCI_SUBSYSTEM_ID_REG 0x2c
+
+/* User defined cfg space regs */
+#define PCI_REG_USERCONFIG 0x40
+#define PCI_OPTION_REG 0x40
+
+/* Public PCI access functions */
+extern _X_EXPORT char *DRICreatePCIBusID(const struct pci_device *dev);
+
+#endif /* _XF86PCI_H */
diff --git a/prebuilt/xlibre/usr/include/xorg/xf86Priv.h b/prebuilt/xlibre/usr/include/xorg/xf86Priv.h
new file mode 100644
index 0000000..7e90f86
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/xf86Priv.h
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 1997-2002 by The XFree86 Project, 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.
+ *
+ * Except as contained in this notice, the name of the copyright holder(s)
+ * and author(s) shall not be used in advertising or otherwise to promote
+ * the sale, use or other dealings in this Software without prior written
+ * authorization from the copyright holder(s) and author(s).
+ */
+
+/*
+ * This file contains declarations for private XFree86 functions and variables,
+ * and definitions of private macros.
+ *
+ * "private" means not available to video drivers.
+ */
+
+#ifndef _XF86PRIV_H
+#define _XF86PRIV_H
+
+#include "xlibre_ptrtypes.h"
+#include "xf86Privstr.h"
+#include "input.h"
+
+extern _X_EXPORT int xf86FbBpp;
+extern _X_EXPORT int xf86Depth;
+
+/* Other parameters */
+
+extern _X_EXPORT xf86InfoRec xf86Info;
+extern _X_EXPORT serverLayoutRec xf86ConfigLayout;
+
+extern _X_EXPORT DriverPtr *xf86DriverList;
+extern _X_EXPORT int xf86NumScreens;
+
+extern _X_EXPORT ScrnInfoPtr *xf86GPUScreens; /* List of pointers to ScrnInfoRecs */
+extern _X_EXPORT int xf86NumGPUScreens;
+extern _X_EXPORT int xf86DRMMasterFd; /* Command line argument for DRM master file descriptor */
+#ifndef DEFAULT_DPI
+#define DEFAULT_DPI 96
+#endif
+
+/* xf86Bus.c */
+extern _X_EXPORT void xf86BusProbe(void);
+extern _X_EXPORT void xf86AddDevToEntity(int entityIndex, GDevPtr dev);
+
+#endif /* _XF86PRIV_H */
diff --git a/prebuilt/xlibre/usr/include/xorg/xf86Privstr.h b/prebuilt/xlibre/usr/include/xorg/xf86Privstr.h
new file mode 100644
index 0000000..d123978
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/xf86Privstr.h
@@ -0,0 +1,127 @@
+
+/*
+ * Copyright (c) 1997-2003 by The XFree86 Project, 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.
+ *
+ * Except as contained in this notice, the name of the copyright holder(s)
+ * and author(s) shall not be used in advertising or otherwise to promote
+ * the sale, use or other dealings in this Software without prior written
+ * authorization from the copyright holder(s) and author(s).
+ */
+
+/*
+ * This file contains definitions of the private XFree86 data structures/types.
+ * None of the data structures here should be used by video drivers.
+ */
+
+#ifndef _XF86PRIVSTR_H
+#define _XF86PRIVSTR_H
+
+#include "xf86str.h"
+
+typedef enum {
+ XF86_GlxVisualsMinimal,
+ XF86_GlxVisualsTypical,
+ XF86_GlxVisualsAll,
+} XF86_GlxVisuals;
+
+/*
+ * xf86InfoRec contains global parameters which the video drivers never
+ * need to access. Global parameters which the video drivers do need
+ * should be individual globals.
+ */
+
+typedef struct {
+ int consoleFd;
+ int vtno;
+
+ /* event handler part */
+ int lastEventTime;
+ Bool vtRequestsPending;
+#ifdef __sun
+ int vtPendingNum;
+#endif
+ Bool dontVTSwitch;
+ Bool autoVTSwitch;
+ Bool ShareVTs;
+ Bool dontZap;
+ Bool dontZoom;
+
+ /* graphics part */
+ ScreenPtr currentScreen;
+#ifdef CONFIG_BSD_CONSOLE
+ int consType; /* Which console driver? */
+#endif
+
+ /* Other things */
+ Bool allowMouseOpenFail;
+ Bool vidModeEnabled; /* VidMode extension enabled */
+ Bool vidModeAllowNonLocal; /* allow non-local VidMode
+ * connections */
+ Bool pmFlag;
+ MessageType iglxFrom;
+ MessageType fontserverFrom;
+ XF86_GlxVisuals glxVisuals;
+ MessageType glxVisualsFrom;
+
+ Bool useDefaultFontPath;
+ Bool ignoreABI;
+
+ Bool forceInputDevices; /* force xorg.conf or built-in input devices */
+ Bool autoAddDevices; /* Whether to succeed NIDR, or ignore. */
+ Bool autoEnableDevices; /* Whether to enable, or let the client
+ * control. */
+
+ Bool dri2;
+ MessageType dri2From;
+
+ Bool autoAddGPU;
+ const char *debug;
+ Bool autoBindGPU;
+
+ Bool singleDriver; /* Only the first successfully probed driver adds primary screens,
+ * others may add GPU secondary screens only */
+} xf86InfoRec, *xf86InfoPtr;
+
+/* ISC's cc can't handle ~ of UL constants, so explicitly type cast them. */
+#define XLED1 ((unsigned long) 0x00000001)
+#define XLED2 ((unsigned long) 0x00000002)
+#define XLED3 ((unsigned long) 0x00000004)
+#define XLED4 ((unsigned long) 0x00000008)
+#define XCAPS ((unsigned long) 0x20000000)
+#define XNUM ((unsigned long) 0x40000000)
+#define XSCR ((unsigned long) 0x80000000)
+#define XCOMP ((unsigned long) 0x00008000)
+
+/* BSD console driver types (consType) */
+#ifdef CONFIG_BSD_CONSOLE
+#define PCCONS 0
+#define CODRV011 1
+#define CODRV01X 2
+#define SYSCONS 8
+#define PCVT 16
+#define WSCONS 32
+#endif
+
+/* Root window property to tell clients whether our VT is currently active.
+ * Name chosen to match the "XFree86_VT" property. */
+#define HAS_VT_ATOM_NAME "XFree86_has_VT"
+
+#endif /* _XF86PRIVSTR_H */
diff --git a/prebuilt/xlibre/usr/include/xorg/xf86RandR12.h b/prebuilt/xlibre/usr/include/xorg/xf86RandR12.h
new file mode 100644
index 0000000..e92cd64
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/xf86RandR12.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright © 2006 Keith Packard
+ *
+ * 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 _XF86_RANDR_H_
+#define _XF86_RANDR_H_
+#include
+#include
+
+extern _X_EXPORT Bool xf86RandR12Init(ScreenPtr pScreen);
+extern _X_EXPORT void xf86RandR12SetRotations(ScreenPtr pScreen,
+ Rotation rotation);
+extern _X_EXPORT void xf86RandR12SetTransformSupport(ScreenPtr pScreen,
+ Bool transforms);
+extern _X_EXPORT Bool xf86RandR12SetConfig(ScreenPtr pScreen, Rotation rotation,
+ int rate, RRScreenSizePtr pSize);
+extern _X_EXPORT Rotation xf86RandR12GetRotation(ScreenPtr pScreen);
+extern _X_EXPORT void xf86RandR12GetOriginalVirtualSize(ScrnInfoPtr pScrn,
+ int *x, int *y);
+extern _X_EXPORT Bool xf86RandR12PreInit(ScrnInfoPtr pScrn);
+extern _X_EXPORT void xf86RandR12TellChanged(ScreenPtr pScreen);
+
+#endif /* _XF86_RANDR_H_ */
diff --git a/prebuilt/xlibre/usr/include/xorg/xf86Xinput.h b/prebuilt/xlibre/usr/include/xorg/xf86Xinput.h
new file mode 100644
index 0000000..1edc1ce
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/xf86Xinput.h
@@ -0,0 +1,192 @@
+/*
+ * Copyright 1995-1999 by Frederic Lepied, France.
+ *
+ * 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 Frederic Lepied not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. Frederic Lepied makes no
+ * representations about the suitability of this software for any purpose. It
+ * is provided "as is" without express or implied warranty.
+ *
+ * FREDERIC LEPIED DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL FREDERIC LEPIED 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.
+ *
+ */
+
+/*
+ * Copyright (c) 2000-2002 by The XFree86 Project, 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.
+ *
+ * Except as contained in this notice, the name of the copyright holder(s)
+ * and author(s) shall not be used in advertising or otherwise to promote
+ * the sale, use or other dealings in this Software without prior written
+ * authorization from the copyright holder(s) and author(s).
+ */
+
+#ifndef _xf86Xinput_h
+#define _xf86Xinput_h
+
+#include
+
+#include "xlibre_ptrtypes.h"
+#include "xf86.h"
+#include "xf86str.h"
+#include "inputstr.h"
+#include
+#include
+
+/* Input device flags */
+#define XI86_ALWAYS_CORE 0x04 /* device always controls the pointer */
+/* the device sends Xinput and core pointer events */
+#define XI86_SEND_CORE_EVENTS XI86_ALWAYS_CORE
+/* 0x08 is reserved for legacy XI86_SEND_DRAG_EVENTS, do not use for now */
+/* server-internal only */
+#define XI86_DEVICE_DISABLED 0x10 /* device was disabled before vt switch */
+#define XI86_SERVER_FD 0x20 /* fd is managed by xserver */
+
+/* Input device driver capabilities */
+#define XI86_DRV_CAP_SERVER_FD 0x01
+
+/* This holds the input driver entry and module information. */
+typedef struct _InputDriverRec {
+ int driverVersion;
+ const char *driverName;
+ void (*Identify) (int flags);
+ int (*PreInit) (struct _InputDriverRec * drv,
+ struct _InputInfoRec * pInfo, int flags);
+ void (*UnInit) (struct _InputDriverRec * drv,
+ struct _InputInfoRec * pInfo, int flags);
+ void *module;
+ const char **default_options;
+ int capabilities;
+} InputDriverRec, *InputDriverPtr;
+
+/* This is to input devices what the ScrnInfoRec is to screens. */
+
+struct _InputInfoRec {
+ struct _InputInfoRec *next;
+ char *name;
+ char *driver;
+
+ int flags;
+
+ Bool (*device_control) (DeviceIntPtr device, int what);
+ void (*read_input) (struct _InputInfoRec * local);
+ int (*control_proc) (struct _InputInfoRec * local, xDeviceCtl * control);
+ int (*switch_mode) (ClientPtr client, DeviceIntPtr dev, int mode);
+ int (*set_device_valuators)
+ (struct _InputInfoRec * local,
+ int *valuators, int first_valuator, int num_valuators);
+
+ int fd;
+ int major;
+ int minor;
+ DeviceIntPtr dev;
+ void *private;
+ const char *type_name;
+ InputDriverPtr drv;
+ void *module;
+ XF86OptionPtr options;
+ InputAttributes *attrs;
+};
+
+/* xf86Xinput.c */
+extern _X_EXPORT void xf86PostMotionEvent(DeviceIntPtr device, int is_absolute,
+ int first_valuator, int num_valuators,
+ ...);
+extern _X_EXPORT void xf86PostMotionEventM(DeviceIntPtr device, int is_absolute,
+ const ValuatorMask *mask);
+extern _X_EXPORT void xf86PostProximityEvent(DeviceIntPtr device, int is_in,
+ int first_valuator,
+ int num_valuators, ...);
+extern _X_EXPORT void xf86PostProximityEventM(DeviceIntPtr device, int is_in,
+ const ValuatorMask *mask);
+extern _X_EXPORT void xf86PostButtonEvent(DeviceIntPtr device, int is_absolute,
+ int button, int is_down,
+ int first_valuator, int num_valuators,
+ ...);
+extern _X_EXPORT void xf86PostButtonEventP(DeviceIntPtr device, int is_absolute,
+ int button, int is_down,
+ int first_valuator,
+ int num_valuators,
+ const int *valuators);
+extern _X_EXPORT void xf86PostButtonEventM(DeviceIntPtr device, int is_absolute,
+ int button, int is_down,
+ const ValuatorMask *mask);
+extern _X_EXPORT void xf86PostKeyboardEvent(DeviceIntPtr device,
+ unsigned int key_code, int is_down);
+extern _X_EXPORT void xf86PostTouchEvent(DeviceIntPtr dev, uint32_t touchid,
+ uint16_t type, uint32_t flags,
+ const ValuatorMask *mask);
+extern _X_EXPORT void xf86PostGesturePinchEvent(DeviceIntPtr dev, uint16_t type,
+ uint16_t num_touches,
+ uint32_t flags,
+ double delta_x, double delta_y,
+ double delta_unaccel_x,
+ double delta_unaccel_y,
+ double scale, double delta_angle);
+extern _X_EXPORT void xf86PostGestureSwipeEvent(DeviceIntPtr dev, uint16_t type,
+ uint16_t num_touches,
+ uint32_t flags,
+ double delta_x, double delta_y,
+ double delta_unaccel_x,
+ double delta_unaccel_y);
+
+extern _X_EXPORT InputInfoPtr xf86FirstLocalDevice(void);
+extern _X_EXPORT int xf86ScaleAxis(int Cx, int to_max, int to_min, int from_max,
+ int from_min);
+extern _X_EXPORT void xf86ProcessCommonOptions(InputInfoPtr pInfo,
+ XF86OptionPtr options);
+extern _X_EXPORT Bool xf86InitValuatorAxisStruct(DeviceIntPtr dev, int axnum,
+ Atom label, int minval,
+ int maxval, int resolution,
+ int min_res, int max_res,
+ int mode);
+extern _X_EXPORT void xf86InitValuatorDefaults(DeviceIntPtr dev, int axnum);
+extern _X_EXPORT void xf86AddEnabledDevice(InputInfoPtr pInfo);
+extern _X_EXPORT void xf86RemoveEnabledDevice(InputInfoPtr pInfo);
+extern _X_EXPORT void xf86DisableDevice(DeviceIntPtr dev, Bool panic);
+
+/* xf86Helper.c */
+extern _X_EXPORT void xf86AddInputDriver(InputDriverPtr driver, void *module,
+ int flags);
+extern _X_EXPORT void xf86DeleteInput(InputInfoPtr pInp, int flags);
+extern _X_EXPORT void xf86MotionHistoryAllocate(InputInfoPtr pInfo);
+extern _X_EXPORT void
+xf86IDrvMsgVerb(InputInfoPtr dev,
+ MessageType type, int verb, const char *format, ...)
+_X_ATTRIBUTE_PRINTF(4, 5);
+extern _X_EXPORT void
+xf86IDrvMsg(InputInfoPtr dev, MessageType type, const char *format, ...)
+_X_ATTRIBUTE_PRINTF(3, 4);
+
+/* xf86Option.c */
+extern _X_EXPORT void
+xf86CollectInputOptions(InputInfoPtr pInfo, const char **defaultOpts);
+
+#endif /* _xf86Xinput_h */
diff --git a/prebuilt/xlibre/usr/include/xorg/xf86_OSlib.h b/prebuilt/xlibre/usr/include/xorg/xf86_OSlib.h
new file mode 100644
index 0000000..aed1565
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/xf86_OSlib.h
@@ -0,0 +1,242 @@
+/*
+ * Copyright 1990, 1991 by Thomas Roell, Dinkelscherben, Germany
+ * Copyright 1992 by David Dawes
+ * Copyright 1992 by Jim Tsillas
+ * Copyright 1992 by Rich Murphey
+ * Copyright 1992 by Robert Baron
+ * Copyright 1992 by Orest Zborowski
+ * Copyright 1993 by Vrije Universiteit, The Netherlands
+ * Copyright 1993 by David Wexelblat
+ * Copyright 1994, 1996 by Holger Veit
+ * Copyright 1997 by Takis Psarogiannakopoulos
+ * Copyright 1994-2003 by The XFree86 Project, 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 names of the above listed copyright holders
+ * not be used in advertising or publicity pertaining to distribution of
+ * the software without specific, written prior permission. The above listed
+ * 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 ABOVE LISTED COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD
+ * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED 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.
+ *
+ */
+
+/*
+ * The ARM32 code here carries the following copyright:
+ *
+ * Copyright 1997
+ * Digital Equipment Corporation. All rights reserved.
+ * This software is furnished under license and may be used and copied only in
+ * accordance with the following terms and conditions. Subject to these
+ * conditions, you may download, copy, install, use, modify and distribute
+ * this software in source and/or binary form. No title or ownership is
+ * transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce and retain
+ * this copyright notice and list of conditions as they appear in the
+ * source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or logo of Digital
+ * Equipment Corporation. Neither the "Digital Equipment Corporation"
+ * name nor any trademark or logo of Digital Equipment Corporation may be
+ * used to endorse or promote products derived from this software without
+ * the prior written permission of Digital Equipment Corporation.
+ *
+ * 3) This software is provided "AS-IS" and any express or implied warranties,
+ * including but not limited to, any implied warranties of merchantability,
+ * fitness for a particular purpose, or non-infringement are disclaimed.
+ * In no event shall DIGITAL be liable for any damages whatsoever, and in
+ * particular, DIGITAL shall not be liable for special, indirect,
+ * consequential, or incidental damages or damages for lost profits, loss
+ * of revenue or loss of use, whether such damages arise in contract,
+ * negligence, tort, under statute, in equity, at law or otherwise, even
+ * if advised of the possibility of such damage.
+ *
+ */
+
+/*
+ * This is private, and should not be included by any drivers. Drivers
+ * may include xf86_OSproc.h to get prototypes for public interfaces.
+ */
+
+#ifndef _XF86_OSLIB_H
+#define _XF86_OSLIB_H
+
+#include
+#include
+
+#include
+#include
+#include
+
+/**************************************************************************/
+/* Solaris or illumos-based system */
+/**************************************************************************/
+#if defined(__SVR4) && defined(__sun)
+#include
+#include
+#include
+#include
+
+#include
+
+#ifdef HAVE_SYS_VT_H
+#define HAS_USL_VTS
+#endif
+#ifdef HAS_USL_VTS
+#include
+#include
+#endif
+
+#define CLEARDTR_SUPPORT
+
+#endif /* SVR4 && __sun */
+
+/**************************************************************************/
+/* Linux or Glibc-based system */
+/**************************************************************************/
+#if defined(__linux__) || defined(__GLIBC__) || defined(__CYGWIN__)
+#include
+#include
+#include
+#include
+#include
+
+#include
+#ifdef __sparc__
+#include
+#endif
+
+#include
+
+#ifdef __linux__
+#define HAS_USL_VTS
+#include
+#include
+#define LDGMAP GIO_SCRNMAP
+#define LDSMAP PIO_SCRNMAP
+#define LDNMAP LDSMAP
+#define CLEARDTR_SUPPORT
+#endif
+
+#endif /* __linux__ || __GLIBC__ */
+
+/**************************************************************************/
+/* System is BSD-like */
+/**************************************************************************/
+
+#ifdef CSRG_BASED
+#include
+#include
+
+#include
+
+#include
+
+#include
+
+#endif /* CSRG_BASED */
+
+/**************************************************************************/
+/* Kernel of *BSD */
+/**************************************************************************/
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || \
+ defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
+
+#include
+#if defined(__FreeBSD_version) && !defined(__FreeBSD_kernel_version)
+#define __FreeBSD_kernel_version __FreeBSD_version
+#endif
+
+#ifdef SYSCONS_SUPPORT
+#define COMPAT_SYSCONS
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
+#if defined(__DragonFly__) || (__FreeBSD_kernel_version >= 410000)
+#include
+#include
+#else
+#include
+#endif /* FreeBSD 4.1 RELEASE or lator */
+#else
+#if !defined(__NetBSD__) && !defined(__OpenBSD__)
+#include
+#endif
+#endif
+#endif /* SYSCONS_SUPPORT */
+#if defined(PCVT_SUPPORT) && !defined(__NetBSD__) && !defined(__OpenBSD__)
+#if !defined(SYSCONS_SUPPORT)
+ /* no syscons, so include pcvt specific header file */
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+#include
+#else
+#include
+#endif /* __FreeBSD_kernel__ */
+#else /* pcvt and syscons: hard-code the ID magic */
+#define VGAPCVTID _IOWR('V',113, struct pcvtid)
+struct pcvtid {
+ char name[16];
+ int rmajor, rminor;
+};
+#endif /* PCVT_SUPPORT && SYSCONS_SUPPORT */
+#endif /* PCVT_SUPPORT */
+#ifdef WSCONS_SUPPORT
+#include
+#include
+#endif /* WSCONS_SUPPORT */
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
+#include
+#endif
+ /* Include these definitions in case ioctl_pc.h didn't get included */
+#ifndef CONSOLE_X_BELL
+#define CONSOLE_X_BELL _IOW('t',123,int[2])
+#endif
+
+#define CLEARDTR_SUPPORT
+
+#endif /* __FreeBSD__ || __NetBSD__ || __OpenBSD__ || __DragonFly__ */
+
+/**************************************************************************/
+/* IRIX */
+/**************************************************************************/
+
+/**************************************************************************/
+/* Generic */
+/**************************************************************************/
+
+/* For PATH_MAX */
+#include "misc.h"
+
+/*
+ * Hack originally for ISC 2.2 POSIX headers, but may apply elsewhere,
+ * and it's safe, so just do it.
+ */
+#if !defined(O_NDELAY) && defined(O_NONBLOCK)
+#define O_NDELAY O_NONBLOCK
+#endif /* !O_NDELAY && O_NONBLOCK */
+
+#if !defined(MAXHOSTNAMELEN)
+#define MAXHOSTNAMELEN 32
+#endif /* !MAXHOSTNAMELEN */
+
+#include
+
+#ifndef MAP_FAILED
+#define MAP_FAILED ((void *)-1)
+#endif
+
+#define SYSCALL(call) while(((call) == -1) && (errno == EINTR)) {}
+
+#include "xf86_OSproc.h"
+
+#endif /* _XF86_OSLIB_H */
diff --git a/prebuilt/xlibre/usr/include/xorg/xf86_OSproc.h b/prebuilt/xlibre/usr/include/xorg/xf86_OSproc.h
new file mode 100644
index 0000000..b030ebd
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/xf86_OSproc.h
@@ -0,0 +1,150 @@
+/*
+ * Copyright 1990, 1991 by Thomas Roell, Dinkelscherben, Germany
+ * Copyright 1992 by David Dawes
+ * Copyright 1992 by Jim Tsillas
+ * Copyright 1992 by Rich Murphey
+ * Copyright 1992 by Robert Baron
+ * Copyright 1992 by Orest Zborowski
+ * Copyright 1993 by Vrije Universiteit, The Netherlands
+ * Copyright 1993 by David Wexelblat
+ * Copyright 1994, 1996 by Holger Veit
+ * Copyright 1994-2003 by The XFree86 Project, 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 names of the above listed copyright holders
+ * not be used in advertising or publicity pertaining to distribution of
+ * the software without specific, written prior permission. The above listed
+ * 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 ABOVE LISTED COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD
+ * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED 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.
+ *
+ */
+
+/*
+ * The ARM32 code here carries the following copyright:
+ *
+ * Copyright 1997
+ * Digital Equipment Corporation. All rights reserved.
+ * This software is furnished under license and may be used and copied only in
+ * accordance with the following terms and conditions. Subject to these
+ * conditions, you may download, copy, install, use, modify and distribute
+ * this software in source and/or binary form. No title or ownership is
+ * transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce and retain
+ * this copyright notice and list of conditions as they appear in the
+ * source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or logo of Digital
+ * Equipment Corporation. Neither the "Digital Equipment Corporation"
+ * name nor any trademark or logo of Digital Equipment Corporation may be
+ * used to endorse or promote products derived from this software without
+ * the prior written permission of Digital Equipment Corporation.
+ *
+ * 3) This software is provided "AS-IS" and any express or implied warranties,
+ * including but not limited to, any implied warranties of merchantability,
+ * fitness for a particular purpose, or non-infringement are disclaimed.
+ * In no event shall DIGITAL be liable for any damages whatsoever, and in
+ * particular, DIGITAL shall not be liable for special, indirect,
+ * consequential, or incidental damages or damages for lost profits, loss
+ * of revenue or loss of use, whether such damages arise in contract,
+ * negligence, tort, under statute, in equity, at law or otherwise, even
+ * if advised of the possibility of such damage.
+ *
+ */
+
+#ifndef _XF86_OSPROC_H
+#define _XF86_OSPROC_H
+
+/*
+ * The actual prototypes have been pulled into this separate file so
+ * that they can can be used without pulling in all of the OS specific
+ * stuff like sys/stat.h, etc. that causes problems for loadable modules.
+ */
+
+/*
+ * OS-independent modem state flags for xf86SetSerialModemState() and
+ * xf86GetSerialModemState().
+ */
+#define XF86_M_LE 0x001 /* line enable */
+#define XF86_M_DTR 0x002 /* data terminal ready */
+#define XF86_M_RTS 0x004 /* request to send */
+#define XF86_M_ST 0x008 /* secondary transmit */
+#define XF86_M_SR 0x010 /* secondary receive */
+#define XF86_M_CTS 0x020 /* clear to send */
+#define XF86_M_CAR 0x040 /* carrier detect */
+#define XF86_M_RNG 0x080 /* ring */
+#define XF86_M_DSR 0x100 /* data set ready */
+
+/***************************************************************************/
+/* Prototypes */
+/***************************************************************************/
+
+#include
+#include "opaque.h"
+#include "xf86Optionstr.h"
+
+_XFUNCPROTOBEGIN
+
+/* public functions */
+extern _X_EXPORT Bool xf86EnableIO(void);
+extern _X_EXPORT void xf86DisableIO(void);
+
+extern _X_EXPORT void xf86SlowBcopy(unsigned char *, unsigned char *, int);
+extern _X_EXPORT int xf86OpenSerial(XF86OptionPtr options);
+extern _X_EXPORT int xf86SetSerial(int fd, XF86OptionPtr options);
+extern _X_EXPORT int xf86SetSerialSpeed(int fd, int speed);
+extern _X_EXPORT int xf86ReadSerial(int fd, void *buf, int count);
+extern _X_EXPORT int xf86WriteSerial(int fd, const void *buf, int count);
+extern _X_EXPORT int xf86CloseSerial(int fd);
+extern _X_EXPORT int xf86FlushInput(int fd);
+extern _X_EXPORT int xf86WaitForInput(int fd, int timeout);
+extern _X_EXPORT int xf86SetSerialModemState(int fd, int state);
+extern _X_EXPORT int xf86GetSerialModemState(int fd);
+extern _X_EXPORT int xf86SerialModemSetBits(int fd, int bits);
+extern _X_EXPORT int xf86SerialModemClearBits(int fd, int bits);
+extern _X_EXPORT int xf86LoadKernelModule(const char *pathname);
+
+/* AGP GART interface */
+
+typedef struct _AgpInfo {
+ CARD32 bridgeId;
+ CARD32 agpMode;
+ unsigned long base;
+ unsigned long size;
+ unsigned long totalPages;
+ unsigned long systemPages;
+ unsigned long usedPages;
+} AgpInfo, *AgpInfoPtr;
+
+extern _X_EXPORT Bool xf86AgpGARTSupported(void);
+extern _X_EXPORT AgpInfoPtr xf86GetAGPInfo(int screenNum);
+extern _X_EXPORT Bool xf86AcquireGART(int screenNum);
+extern _X_EXPORT Bool xf86ReleaseGART(int screenNum);
+extern _X_EXPORT int xf86AllocateGARTMemory(int screenNum, unsigned long size,
+ int type, unsigned long *physical);
+extern _X_EXPORT Bool xf86BindGARTMemory(int screenNum, int key,
+ unsigned long offset);
+extern _X_EXPORT Bool xf86UnbindGARTMemory(int screenNum, int key);
+extern _X_EXPORT Bool xf86GARTCloseScreen(int screenNum);
+
+/* These routines are in shared/sigio.c and are not loaded as part of the
+ module. These routines are small, and the code if very POSIX-signal (or
+ OS-signal) specific, so it seemed better to provide more complex
+ wrappers than to wrap each individual function called. */
+extern _X_EXPORT int xf86InstallSIGIOHandler(int fd, void (*f) (int, void *),
+ void *);
+
+_XFUNCPROTOEND
+#endif /* _XF86_OSPROC_H */
diff --git a/prebuilt/xlibre/usr/include/xorg/xf86cmap.h b/prebuilt/xlibre/usr/include/xorg/xf86cmap.h
new file mode 100644
index 0000000..acd6035
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/xf86cmap.h
@@ -0,0 +1,67 @@
+
+/*
+ * Copyright (c) 1998-2001 by The XFree86 Project, 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.
+ *
+ * Except as contained in this notice, the name of the copyright holder(s)
+ * and author(s) shall not be used in advertising or otherwise to promote
+ * the sale, use or other dealings in this Software without prior written
+ * authorization from the copyright holder(s) and author(s).
+ */
+
+#ifndef _XF86CMAP_H
+#define _XF86CMAP_H
+
+#include "xlibre_ptrtypes.h"
+#include "xf86str.h"
+
+#define CMAP_PALETTED_TRUECOLOR 0x0000001
+#define CMAP_RELOAD_ON_MODE_SWITCH 0x0000002
+#define CMAP_LOAD_EVEN_IF_OFFSCREEN 0x0000004
+
+extern _X_EXPORT Bool xf86HandleColormaps(ScreenPtr pScreen,
+ int maxCol,
+ int sigRGBbits,
+ xf86LoadPaletteProc * loadPalette,
+ xf86SetOverscanProc * setOverscan,
+ unsigned int flags);
+
+extern _X_EXPORT Bool xf86ColormapAllocatePrivates(ScrnInfoPtr pScrn);
+
+extern _X_EXPORT int
+ xf86ChangeGamma(ScreenPtr pScreen, Gamma newGamma);
+
+extern _X_EXPORT int
+
+xf86ChangeGammaRamp(ScreenPtr pScreen,
+ int size,
+ unsigned short *red,
+ unsigned short *green, unsigned short *blue);
+
+extern _X_EXPORT int xf86GetGammaRampSize(ScreenPtr pScreen);
+
+extern _X_EXPORT int
+
+xf86GetGammaRamp(ScreenPtr pScreen,
+ int size,
+ unsigned short *red,
+ unsigned short *green, unsigned short *blue);
+
+#endif /* _XF86CMAP_H */
diff --git a/prebuilt/xlibre/usr/include/xorg/xf86fbman.h b/prebuilt/xlibre/usr/include/xorg/xf86fbman.h
new file mode 100644
index 0000000..64b9a31
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/xf86fbman.h
@@ -0,0 +1,113 @@
+
+/*
+ * Copyright (c) 1998-2001 by The XFree86 Project, 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.
+ *
+ * Except as contained in this notice, the name of the copyright holder(s)
+ * and author(s) shall not be used in advertising or otherwise to promote
+ * the sale, use or other dealings in this Software without prior written
+ * authorization from the copyright holder(s) and author(s).
+ */
+
+#ifndef _XF86FBMAN_H
+#define _XF86FBMAN_H
+
+#include "scrnintstr.h"
+#include "regionstr.h"
+
+#define FAVOR_AREA_THEN_WIDTH 0
+#define FAVOR_AREA_THEN_HEIGHT 1
+#define FAVOR_WIDTH_THEN_AREA 2
+#define FAVOR_HEIGHT_THEN_AREA 3
+
+#define PRIORITY_LOW 0
+#define PRIORITY_NORMAL 1
+#define PRIORITY_EXTREME 2
+
+typedef struct _FBArea {
+ ScreenPtr pScreen;
+ BoxRec box;
+ int granularity;
+ void (*MoveAreaCallback) (struct _FBArea *, struct _FBArea *);
+ void (*RemoveAreaCallback) (struct _FBArea *);
+ DevUnion devPrivate;
+} FBArea, *FBAreaPtr;
+
+typedef struct _FBLinear {
+ ScreenPtr pScreen;
+ int size;
+ int offset;
+ int granularity;
+ void (*MoveLinearCallback) (struct _FBLinear *, struct _FBLinear *);
+ void (*RemoveLinearCallback) (struct _FBLinear *);
+ DevUnion devPrivate;
+} FBLinear, *FBLinearPtr;
+
+typedef void (*MoveAreaCallbackProcPtr) (FBAreaPtr, FBAreaPtr);
+typedef void (*RemoveAreaCallbackProcPtr) (FBAreaPtr);
+
+typedef void (*MoveLinearCallbackProcPtr) (FBLinearPtr, FBLinearPtr);
+typedef void (*RemoveLinearCallbackProcPtr) (FBLinearPtr);
+
+extern _X_EXPORT Bool
+ xf86InitFBManager(ScreenPtr pScreen, BoxPtr FullBox);
+
+extern _X_EXPORT Bool
+ xf86InitFBManagerLinear(ScreenPtr pScreen, int offset, int size);
+
+extern _X_EXPORT FBAreaPtr
+xf86AllocateOffscreenArea(ScreenPtr pScreen,
+ int w, int h,
+ int granularity,
+ MoveAreaCallbackProcPtr moveCB,
+ RemoveAreaCallbackProcPtr removeCB, void *privData);
+
+extern _X_EXPORT FBLinearPtr
+xf86AllocateOffscreenLinear(ScreenPtr pScreen,
+ int length,
+ int granularity,
+ MoveLinearCallbackProcPtr moveCB,
+ RemoveLinearCallbackProcPtr removeCB,
+ void *privData);
+
+extern _X_EXPORT void xf86FreeOffscreenArea(FBAreaPtr area);
+extern _X_EXPORT void xf86FreeOffscreenLinear(FBLinearPtr area);
+
+extern _X_EXPORT Bool
+ xf86ResizeOffscreenArea(FBAreaPtr resize, int w, int h);
+
+extern _X_EXPORT Bool
+ xf86ResizeOffscreenLinear(FBLinearPtr resize, int size);
+
+extern _X_EXPORT Bool
+ xf86PurgeUnlockedOffscreenAreas(ScreenPtr pScreen);
+
+extern _X_EXPORT Bool
+
+xf86QueryLargestOffscreenArea(ScreenPtr pScreen,
+ int *width, int *height,
+ int granularity, int preferences, int priority);
+
+extern _X_EXPORT Bool
+
+xf86QueryLargestOffscreenLinear(ScreenPtr pScreen,
+ int *size, int granularity, int priority);
+
+#endif /* _XF86FBMAN_H */
diff --git a/prebuilt/xlibre/usr/include/xorg/xf86i2c.h b/prebuilt/xlibre/usr/include/xorg/xf86i2c.h
new file mode 100644
index 0000000..e4f10f9
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/xf86i2c.h
@@ -0,0 +1,110 @@
+/*
+ * Copyright (C) 1998 Itai Nahshon, Michael Schimek
+ */
+
+#ifndef _XF86I2C_H
+#define _XF86I2C_H
+
+#include "regionstr.h"
+#include "xf86.h"
+
+typedef unsigned char I2CByte;
+typedef unsigned short I2CSlaveAddr;
+
+typedef struct _I2CBusRec *I2CBusPtr;
+typedef struct _I2CDevRec *I2CDevPtr;
+
+/* I2C masters have to register themselves */
+
+typedef struct _I2CBusRec {
+ const char *BusName;
+ int scrnIndex;
+ ScrnInfoPtr pScrn;
+
+ void (*I2CUDelay) (I2CBusPtr b, int usec);
+
+ void (*I2CPutBits) (I2CBusPtr b, int scl, int sda);
+ void (*I2CGetBits) (I2CBusPtr b, int *scl, int *sda);
+
+ /* Look at the generic routines to see how these functions should behave. */
+
+ Bool (*I2CStart) (I2CBusPtr b, int timeout);
+ Bool (*I2CAddress) (I2CDevPtr d, I2CSlaveAddr);
+ void (*I2CStop) (I2CDevPtr d);
+ Bool (*I2CPutByte) (I2CDevPtr d, I2CByte data);
+ Bool (*I2CGetByte) (I2CDevPtr d, I2CByte * data, Bool);
+
+ DevUnion DriverPrivate;
+
+ int HoldTime; /* 1 / bus clock frequency, 5 or 2 usec */
+
+ int BitTimeout; /* usec */
+ int ByteTimeout; /* usec */
+ int AcknTimeout; /* usec */
+ int StartTimeout; /* usec */
+ int RiseFallTime; /* usec */
+
+ I2CDevPtr FirstDev;
+ I2CBusPtr NextBus;
+ Bool (*I2CWriteRead) (I2CDevPtr d, I2CByte * WriteBuffer, int nWrite,
+ I2CByte * ReadBuffer, int nRead);
+} I2CBusRec;
+
+#define CreateI2CBusRec xf86CreateI2CBusRec
+extern _X_EXPORT I2CBusPtr xf86CreateI2CBusRec(void);
+
+#define DestroyI2CBusRec xf86DestroyI2CBusRec
+extern _X_EXPORT void xf86DestroyI2CBusRec(I2CBusPtr pI2CBus, Bool unalloc,
+ Bool devs_too);
+#define I2CBusInit xf86I2CBusInit
+extern _X_EXPORT Bool xf86I2CBusInit(I2CBusPtr pI2CBus);
+
+extern _X_EXPORT I2CBusPtr xf86I2CFindBus(int scrnIndex, const char *name);
+extern _X_EXPORT int xf86I2CGetScreenBuses(int scrnIndex,
+ I2CBusPtr ** pppI2CBus);
+
+/* I2C slave devices */
+
+typedef struct _I2CDevRec {
+ const char *DevName;
+
+ int BitTimeout; /* usec */
+ int ByteTimeout; /* usec */
+ int AcknTimeout; /* usec */
+ int StartTimeout; /* usec */
+
+ I2CSlaveAddr SlaveAddr;
+ I2CBusPtr pI2CBus;
+ I2CDevPtr NextDev;
+ DevUnion DriverPrivate;
+} I2CDevRec;
+
+#define CreateI2CDevRec xf86CreateI2CDevRec
+extern _X_EXPORT I2CDevPtr xf86CreateI2CDevRec(void);
+extern _X_EXPORT void xf86DestroyI2CDevRec(I2CDevPtr pI2CDev, Bool unalloc);
+
+#define I2CDevInit xf86I2CDevInit
+extern _X_EXPORT Bool xf86I2CDevInit(I2CDevPtr pI2CDev);
+extern _X_EXPORT I2CDevPtr xf86I2CFindDev(I2CBusPtr, I2CSlaveAddr);
+
+/* See descriptions of these functions in xf86i2c.c */
+
+#define I2CProbeAddress xf86I2CProbeAddress
+extern _X_EXPORT Bool xf86I2CProbeAddress(I2CBusPtr pI2CBus, I2CSlaveAddr);
+
+#define I2C_WriteRead xf86I2CWriteRead
+extern _X_EXPORT Bool xf86I2CWriteRead(I2CDevPtr d, I2CByte * WriteBuffer,
+ int nWrite, I2CByte * ReadBuffer,
+ int nRead);
+#define xf86I2CRead(d, rb, nr) xf86I2CWriteRead(d, NULL, 0, rb, nr)
+
+extern _X_EXPORT Bool xf86I2CReadByte(I2CDevPtr d, I2CByte subaddr,
+ I2CByte * pbyte);
+extern _X_EXPORT Bool xf86I2CReadBytes(I2CDevPtr d, I2CByte subaddr,
+ I2CByte * pbyte, int n);
+#define xf86I2CWrite(d, wb, nw) xf86I2CWriteRead(d, wb, nw, NULL, 0)
+extern _X_EXPORT Bool xf86I2CWriteByte(I2CDevPtr d, I2CByte subaddr,
+ I2CByte byte);
+extern _X_EXPORT Bool xf86I2CWriteVec(I2CDevPtr d, I2CByte * vec, int nValues);
+
+#endif /*_XF86I2C_H */
diff --git a/prebuilt/xlibre/usr/include/xorg/xf86platformBus.h b/prebuilt/xlibre/usr/include/xorg/xf86platformBus.h
new file mode 100644
index 0000000..8f9b7c6
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/xf86platformBus.h
@@ -0,0 +1,92 @@
+/*
+ * Copyright © 2012 Red Hat.
+ *
+ * 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 AUTHORS OR COPYRIGHT HOLDERS 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.
+ *
+ * Author: Dave Airlie
+ */
+#ifndef XF86_PLATFORM_BUS_H
+#define XF86_PLATFORM_BUS_H
+
+struct xf86_platform_device {
+ struct OdevAttributes *attribs;
+ /* for PCI devices */
+ struct pci_device *pdev;
+ int flags;
+};
+
+/* xf86_platform_device flags */
+#define XF86_PDEV_UNOWNED 0x01
+#define XF86_PDEV_SERVER_FD 0x02
+#define XF86_PDEV_PAUSED 0x04
+
+#ifdef XSERVER_PLATFORM_BUS
+
+/*
+ * Define the legacy API only for external builds
+ */
+
+/* path to kernel device node - Linux e.g. /dev/dri/card0 */
+#define ODEV_ATTRIB_PATH 1
+/* system device path - Linux e.g. /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/drm/card1 */
+#define ODEV_ATTRIB_SYSPATH 2
+/* DRI-style bus id */
+#define ODEV_ATTRIB_BUSID 3
+/* Server managed FD */
+#define ODEV_ATTRIB_FD 4
+/* Major number of the device node pointed to by ODEV_ATTRIB_PATH */
+#define ODEV_ATTRIB_MAJOR 5
+/* Minor number of the device node pointed to by ODEV_ATTRIB_PATH */
+#define ODEV_ATTRIB_MINOR 6
+/* kernel driver name */
+#define ODEV_ATTRIB_DRIVER 7
+
+_X_EXPORT char *
+_xf86_get_platform_device_attrib(struct xf86_platform_device *device, int attrib, int (*fake)[0]);
+
+_X_EXPORT int
+_xf86_get_platform_device_int_attrib(struct xf86_platform_device *device, int attrib, int (*fake)[0]);
+
+/* Protect against a mismatch attribute type by generating a compiler
+ * error using a negative array size when an incorrect attribute is
+ * passed
+ */
+
+#define _ODEV_ATTRIB_IS_STRING(x) ((x) == ODEV_ATTRIB_PATH || \
+ (x) == ODEV_ATTRIB_SYSPATH || \
+ (x) == ODEV_ATTRIB_BUSID || \
+ (x) == ODEV_ATTRIB_DRIVER)
+
+#define _ODEV_ATTRIB_STRING_CHECK(x) ((int (*)[_ODEV_ATTRIB_IS_STRING((x))-1]) 0)
+
+#define xf86_get_platform_device_attrib(device, attrib) _xf86_get_platform_device_attrib((device),(attrib),_ODEV_ATTRIB_STRING_CHECK((attrib)))
+
+#define _ODEV_ATTRIB_IS_INT(x) ((x) == ODEV_ATTRIB_FD || (x) == ODEV_ATTRIB_MAJOR || (x) == ODEV_ATTRIB_MINOR)
+#define _ODEV_ATTRIB_INT_DEFAULT(x) ((x) == ODEV_ATTRIB_FD ? -1 : 0)
+#define _ODEV_ATTRIB_DEFAULT_CHECK(x,def) (_ODEV_ATTRIB_INT_DEFAULT(x) == (def))
+#define _ODEV_ATTRIB_INT_CHECK(x,def) ((int (*)[_ODEV_ATTRIB_IS_INT(x)*_ODEV_ATTRIB_DEFAULT_CHECK(x,def)-1]) 0)
+
+#define xf86_get_platform_device_int_attrib(device, attrib, def) _xf86_get_platform_device_int_attrib(device,attrib,_ODEV_ATTRIB_INT_CHECK(attrib,def))
+
+extern _X_EXPORT Bool
+xf86PlatformDeviceCheckBusID(struct xf86_platform_device *device, const char *busid);
+
+#endif
+
+#endif
diff --git a/prebuilt/xlibre/usr/include/xorg/xf86sbusBus.h b/prebuilt/xlibre/usr/include/xorg/xf86sbusBus.h
new file mode 100644
index 0000000..307eda5
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/xf86sbusBus.h
@@ -0,0 +1,74 @@
+/*
+ * SBUS bus-specific declarations
+ *
+ * Copyright (C) 2000 Jakub Jelinek (jakub@redhat.com)
+ *
+ * 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
+ * JAKUB JELINEK 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 _XF86_SBUSBUS_H
+#define _XF86_SBUSBUS_H
+
+#include "xf86str.h"
+
+#define SBUS_DEVICE_CG3 0x0003
+#define SBUS_DEVICE_CG6 0x0005
+#define SBUS_DEVICE_CG14 0x0008
+#define SBUS_DEVICE_LEO 0x0009
+#define SBUS_DEVICE_TCX 0x000a
+#define SBUS_DEVICE_FFB 0x000b
+
+typedef struct sbus_prom_node {
+ int node;
+ /* Because of misdesigned openpromio */
+ int cookie[2];
+} sbusPromNode, *sbusPromNodePtr;
+
+typedef struct sbus_device {
+ int devId;
+ int fbNum;
+ int fd;
+ int width, height;
+ sbusPromNode node;
+ const char *descr;
+ const char *device;
+} sbusDevice, *sbusDevicePtr;
+
+extern _X_EXPORT int xf86MatchSbusInstances(const char *driverName,
+ int sbusDevId, GDevPtr * devList,
+ int numDevs, DriverPtr drvp,
+ int **foundEntities);
+extern _X_EXPORT sbusDevicePtr xf86GetSbusInfoForEntity(int entityIndex);
+extern _X_EXPORT void xf86SbusUseBuiltinMode(ScrnInfoPtr pScrn,
+ sbusDevicePtr psdp);
+extern _X_EXPORT void *xf86MapSbusMem(sbusDevicePtr psdp,
+ unsigned long offset,
+ unsigned long size);
+extern _X_EXPORT void xf86UnmapSbusMem(sbusDevicePtr psdp, void *addr,
+ unsigned long size);
+extern _X_EXPORT void xf86SbusHideOsHwCursor(sbusDevicePtr psdp);
+extern _X_EXPORT void xf86SbusSetOsHwCursorCmap(sbusDevicePtr psdp, int bg,
+ int fg);
+extern _X_EXPORT Bool xf86SbusHandleColormaps(ScreenPtr pScreen,
+ sbusDevicePtr psdp);
+
+extern _X_EXPORT int sparcPromInit(void);
+extern _X_EXPORT void sparcPromClose(void);
+extern _X_EXPORT int sparcPromGetBool(sbusPromNodePtr pnode, const char *prop);
+
+#endif /* _XF86_SBUSBUS_H */
diff --git a/prebuilt/xlibre/usr/include/xorg/xf86str.h b/prebuilt/xlibre/usr/include/xorg/xf86str.h
new file mode 100644
index 0000000..7841002
--- /dev/null
+++ b/prebuilt/xlibre/usr/include/xorg/xf86str.h
@@ -0,0 +1,749 @@
+
+/*
+ * Copyright (c) 1997-2003 by The XFree86 Project, 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.
+ *
+ * Except as contained in this notice, the name of the copyright holder(s)
+ * and author(s) shall not be used in advertising or otherwise to promote
+ * the sale, use or other dealings in this Software without prior written
+ * authorization from the copyright holder(s) and author(s).
+ */
+
+/*
+ * This file contains definitions of the public XFree86 data structures/types.
+ * Any data structures that video drivers need to access should go here.
+ */
+
+#ifndef _XF86STR_H
+#define _XF86STR_H
+
+#include "xlibre_ptrtypes.h"
+#include "misc.h"
+#include "input.h"
+#include "scrnintstr.h"
+#include "pixmapstr.h"
+#include "colormapst.h"
+#include "xf86Module.h"
+#include "xf86Opt.h"
+#include "displaymode.h"
+
+/**
+ * Integer type that is of the size of the addressable memory (machine size).
+ * On most platforms \c uintptr_t will suffice. However, on some mixed
+ * 32-bit / 64-bit platforms, such as 32-bit binaries on 64-bit PowerPC, this
+ * must be 64-bits.
+ */
+#include