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 <emil.velikov@collabora.com>
Tested-by: Rob Herring <robh@kernel.org>
- dri2_dpy->driver_name = strdup(dri2_dpy->gbm_dri->base.driver_name);
+ dri2_dpy->driver_name = strdup(dri2_dpy->gbm_dri->driver_name);
dri2_dpy->dri_screen = dri2_dpy->gbm_dri->screen;
dri2_dpy->core = dri2_dpy->gbm_dri->core;
dri2_dpy->dri_screen = dri2_dpy->gbm_dri->screen;
dri2_dpy->core = dri2_dpy->gbm_dri->core;
len = next - p;
#if GLX_USE_TLS
snprintf(path, sizeof path,
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,
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 */
dri->driver = dlopen(path, RTLD_NOW | RTLD_GLOBAL);
}
/* not need continue to loop all paths once the driver is found */
- 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);
if (get_extensions_name) {
const __DRIextension **(*get_extensions)(void);
const __DRIextension **extensions;
int ret = 0;
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) {
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);
- 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);
return -1;
ret = dri_load_driver_swrast(dri);
free((__DRIconfig *) dri->driver_configs[i]);
free(dri->driver_configs);
dlclose(dri->driver);
free((__DRIconfig *) dri->driver_configs[i]);
free(dri->driver_configs);
dlclose(dri->driver);
- free(dri->base.driver_name);
+ free(dri->driver_name);
struct gbm_drm_device base;
void *driver;
struct gbm_drm_device base;
void *driver;
+ char *driver_name; /* Name of the DRI module, without the _dri suffix */
__DRIscreen *screen;
__DRIcontext *context;
__DRIscreen *screen;
__DRIcontext *context;
struct gbm_drm_device {
struct gbm_device base;
enum gbm_drm_driver_type type;
struct gbm_drm_device {
struct gbm_device base;
enum gbm_drm_driver_type type;