summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@redhat.com>2009-02-03 13:26:22 -0500
committerKristian Høgsberg <krh@redhat.com>2009-02-03 13:26:38 -0500
commitd9c55a6becb530dcf11bc980cb6b31843be0b8c2 (patch)
treec70784bdc8570c097e26941b2d5dc33065e5ad8e /tests
parent39755db856794a4d0481d66b46b1b86e46a39b39 (diff)
modetest: Use a more interesting test pattern.
Diffstat (limited to 'tests')
-rw-r--r--tests/modetest/modetest.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/modetest/modetest.c b/tests/modetest/modetest.c
index 1706641c..d750f4c3 100644
--- a/tests/modetest/modetest.c
+++ b/tests/modetest/modetest.c
@@ -251,6 +251,7 @@ void set_mode(int connector_id, char *mode_str)
drm_intel_bo *bo;
unsigned int fb_id, *fb_ptr;
int i, j, size, ret, width, height;
+ div_t d;
/* First, find the connector & mode */
for (i = 0; i < resources->count_connectors; i++) {
@@ -336,9 +337,11 @@ void set_mode(int connector_id, char *mode_str)
fb_ptr = bo->virtual;
- /* paint the buffer blue */
- for (i = 0; i < width * height; i++)
- fb_ptr[i] = 0xff;
+ /* paint the buffer with colored tiles */
+ for (i = 0; i < width * height; i++) {
+ d = div(i, width);
+ fb_ptr[i] = 0x00130502 * (d.quot >> 6) + 0x000a1120 * (d.rem >> 6);
+ }
ret = drmModeAddFB(fd, width, height, 32, 32, width * 4, bo->handle,
&fb_id);