2 * Copyright (c) 2014 The Chromium OS Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file.
12 #include <exynos_drm.h>
17 int gbm_exynos_bo_create(struct gbm_bo *bo, uint32_t width, uint32_t height, uint32_t format, uint32_t flags)
19 size_t size = width * height * gbm_bytes_from_format(format);
20 struct drm_exynos_gem_create gem_create;
23 memset(&gem_create, 0, sizeof(gem_create));
24 gem_create.size = size;
25 gem_create.flags = EXYNOS_BO_NONCONTIG;
27 ret = drmIoctl(bo->gbm->fd, DRM_IOCTL_EXYNOS_GEM_CREATE, &gem_create);
29 fprintf(stderr, "minigbm: DRM_IOCTL_EXYNOS_GEM_CREATE failed "
30 "(size=%zu)\n", size);
34 bo->handle.u32 = gem_create.handle;
36 bo->stride = width * gbm_bytes_from_format(format);
41 const struct gbm_driver gbm_driver_exynos =
44 .bo_create = gbm_exynos_bo_create,
45 .bo_destroy = gbm_gem_bo_destroy,
47 {GBM_FORMAT_XRGB8888, GBM_BO_USE_SCANOUT | GBM_BO_USE_CURSOR | GBM_BO_USE_RENDERING | GBM_BO_USE_WRITE},
48 {GBM_FORMAT_ARGB8888, GBM_BO_USE_SCANOUT | GBM_BO_USE_CURSOR | GBM_BO_USE_RENDERING | GBM_BO_USE_WRITE},