aboutsummaryrefslogtreecommitdiffstats
path: root/src/gbm/backends
diff options
context:
space:
mode:
authorEmil Velikov <[email protected]>2017-05-09 18:47:20 +0100
committerEmil Velikov <[email protected]>2017-05-29 16:49:47 +0100
commit628af2bc9690f42957f9799dfc0dbd0614d38d4c (patch)
tree38eae45353ad63129c3cb2d8a346f29723e3033e /src/gbm/backends
parente183c552758ac47880f5518cdff9057d99df921b (diff)
gbm: remove unneeded gbm_drm_device abstraction
Signed-off-by: Emil Velikov <[email protected]> Tested-by: Rob Herring <[email protected]>
Diffstat (limited to 'src/gbm/backends')
-rw-r--r--src/gbm/backends/dri/gbm_dri.c53
-rw-r--r--src/gbm/backends/dri/gbm_driint.h4
2 files changed, 27 insertions, 30 deletions
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 */