mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-06-12 02:16:17 +00:00
tests/vgem_fb_test: Remove volatile
By simply removing volatile qualifier in draw() from uint32_t *ptr, memory accesses improve a lot in that test. We practically saw 1 order of magnitude in the performance of VGEM and the speed was equally on using drm_intel specific ioctls. The inclusion of volatile has forced the compiler to load and store the variable from memory on every run, hurting quite badly the performance. Therefore, performance is dropped due many read operations in the mapped pointer which is a no-no when objects are write-combining mapped. This patch also removes sleep, that bothers performance measurements
This commit is contained in:
parent
1319c565ec
commit
1f937389fc
@ -259,7 +259,7 @@ static void draw(struct context *ctx) {
|
||||
size_t bo_stride = gbm_bo_get_stride(ctx->gbm_buffer[fb_idx]);
|
||||
size_t bo_size = gbm_bo_get_stride(ctx->gbm_buffer[fb_idx]) * gbm_bo_get_height(ctx->gbm_buffer[fb_idx]);
|
||||
uint32_t *bo_ptr;
|
||||
volatile uint32_t *ptr;
|
||||
uint32_t *ptr;
|
||||
struct timeval start, end;
|
||||
|
||||
for (sequence_subindex = 0; sequence_subindex < 4; sequence_subindex++) {
|
||||
@ -306,11 +306,8 @@ static void draw(struct context *ctx) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
munmap(bo_ptr, bo_size);
|
||||
|
||||
usleep(1e6 / 120); /* 120 Hz */
|
||||
|
||||
fb_idx = fb_idx ^ 1;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user