summaryrefslogtreecommitdiff
path: root/src/gallium/winsys
diff options
context:
space:
mode:
authorMarek Olšák <maraeo@gmail.com>2010-06-20 03:37:14 +0200
committerMarek Olšák <maraeo@gmail.com>2010-06-20 03:59:32 +0200
commite4fe18a6206560a3a562147d1033389ec977d607 (patch)
tree79dc30007006d1fa6b01d102e10815c3fa30e104 /src/gallium/winsys
parent6e96cfa39a1d6705be6b3fc3bae651ba0450a336 (diff)
r300g: cleanup buffer_{from, get}_handle
Diffstat (limited to 'src/gallium/winsys')
-rw-r--r--src/gallium/winsys/radeon/drm/radeon_drm_buffer.c6
-rw-r--r--src/gallium/winsys/radeon/drm/radeon_r300.c16
2 files changed, 6 insertions, 16 deletions
diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_buffer.c b/src/gallium/winsys/radeon/drm/radeon_drm_buffer.c
index ee1b9ede25..a4b6cff33d 100644
--- a/src/gallium/winsys/radeon/drm/radeon_drm_buffer.c
+++ b/src/gallium/winsys/radeon/drm/radeon_drm_buffer.c
@@ -267,16 +267,14 @@ static struct radeon_drm_buffer *get_drm_buffer(struct pb_buffer *_buf)
boolean radeon_drm_bufmgr_get_handle(struct pb_buffer *_buf,
struct winsys_handle *whandle)
{
- int retval, fd;
struct drm_gem_flink flink;
struct radeon_drm_buffer *buf = get_drm_buffer(_buf);
+
if (whandle->type == DRM_API_HANDLE_TYPE_SHARED) {
if (!buf->flinked) {
- fd = buf->mgr->rws->fd;
flink.handle = buf->bo->handle;
- retval = ioctl(fd, DRM_IOCTL_GEM_FLINK, &flink);
- if (retval) {
+ if (ioctl(buf->mgr->rws->fd, DRM_IOCTL_GEM_FLINK, &flink)) {
return FALSE;
}
diff --git a/src/gallium/winsys/radeon/drm/radeon_r300.c b/src/gallium/winsys/radeon/drm/radeon_r300.c
index dbf4d197dd..237fdc8bac 100644
--- a/src/gallium/winsys/radeon/drm/radeon_r300.c
+++ b/src/gallium/winsys/radeon/drm/radeon_r300.c
@@ -136,29 +136,21 @@ static boolean radeon_r300_winsys_is_buffer_referenced(struct r300_winsys_screen
}
static struct r300_winsys_buffer *radeon_r300_winsys_buffer_from_handle(struct r300_winsys_screen *rws,
- struct pipe_screen *screen,
- struct winsys_handle *whandle,
- unsigned *stride)
+ unsigned handle)
{
struct radeon_libdrm_winsys *ws = radeon_winsys_screen(rws);
struct pb_buffer *_buf;
- _buf = radeon_drm_bufmgr_create_buffer_from_handle(ws->kman, whandle->handle);
- *stride = whandle->stride;
+ _buf = radeon_drm_bufmgr_create_buffer_from_handle(ws->kman, handle);
return radeon_libdrm_winsys_buffer(_buf);
}
static boolean radeon_r300_winsys_buffer_get_handle(struct r300_winsys_screen *rws,
struct r300_winsys_buffer *buffer,
- unsigned stride,
- struct winsys_handle *whandle)
+ struct winsys_handle *whandle)
{
struct pb_buffer *_buf = radeon_pb_buffer(buffer);
- boolean ret;
- ret = radeon_drm_bufmgr_get_handle(_buf, whandle);
- if (ret)
- whandle->stride = stride;
- return ret;
+ return radeon_drm_bufmgr_get_handle(_buf, whandle);
}
static void radeon_set_flush_cb(struct r300_winsys_screen *rws,