aboutsummaryrefslogtreecommitdiffstats
path: root/src/gbm
diff options
context:
space:
mode:
authorQuanxian Wang <[email protected]>2013-12-18 22:11:00 -0700
committerBrian Paul <[email protected]>2013-12-19 12:44:11 -0700
commit1413a09f346f7b0765b303f7770ec597c78bff2f (patch)
treef35ed11aa3963417742d34096bcc489d5bd15c01 /src/gbm
parent22bf0f3eb4668044042cdf326ccee29fa44f850a (diff)
egl: break instead of looping after driver is found
Stop searching for a driver after success. Signed-off-by: Quanxian Wang <[email protected]> Reviewed-By: Gong, Zhigang <[email protected]> Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/gbm')
-rw-r--r--src/gbm/backends/dri/gbm_dri.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gbm/backends/dri/gbm_dri.c b/src/gbm/backends/dri/gbm_dri.c
index b4b97ac6a97..cd3122199eb 100644
--- a/src/gbm/backends/dri/gbm_dri.c
+++ b/src/gbm/backends/dri/gbm_dri.c
@@ -224,9 +224,10 @@ dri_load_driver(struct gbm_dri_device *dri)
snprintf(path, sizeof path,
"%.*s/%s_dri.so", len, p, dri->base.driver_name);
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) {