summaryrefslogtreecommitdiffstats
path: root/src/gbm
diff options
context:
space:
mode:
authorEmil Velikov <[email protected]>2017-05-09 18:41:50 +0100
committerEmil Velikov <[email protected]>2017-05-29 16:49:44 +0100
commite183c552758ac47880f5518cdff9057d99df921b (patch)
tree191a20970f649dabd715f414044dacf32516e32c /src/gbm
parent2204ea64644212b9eb1c502f4743af3c1f5655a4 (diff)
gbm: move gbm_drm_device::driver_name to gbm_dri_device
The former already keeps track of the DRI module opened, based on the driver_name provided. So let's keep them together. As a nice bonus this Will allows us to remove the gbm_drm_device all together with next patch. Signed-off-by: Emil Velikov <[email protected]> Tested-by: Rob Herring <[email protected]>
Diffstat (limited to 'src/gbm')
-rw-r--r--src/gbm/backends/dri/gbm_dri.c18
-rw-r--r--src/gbm/backends/dri/gbm_driint.h1
-rw-r--r--src/gbm/main/common_drm.h1
3 files changed, 10 insertions, 10 deletions
diff --git a/src/gbm/backends/dri/gbm_dri.c b/src/gbm/backends/dri/gbm_dri.c
index 9f3fe194170..ceed0c10ca6 100644
--- a/src/gbm/backends/dri/gbm_dri.c
+++ b/src/gbm/backends/dri/gbm_dri.c
@@ -344,12 +344,12 @@ dri_open_driver(struct gbm_dri_device *dri)
len = next - p;
#if GLX_USE_TLS
snprintf(path, sizeof path,
- "%.*s/tls/%s_dri.so", len, p, dri->base.driver_name);
+ "%.*s/tls/%s_dri.so", len, p, dri->driver_name);
dri->driver = dlopen(path, RTLD_NOW | RTLD_GLOBAL);
#endif
if (dri->driver == NULL) {
snprintf(path, sizeof path,
- "%.*s/%s_dri.so", len, p, dri->base.driver_name);
+ "%.*s/%s_dri.so", len, p, dri->driver_name);
dri->driver = dlopen(path, RTLD_NOW | RTLD_GLOBAL);
}
/* not need continue to loop all paths once the driver is found */
@@ -373,7 +373,7 @@ dri_open_driver(struct gbm_dri_device *dri)
return NULL;
}
- get_extensions_name = loader_get_extensions_name(dri->base.driver_name);
+ get_extensions_name = loader_get_extensions_name(dri->driver_name);
if (get_extensions_name) {
const __DRIextension **(*get_extensions)(void);
@@ -440,13 +440,13 @@ dri_screen_create_dri2(struct gbm_dri_device *dri, char *driver_name)
const __DRIextension **extensions;
int ret = 0;
- dri->base.driver_name = driver_name;
- if (dri->base.driver_name == NULL)
+ dri->driver_name = driver_name;
+ if (dri->driver_name == NULL)
return -1;
ret = dri_load_driver(dri);
if (ret) {
- fprintf(stderr, "failed to load driver: %s\n", dri->base.driver_name);
+ fprintf(stderr, "failed to load driver: %s\n", dri->driver_name);
return ret;
};
@@ -490,8 +490,8 @@ dri_screen_create_swrast(struct gbm_dri_device *dri)
{
int ret;
- dri->base.driver_name = strdup("swrast");
- if (dri->base.driver_name == NULL)
+ dri->driver_name = strdup("swrast");
+ if (dri->driver_name == NULL)
return -1;
ret = dri_load_driver_swrast(dri);
@@ -1336,7 +1336,7 @@ dri_destroy(struct gbm_device *gbm)
free((__DRIconfig *) dri->driver_configs[i]);
free(dri->driver_configs);
dlclose(dri->driver);
- free(dri->base.driver_name);
+ free(dri->driver_name);
free(dri);
}
diff --git a/src/gbm/backends/dri/gbm_driint.h b/src/gbm/backends/dri/gbm_driint.h
index f060830c0c9..c4a4794e50d 100644
--- a/src/gbm/backends/dri/gbm_driint.h
+++ b/src/gbm/backends/dri/gbm_driint.h
@@ -46,6 +46,7 @@ struct gbm_dri_device {
struct gbm_drm_device base;
void *driver;
+ char *driver_name; /* Name of the DRI module, without the _dri suffix */
__DRIscreen *screen;
__DRIcontext *context;
diff --git a/src/gbm/main/common_drm.h b/src/gbm/main/common_drm.h
index 69e51ef9926..1cc52ae9314 100644
--- a/src/gbm/main/common_drm.h
+++ b/src/gbm/main/common_drm.h
@@ -38,7 +38,6 @@ enum gbm_drm_driver_type {
struct gbm_drm_device {
struct gbm_device base;
enum gbm_drm_driver_type type;
- char *driver_name;
};
#endif