示例#1
0
static struct exynos_bo *exynos_create_buffer(struct exynos_device *dev,
						unsigned long size,
						unsigned int flags)
{
	struct exynos_bo *bo;

	bo = exynos_bo_create(dev, size, flags);
	if (!bo)
		return bo;

	if (!exynos_bo_map(bo)) {
		exynos_bo_destroy(bo);
		return NULL;
	}

	return bo;
}
示例#2
0
/* Create a GEM buffer with userspace mapping. Buffer is cleared after creation. */
static struct exynos_bo *create_mapped_buffer(struct exynos_device *dev, unsigned size) {
  struct exynos_bo *buf;
  const unsigned flags = 0;

  buf = exynos_bo_create(dev, size, flags);
  if (buf == NULL) {
    RARCH_ERR("video_exynos: failed to create temp buffer object\n");
    return NULL;
  }

  if (exynos_bo_map(buf) == NULL) {
    RARCH_ERR("video_exynos: failed to map temp buffer object\n");
    exynos_bo_destroy(buf);
    return NULL;
  }

  memset(buf->vaddr, 0, size);

  return buf;
}