diff options
author | David Airlie <airlied@asimov.stargames.com.au> | 2007-04-11 17:13:45 +1000 |
---|---|---|
committer | David Airlie <airlied@asimov.stargames.com.au> | 2007-04-11 17:13:45 +1000 |
commit | a6cc6a778f8b2f86300a8ce87441d044fd67f930 (patch) | |
tree | 22bec4c9765ac635e363a072e2587c7fd8b3ce80 | |
parent | c582eaac194411f52a2c0527ffa093b5a422d7b9 (diff) |
add support for setting a framebuffer depth
-rw-r--r-- | libdrm/xf86drmMode.c | 3 | ||||
-rw-r--r-- | libdrm/xf86drmMode.h | 2 | ||||
-rw-r--r-- | linux-core/drm_crtc.c | 11 | ||||
-rw-r--r-- | shared-core/drm.h | 1 |
4 files changed, 10 insertions, 7 deletions
diff --git a/libdrm/xf86drmMode.c b/libdrm/xf86drmMode.c index 7f0252ce..04fb07dc 100644 --- a/libdrm/xf86drmMode.c +++ b/libdrm/xf86drmMode.c @@ -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)) diff --git a/libdrm/xf86drmMode.h b/libdrm/xf86drmMode.h index 4ca9e407..cdc82f7d 100644 --- a/libdrm/xf86drmMode.h +++ b/libdrm/xf86drmMode.h @@ -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. diff --git a/linux-core/drm_crtc.c b/linux-core/drm_crtc.c index 83f8e167..1c1c3006 100644 --- a/linux-core/drm_crtc.c +++ b/linux-core/drm_crtc.c @@ -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; diff --git a/shared-core/drm.h b/shared-core/drm.h index a5330b28..621b201c 100644 --- a/shared-core/drm.h +++ b/shared-core/drm.h @@ -970,6 +970,7 @@ struct drm_mode_fb_cmd { unsigned int pitch; unsigned int bpp; unsigned int handle; + unsigned int depth; }; /** |