Re: [PATCH 7/7] lib: add igt_draw

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

 



On Wed, Apr 01, 2015 at 07:40:59PM -0300, Paulo Zanoni wrote:
> +static void draw_rect_mmap_wc(int fd, struct buf_data *buf, struct rect *rect,
> +			      uint32_t color)
> +{
> +	uint32_t *ptr;
> +	uint32_t tiling, swizzle;
> +
> +	gem_get_tiling(fd, buf->handle, &tiling, &swizzle);
> +
> +	/* We didn't implement suport for the older tiling methods yet. */
> +	if (tiling != I915_TILING_NONE)
> +		igt_require(intel_gen(intel_get_drm_devid(fd)) >= 5);

But you now do! You need something like:

static void get_tiling_and_swizzle(int fd,
				   struct buf_data *buf,
				   int *tiling, int *swizzle)
{
	struct local_i915_gem_get_tiling_v2 {
		uint32_t handle;
		uint32_t tiling_mode;
		uint32_t swizzle_mode;
		uint32_t phys_swizzle_mode;
	} tiling;
#define LOCAL_IOCTL_I915_GEM_GET_TILING DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_GET_TILING, struct local_i915_gem_get_tiling_v2)

	memset(&tiling, 0, sizeof(tiling));
	tiling.handle = buf->handle;
	do_ioctl(fd, LOCAL_IOCTL_I915_GEM_GET_TILING, &tiling);
	igt_require(tiling.phys_swizzle == tiling.swizzle_mode ||
		    intel_gen(intel_get_drm_devid(fd)) >= 5); /* old kernel? */

	*tiling = tiling.tilling_mode;
	*swizzle = tiling.swizzle_mode;
}

-- 
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