From patchwork Sat Apr 20 04:24:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 162545 Delivered-To: patches@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp170076jan; Fri, 19 Apr 2019 21:25:05 -0700 (PDT) X-Received: by 2002:a17:902:5a4b:: with SMTP id f11mr7636226plm.211.1555734305163; Fri, 19 Apr 2019 21:25:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555734305; cv=none; d=google.com; s=arc-20160816; b=deMQlKAUaC161JSMKnYCORdZ0iryt0EdCYj3EEv0QLpZdTZo0NzOjAsZVShXyfgFJJ 81Ka+lnZApFQVSc4VofBUnwZMqKBht2j6nN4EnmBhO3bjU203rmonN+1IlwBx8CtbR0u EMjdiB7n4uaNK6IkjwuNLkTHau55QLuauuXAPElfDlbuFgvW/6wFLMd7sIx2op3o5N32 va8NimyWNLwcUhGOLdcrQbOjyoyNCPoqlGCE7gTsV8+TUeVc1KTwu3tk5352Kj5emp/S 1yHGRk9lbQM1VbQhO50xvCr8MA1/yWVDihB7lC77VoXIHpcRZKO08BMsX08NSCTbo6E0 YPmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=dFUdtdP/ypVic56bhSTqPu40xHoF+qrMfw3zZAVOZk8=; b=V/k6e0N+2SWT5glQG4taySG6rbqP14nJoyKOa/JhUmQi93eFyWIUOym9109lv3Lh4N zACTM8WObpxbSlF5AQIEGFY4fS92P5IHGkEdyC8LKAbbYOQ84lxGK1q4Vuf6I4QAoDBp Y0zVS44CzN7/9P5/hj7HyRN7lPimVQEYDgXamrlE01pRWwyl0Zwnt5BcsfNh3lXDU2Zf TA1flJD2QXDcPEX0XlkvyL6dBzBnpZZw/ajA/5T3gQo8Wwav+2ZCpnKeQh4UUuHd+ST7 uytR9tM2OXz0dB5hcamJzmZnUTUULMgzjvmkWvjbz/SzWFZZFl2k491WuT1DBb2aySNl Om5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="dd6u7iM/"; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id b2sor7863001pfj.12.2019.04.19.21.25.05 for (Google Transport Security); Fri, 19 Apr 2019 21:25:05 -0700 (PDT) Received-SPF: pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="dd6u7iM/"; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=dFUdtdP/ypVic56bhSTqPu40xHoF+qrMfw3zZAVOZk8=; b=dd6u7iM/QVJ5VAm6UJnHZxkfAjOpHILyOTbtPEWF65RYD7E5Ac8U5JE55Z+Fv7//BI Gv3hQ0Uccznvvg2k5gJ8C7R7CuE/D5ogDm3rAWjBXD+gqajonvhFiSB/J+CgHCUQAQOz fTJZakA/A7/U0zynMiqPRagsUG23f03752uIZVHLCYxomjKFWY1eYDhrUjmmn+/XHYeE xfxOzP/qJybiWvZC+H+2/RE3F3XNeVoS5aUVHcksk8ZpLuBxMt8P1RGZ4oU7peTI7Qtr Nv9ehYfAoX3G0stG5tOBki9Z0oIjywcXIcSiay94WHZDBlKov9kk7XukyztLk7Dtd+2Y hn8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=dFUdtdP/ypVic56bhSTqPu40xHoF+qrMfw3zZAVOZk8=; b=cfU/ew05MFZruKaXzTLpLnxD0htzymnwLloC/94keFiSaANn1s/uXT+qgF6kJxY7Kj HjUotiVBZb11bTQJAmRkIBTWfNJyZv+v4ukThRDwgiJmQJGM6RIXK8EX12p4078iAcqJ WV3NnfZ16CE75zWGyzx6VziUh7/9EZMpzoauxpQ5oSf1sDBwvEvUHI71odk51ZGzufdc 6T1cX7FtMMGGhMUcGhov5PAQj1SC/PIKv6U95pqihnqcHbYxleqYHTvVjyTsJK0x+BaB guFeHGRrj2jfU25gxJ0f9q8YV0yflYyhvPfvRL1srHyb92yu+X5ZAZ0aUvzjO5E8SuFH iy/A== X-Gm-Message-State: APjAAAXs4/9cWq0tOBi2D6nv8ntuar7zqdl516bAUk6w6qx09HCpCjhG mYAdvvzK2p1jHc/spJX8jdXBcwva X-Google-Smtp-Source: APXvYqxyJMGxPyEJWj+txeYPF1zs21vUhkg5OgOuypXpRKFogp/aiyoij9kmZx8dmSS+xibCcMa0eQ== X-Received: by 2002:a63:c746:: with SMTP id v6mr7430567pgg.401.1555734304796; Fri, 19 Apr 2019 21:25:04 -0700 (PDT) Return-Path: Received: from localhost.localdomain ([2601:1c2:680:1319:4e72:b9ff:fe99:466a]) by smtp.gmail.com with ESMTPSA id i1sm15578372pgc.63.2019.04.19.21.25.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 19 Apr 2019 21:25:03 -0700 (PDT) From: John Stultz To: dri-devel Cc: Prabhanjan Kandula , Emil Velikov , Sean Paul , Alistair Strachan , Marissa Wall , John Stultz Subject: [RFC][PATCH 3/5] libdrm: Avoid additional drm open close Date: Fri, 19 Apr 2019 21:24:53 -0700 Message-Id: <1555734295-31015-4-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1555734295-31015-1-git-send-email-john.stultz@linaro.org> References: <1555734295-31015-1-git-send-email-john.stultz@linaro.org> From: Prabhanjan Kandula Avoid additional drm device open and close. Cc: Emil Velikov Cc: Sean Paul Cc: Alistair Strachan Cc: Marissa Wall Signed-off-by: John Stultz --- xf86drm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.7.4 Reviewed-by: Alex Deucher diff --git a/xf86drm.c b/xf86drm.c index fe822ca..2c19376 100644 --- a/xf86drm.c +++ b/xf86drm.c @@ -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);