From: Daniel Vetter <daniel@ffwll.ch>
To: Chris Wilson <chris@chris-wilson.co.uk>,
Paulo Zanoni <przanoni@gmail.com>,
intel-gfx@lists.freedesktop.org,
Paulo Zanoni <paulo.r.zanoni@intel.com>
Subject: Re: [PATCH 7/7] lib: add igt_draw
Date: Tue, 7 Apr 2015 10:10:25 +0200 [thread overview]
Message-ID: <20150407081025.GO6354@phenom.ffwll.local> (raw)
In-Reply-To: <20150401231512.GF24856@nuc-i3427.alporthouse.com>
On Thu, Apr 02, 2015 at 12:15:13AM +0100, Chris Wilson wrote:
> 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:
The problem is that the kernel hides bit17 swizzling. I chatted with Paulo
on irc about this and we decided just ignore them all is the simplest
approach.
-Daniel
>
> 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@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2015-04-07 8:32 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-25 21:50 [PATCH 1/7] lib: add igt_wait() Paulo Zanoni
2015-03-25 21:50 ` [PATCH 2/7] tests/kms_fb_crc: call gem_sync() instead of gem_bo_busy() Paulo Zanoni
2015-03-26 10:06 ` Daniel Vetter
2015-03-25 21:50 ` [PATCH 3/7] tests/kms_fbc_crc: add wait_for_fbc_enabled() Paulo Zanoni
2015-03-26 10:07 ` Daniel Vetter
2015-03-25 21:50 ` [PATCH 4/7] tests/kms_fbc_crc: also gem_sync() on exec_nop() Paulo Zanoni
2015-03-25 21:50 ` [PATCH 5/7] tests/kms_fbc_crc: use igt_pipe_crc_collect_crc() Paulo Zanoni
2015-03-25 21:50 ` [PATCH 6/7] tests/kms_fbc_crc: remove redundant information from data_t Paulo Zanoni
2015-03-25 21:50 ` [PATCH 7/7] lib: add igt_draw Paulo Zanoni
2015-03-26 10:19 ` Daniel Vetter
2015-03-30 19:45 ` Paulo Zanoni
2015-03-31 13:07 ` Daniel Vetter
2015-03-31 14:03 ` Paulo Zanoni
2015-03-31 21:52 ` Paulo Zanoni
2015-03-31 22:05 ` Chris Wilson
2015-04-01 22:08 ` Paulo Zanoni
2015-04-01 22:22 ` Chris Wilson
2015-04-01 22:33 ` Paulo Zanoni
2015-04-01 22:40 ` Paulo Zanoni
2015-04-01 23:15 ` Chris Wilson
2015-04-01 23:17 ` Chris Wilson
2015-04-07 8:10 ` Daniel Vetter [this message]
2015-04-07 8:36 ` Chris Wilson
2015-04-07 9:07 ` Daniel Vetter
2015-04-07 10:12 ` Chris Wilson
2015-04-07 13:44 ` Daniel Vetter
2015-05-05 21:30 ` Paulo Zanoni
2015-05-06 9:00 ` Daniel Vetter
2015-04-01 23:03 ` Chris Wilson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150407081025.GO6354@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=chris@chris-wilson.co.uk \
--cc=intel-gfx@lists.freedesktop.org \
--cc=paulo.r.zanoni@intel.com \
--cc=przanoni@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox