summaryrefslogtreecommitdiff
path: root/libdrm
diff options
context:
space:
mode:
authorJesse Barnes <jbarnes@hobbes.virtuousgeek.org>2007-04-11 20:41:54 -0700
committerJesse Barnes <jbarnes@hobbes.virtuousgeek.org>2007-04-11 20:41:54 -0700
commite8bd9fdf31bf3db91431b69ce1fc8d419148c838 (patch)
tree6a71e0a919484e8a5255063d3abc691e05e70665 /libdrm
parent0430a80fc7861a3397a3f2649dfeb9eff14359a5 (diff)
parentb1f0fd6dfbd1495aa08c6358e936582eeca042c8 (diff)
Merge branch 'modesetting-101' of git+ssh://git.freedesktop.org/git/mesa/drm into origin/modesetting-101
Diffstat (limited to 'libdrm')
-rw-r--r--libdrm/xf86drmMode.c56
-rw-r--r--libdrm/xf86drmMode.h19
2 files changed, 25 insertions, 50 deletions
diff --git a/libdrm/xf86drmMode.c b/libdrm/xf86drmMode.c
index 04fb07dc..b695467b 100644
--- a/libdrm/xf86drmMode.c
+++ b/libdrm/xf86drmMode.c
@@ -106,7 +106,7 @@ void drmModeFreeResources(drmModeResPtr ptr)
}
-void drmModeFreeFrameBuffer(drmModeFrameBufferPtr ptr)
+void drmModeFreeFB(drmModeFBPtr ptr)
{
if (!ptr)
return;
@@ -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)
+drmModeFBPtr drmModeGetFB(int fd, uint32_t buf)
{
- /* TODO impl/keep? */
-}
+ struct drm_mode_fb_cmd info;
+ drmModeFBPtr r;
-drmModeFrameBufferPtr drmModeGetFrameBuffer(int fd, uint32_t buf)
-{
-// struct drm_mode_fb_cmd info;
- drmModeFrameBufferPtr r;
+ info.buffer_id = buf;
- // if (ioctl(fd, DRM_IOCTL_MODE_GETFRAMEBUFFER, &info))
- return 0;
+ 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
@@ -294,7 +276,7 @@ drmModeCrtcPtr drmModeGetCrtc(int fd, uint32_t crtcId)
r->mode = crtc.mode;
// r->width = crtc.width;
// r->height = crtc.height;
- r->bufferId = crtc.fb_id;
+ r->buffer_id = crtc.fb_id;
r->gamma_size = crtc.gamma_size;
r->count_outputs = crtc.count_outputs;
r->count_possibles = crtc.count_possibles;
diff --git a/libdrm/xf86drmMode.h b/libdrm/xf86drmMode.h
index cdc82f7d..6aa104a9 100644
--- a/libdrm/xf86drmMode.h
+++ b/libdrm/xf86drmMode.h
@@ -76,18 +76,11 @@ typedef struct _drmModeRes {
} drmModeRes, *drmModeResPtr;
-typedef struct _drmModeFrameBuffer {
-
- uint32_t width;
- uint32_t height;
- uint32_t pitch;
- uint8_t bpp;
-
-} drmModeFrameBuffer, *drmModeFrameBufferPtr;
+typedef struct drm_mode_fb_cmd drmModeFB, *drmModeFBPtr;
typedef struct _drmModeCrtc {
- unsigned int bufferId; /**< Buffer currently connected to */
+ unsigned int buffer_id; /**< FB id to connect to 0 = disconnect*/
uint32_t x, y; /**< Position on the frameuffer */
uint32_t width, height;
@@ -187,7 +180,7 @@ typedef struct _drmModeOutput {
extern void drmModeFreeModeInfo( struct drm_mode_modeinfo *ptr );
extern void drmModeFreeResources( drmModeResPtr ptr );
-extern void drmModeFreeFrameBuffer( drmModeFrameBufferPtr ptr );
+extern void drmModeFreeFB( drmModeFBPtr ptr );
extern void drmModeFreeCrtc( drmModeCrtcPtr ptr );
extern void drmModeFreeOutput( drmModeOutputPtr ptr );
@@ -209,14 +202,14 @@ extern int drmModeForceProbe(int fd, uint32_t outputId);
/**
* Retrive information about framebuffer bufferId
*/
-extern drmModeFrameBufferPtr drmModeGetFB(int fd,
- uint32_t bufferId);
+extern drmModeFBPtr drmModeGetFB(int fd, uint32_t bufferId);
/**
* Creates a new framebuffer with an buffer object as its scanout buffer.
*/
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);
+ uint8_t bpp, uint32_t pitch, drmBO *bo,
+ uint32_t *buf_id);
/**
* Destroies the given framebuffer.
*/