From: Thierry Reding <thierry.reding@gmail.com>
To: Gurchetan Singh <gurchetansingh@chromium.org>
Cc: emil.l.velikov@gmail.com, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] xf86drm: continue after drmProcessPlatformDevice failure
Date: Thu, 20 Jul 2017 15:47:57 +0200 [thread overview]
Message-ID: <20170720134757.GA25942@ulmo> (raw)
In-Reply-To: <20170719153706.1535-1-gurchetansingh@chromium.org>
[-- Attachment #1.1: Type: text/plain, Size: 1705 bytes --]
On Wed, Jul 19, 2017 at 08:37:06AM -0700, Gurchetan Singh wrote:
> 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(-)
I'm not sure this is a good fix. drmProcessPlatformDevice() is only
supposed to fail in fatal situations, such as out-of-memory. So the
reason it doesn't continue is that it doesn't make sense to. In the
case of out-of-memory situations, for example, the next allocation
is assumed to fail as well.
Now, reading the code again, maybe the reason it is failing is because
the code tries to look for OF_FULLNAME and OF_COMPATIBLE_N and may not
find them. I suspect that card1 and renderD129 are from a vgem device,
which is, as far as I can tell, the only case of a platform device
without an OF node.
In that case I think we should fix drmProcessPlatformDevice() to deal
with those cases instead (make the list of compatibles optional, and
fallback to some other mechanism to determine the name). Otherwise we
will be silently ignoring errors and skipping devices that we really
shouldn't.
Thierry
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
[-- Attachment #2: Type: text/plain, Size: 160 bytes --]
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
prev parent reply other threads:[~2017-07-20 13:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-19 15:37 [PATCH] xf86drm: continue after drmProcessPlatformDevice failure Gurchetan Singh
2017-07-20 11:33 ` Emil Velikov
2017-07-20 13:47 ` Thierry Reding [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170720134757.GA25942@ulmo \
--to=thierry.reding@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=emil.l.velikov@gmail.com \
--cc=gurchetansingh@chromium.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox