egl: break instead of looping after driver is found
Stop searching for a driver after success. Signed-off-by: Quanxian Wang <quanxian.wang@intel.com> Reviewed-By: Gong, Zhigang <zhigang.gong@gmail.com> Reviewed-by: Brian Paul <brianp@vmware.com>
This commit is contained in:
parent
22bf0f3eb4
commit
1413a09f34
|
@ -403,6 +403,9 @@ dri2_open_driver(_EGLDisplay *disp)
|
||||||
if (dri2_dpy->driver == NULL)
|
if (dri2_dpy->driver == NULL)
|
||||||
_eglLog(_EGL_DEBUG, "failed to open %s: %s\n", path, dlerror());
|
_eglLog(_EGL_DEBUG, "failed to open %s: %s\n", path, dlerror());
|
||||||
}
|
}
|
||||||
|
/* not need continue to loop all paths once the driver is found */
|
||||||
|
if (dri2_dpy->driver != NULL)
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dri2_dpy->driver == NULL) {
|
if (dri2_dpy->driver == NULL) {
|
||||||
|
|
|
@ -224,9 +224,10 @@ dri_load_driver(struct gbm_dri_device *dri)
|
||||||
snprintf(path, sizeof path,
|
snprintf(path, sizeof path,
|
||||||
"%.*s/%s_dri.so", len, p, dri->base.driver_name);
|
"%.*s/%s_dri.so", len, p, dri->base.driver_name);
|
||||||
dri->driver = dlopen(path, RTLD_NOW | RTLD_GLOBAL);
|
dri->driver = dlopen(path, RTLD_NOW | RTLD_GLOBAL);
|
||||||
if (dri->driver == NULL)
|
|
||||||
fprintf(stderr, "failed to open %s: %s\n", path, dlerror());
|
|
||||||
}
|
}
|
||||||
|
/* not need continue to loop all paths once the driver is found */
|
||||||
|
if (dri->driver != NULL)
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dri->driver == NULL) {
|
if (dri->driver == NULL) {
|
||||||
|
|
Loading…
Reference in New Issue