OSDN Git Service

minigbm: Enable vc4 driver
[android-x86/external-minigbm.git] / helpers.c
index 6c26e54..94b0d65 100644 (file)
--- a/helpers.c
+++ b/helpers.c
@@ -100,7 +100,7 @@ static uint32_t bpp_from_format(uint32_t format, size_t plane)
                return 32;
        }
 
-       fprintf(stderr, "drv: UNKNOWN FORMAT %d\n", format);
+       drv_log("UNKNOWN FORMAT %d\n", format);
        return 0;
 }
 
@@ -211,7 +211,7 @@ int drv_dumb_bo_create(struct bo *bo, uint32_t width, uint32_t height, uint32_t
 
        ret = drmIoctl(bo->drv->fd, DRM_IOCTL_MODE_CREATE_DUMB, &create_dumb);
        if (ret) {
-               fprintf(stderr, "drv: DRM_IOCTL_MODE_CREATE_DUMB failed\n");
+               drv_log("DRM_IOCTL_MODE_CREATE_DUMB failed (%d, %d)\n", bo->drv->fd, errno);
                return ret;
        }
 
@@ -234,8 +234,7 @@ int drv_dumb_bo_destroy(struct bo *bo)
 
        ret = drmIoctl(bo->drv->fd, DRM_IOCTL_MODE_DESTROY_DUMB, &destroy_dumb);
        if (ret) {
-               fprintf(stderr, "drv: DRM_IOCTL_MODE_DESTROY_DUMB failed (handle=%x)\n",
-                       bo->handles[0].u32);
+               drv_log("DRM_IOCTL_MODE_DESTROY_DUMB failed (handle=%x)\n", bo->handles[0].u32);
                return ret;
        }
 
@@ -261,7 +260,7 @@ int drv_gem_bo_destroy(struct bo *bo)
 
                ret = drmIoctl(bo->drv->fd, DRM_IOCTL_GEM_CLOSE, &gem_close);
                if (ret) {
-                       fprintf(stderr, "drv: DRM_IOCTL_GEM_CLOSE failed (handle=%x) error %d\n",
+                       drv_log("DRM_IOCTL_GEM_CLOSE failed (handle=%x) error %d\n",
                                bo->handles[plane].u32, ret);
                        error = ret;
                }
@@ -283,8 +282,7 @@ int drv_prime_bo_import(struct bo *bo, struct drv_import_fd_data *data)
                ret = drmIoctl(bo->drv->fd, DRM_IOCTL_PRIME_FD_TO_HANDLE, &prime_handle);
 
                if (ret) {
-                       fprintf(stderr, "drv: DRM_IOCTL_PRIME_FD_TO_HANDLE failed (fd=%u)\n",
-                               prime_handle.fd);
+                       drv_log("DRM_IOCTL_PRIME_FD_TO_HANDLE failed (fd=%u)\n", prime_handle.fd);
 
                        /*
                         * Need to call GEM close on planes that were opened,
@@ -320,7 +318,7 @@ void *drv_dumb_bo_map(struct bo *bo, struct vma *vma, size_t plane, uint32_t map
 
        ret = drmIoctl(bo->drv->fd, DRM_IOCTL_MODE_MAP_DUMB, &map_dumb);
        if (ret) {
-               fprintf(stderr, "drv: DRM_IOCTL_MODE_MAP_DUMB failed \n");
+               drv_log("DRM_IOCTL_MODE_MAP_DUMB failed\n");
                return MAP_FAILED;
        }
 
@@ -361,7 +359,7 @@ int drv_mapping_destroy(struct bo *bo)
                        if (!--mapping->vma->refcount) {
                                ret = bo->drv->backend->bo_unmap(bo, mapping->vma);
                                if (ret) {
-                                       fprintf(stderr, "drv: munmap failed");
+                                       drv_log("munmap failed\n");
                                        return ret;
                                }