Advertisement
Guest User

Untitled

a guest
Jan 31st, 2015
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.56 KB | None | 0 0
  1. commit 8758eb80ff7cdd7ef1f5642d8da327050691ab77
  2. Author: Imre Deak <imre.deak@intel.com>
  3. Date: Thu Jan 29 14:32:24 2015 -0800
  4.  
  5. gem_render_copy: check whole dst area
  6.  
  7. Signed-off-by: Imre Deak <imre.deak@intel.com>
  8.  
  9. diff --git a/tests/gem_render_copy.c b/tests/gem_render_copy.c
  10. index 006b6f5..691dcb5 100644
  11. --- a/tests/gem_render_copy.c
  12. +++ b/tests/gem_render_copy.c
  13. @@ -119,6 +119,25 @@ scratch_buf_check(data_t *data, struct igt_buf *buf, int x, int y,
  14. color, val, x, y);
  15. }
  16.  
  17. +static void
  18. +scratch_buf_check_area(data_t *data, struct igt_buf *buf, int x, int y,
  19. + int w, int h, uint32_t color)
  20. +{
  21. + int row, col;
  22. + uint32_t val;
  23. +
  24. + gem_read(data->drm_fd, buf->bo->handle, 0,
  25. + data->linear, sizeof(data->linear));
  26. + for (row = y; row < y + h; row++) {
  27. + for (col = x; col < x + w; col++) {
  28. + val = data->linear[y * WIDTH + x];
  29. + igt_assert_f(val == color,
  30. + "Expected 0x%08x, found 0x%08x at (%d,%d)\n",
  31. + color, val, x, y);
  32. + }
  33. + }
  34. +}
  35. +
  36. static int opt_handler(int opt, int opt_index)
  37. {
  38. if (opt == 'd') {
  39. @@ -184,8 +203,10 @@ int main(int argc, char **argv)
  40. STRIDE, 0);
  41. drm_intel_bufmgr_gem_set_aub_dump(data.bufmgr, false);
  42. } else {
  43. - scratch_buf_check(&data, &dst, 10, 10, DST_COLOR);
  44. - scratch_buf_check(&data, &dst, WIDTH - 10, HEIGHT - 10, SRC_COLOR);
  45. + scratch_buf_check_area(&data, &dst, 0, 0, WIDTH / 2, HEIGHT / 2,
  46. + DST_COLOR);
  47. + scratch_buf_check_area(&data, &dst, WIDTH / 2, HEIGHT / 2,
  48. + WIDTH / 2, HEIGHT / 2, SRC_COLOR);
  49. }
  50.  
  51. igt_exit();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement