From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Intel-gfx@lists.freedesktop.org
Subject: [PATCH i-g-t 10/13] lib/igt_fb: Use new ADDFB2 extension for new tiling modes
Date: Tue, 3 Mar 2015 14:11:03 +0000 [thread overview]
Message-ID: <1425391866-15377-11-git-send-email-tvrtko.ursulin@linux.intel.com> (raw)
In-Reply-To: <1425391866-15377-1-git-send-email-tvrtko.ursulin@linux.intel.com>
From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
lib/igt_fb.c | 36 +++++++++++++++++++++++-------------
1 file changed, 23 insertions(+), 13 deletions(-)
diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index 853b2f9..c54907e 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -404,16 +404,10 @@ igt_create_fb_with_bo_size(int fd, int width, int height,
uint32_t format, uint64_t tiling,
struct igt_fb *fb, unsigned bo_size)
{
- uint32_t handles[4];
- uint32_t pitches[4];
- uint32_t offsets[4];
uint32_t fb_id;
int bpp;
memset(fb, 0, sizeof(*fb));
- memset(handles, 0, sizeof(handles));
- memset(pitches, 0, sizeof(pitches));
- memset(offsets, 0, sizeof(offsets));
bpp = igt_drm_format_to_bpp(format);
@@ -422,14 +416,30 @@ igt_create_fb_with_bo_size(int fd, int width, int height,
do_or_die(create_bo_for_fb(fd, width, height, bpp, tiling, bo_size,
&fb->gem_handle, &fb->size, &fb->stride));
- handles[0] = fb->gem_handle;
- pitches[0] = fb->stride;
-
igt_debug("%s(handle=%d, pitch=%d)\n",
- __func__, handles[0], pitches[0]);
- do_or_die(drmModeAddFB2(fd, width, height, format,
- handles, pitches, offsets,
- &fb_id, 0));
+ __func__, fb->gem_handle, fb->stride);
+
+ if (tiling != LOCAL_DRM_FORMAT_MOD_NONE &&
+ tiling != LOCAL_I915_FORMAT_MOD_X_TILED) {
+ do_or_die(__kms_addfb(fd, fb->gem_handle, width, height,
+ fb->stride, format, tiling,
+ LOCAL_DRM_MODE_FB_MODIFIERS, &fb_id));
+ } else {
+ uint32_t handles[4];
+ uint32_t pitches[4];
+ uint32_t offsets[4];
+
+ memset(handles, 0, sizeof(handles));
+ memset(pitches, 0, sizeof(pitches));
+ memset(offsets, 0, sizeof(offsets));
+
+ handles[0] = fb->gem_handle;
+ pitches[0] = fb->stride;
+
+ do_or_die(drmModeAddFB2(fd, width, height, format,
+ handles, pitches, offsets,
+ &fb_id, 0));
+ }
fb->width = width;
fb->height = height;
--
2.3.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2015-03-03 14:11 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-03 14:10 [PATCH i-g-t v3 00/13] Testing the Y tiled display Tvrtko Ursulin
2015-03-03 14:10 ` [PATCH i-g-t 01/13] tests/kms_addfb: Add support for fb modifiers Tvrtko Ursulin
2015-03-03 14:10 ` [PATCH i-g-t 02/13] lib: Extract igt_buf_write_to_png() from gem_render_copy Tvrtko Ursulin
2015-03-03 16:03 ` Tvrtko Ursulin
2015-03-03 16:12 ` Gore, Tim
2015-03-03 14:10 ` [PATCH i-g-t 03/13] tests/kms_addfb: Y tiled testcases Tvrtko Ursulin
2015-03-03 14:10 ` [PATCH i-g-t 04/13] lib/skl: Add gen9 specific igt_blitter_fast_copy() Tvrtko Ursulin
2015-03-03 14:10 ` [PATCH i-g-t 05/13] lib: Don't give a struct igt_buf * to fast_copy_pitch() Tvrtko Ursulin
2015-03-03 14:10 ` [PATCH i-g-t 06/13] lib: Split two helpers to build fast copy's dword0 and dword1 Tvrtko Ursulin
2015-03-03 14:11 ` [PATCH i-g-t 07/13] lib: Provide a raw version of the gen9 fast copy blits Tvrtko Ursulin
2015-03-03 14:11 ` [PATCH i-g-t 08/13] tiling: Convert framebuffer helpers to use fb modifiers Tvrtko Ursulin
2015-03-03 14:11 ` [PATCH i-g-t 09/13] lib: Add support for new extension to the ADDFB2 ioctl Tvrtko Ursulin
2015-03-03 14:11 ` Tvrtko Ursulin [this message]
2015-03-03 14:11 ` [PATCH i-g-t 11/13] lib: Allow the creation of Ys/Yf tiled FBs Tvrtko Ursulin
2015-03-03 14:11 ` [PATCH i-g-t 12/13] testdisplay/skl: Add command line options for Yb/Yf tiled fbs Tvrtko Ursulin
2015-03-03 14:11 ` [PATCH i-g-t 13/13] tests/kms_flip_tiling: Exercise Y tiling modes on Gen9+ Tvrtko Ursulin
2015-03-12 14:36 ` [PATCH i-g-t v3 00/13] Testing the Y tiled display Damien Lespiau
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=1425391866-15377-11-git-send-email-tvrtko.ursulin@linux.intel.com \
--to=tvrtko.ursulin@linux.intel.com \
--cc=Intel-gfx@lists.freedesktop.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.