intel_upload_blit_*: Fix reporting and generate junk instead of using random.

Turns out that random completely overwhelmed the cost of the driver stuff
in _large.c.  I definitely want to generate data, but still be able to see
the driver's responsibility.
This commit is contained in:
Eric Anholt 2009-03-30 19:09:00 -07:00
parent 614b165c60
commit 7889abd263
2 changed files with 6 additions and 4 deletions

View File

@ -77,12 +77,13 @@ do_render(drm_intel_bufmgr *bufmgr, struct intel_batchbuffer *batch,
uint32_t data[width * height];
drm_intel_bo *src_bo;
int i;
static uint32_t seed = 1;
/* Generate some junk. Real workloads would be doing a lot more
* work to generate the junk.
*/
for (i = 0; i < width * height; i++) {
data[i] = (uint32_t)random();
data[i] = seed++;
}
/* Upload the junk. */
@ -145,7 +146,7 @@ int main(int argc, char **argv)
printf("%d iterations in %.03f secs: %.01f MB/sec\n", i,
end_time - start_time,
(double)OBJECT_WIDTH * OBJECT_HEIGHT * 4 /
(double)i * OBJECT_WIDTH * OBJECT_HEIGHT * 4 / 1024.0 / 1024.0 /
(end_time - start_time));
intel_batchbuffer_free(batch);

View File

@ -76,6 +76,7 @@ do_render(drm_intel_bufmgr *bufmgr, struct intel_batchbuffer *batch,
uint32_t data[64];
drm_intel_bo *src_bo;
int i;
static uint32_t seed = 1;
src_bo = drm_intel_bo_alloc(bufmgr, "src", width * height * 4, 4096);
@ -96,7 +97,7 @@ do_render(drm_intel_bufmgr *bufmgr, struct intel_batchbuffer *batch,
size = width * height - i;
for (j = 0; j < size; j++)
data[j] = (uint32_t)random();
data[j] = seed++;
/* Upload the junk. */
drm_intel_bo_subdata(src_bo, i * 4, size * 4, data);
@ -160,7 +161,7 @@ int main(int argc, char **argv)
printf("%d iterations in %.03f secs: %.01f MB/sec\n", i,
end_time - start_time,
(double)OBJECT_WIDTH * OBJECT_HEIGHT * 4 /
(double)i * OBJECT_WIDTH * OBJECT_HEIGHT * 4 / 1024.0 / 1024.0 /
(end_time - start_time));
intel_batchbuffer_free(batch);