diff options
-rw-r--r-- | src/egl/drivers/dri2/egl_dri2.c | 2 | ||||
-rw-r--r-- | src/egl/drivers/dri2/platform_drm.c | 17 | ||||
-rw-r--r-- | src/gbm/Makefile.sources | 1 | ||||
-rw-r--r-- | src/gbm/backends/dri/gbm_dri.c | 53 | ||||
-rw-r--r-- | src/gbm/backends/dri/gbm_driint.h | 4 | ||||
-rw-r--r-- | src/gbm/main/common_drm.h | 43 |
6 files changed, 34 insertions, 86 deletions
diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c index 0be7132ac58..405db61d185 100644 --- a/src/egl/drivers/dri2/egl_dri2.c +++ b/src/egl/drivers/dri2/egl_dri2.c @@ -893,7 +893,7 @@ dri2_display_release(_EGLDisplay *disp) #ifdef HAVE_DRM_PLATFORM case _EGL_PLATFORM_DRM: if (dri2_dpy->own_device) { - gbm_device_destroy(&dri2_dpy->gbm_dri->base.base); + gbm_device_destroy(&dri2_dpy->gbm_dri->base); } break; #endif diff --git a/src/egl/drivers/dri2/platform_drm.c b/src/egl/drivers/dri2/platform_drm.c index 9cee91bbfcf..455225e56b0 100644 --- a/src/egl/drivers/dri2/platform_drm.c +++ b/src/egl/drivers/dri2/platform_drm.c @@ -232,13 +232,13 @@ get_back_bo(struct dri2_egl_surface *dri2_surf) 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, @@ -264,7 +264,7 @@ get_swrast_front_bo(struct dri2_egl_surface *dri2_surf) } 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) @@ -709,11 +709,6 @@ dri2_initialize_drm(_EGLDriver *drv, _EGLDisplay *disp) } 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); @@ -737,9 +732,9 @@ dri2_initialize_drm(_EGLDriver *drv, _EGLDisplay *disp) 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); diff --git a/src/gbm/Makefile.sources b/src/gbm/Makefile.sources index 7a2d6a43548..461025c1acf 100644 --- a/src/gbm/Makefile.sources +++ b/src/gbm/Makefile.sources @@ -1,7 +1,6 @@ gbm_core_FILES = \ main/backend.c \ main/backend.h \ - main/common_drm.h \ main/gbm.c \ main/gbm.h \ main/gbmint.h diff --git a/src/gbm/backends/dri/gbm_dri.c b/src/gbm/backends/dri/gbm_dri.c index ceed0c10ca6..9b08ae31a50 100644 --- a/src/gbm/backends/dri/gbm_dri.c +++ b/src/gbm/backends/dri/gbm_dri.c @@ -456,12 +456,12 @@ dri_screen_create_dri2(struct gbm_dri_device *dri, char *driver_name) 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); } @@ -527,7 +527,7 @@ dri_screen_create(struct gbm_dri_device *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; @@ -790,7 +790,7 @@ gbm_dri_bo_destroy(struct gbm_bo *_bo) 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); @@ -1034,7 +1034,7 @@ create_dumb(struct gbm_device *gbm, 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; @@ -1055,7 +1055,7 @@ create_dumb(struct gbm_device *gbm, 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); @@ -1351,26 +1351,25 @@ dri_device_create(int fd) 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); @@ -1386,7 +1385,7 @@ dri_device_create(int fd) if (ret) goto err_dri; - return &dri->base.base; + return &dri->base; err_dri: free(dri); diff --git a/src/gbm/backends/dri/gbm_driint.h b/src/gbm/backends/dri/gbm_driint.h index c4a4794e50d..68220cb85d0 100644 --- a/src/gbm/backends/dri/gbm_driint.h +++ b/src/gbm/backends/dri/gbm_driint.h @@ -34,8 +34,6 @@ #include "gbmint.h" #include "c11/threads.h" -#include "common_drm.h" - #include <GL/gl.h> /* dri_interface needs GL types */ #include "GL/internal/dri_interface.h" @@ -43,7 +41,7 @@ struct gbm_dri_surface; struct gbm_dri_bo; struct gbm_dri_device { - struct gbm_drm_device base; + struct gbm_device base; void *driver; char *driver_name; /* Name of the DRI module, without the _dri suffix */ diff --git a/src/gbm/main/common_drm.h b/src/gbm/main/common_drm.h deleted file mode 100644 index 1cc52ae9314..00000000000 --- a/src/gbm/main/common_drm.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * 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 <[email protected]> - */ - -#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 |