Re: [Mesa-dev] [PATCH] vulkan/wsi: use the drmGetDevice2() API

2018-10-24 Thread Emil Velikov
On Mon, 22 Oct 2018 at 18:13, Jason Ekstrand  wrote:
>
> On Mon, Oct 22, 2018 at 12:10 PM Emil Velikov  
> wrote:
>>
>> From: Emil Velikov 
>>
>> On older kernels, the drmGetDevice() call will wake up all the GPUs
>> on the system, while fetching the PCI revision.
>>
>> Use the 2 version of the API and pass flags == 0, so we don't fetch the
>> device PCI revision, since we don't need that information.
>
>
> As long as we still get all the PCI address information,
>
> Reviewed-by: Jason Ekstrand 
>
Indeed it does, thanks.

> I had no idea one of them work up the device and the other didn't...
>
Right, will add some documentation in a moment.

-Emil
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] vulkan/wsi: use the drmGetDevice2() API

2018-10-22 Thread Jason Ekstrand
On Mon, Oct 22, 2018 at 12:10 PM Emil Velikov 
wrote:

> From: Emil Velikov 
>
> On older kernels, the drmGetDevice() call will wake up all the GPUs
> on the system, while fetching the PCI revision.
>
> Use the 2 version of the API and pass flags == 0, so we don't fetch the
> device PCI revision, since we don't need that information.
>

As long as we still get all the PCI address information,

Reviewed-by: Jason Ekstrand 

I had no idea one of them work up the device and the other didn't...

--Jason


> Fixes: baa38c144f6 ("vulkan/wsi: Use VK_EXT_pci_bus_info for DRM fd
> matching")
> Cc: Jason Ekstrand 
> Signed-off-by: Emil Velikov 
> ---
>  src/vulkan/wsi/wsi_common.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/vulkan/wsi/wsi_common.c b/src/vulkan/wsi/wsi_common.c
> index 51d8655a5a9..1cd5f8d62c5 100644
> --- a/src/vulkan/wsi/wsi_common.c
> +++ b/src/vulkan/wsi/wsi_common.c
> @@ -135,7 +135,7 @@ bool
>  wsi_device_matches_drm_fd(const struct wsi_device *wsi, int drm_fd)
>  {
> drmDevicePtr fd_device;
> -   int ret = drmGetDevice(drm_fd, _device);
> +   int ret = drmGetDevice2(drm_fd, 0, _device);
> if (ret)
>return false;
>
> --
> 2.19.1
>
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] vulkan/wsi: use the drmGetDevice2() API

2018-10-22 Thread Emil Velikov
From: Emil Velikov 

On older kernels, the drmGetDevice() call will wake up all the GPUs
on the system, while fetching the PCI revision.

Use the 2 version of the API and pass flags == 0, so we don't fetch the
device PCI revision, since we don't need that information.

Fixes: baa38c144f6 ("vulkan/wsi: Use VK_EXT_pci_bus_info for DRM fd matching")
Cc: Jason Ekstrand 
Signed-off-by: Emil Velikov 
---
 src/vulkan/wsi/wsi_common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/vulkan/wsi/wsi_common.c b/src/vulkan/wsi/wsi_common.c
index 51d8655a5a9..1cd5f8d62c5 100644
--- a/src/vulkan/wsi/wsi_common.c
+++ b/src/vulkan/wsi/wsi_common.c
@@ -135,7 +135,7 @@ bool
 wsi_device_matches_drm_fd(const struct wsi_device *wsi, int drm_fd)
 {
drmDevicePtr fd_device;
-   int ret = drmGetDevice(drm_fd, _device);
+   int ret = drmGetDevice2(drm_fd, 0, _device);
if (ret)
   return false;
 
-- 
2.19.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev