[igt-dev] [PATCH i-g-t] lib/i915/intel_memory_region: wrappers for memory regions ops

Chris Wilson chris at chris-wilson.co.uk
Tue Jan 7 11:36:29 UTC 2020


Quoting Ramalingam C (2020-01-07 08:25:48)
> +static void __debugfs_read(int fd, const char *param, char *buf, int len)
> +{
> +       len = igt_debugfs_simple_read(fd, param, buf, len);
> +       if (len < 0)
> +               igt_assert_eq(len, -ENODEV);
> +}
> +
> +#define debugfs_read(fd, p, arr) __debugfs_read(fd, p, arr, sizeof(arr))
> +
> +#define MAX_i915_GEM_OBJ_BUF_LEN       5000
> +
> +static int get_i915_gem_objects_str(int drm_fd, char *buf)
> +{
> +       int fd;
> +
> +       fd = igt_debugfs_dir(drm_fd);
> +       if (fd < 0)
> +               return -ENODEV;
> +
> +       debugfs_read(fd, "i915_gem_objects", buf);

How you will laugh about this one later!
-Chris


More information about the igt-dev mailing list