From b15f9b6454040498bff37baa615dd66d2600ffe0 Mon Sep 17 00:00:00 2001 From: Ian Douglas Scott Date: Wed, 25 Sep 2024 10:24:24 -0700 Subject: [PATCH 1/5] Update `drm` to 0.14 --- Cargo.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 80dba2c..f34fa99 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,7 +21,7 @@ version = "0.3.0" path = "./gbm-sys" [dependencies.drm] -version = "0.12.0" +version = "0.14.0" optional = true [dependencies.wayland-server] @@ -42,7 +42,7 @@ features = ["derive"] optional = true [dev-dependencies.drm] -version = "0.12.0" +version = "0.14.0" [features] default = ["import-wayland", "import-egl", "drm-support"] From 64945f1492635dbd44e0a680dacc11c30bf6816b Mon Sep 17 00:00:00 2001 From: Ian Douglas Scott Date: Wed, 25 Sep 2024 10:26:48 -0700 Subject: [PATCH 2/5] Fix tests for renamed "gen" feature I guess the earlier commit to rename this missed these, and Rustc didn't have a warning for non-existent features at the time. Seems to build with or without the feature now. --- gbm-sys/build.rs | 6 +++--- gbm-sys/src/lib.rs | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gbm-sys/build.rs b/gbm-sys/build.rs index b23dd16..4dfc5dc 100644 --- a/gbm-sys/build.rs +++ b/gbm-sys/build.rs @@ -1,10 +1,10 @@ -#[cfg(feature = "gen")] +#[cfg(feature = "use_bindgen")] extern crate bindgen; -#[cfg(not(feature = "gen"))] +#[cfg(not(feature = "use_bindgen"))] fn main() {} -#[cfg(feature = "gen")] +#[cfg(feature = "use_bindgen")] fn main() { use std::{env, path::Path}; diff --git a/gbm-sys/src/lib.rs b/gbm-sys/src/lib.rs index 2c95bcf..77c6bda 100644 --- a/gbm-sys/src/lib.rs +++ b/gbm-sys/src/lib.rs @@ -4,10 +4,10 @@ // it is not so. #![cfg_attr(test, allow(deref_nullptr))] -#[cfg(feature = "gen")] +#[cfg(feature = "use_bindgen")] include!(concat!(env!("OUT_DIR"), "/bindings.rs")); -#[cfg(not(feature = "gen"))] +#[cfg(not(feature = "use_bindgen"))] include!("bindings.rs"); #[link(name = "gbm")] From 2c919976c706e0220f701cd83321dc592aa29fb9 Mon Sep 17 00:00:00 2001 From: Ian Douglas Scott Date: Wed, 25 Sep 2024 10:29:04 -0700 Subject: [PATCH 3/5] v0.16.0 --- CHANGELOG.md | 5 +++++ Cargo.toml | 2 +- README.md | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9cc3909..ea4b065 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.16.0 + +- Update drm-rs to 0.14 +- Fix `use_bindgen` feature + ## 0.15.0 - Update drm-rs to 0.12 diff --git a/Cargo.toml b/Cargo.toml index f34fa99..97eb738 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ description = "libgbm bindings for rust" license = "MIT" documentation = "https://docs.rs/gbm" repository = "https://github.com/Smithay/gbm.rs" -version = "0.15.0" +version = "0.16.0" keywords = ["wayland", "gbm", "drm", "bindings"] categories = ["external-ffi-bindings"] authors = ["Victoria Brekenfeld "] diff --git a/README.md b/README.md index 1d90c0d..54120a8 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ provided through the `drm-support` feature. Add to your Cargo.toml ```toml -gbm = "0.15.0" +gbm = "0.16.0" ``` ## Example From c6c22c57403be85b20d08c47437fe42c39ef8058 Mon Sep 17 00:00:00 2001 From: Ian Douglas Scott Date: Fri, 27 Sep 2024 13:06:38 -0700 Subject: [PATCH 4/5] ci: Use Rust 1.66; which drm-rs now depends on --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e0893fd..bdfd2f9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -67,7 +67,7 @@ jobs: - run: sudo apt-get install -y libdrm-dev libwayland-dev - uses: actions-rs/toolchain@v1 with: - toolchain: 1.65.0 + toolchain: 1.66.0 profile: minimal components: clippy default: true @@ -78,12 +78,12 @@ jobs: path: | ~/.cargo/registry ~/.cargo/git - key: ${{ runner.os }}-cargo-rust_1_65-${{ hashFiles('**/Cargo.toml') }} + key: ${{ runner.os }}-cargo-rust_1_66-${{ hashFiles('**/Cargo.toml') }} - name: Build cache uses: actions/cache@v2 with: path: target - key: ${{ runner.os }}-build-rust_1_65-check-${{ hashFiles('**/Cargo.toml') }} + key: ${{ runner.os }}-build-rust_1_66-check-${{ hashFiles('**/Cargo.toml') }} - name: Downgrade to MSRV package versions run: cargo update -p home --precise 0.5.5 - name: Clippy check From ccd9186c9fef717de88c2ed2fae80df071cf1027 Mon Sep 17 00:00:00 2001 From: Ian Douglas Scott Date: Fri, 27 Sep 2024 13:17:43 -0700 Subject: [PATCH 5/5] Fix clippy `unnecessary_cast` lint Removed the case where `bindings.rs` defined the constants as `u32`, but allowed the lint where it instead uses a type alias defined as `libc::c_uint` (which tecnically may not be 32-bit). --- src/buffer_object.rs | 2 ++ src/device.rs | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/buffer_object.rs b/src/buffer_object.rs index b16c8a6..610851f 100644 --- a/src/buffer_object.rs +++ b/src/buffer_object.rs @@ -1,3 +1,5 @@ +#![allow(clippy::unnecessary_cast)] + use crate::{AsRaw, Device, DeviceDestroyedError, Format, Modifier, Ptr, WeakPtr}; #[cfg(feature = "drm-support")] diff --git a/src/device.rs b/src/device.rs index b5aa670..ca39918 100644 --- a/src/device.rs +++ b/src/device.rs @@ -265,7 +265,7 @@ impl Device { let ptr = unsafe { ffi::gbm_bo_import( *self.ffi, - ffi::GBM_BO_IMPORT_WL_BUFFER as u32, + ffi::GBM_BO_IMPORT_WL_BUFFER, buffer.id().as_ptr() as *mut _, usage.bits(), ) @@ -298,7 +298,7 @@ impl Device { ) -> IoResult> { let ptr = ffi::gbm_bo_import( *self.ffi, - ffi::GBM_BO_IMPORT_EGL_IMAGE as u32, + ffi::GBM_BO_IMPORT_EGL_IMAGE, buffer, usage.bits(), ); @@ -337,7 +337,7 @@ impl Device { let ptr = unsafe { ffi::gbm_bo_import( *self.ffi, - ffi::GBM_BO_IMPORT_FD as u32, + ffi::GBM_BO_IMPORT_FD, &mut fd_data as *mut ffi::gbm_import_fd_data as *mut _, usage.bits(), ) @@ -385,7 +385,7 @@ impl Device { let ptr = unsafe { ffi::gbm_bo_import( *self.ffi, - ffi::GBM_BO_IMPORT_FD_MODIFIER as u32, + ffi::GBM_BO_IMPORT_FD_MODIFIER, &mut fd_data as *mut ffi::gbm_import_fd_modifier_data as *mut _, usage.bits(), )