rdw: use pixman-sys for constants

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
This commit is contained in:
Marc-André Lureau 2025-01-22 15:31:36 +04:00
parent fa1e5956a0
commit b1f58e8704
3 changed files with 9 additions and 4 deletions

1
Cargo.lock generated
View File

@ -3708,6 +3708,7 @@ dependencies = [
"keycodemap",
"log 0.4.25",
"once_cell",
"pixman-sys",
"pretty_env_logger",
"qemu-display",
"rdw4",

View File

@ -2,7 +2,7 @@
name = "qemu-rdw"
version = "0.1.0"
authors = ["Marc-André Lureau <marcandre.lureau@redhat.com>"]
edition = "2018"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[features]
@ -19,6 +19,7 @@ futures-util = "0.3"
futures = "0.3"
async-trait = "0.1"
tracing-subscriber = { version = "0.3.18", features = ["env-filter" , "fmt"], default-features = false }
pixman-sys = "0.1.0"
[target.'cfg(unix)'.dependencies]
rdw = { package = "rdw4", version = "0.1", features = ["bindings"] }

View File

@ -12,6 +12,9 @@ use std::cell::Cell;
#[cfg(unix)]
use std::os::unix::io::IntoRawFd;
const XRGB_FORMAT: pixman_sys::pixman_format_code_t =
pixman_sys::pixman_format_code_t_PIXMAN_x8r8g8b8;
mod imp {
use super::*;
use gtk::subclass::prelude::*;
@ -256,7 +259,7 @@ mod imp {
use ConsoleEvent::*;
match e {
Scanout(s) => {
if s.format != 0x20020888 {
if s.format != XRGB_FORMAT {
log::warn!("Format not yet supported: {:X}", s.format);
continue;
}
@ -272,7 +275,7 @@ mod imp {
);
}
Update(u) => {
if u.format != 0x20020888 {
if u.format != XRGB_FORMAT {
log::warn!("Format not yet supported: {:X}", u.format);
continue;
}
@ -287,7 +290,7 @@ mod imp {
}
ScanoutMap { scanout, wait_tx } => {
log::debug!("{scanout:?}");
if scanout.format != 0x20020888 {
if scanout.format != XRGB_FORMAT {
log::warn!(
"Format not yet supported: {:X}",
scanout.format