diff --git a/libports/src/lib/gallium/i915/query_device_id.cc b/libports/src/lib/gallium/i915/query_device_id.cc index e0f37d1ed9..d24ed5d913 100644 --- a/libports/src/lib/gallium/i915/query_device_id.cc +++ b/libports/src/lib/gallium/i915/query_device_id.cc @@ -53,8 +53,8 @@ namespace { bool supports_open(const char *pathname, int flags) { - return !Genode::strcmp(pathname, - "/sys/class/drm/card0/device/device"); + return (Genode::strcmp(pathname, + "/sys/class/drm/card0/device/device") == 0); } Libc::File_descriptor *open(const char *pathname, int flags) @@ -88,6 +88,23 @@ namespace { context(fd)->position += count; return count; } + + bool supports_stat(const char *path) + { + return (Genode::strcmp(path, "/sys") == 0) || + (Genode::strcmp(path, "/sys/class") == 0) || + (Genode::strcmp(path, "/sys/class/drm") == 0) || + (Genode::strcmp(path, "/sys/class/drm/card0") == 0) || + (Genode::strcmp(path, "/sys/class/drm/card0/device") == 0) || + (Genode::strcmp(path, "/sys/class/drm/card0/device/device") == 0); + } + + int stat(const char *path, struct stat *buf) + { + if (buf) + buf->st_mode = S_IFDIR; + return 0; + } }; } diff --git a/libports/src/lib/libdrm/ioctl.cc b/libports/src/lib/libdrm/ioctl.cc index 42afd72f11..92d1a010cb 100644 --- a/libports/src/lib/libdrm/ioctl.cc +++ b/libports/src/lib/libdrm/ioctl.cc @@ -139,6 +139,20 @@ namespace { return Libc::file_descriptor_allocator()->alloc(this, context); } + bool supports_stat(const char *path) + { + return (Genode::strcmp(path, "/dev") == 0 || + Genode::strcmp(path, "/dev/drm") == 0); + } + + int stat(const char *path, struct stat *buf) + { + if (buf) + buf->st_mode = S_IFDIR; + + return 0; + } + int ioctl(Libc::File_descriptor *fd, int request, char *argp) { if (verbose_ioctl) @@ -152,6 +166,8 @@ namespace { return _driver->ioctl(_client, drm_command(request), argp); } + bool supports_mmap() { return true; } + /** * Pseudo mmap specific for DRM device *