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: 10915297 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 969EF161F for ; Wed, 24 Apr 2019 17:08:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7FF1828A77 for ; Wed, 24 Apr 2019 17:08:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7396028B81; Wed, 24 Apr 2019 17:08:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 51FEC28A77 for ; Wed, 24 Apr 2019 17:08:58 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 24FE189250; Wed, 24 Apr 2019 17:08:55 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) by gabe.freedesktop.org (Postfix) with ESMTPS id 26F58891FF for ; Wed, 24 Apr 2019 17:08:52 +0000 (UTC) Received: by mail-pg1-x543.google.com with SMTP id d31so9685632pgl.7 for ; Wed, 24 Apr 2019 10:08:52 -0700 (PDT) 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=M4ZWsAQqnDcjvKPj5ygYQzxPin7ZRTxiqZHawZcPZdyLUs09Ki5UmTnafHyTpQjr+C 95Wes13HgwCQlhM2pAGmp8rpFwQJIURA+yfgiDi30SnwpuxWAVChVIacSkk1GtMpJSpj gd4vhcQGH4F768Jfxdr7F90UKsu7vPn41R6fS54msmL1x8LFfunf19ANfm6lyWKj6Sd/ KN5sHVwgs+Qr/a+cWb/ks3mf86jrrXJdBDYPe+Iy401As4+Y9Sfm+woLScbmB/sJIDJf StHF2yeknixB2O88IikNelXqyvhp128A4JpFXftqonBiMdtjl845ijQ7Yo3trAI/bIxa mmJA== X-Gm-Message-State: APjAAAUeokJkN/5t7uKBrfL5PNWsit0TNeesuaEYWjaXyXLR3eB5F9s1 tlU+7OfEhMDCnEaQZQA5MOCiTgL3ppw= 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) 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 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> X-Mailman-Original-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-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alistair Strachan , Marissa Wall , Sean Paul , Prabhanjan Kandula , Emil Velikov MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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(-) 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);