Re: [PATCH i-g-t] tests/gem_guc_loading: Adding simple GuC loading test

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jan 05, 2016 at 05:17:07PM +0100, Lukasz Fiedorowicz wrote:
> +static void open_guc_status(void)
> +{
> +	guc_status_fd = igt_debugfs_open("i915_guc_load_status", O_RDONLY);
> +	igt_assert_f(guc_status_fd >= 0, "Can't open i915_guc_load_status\n");

igt_require(). So that the test doesn't explode if the kernel changes.

> +
> +static enum guc_status get_guc_status(void)
> +{
> +	char buf[LOAD_STATUS_BUF_SIZE];
> +
> +	FILE *fp = fdopen(guc_status_fd, "r");

If you just wanted the FILE*, use igt_debugfs_fopen.

> +	igt_assert_f(fp != NULL, "Can't open i915_guc_load_status file\n");
> +
> +	while (fgets(buf, LOAD_STATUS_BUF_SIZE, fp))
> +		if ((strstr(buf, "\tload: SUCCESS\n")))
> +			return GUC_ENABLED;

Testing FILE* leak handling?
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux