summaryrefslogtreecommitdiff
path: root/libdrm/xf86drmMode.c
diff options
context:
space:
mode:
Diffstat (limited to 'libdrm/xf86drmMode.c')
-rw-r--r--libdrm/xf86drmMode.c52
1 files changed, 17 insertions, 35 deletions
diff --git a/libdrm/xf86drmMode.c b/libdrm/xf86drmMode.c
index 04fb07dc..6070ec6f 100644
--- a/libdrm/xf86drmMode.c
+++ b/libdrm/xf86drmMode.c
@@ -215,51 +215,33 @@ int drmModeRmFB(int fd, uint32_t bufferId)
return ioctl(fd, DRM_IOCTL_MODE_RMFB, bufferId);
}
-#if 0
-int drmModeForceProbe(int fd, uint32_t outputId)
-{
- /* TODO impl/keep? */
-}
-
-drmModeFrameBufferPtr drmModeGetFrameBuffer(int fd, uint32_t buf)
+drmModeFrameBufferPtr drmModeGetFB(int fd, uint32_t buf)
{
-// struct drm_mode_fb_cmd info;
+ struct drm_mode_fb_cmd info;
drmModeFrameBufferPtr r;
- // if (ioctl(fd, DRM_IOCTL_MODE_GETFRAMEBUFFER, &info))
- return 0;
+ info.buffer_id = buf;
+
+ if (ioctl(fd, DRM_IOCTL_MODE_GETFB, &info))
+ return NULL;
if (!(r = drmMalloc(sizeof(*r))))
- return 0;
+ return NULL;
- /* TODO change to new code
- r->minWidth = info.minWidth;
- r->maxWidth = info.maxWidth;
- r->minHeight = info.minHeight;
- r->maxHeight = info.maxHeight;*/
+ r->buffer_id = info.buffer_id;
+ r->width = info.width;
+ r->height = info.height;
+ r->pitch = info.pitch;
+ r->bpp = info.bpp;
+ r->handle = info.handle;
+ r->depth = info.depth;
return r;
}
-
-uint32_t drmModeNewFrameBuffer(int fd, uint32_t width, uint32_t height,
- uint8_t bpp, uint32_t pitch, drmBO *bo)
-{
- drm_mode_fb_cmd_t f;
-
- f.handle = bo->handle;
- f.width = width;
- f.height = height;
- f.pitch = pitch;
-
- // if (ioctl(fd, DRM_IOCTL_MODE_NEWFRAMEBUFFER, &f))
- return 0;
-
- return f.bufferId;
-}
-
-int drmModeDesFrameBuffer(int fd, uint32_t bufferId)
+#if 0
+int drmModeForceProbe(int fd, uint32_t outputId)
{
- // return ioctl(fd, DRM_IOCTL_MODE_DESFRAMEBUFFER, bufferId);
+ /* TODO impl/keep? */
}
#endif