From: Daniel Vetter <daniel@ffwll.ch>
To: Paulo Zanoni <paulo.r.zanoni@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH igt 00/10] igt_fb buffer sizes + kms_frontbuffer_tracking
Date: Wed, 18 Nov 2015 16:59:18 +0100 [thread overview]
Message-ID: <20151118155918.GG20799@phenom.ffwll.local> (raw)
In-Reply-To: <1447434771-19337-1-git-send-email-paulo.r.zanoni@intel.com>
On Fri, Nov 13, 2015 at 03:12:41PM -0200, Paulo Zanoni wrote:
> Hello
>
> I've been carrying some local IGT patches that reduced the size of buffers
> created by igt_create_fb() so they would fit the stolen memory, but when I
> decided to test the tree without them, I concluded the lack of sane sizes was
> even causing test failures. So here's my attempt to fix this. This series alone
> should help reducing the number of kms_frontbuffer_tracking failures seen by QA.
>
> The last few patches make the FBC tests a little harder. They are all based on
> the feedback I got from the last patches I sent.
The point of a helper library is that it helps, not that every caller has
to work around it's choice of size and stride.
The only thing we need to do here is fix up the selection of stride and
size to make it not pick the super-conservative value that work even on
gen2&3. Something like:
diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index 13a6a34982e0..9eb97952ed95 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -87,21 +87,26 @@ static int create_bo_for_fb(int fd, int width, int height, int bpp,
if (tiling != LOCAL_DRM_FORMAT_MOD_NONE) {
int v;
- /* Round the tiling up to the next power-of-two and the
- * region up to the next pot fence size so that this works
- * on all generations.
- *
- * This can still fail if the framebuffer is too large to
- * be tiled. But then that failure is expected.
- */
-
- v = width * bpp / 8;
- for (stride = 512; stride < v; stride *= 2)
- ;
-
- v = stride * height;
- for (size = 1024*1024; size < v; size *= 2)
- ;
+ if (gen < 4) {
+ /* Round the tiling up to the next power-of-two and the
+ * region up to the next pot fence size so that this works
+ * on all generations.
+ *
+ * This can still fail if the framebuffer is too large to
+ * be tiled. But then that failure is expected.
+ */
+
+ v = width * bpp / 8;
+ for (stride = 512; stride < v; stride *= 2)
+ ;
+
+ v = stride * height;
+ for (size = 1024*1024; size < v; size *= 2)
+ ;
+ } else {
+ stride = ALIGN(stride, 512);
+ size = ALIGN(size, stride * 32);
+ }
} else {
/* Scan-out has a 64 byte alignment restriction */
stride = (width * (bpp / 8) + 63) & ~63;
Or whatever is the right thing to pick that works on gen4+.
-Daniel
--
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-11-18 15:59 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-13 17:12 [PATCH igt 00/10] igt_fb buffer sizes + kms_frontbuffer_tracking Paulo Zanoni
2015-11-13 17:12 ` [PATCH igt 01/10] lib/igt_fb: fix fb->size when provided by the user Paulo Zanoni
2015-11-13 17:12 ` [PATCH igt 02/10] lib/igt_fb: fix igt_create_fb_with_bo_size() documentation Paulo Zanoni
2015-11-13 17:12 ` [PATCH igt 03/10] lib/igt_fb: fix open-coded ALIGN() Paulo Zanoni
2015-11-13 17:12 ` [PATCH igt 04/10] lib/igt_fb: also pass the stride to igt_create_fb_with_bo_size() Paulo Zanoni
2015-11-13 17:12 ` [PATCH igt 05/10] kms_frontbuffer_tracking: set our own size for the FBs we create Paulo Zanoni
2015-11-13 17:12 ` [PATCH igt 06/10] kms_frontbuffer_tracking: do page flips using the planes API Paulo Zanoni
2015-11-13 17:12 ` [PATCH igt 07/10] kms_frontbuffer_tracking: move flip_type to struct test_mode Paulo Zanoni
2015-11-13 17:12 ` [PATCH igt 08/10] kms_frontbuffer_tracking: expand badstride and stridechange Paulo Zanoni
2015-11-13 17:12 ` [PATCH igt 09/10] kms_frontbuffer_tracking: assert the stride changes at stridechange() Paulo Zanoni
2015-11-13 17:12 ` [PATCH igt 10/10] kms_frontbuffer_tracking: add tilingchange subtest Paulo Zanoni
2015-11-18 15:59 ` Daniel Vetter [this message]
2015-11-18 16:20 ` [PATCH igt 00/10] igt_fb buffer sizes + kms_frontbuffer_tracking Paulo Zanoni
2015-11-18 16:38 ` Daniel Vetter
2015-11-18 16:49 ` Ville Syrjälä
2015-11-18 16:56 ` Zanoni, Paulo R
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=20151118155918.GG20799@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=intel-gfx@lists.freedesktop.org \
--cc=paulo.r.zanoni@intel.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