Commit c9090910 authored by Alyssa Rosenzweig's avatar Alyssa Rosenzweig 💜

Simplify vendor compat layer (part 2)

parent c95013f7
......@@ -37,21 +37,8 @@ int
pandev_ioctl(int fd, unsigned long request, void *args)
{
union mali_ioctl_header *h = args;
int rc;
h->id = ((_IOC_TYPE(request) & 0xF) << 8) | _IOC_NR(request);
rc = ioctl(fd, request, args);
if (rc)
return rc;
switch (h->rc) {
case MALI_ERROR_NONE: return 0;
case MALI_ERROR_FUNCTION_FAILED: return -EINVAL;
case MALI_ERROR_OUT_OF_MEMORY: return -ENOMEM;
case MALI_ERROR_OUT_OF_GPU_MEMORY: return -ENOSPC;
default: return -EINVAL;
}
assert(ioctl(fd, request, args) == 0);
}
int
......@@ -64,14 +51,9 @@ pandev_general_allocate(int fd, int va_pages, int commit_pages, int extent, int
.flags = flags
};
int rc = pandev_ioctl(fd, MALI_IOCTL_MEM_ALLOC, &args);
if (rc)
return rc;
assert(pandev_ioctl(fd, MALI_IOCTL_MEM_ALLOC, &args) == 0);
*out = args.gpu_va;
return 0;
}
int
......
......@@ -24,8 +24,6 @@
#include "slow-framebuffer.h"
int pandev_open(void);
int pandev_query_mem(int fd, mali_ptr addr, enum mali_ioctl_mem_query_type attr,
u64 *out);
/* Calls used while replaying */
int pandev_raw_open(void);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment