Skip to content

Commit

Permalink
ffi: Add public set_version function
Browse files Browse the repository at this point in the history
Somehow Cargo didn't complain about the previous generated ioctl function
being unused, but does now with the macro based on Rustix.

Taking an `&mut` matches the API of `drmSetInterfaceVersion` in libdrm,
so it makes sense to just stick with that.
  • Loading branch information
ids1024 committed Nov 13, 2023
1 parent 1554bfe commit b744daf
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drm-ffi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,11 @@ pub fn set_capability(fd: BorrowedFd<'_>, cty: u64, val: bool) -> io::Result<drm
Ok(cap)
}

/// Sets the requested interface version
pub fn set_version(fd: BorrowedFd<'_>, version: &mut drm_set_version) -> io::Result<()> {
unsafe { ioctl::set_version(fd, version) }
}

/// Gets the driver version for this device.
pub fn get_version(
fd: BorrowedFd<'_>,
Expand Down

0 comments on commit b744daf

Please sign in to comment.