summaryrefslogtreecommitdiff
path: root/lib/igt_fb.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2014-09-06 12:07:49 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2014-09-06 12:11:08 +0100
commitdb4cc747fac2692d3b947992384d21a253e2a264 (patch)
treeb37fb25caac3138e23c9f6c13589b93f4abf9e2d /lib/igt_fb.c
parent91a432721c2b16aa6610bd9c89bbee7763552f77 (diff)
lib/igt_fb: Add debug output for creating fb
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'lib/igt_fb.c')
-rw-r--r--lib/igt_fb.c31
1 files changed, 18 insertions, 13 deletions
diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index ce0dd6b9..1c500f54 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -75,9 +75,10 @@ static struct format_desc_struct {
/* helpers to create nice-looking framebuffers */
static int create_bo_for_fb(int fd, int width, int height, int bpp,
- unsigned int tiling, uint32_t *gem_handle_ret,
- unsigned *size_ret, unsigned *stride_ret, unsigned
- bo_size)
+ unsigned int tiling, unsigned bo_size,
+ uint32_t *gem_handle_ret,
+ unsigned *size_ret,
+ unsigned *stride_ret)
{
uint32_t gem_handle;
int size, ret = 0;
@@ -408,23 +409,27 @@ igt_create_fb_with_bo_size(int fd, int width, int height,
uint32_t offsets[4];
uint32_t fb_id;
int bpp;
- int ret;
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);
- ret = create_bo_for_fb(fd, width, height, bpp, tiling, &fb->gem_handle,
- &fb->size, &fb->stride, bo_size);
- igt_assert(ret == 0);
- memset(handles, 0, sizeof(handles));
+ igt_debug("%s(width=%d, height=%d, format=0x%x [bpp=%d], tiling=%d, size=%d\n",
+ __func__, width, height, format, bpp, tiling, bo_size);
+ 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;
- memset(pitches, 0, sizeof(pitches));
pitches[0] = fb->stride;
- memset(offsets, 0, sizeof(offsets));
- ret = drmModeAddFB2(fd, width, height, format, handles, pitches,
- offsets, &fb_id, 0);
- igt_assert(ret == 0);
+
+ 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));
fb->width = width;
fb->height = height;