Currently DumbBuf is one big opaque blob (with a GemHandle implemntation).
Which was mostly done to Just Get It Working™.
The steps for using a dumb buf and mapping it are:
- Create Dumb buffer.
- create something that can be mapped.
a. Use map dump which gives you an offset.
b. Create a PRIME fd
- mmap
- Create a Drm Fb.
Currently it:
- Creates the buffer
- Dups device
- Creates the offset,
- Mmaps it.
- Then returns all that in one big mess (with a generic parameter)
I would like something that looks like:
let dumb = device.create_dumb::<Argb8888>(width, height);
let prime = dumb.create_prime();
let map = prime.map();
Where prime is some struct Prime. create_prime is actaully from a Gem trait. (Or GemExt for AsRef<&GemHandle>), and Argb8888 is some pixel type. (We have those already) with a trait like so:
pub trait PixelFormat {
type Pixel: Copy, Sized, From<u32>;
fn buffer_as(buf: &[u8]) -> &[Self::Pixel];
}
map is probably going to be some wrapper around Memmap.
Currently DumbBuf is one big opaque blob (with a GemHandle implemntation).
Which was mostly done to Just Get It Working™.
The steps for using a dumb buf and mapping it are:
a. Use map dump which gives you an offset.
b. Create a PRIME fd
Currently it:
I would like something that looks like:
Where
primeis some structPrime.create_primeis actaully from a Gem trait. (OrGemExtforAsRef<&GemHandle>), andArgb8888is some pixel type. (We have those already) with a trait like so:map is probably going to be some wrapper around Memmap.