From 13adefefe68d459f3133debe7a029412d5c09697 Mon Sep 17 00:00:00 2001 From: Russell King Date: Thu, 20 Mar 2014 18:00:12 +0000 Subject: Split out the ioctl issuing function This functionality can be re-used by providing other ioctls, so move it out from vivante_map_bo_to_gpu(). Signed-off-by: Russell King --- src/vivante_utils.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/vivante_utils.c b/src/vivante_utils.c index bae3221..a53459a 100644 --- a/src/vivante_utils.c +++ b/src/vivante_utils.c @@ -70,6 +70,13 @@ void __vivante_error(struct vivante *vivante, const char *fn, const char *w, int } +static gceSTATUS vivante_ioctl(struct vivante *vivante, unsigned cmd, + void *buf, size_t size) +{ + return gcoOS_DeviceControl(vivante->os, cmd, buf, size, buf, size); +} + + PixmapPtr vivante_drawable_pixmap_deltas(DrawablePtr pDrawable, int *x, int *y) { PixmapPtr pPixmap; @@ -129,8 +136,7 @@ Bool vivante_map_bo_to_gpu(struct vivante *vivante, struct drm_armada_bo *bo, map.zero = 0; map.fd = fd; - status = gcoOS_DeviceControl(vivante->os, IOC_GDMABUF_MAP, - &map, sizeof(map), &map, sizeof(map)); + status = vivante_ioctl(vivante, IOC_GDMABUF_MAP, &map, sizeof(map)); /* we don't need to keep the fd around anymore */ close(fd); -- cgit v1.2.3