return -1;
if (dri2_surf->back->bo == NULL) {
if (surf->base.modifiers)
- dri2_surf->back->bo = gbm_bo_create_with_modifiers(&dri2_dpy->gbm_dri->base.base,
+ dri2_surf->back->bo = gbm_bo_create_with_modifiers(&dri2_dpy->gbm_dri->base,
surf->base.width, surf->base.height,
surf->base.format,
surf->base.modifiers,
surf->base.count);
else
- dri2_surf->back->bo = gbm_bo_create(&dri2_dpy->gbm_dri->base.base,
+ dri2_surf->back->bo = gbm_bo_create(&dri2_dpy->gbm_dri->base,
surf->base.width,
surf->base.height,
surf->base.format,
}
if (dri2_surf->current->bo == NULL)
- dri2_surf->current->bo = gbm_bo_create(&dri2_dpy->gbm_dri->base.base,
+ dri2_surf->current->bo = gbm_bo_create(&dri2_dpy->gbm_dri->base,
surf->base.width, surf->base.height,
surf->base.format, surf->base.flags);
if (dri2_surf->current->bo == NULL)
}
dri2_dpy->gbm_dri = gbm_dri_device(gbm);
- if (dri2_dpy->gbm_dri->base.type != GBM_DRM_DRIVER_TYPE_DRI) {
- err = "DRI2: gbm device using incorrect/incompatible type";
- goto cleanup;
- }
-
dri2_dpy->fd = fd;
dri2_dpy->driver_name = strdup(dri2_dpy->gbm_dri->driver_name);
dri2_dpy->gbm_dri->swrast_put_image2 = swrast_put_image2;
dri2_dpy->gbm_dri->swrast_get_image = swrast_get_image;
- dri2_dpy->gbm_dri->base.base.surface_lock_front_buffer = lock_front_buffer;
- dri2_dpy->gbm_dri->base.base.surface_release_buffer = release_buffer;
- dri2_dpy->gbm_dri->base.base.surface_has_free_buffers = has_free_buffers;
+ dri2_dpy->gbm_dri->base.surface_lock_front_buffer = lock_front_buffer;
+ dri2_dpy->gbm_dri->base.surface_release_buffer = release_buffer;
+ dri2_dpy->gbm_dri->base.surface_has_free_buffers = has_free_buffers;
dri2_setup_screen(disp);
return -1;
if (dri->dri2->base.version >= 4) {
- dri->screen = dri->dri2->createNewScreen2(0, dri->base.base.fd,
+ dri->screen = dri->dri2->createNewScreen2(0, dri->base.fd,
dri->loader_extensions,
dri->driver_extensions,
&dri->driver_configs, dri);
} else {
- dri->screen = dri->dri2->createNewScreen(0, dri->base.base.fd,
+ dri->screen = dri->dri2->createNewScreen(0, dri->base.fd,
dri->loader_extensions,
&dri->driver_configs, dri);
}
{
char *driver_name;
- driver_name = loader_get_driver_for_fd(dri->base.base.fd);
+ driver_name = loader_get_driver_for_fd(dri->base.fd);
if (!driver_name)
return -1;
gbm_dri_bo_unmap_dumb(bo);
memset(&arg, 0, sizeof(arg));
arg.handle = bo->handle;
- drmIoctl(dri->base.base.fd, DRM_IOCTL_MODE_DESTROY_DUMB, &arg);
+ drmIoctl(dri->base.fd, DRM_IOCTL_MODE_DESTROY_DUMB, &arg);
}
free(bo);
create_arg.width = width;
create_arg.height = height;
- ret = drmIoctl(dri->base.base.fd, DRM_IOCTL_MODE_CREATE_DUMB, &create_arg);
+ ret = drmIoctl(dri->base.fd, DRM_IOCTL_MODE_CREATE_DUMB, &create_arg);
if (ret)
goto free_bo;
destroy_dumb:
memset(&destroy_arg, 0, sizeof destroy_arg);
destroy_arg.handle = create_arg.handle;
- drmIoctl(dri->base.base.fd, DRM_IOCTL_MODE_DESTROY_DUMB, &destroy_arg);
+ drmIoctl(dri->base.fd, DRM_IOCTL_MODE_DESTROY_DUMB, &destroy_arg);
free_bo:
free(bo);
if (!dri)
return NULL;
- dri->base.base.fd = fd;
- dri->base.base.bo_create = gbm_dri_bo_create;
- dri->base.base.bo_import = gbm_dri_bo_import;
- dri->base.base.bo_map = gbm_dri_bo_map;
- dri->base.base.bo_unmap = gbm_dri_bo_unmap;
- dri->base.base.is_format_supported = gbm_dri_is_format_supported;
- dri->base.base.bo_write = gbm_dri_bo_write;
- dri->base.base.bo_get_fd = gbm_dri_bo_get_fd;
- dri->base.base.bo_get_planes = gbm_dri_bo_get_planes;
- dri->base.base.bo_get_handle = gbm_dri_bo_get_handle_for_plane;
- dri->base.base.bo_get_stride = gbm_dri_bo_get_stride;
- dri->base.base.bo_get_offset = gbm_dri_bo_get_offset;
- dri->base.base.bo_get_modifier = gbm_dri_bo_get_modifier;
- dri->base.base.bo_destroy = gbm_dri_bo_destroy;
- dri->base.base.destroy = dri_destroy;
- dri->base.base.surface_create = gbm_dri_surface_create;
- dri->base.base.surface_destroy = gbm_dri_surface_destroy;
-
- dri->base.type = GBM_DRM_DRIVER_TYPE_DRI;
- dri->base.base.name = "drm";
+ dri->base.fd = fd;
+ dri->base.bo_create = gbm_dri_bo_create;
+ dri->base.bo_import = gbm_dri_bo_import;
+ dri->base.bo_map = gbm_dri_bo_map;
+ dri->base.bo_unmap = gbm_dri_bo_unmap;
+ dri->base.is_format_supported = gbm_dri_is_format_supported;
+ dri->base.bo_write = gbm_dri_bo_write;
+ dri->base.bo_get_fd = gbm_dri_bo_get_fd;
+ dri->base.bo_get_planes = gbm_dri_bo_get_planes;
+ dri->base.bo_get_handle = gbm_dri_bo_get_handle_for_plane;
+ dri->base.bo_get_stride = gbm_dri_bo_get_stride;
+ dri->base.bo_get_offset = gbm_dri_bo_get_offset;
+ dri->base.bo_get_modifier = gbm_dri_bo_get_modifier;
+ dri->base.bo_destroy = gbm_dri_bo_destroy;
+ dri->base.destroy = dri_destroy;
+ dri->base.surface_create = gbm_dri_surface_create;
+ dri->base.surface_destroy = gbm_dri_surface_destroy;
+
+ dri->base.name = "drm";
mtx_init(&dri->mutex, mtx_plain);
if (ret)
goto err_dri;
- return &dri->base.base;
+ return &dri->base;
err_dri:
free(dri);
+++ /dev/null
-/*
- * Copyright © 2011 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Authors:
- * Benjamin Franzke <benjaminfranzke@googlemail.com>
- */
-
-#ifndef _COMMON_DRM_H_
-#define _COMMON_DRM_H_
-
-#include "gbmint.h"
-
-enum gbm_drm_driver_type {
- GBM_DRM_DRIVER_TYPE_DRI,
- GBM_DRM_DRIVER_TYPE_GALLIUM,
-};
-
-struct gbm_drm_device {
- struct gbm_device base;
- enum gbm_drm_driver_type type;
-};
-
-#endif