From patchwork Wed Jul 19 15:37:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gurchetan Singh X-Patchwork-Id: 9852533 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DBF52602C8 for ; Wed, 19 Jul 2017 15:37:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CB72C2861B for ; Wed, 19 Jul 2017 15:37:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BFDF92863B; Wed, 19 Jul 2017 15:37:12 +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=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID 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 1DE632861B for ; Wed, 19 Jul 2017 15:37:12 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DE70789DBC; Wed, 19 Jul 2017 15:37:10 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pg0-x231.google.com (mail-pg0-x231.google.com [IPv6:2607:f8b0:400e:c05::231]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5CAE089DBC for ; Wed, 19 Jul 2017 15:37:10 +0000 (UTC) Received: by mail-pg0-x231.google.com with SMTP id 123so1851463pgj.1 for ; Wed, 19 Jul 2017 08:37:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id; bh=NPhzNSj2BtmcYN2KeuRKTa0fK+b5IGnXjcm38Zbrrb8=; b=mD10ETJ1pr7asjx/ZHb2AtmwkVOzLrlE/j8KutMn6v8lx/6sLP6XuZfdEUjcmgXY+g EvQbHvGsyOuaooQKOPfxXgR57HporxB8SSdot9Tkkhm2+zS1FuRYFBb0ajWDl1xcyXUD q/vZiP1fJAZK3qLwz82UGGL/RUKlSH1wrzNEg= 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; bh=NPhzNSj2BtmcYN2KeuRKTa0fK+b5IGnXjcm38Zbrrb8=; b=UUQ4UTavoQyRMq8M5gm9lr+tY6JZZ+nxImbyOSzUX5MZ7VH60ufh/Iv1ki9TIfbq6x uE2zdlyDJI843jlFZ6u0OGZlzM14T5BTdef0N/8Zd/bP0r4HvL9pvW4NYQ8dTJ8Blsx2 cFOgUcFFjsH9Ca2GdUv8bVz338750wxf8sY+q5j34VlSz1x5darujDa0MpSXKdsh4sgf 4UiVR/2VAswSF4b+UtSgK5hEaoaPyRcloM6XOPaxUW7qKlMWs2FYhaqNAU8gdpaqeZ/8 /dsuRolKyStnUVCCul7fnl//JJR8mugKKAZhhgVTUxHmOOkQnYZuwlYUyixgR7wIdU/G B85Q== X-Gm-Message-State: AIVw1108qk/dJwwDRPknSlg/CECGVWrsEq3CuQN9FCvPTQMFPd7xktHn FB5SvDZGy6vP6fOYq5Lp5w== X-Received: by 10.84.204.133 with SMTP id b5mr573783ple.124.1500478629832; Wed, 19 Jul 2017 08:37:09 -0700 (PDT) Received: from gurchetansingh0.mtv.corp.google.com ([2620:0:1000:1301:6db2:e4db:89cf:190f]) by smtp.gmail.com with ESMTPSA id b16sm500059pfm.84.2017.07.19.08.37.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 19 Jul 2017 08:37:08 -0700 (PDT) From: Gurchetan Singh To: dri-devel@lists.freedesktop.org Subject: [PATCH] xf86drm: continue after drmProcessPlatformDevice failure Date: Wed, 19 Jul 2017 08:37:06 -0700 Message-Id: <20170719153706.1535-1-gurchetansingh@chromium.org> X-Mailer: git-send-email 2.12.2 Cc: thierry.reding@gmail.com, emil.l.velikov@gmail.com, Gurchetan Singh X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP On ChromeOS devices, readdir() processes the directory in the following order: -NAME- -TYPE- . n/a .. n/a vgem n/a card1 DRM_BUS_PLATFORM renderD129 DRM_BUS_PLATFORM card0 DRM_BUS_PCI renderD128 DRM_BUS_PCI controlD64 DRM_BUS_PCI In drmGetDevices2, after drmProcessPlatformDevice fails for /dev/dri/card1, we don't process the remaining directory entries. As such, Vulkan fails to initialize since Mesa uses drmGetDevices2. To fix this, continue if drmProcessPlatformDevice fails. --- xf86drm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xf86drm.c b/xf86drm.c index 879f85b6..50862f22 100644 --- a/xf86drm.c +++ b/xf86drm.c @@ -3997,7 +3997,7 @@ int drmGetDevices2(uint32_t flags, drmDevicePtr devices[], int max_devices) ret = drmProcessPlatformDevice(&device, node, node_type, maj, min, devices != NULL, flags); if (ret) - goto free_devices; + continue; break;