[Mesa-dev] [PATCH 2/2] anv: Throw INCOMPATIBLE_DRIVER for non-fatal initialization errors

Jason Ekstrand jason at jlekstrand.net
Tue Aug 23 14:55:05 UTC 2016


On Tue, Aug 23, 2016 at 2:17 AM, Emil Velikov <emil.l.velikov at gmail.com>
wrote:

> On 23 August 2016 at 02:11, Jason Ekstrand <jason at jlekstrand.net> wrote:
> > The only reason we should throw INITIALIZATION_FAILED is if we have found
> > useable intel hardware but have failed to bring it up for some reason.
> > Otherwise, we should just throw INCOMPATIBLE_DRIVER which will turn into
> > successfully advertising 0 physical devices
> > ---
> >  src/intel/vulkan/anv_device.c | 8 +++-----
> >  1 file changed, 3 insertions(+), 5 deletions(-)
> >
> > diff --git a/src/intel/vulkan/anv_device.c
> b/src/intel/vulkan/anv_device.c
> > index f31f366..940a14e 100644
> > --- a/src/intel/vulkan/anv_device.c
> > +++ b/src/intel/vulkan/anv_device.c
> > @@ -62,8 +62,7 @@ anv_physical_device_init(struct anv_physical_device
> *device,
> >
> >     fd = open(path, O_RDWR | O_CLOEXEC);
> >     if (fd < 0)
> > -      return vk_errorf(VK_ERROR_INITIALIZATION_FAILED,
> > -                       "failed to open %s: %m", path);
> > +      return vk_error(VK_ERROR_INCOMPATIBLE_DRIVER);
> >
> Mildly related:
> You mentioned before that you prefer no not link against libdrm. What
> is the reasoning behind that - opencoding some of it's functionality
> in here is not likely to pan out well.
>

The amount of libdrm functionality we are repeating here is pretty small.
Also, if we need more queries, having to add them to libdrm *and* add
support to the vulkan driver to query it through libdrm is kind-of
pointless since each query is only a couple of lines.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160823/d9488bc7/attachment.html>


More information about the mesa-dev mailing list