Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: build

# PR gate: every change compiles with no warnings.
#
# Host build only. The Android artifacts (`tools/build-android.sh`,
# `build-shim.sh android`) need the NDK, the gamescope termux prefix and the
# export/undefined-symbol audits that read the cross build's output — that is a
# workstation step, not something this runner can stand up. What is checked here
# is the part CI can hold: the workspace builds for the host target, tests and
# benches included, with `-D warnings`, and clippy accepts every target.
#
# No formatting check on purpose: the tree is hand-formatted.
#
# No artifacts are produced or uploaded; the result is the job's status.

on:
pull_request:
workflow_dispatch:

permissions:
contents: read

concurrency:
group: build-${{ github.ref }}
cancel-in-progress: true

jobs:
host:
name: host build, no warnings
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: dtolnay/rust-toolchain@stable
with:
components: clippy

- uses: Swatinem/rust-cache@v2

# The guest-side clients link the host's Vulkan, wayland and xcb:
# `utils/src/{vk,wlproto}.rs` and `icd_shim/src/x11.rs` carry the `#[link]`
# attributes, so a runner without the -dev packages fails at link time with
# `unable to find library -lvulkan` rather than in the code.
- name: system libraries the clients link
run: |
sudo apt-get update -qq
sudo apt-get install -y -qq --no-install-recommends \
libvulkan-dev libwayland-dev \
libxcb1-dev libxcb-dri3-dev libxcb-present-dev libxcb-sync-dev

# `--all-targets` compiles the test and bench targets too, so a change
# that only breaks a test build fails here rather than at review.
- name: cargo build (workspace, all targets, warnings are errors)
env:
RUSTFLAGS: -D warnings
run: cargo build --workspace --all-targets --locked

- name: cargo clippy (workspace, all targets, warnings are errors)
run: cargo clippy --workspace --all-targets --locked -- -D warnings
21 changes: 0 additions & 21 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
resolver = "2"
members = [
"modules/gndrm-lsfg",
"modules/gndrm-obf",
"modules/gndrm-obf-macros",
"modules/gndrm-uapi",
"modules/gndrm-daemon",
"modules/gndrm-android",
Expand Down
4 changes: 2 additions & 2 deletions THIRD_PARTY_NOTICES
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ License text: `lsfg/thirdparty/dxbc/LICENSE.md`. Also recorded in GameNative's
---

The `LICENSE` in this repository covers its own code — the daemon, the DRM UAPI
crate, the obfuscation crates and the tools — under GPL-3.0-or-later, the same
license as the library the engine is linked into. Copyright (C) 2026 Joshua Tam
crate, the ICD shim and the tools — under GPL-3.0-or-later, the same license as
the library the engine is linked into. Copyright (C) 2026 Joshua Tam
and Utkarsh Dalal.
2 changes: 1 addition & 1 deletion docs/performance/05-daemon-present-allocations.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ frame, i.e. ~340 Hz, on a path the doc calls **exactly one deep**: every µs her
| — | `PresentDone::encode()` (`wire.rs:727`) | **refuted** | — | — | returns `[u8; 24]`, stack |
| — | `server.rs` serve pollfd array (`:386`) | **refuted** | — | — | fixed `[pollfd; 2]` on the stack |
| — | `dump_published` env lookup (`asc.rs:149`) | **refuted** | — | — | `OnceLock`, one lookup per process |
| — | log macros on the hot path | **refuted** | `log.rs:20` | — | gate is tested before `fmt::format`; `obf!` decodes into a stack array (`gndrm-obf/src/lib.rs:46`), no heap |
| — | log macros on the hot path | **refuted** | `log.rs:20` | — | gate is tested before `fmt::format`, so a disabled line formats nothing |

Non-allocation hot-path cost found while verifying, listed for completeness, **not** in this
plan item: `Device::diag_on()` (`lib.rs:903`) takes the logger `Mutex` once per commit — a
Expand Down
1 change: 0 additions & 1 deletion icd_shim/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,4 @@ libc = "0.2"
# LD_PRELOAD shim's — a second, hand-mirrored set of structs is how the two
# sides drift apart.
gndrm-lsfg = { path = "../modules/gndrm-lsfg" }
gndrm-obf = { path = "../modules/gndrm-obf" }
gndrm-uapi = { path = "../modules/gndrm-uapi" }
24 changes: 8 additions & 16 deletions icd_shim/src/advertise.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,8 @@ pub fn mask(c: &mut CoreFeatures, base: &CoreFeatures) -> Vec<&'static str> {
// same at its create ("Faking feature support for ..."); here it is the
// calibration signal when a game misbehaves under a lift the driver gated.
if !cleared.is_empty() && !MASKED.swap(true, Ordering::Relaxed) {
crate::logf!(gndrm_obf::obf!(
"feature lift masked back to the driver's answer: {}",
cleared.join(" ")
));
crate::logf!("feature lift masked back to the driver's answer: {}",
cleared.join(" "));
}
cleared
}
Expand Down Expand Up @@ -220,14 +218,10 @@ pub unsafe fn features(f: *mut c_void) {
let zero = zeros(c);
let raised = lift_core(c);
if !LOGGED.swap(true, Ordering::Relaxed) {
crate::logf!(gndrm_obf::obf!(
"driver core features zero: {}",
zero.join(" ")
));
crate::logf!(gndrm_obf::obf!(
"wrapper-style feature lift over the driver's zeros: {}",
raised.join(" ")
));
crate::logf!("driver core features zero: {}",
zero.join(" "));
crate::logf!("wrapper-style feature lift over the driver's zeros: {}",
raised.join(" "));
}
}

Expand Down Expand Up @@ -264,10 +258,8 @@ pub fn request_mismatch(c: &CoreFeatures, base: &CoreFeatures) -> Vec<&'static s
inheritedQueries,
);
if !bad.is_empty() && !MISMATCH.swap(true, Ordering::Relaxed) {
crate::logf!(gndrm_obf::obf!(
"guest requests features the driver answers zero: {}",
bad.join(" ")
));
crate::logf!("guest requests features the driver answers zero: {}",
bad.join(" "));
}
bad
}
Expand Down
4 changes: 1 addition & 3 deletions icd_shim/src/divisor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ static FAKED: AtomicBool = AtomicBool::new(false);

pub fn note_faked() {
if !FAKED.swap(true, Ordering::Relaxed) {
crate::logf!(gndrm_obf::obf!(
"proxy: advertised VK_EXT_vertex_attribute_divisor over the KHR extension"
));
crate::logf!("proxy: advertised VK_EXT_vertex_attribute_divisor over the KHR extension");
}
}

Expand Down
Loading
Loading