libdrm: Avoid additional drm open close

Avoid additional drm device open and close.

Cc: Sean Paul <seanpaul@chromium.org>
Cc: Alistair Strachan <astrachan@google.com>
Cc: Marissa Wall <marissaw@google.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
main
Prabhanjan Kandula 2019-04-24 10:08:39 -07:00 committed by Emil Velikov
parent 51553dd0e0
commit 225d73fd3b
1 changed files with 2 additions and 2 deletions

View File

@ -750,8 +750,8 @@ drm_public int drmOpen(const char *name, const char *busid)
*/
drm_public int drmOpenWithType(const char *name, const char *busid, int type)
{
if (!drmAvailable() && name != NULL && drm_server_info &&
drm_server_info->load_module) {
if (name != NULL && drm_server_info &&
drm_server_info->load_module && !drmAvailable()) {
/* try to load the kernel module */
if (!drm_server_info->load_module(name)) {
drmMsg("[drm] failed to load kernel module \"%s\"\n", name);