1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#![doc = include_str!("./README.md")]

#![cfg_attr(not(feature = "std"), no_std)]

#![allow(non_upper_case_globals)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]

#[allow(dead_code)]
#[cfg(not(feature = "buildtime_bindgen"))]
mod bindings {
    mod drm;
    pub use drm::*;
}

#[cfg(not(feature = "buildtime_bindgen"))]
mod amdgpu;
#[cfg(not(feature = "buildtime_bindgen"))]
pub mod AMDGPU {
    pub use super::amdgpu::*;
}

#[cfg(not(feature = "buildtime_bindgen"))]
mod pci_bus_info;
#[cfg(not(feature = "buildtime_bindgen"))]
pub use pci_bus_info::*;

/// Convert `errno` to `Err(i32)`
#[macro_export]
macro_rules! query_error {
    ($r: expr) => {
        if $r != 0 {
            return Err($r);
        }
    };
}