pub fn add(dev: &Device, handle: u32,
               width: u32, height: u32,
               bpp: u32, pitch: u32, depth: u32)
               -> io::Result<Fb>
    {
        /// There are two ioctls that make use of drm_mode_fb_cmd.
        /// So we must define DrmIoctl locally.
        #[repr(C)]
        #[derive(Debug)]
        struct AddFb(ffi::fb_cmd);
        impl DrmIoctl for AddFb {
            fn request() -> c_ulong { DRM_IOCTL_MODE_ADDFB }
        }
        
        let mut add_fb = AddFb(ffi::fb_cmd {
            handle: handle,
            width: width, height: height,
            bpp: bpp, pitch: pitch,
            depth: depth,          // TODO: What does this need to be
            ..Default::default()
        });

        try!(dev.ioctl(&mut add_fb));

        Ok(Fb {
            fb_id: unsafe { Id::from_u32(add_fb.0.fb_id).unwrap() },
            size: (width, height),
            pitch: pitch,
            bits_per_pixel: bpp,
            depth: depth,
            handle: handle,
        })
    }
/// Add a frame buffer using a GEM handle.
///
/// * handle: A gem handle
/// * (width, height): The width and height in pixels.
/// * bpp: Bit's per pixel (Eg: 32)
/// * pitch: Offset between the start of each row in bytes. (ie. width + padding)
/// * depth: Color depth. (Eg: 24)
///
/// There is an Api for FbAdd2, which allows for mulit-plane
/// buffers and more useful color format selection.
Add a frame buffer using a GEM handle.
handle: A gem handle
(width, height): The width and height in pixels.
bpp: Bit's per pixel
pitch: Offset between the start of each row in bytes.
depth: Color depth.

There is an Api for FbAdd2, which allows for mulit-plane
buffers and more useful color format selection.
Add a frame buffer using a GEM handle . handle : A gem handle ( width height ) : The width and height in pixels . bpp : Bit ' s per pixel pitch : Offset between the start of each row in bytes . depth : Color depth . There is an Api for FbAdd2 which allows for mulit - plane buffers and more useful color format selection .
pub fn add(dev: &Device, handle: u32,
               width: u32, height: u32,
               bpp: u32, pitch: u32, depth: u32)
               -> io::Result<Fb>
    {
        /// There are two ioctls that make use of drm_mode_fb_cmd.
        /// So we must define DrmIoctl locally.
        #[repr(C)]
        #[derive(Debug)]
        struct AddFb(ffi::fb_cmd);
        impl DrmIoctl for AddFb {
            fn request() -> c_ulong { DRM_IOCTL_MODE_ADDFB }
        }
        let mut add_fb = AddFb(ffi::fb_cmd {
            handle: handle,
            width: width, height: height,
            bpp: bpp, pitch: pitch,
            depth: depth,          // TODO: What does this need to be
            ..Default::default()
        });
        try!(dev.ioctl(&mut add_fb));
        Ok(Fb {
            fb_id: unsafe { Id::from_u32(add_fb.0.fb_id).unwrap() },
            size: (width, height),
            pitch: pitch,
            bits_per_pixel: bpp,
            depth: depth,
            handle: handle,
        })
    }
pub fn add ( dev : & Device , handle : u32 , width : u32 , height : u32 , bpp : u32 , pitch : u32 , depth : u32 ) -> io :: Result < Fb > { /// There are two ioctls that make use of drm_mode_fb_cmd. /// So we must define DrmIoctl locally. # [ repr ( C ) ] # [ derive ( Debug ) ] struct AddFb ( ffi :: fb_cmd ) ; impl DrmIoctl for AddFb { fn request ( ) -> c_ulong { DRM_IOCTL_MODE_ADDFB } } let mut add_fb = AddFb ( ffi :: fb_cmd { handle : handle , width : width , height : height , bpp : bpp , pitch : pitch , depth : depth , // TODO: What does this need to be .. Default :: default ( ) } ) ; try ! ( dev ioctl ( mut add_fb ) ) ; Ok ( Fb { fb_id : unsafe { Id :: from_u32 ( add_fb . 0 . fb_id ) . unwrap ( ) } , size : ( width , height ) , pitch : pitch , bits_per_pixel : bpp , depth : depth , handle : handle , } ) }
Add a frame buffer using a GEM handle.
Add a frame buffer using a GEM handle .
dev
&Device
handle
u32
width
u32
height
u32
bpp
u32
pitch
u32
depth
u32