summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJesse Barnes <jbarnes@virtuousgeek.org>2011-11-02 12:57:20 -0700
committerJesse Barnes <jbarnes@virtuousgeek.org>2011-11-03 17:38:55 -0700
commit3afb7b22d6388d13e7af293baa98cad6c3226aec (patch)
tree5d82ee46fdfe2e931b418712bfd625dd50416339 /tests
parent6f7e6c91009000ad4614609a4b2ebd0bf69ec751 (diff)
testdisplay: update to new addfb2 definition
Diffstat (limited to 'tests')
-rw-r--r--tests/testdisplay.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/testdisplay.c b/tests/testdisplay.c
index 2793a4be..45ab0cd5 100644
--- a/tests/testdisplay.c
+++ b/tests/testdisplay.c
@@ -717,6 +717,7 @@ enable_plane(struct connector *c)
cairo_t *cr;
uint32_t handle, x, y;
int ret;
+ uint32_t pitches[4], offsets[4]; /* we only use [0] */
plane_width = c->mode.hdisplay * 0.50;
plane_height = c->mode.vdisplay * 0.50;
@@ -725,11 +726,11 @@ enable_plane(struct connector *c)
y = (c->mode.vdisplay - plane_height) / 2;
plane_id = connector_find_plane(c);
- plane_crtc_id = c->crtc;
if (!plane_id) {
fprintf(stderr, "failed to find plane for crtc\n");
return;
}
+ plane_crtc_id = c->crtc;
surface = allocate_surface(fd, plane_width, plane_height, 24, 32, &handle, 1);
if (!surface) {
@@ -747,9 +748,10 @@ enable_plane(struct connector *c)
fprintf(stderr, "failed to draw plane %dx%d: %s\n",
plane_width, plane_height, cairo_status_to_string(status));
- ret = drmModeAddFB2(fd, plane_width, plane_height, V4L2_PIX_FMT_RGB32, 24, 32,
- cairo_image_surface_get_stride(surface),
- handle, &plane_fb_id);
+ pitches[0] = cairo_image_surface_get_stride(surface);
+ memset(offsets, 0, sizeof(offsets));
+ ret = drmModeAddFB2(fd, plane_width, plane_height, V4L2_PIX_FMT_RGB24,
+ handle, pitches, offsets, &plane_fb_id);
cairo_surface_destroy(surface);
gem_close(fd, handle);