From patchwork Wed Apr 24 17:08:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 162802 Delivered-To: patches@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp903974jan; Wed, 24 Apr 2019 10:08:51 -0700 (PDT) X-Received: by 2002:a17:902:28ab:: with SMTP id f40mr16415528plb.297.1556125731262; Wed, 24 Apr 2019 10:08:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556125731; cv=none; d=google.com; s=arc-20160816; b=x9Y72vC0dpm4s4xPKU51sjqwy2CumYUTqBGa90w0zZTLapvtk79pchI4fNZhOqsGbG 8dQ30RCKEuGqOSGcBP04wGbe2PcIamVsJvBy7j5UbVnYygIHx9FCz447Vz+Sft2cj5+v Qemb5rmxc/wwq3RlvIw8vxdyrSZo2UtUiv8a04PtOsAiZadM5cBbo49mW4bDUVTpI7GJ jAgqeYiiKzJP0GSwR53M0Iol0bnK8EP0zLd8FbPrMx3NKX5aqYt/Rn3HhJylk131XwDY Z8JPfYcGebjuJXILbc1clgiAgp6hPslAr5OSwspxfRDLZgReUKqqEOiykEnDL6lbP4vy +34g== 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=dAIluZjSLJwIxa7KvWN7HZ/X+6U+jK6ejf8yyjQSeDc=; b=XNUfHrhH7tO12vTXk/tyHF4dum5j7Nd4vZ4mwtRGdtFEjnYkK8d7KIh2ET3fWtRlvc vjK5DV+SsdHHQw3HbperH0ALUsbbsk7Ca1pjOY6ADZi1pn1NFZ7+mapFdSaSO0SXga4c fbpPn0W2HeKXLpb0vcDzcazudwc75RNWN2KZTx8wAA8ruduftMwg3a99Pe6DlKYzBe1J l0xSvpxQdLmqRZG9gZ0ss3ftzgMIEHVLLFHjeTaHRfQv3xPVPOiN18JqslUd4AyryfvD vagD6nj5sZ1xhXgL6AjQgaAWBbv8h0id5c2s+hQx1LTOnamGUhbSdfxdKp968Vg1hqEl 5zOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DueiEhJh; 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 c3sor16668032pgj.58.2019.04.24.10.08.51 for (Google Transport Security); Wed, 24 Apr 2019 10:08:51 -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=DueiEhJh; 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=dAIluZjSLJwIxa7KvWN7HZ/X+6U+jK6ejf8yyjQSeDc=; b=DueiEhJhYxh0nPu7G/PYtL7B1BOWLQpLDU3hwpBIUNa1FWP/k3U6iYU7fOGtwIaH1i 57mSskil+0wa0VPLt/g8xulelDDhC1nmRK2Ck2ArPDcGmZZc/dUTR/obkAFkEvNNC9xs Typ11cyavRs20TV44ufkt1n8ig1vJNP3NTKmIDJUjHgw49GmOLV7WVjCkTX+3RXpBNkJ 96/HoGqtler9diU1K8wrcY16RftVmmVyoBahTrBfRweXENvbrQDT+GFMlR83meb5bl2W UahjO4K2ztu3qiTXU23SZ6z8QARJ8eToUICrl8W4VjlhTYVMlCsgQo3OsRFFe6Io/xic edQA== 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=dAIluZjSLJwIxa7KvWN7HZ/X+6U+jK6ejf8yyjQSeDc=; b=h4jjZNBQsoKKRDt2SBHOQVafCtpI4NX9yeHMO5qFCWCshJktuLCgABTorXvTkqnOFw bY5eVS5IqgOd5vvvvURAqQB+BOba3JcFotZ1UgO0Nl9wOxQzIFgzx/6OOwqp+qIdmYpy FdHTSqReUE8Qne+FmUTY1v30nHIWTxMHyf+MWIAseZ7RN0iVQA9AhBUjnMRhkMyfuxtT WP9LjBLP/YDFKuYVoaBkL5tVCfkn6Se88toTcFy1NrNK9CkXjkl53hEsd8HvVPqCoNpS t4mL3WTVWS30blL0XE2uQTjydRlOp1FKt93bH5cwP/sPChaztvcXHBJrYaDOnprQ4ixA gR6w== X-Gm-Message-State: APjAAAXCBhSoD5JF7qSTMv2SsoBWNhn1o/N/YTxNG+iJjRVyqo1WMVuf 2beZAWw9UfV1WQjfoluqr3dUcbRP X-Google-Smtp-Source: APXvYqxd+OclpBKmDT97OaiNa0BO9Rb/EzvIEw3NtC9kz55kQ3uXGSILcr9jYsQiwCnxnExFPSPPxw== X-Received: by 2002:a65:4302:: with SMTP id j2mr31398460pgq.291.1556125730819; Wed, 24 Apr 2019 10:08:50 -0700 (PDT) Return-Path: Received: from localhost.localdomain ([2601:1c2:680:1319:4e72:b9ff:fe99:466a]) by smtp.gmail.com with ESMTPSA id e4sm4425073pfn.185.2019.04.24.10.08.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 24 Apr 2019 10:08:49 -0700 (PDT) From: John Stultz To: dri-devel Cc: Prabhanjan Kandula , Emil Velikov , Sean Paul , Alistair Strachan , Marissa Wall , John Stultz Subject: [PATCH 4/6 v2] libdrm: Avoid additional drm open close Date: Wed, 24 Apr 2019 10:08:39 -0700 Message-Id: <1556125721-32145-5-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1556125721-32145-1-git-send-email-john.stultz@linaro.org> References: <1556125721-32145-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 Reviewed-by: Alex Deucher Signed-off-by: John Stultz --- xf86drm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.7.4 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);