add support for setting a framebuffer depth
parent
c582eaac19
commit
a6cc6a778f
|
@ -190,7 +190,7 @@ err_allocs:
|
|||
return r;
|
||||
}
|
||||
|
||||
int drmModeAddFB(int fd, uint32_t width, uint32_t height,
|
||||
int drmModeAddFB(int fd, uint32_t width, uint32_t height, uint8_t depth,
|
||||
uint8_t bpp, uint32_t pitch, drmBO *bo, uint32_t *buf_id)
|
||||
{
|
||||
struct drm_mode_fb_cmd f;
|
||||
|
@ -200,6 +200,7 @@ int drmModeAddFB(int fd, uint32_t width, uint32_t height,
|
|||
f.height = height;
|
||||
f.pitch = pitch;
|
||||
f.bpp = bpp;
|
||||
f.depth = depth;
|
||||
f.handle = bo->handle;
|
||||
|
||||
if (ret = ioctl(fd, DRM_IOCTL_MODE_ADDFB, &f))
|
||||
|
|
|
@ -215,7 +215,7 @@ extern drmModeFrameBufferPtr drmModeGetFB(int fd,
|
|||
/**
|
||||
* Creates a new framebuffer with an buffer object as its scanout buffer.
|
||||
*/
|
||||
extern int drmModeAddFB(int fd, uint32_t width, uint32_t height,
|
||||
extern int drmModeAddFB(int fd, uint32_t width, uint32_t height, uint8_t depth,
|
||||
uint8_t bpp, uint32_t pitch, drmBO *bo, uint32_t *buf_id);
|
||||
/**
|
||||
* Destroies the given framebuffer.
|
||||
|
|
|
@ -1003,12 +1003,13 @@ int drm_mode_addfb(struct inode *inode, struct file *filp,
|
|||
if(!fb)
|
||||
return -EINVAL;;
|
||||
|
||||
fb->width = r.width;
|
||||
fb->height = r.height;
|
||||
fb->pitch = r.pitch;
|
||||
fb->width = r.width;
|
||||
fb->height = r.height;
|
||||
fb->pitch = r.pitch;
|
||||
fb->bits_per_pixel = r.bpp;
|
||||
fb->offset = bo->offset;
|
||||
fb->bo = bo;
|
||||
fb->depth = r.depth;
|
||||
fb->offset = bo->offset;
|
||||
fb->bo = bo;
|
||||
|
||||
r.buffer_id = fb->id;
|
||||
|
||||
|
|
|
@ -970,6 +970,7 @@ struct drm_mode_fb_cmd {
|
|||
unsigned int pitch;
|
||||
unsigned int bpp;
|
||||
unsigned int handle;
|
||||
unsigned int depth;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue