On Thu, May 26, 2016 at 05:36:09PM +0300, Ville Syrjälä wrote: > > + > > + for (int n = 0; n < 16; n++) { > > + int len = sprintf(path, "/sys/class/drm/card%d", n); > > + sprintf(path + len, "/error"); > > That's goint to limit this to i915. I was thinking we could pass > the drm_fd here to find the correct minor for it. Hah, I was rewriting it to avoid the i915 presumption. Using fstat and comparing sysfs/cardN/dev is what I went with. Pretty much equivalent to drmGetDeviceNameFromFd(), yes. > > +bool igt_sysfs_set(const char *filename, const char *value) > > +{ > > + int sysfs = __igt_sysfs_singleton(); > > + int fd, len, ret; > > + > > + if (sysfs < 0) > > + return false; > > + > > + fd = openat(sysfs, filename, O_WRONLY); > > + if (fd < 0) > > + return false; > > + > > + len = strlen(value); > > + ret = write(fd, value, len); > > EINTR? Pesky signals. -Chris -- Chris Wilson, Intel Open Source Technology Centre _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/intel-gfx