vk/device: Be consistent about path to DRM device
authorChad Versace <chad.versace@intel.com>
Thu, 9 Jul 2015 22:23:25 +0000 (15:23 -0700)
committerChad Versace <chad.versace@intel.com>
Thu, 9 Jul 2015 22:27:26 +0000 (15:27 -0700)
Function fill_physical_device() has a 'path' parameter, and struct
anv_physical_device has a 'path' member. Sometimes these are used;
sometimes hardcoded "/dev/dri/renderD128" is used instead.

Be consistent. Hardcode "/dev/dri/renderD128" in exactly one location,
during initialization of the physical device.

src/vulkan/device.c

index 61e29a780154ee873bb7537da081028d4dbf79f1..ca8fd843f524aae69f91c9dcc7d31866f2204e51 100644 (file)
@@ -47,7 +47,7 @@ fill_physical_device(struct anv_physical_device *device,
 {
    int fd;
    
-   fd = open("/dev/dri/renderD128", O_RDWR | O_CLOEXEC);
+   fd = open(path, O_RDWR | O_CLOEXEC);
    if (fd < 0)
       return vk_error(VK_ERROR_UNAVAILABLE);
 
@@ -377,7 +377,7 @@ VkResult anv_CreateDevice(
    parse_debug_flags(device);
 
    device->instance = physicalDevice->instance;
-   device->fd = open("/dev/dri/renderD128", O_RDWR | O_CLOEXEC);
+   device->fd = open(physicalDevice->path, O_RDWR | O_CLOEXEC);
    if (device->fd == -1)
       goto fail_device;