summaryrefslogtreecommitdiff
path: root/tests/i915/gem_gpgpu_fill.c
diff options
context:
space:
mode:
authorAshutosh Dixit <ashutosh.dixit@intel.com>2021-10-03 21:20:02 -0700
committerAshutosh Dixit <ashutosh.dixit@intel.com>2021-10-03 22:26:53 -0700
commit242d0848546dd6397c609042559ebcc0f7f41bf5 (patch)
tree015008ef12273c53bd076963b51cba40301884e6 /tests/i915/gem_gpgpu_fill.c
parent1bf33aec92671a1cdf80f4fa84216845a31f73b2 (diff)
lib: Partially revert 22643ce4014a
In 22643ce4014a ("Return allocated size in gem_create_in_memory_regions() and friends") we modified __gem_create_in_memory_regions and gem_create_in_memory_regions to return the allocated size for buffer objects. However, this also unnecessarily complicates programming in the majority of cases where the allocated size is not needed. For example in several cases it requires tracking the requested and allocated sizes separately, the size used must be strictly uint64_t etc. In order to simplify things and provide greater flexibility, here we change 22643ce4014a to follow the same scheme followed in gem_create_ext (and in gem_create) where __gem_create_ext returns the allocated size but gem_create_ext doesn't. With this change, __gem_create_in_memory_regions returns the allocated size for situations where it is needed but in the majority of cases where the allocated size is not needed we can just use gem_create_in_memory_regions for casual use as before. v2: Store requested not allocated bo size in intel_buf->size (Zbigniew) Reviewed-by: Zbigniew KempczyƄski <zbigniew.kempczynski@intel.com> Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
Diffstat (limited to 'tests/i915/gem_gpgpu_fill.c')
-rw-r--r--tests/i915/gem_gpgpu_fill.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/tests/i915/gem_gpgpu_fill.c b/tests/i915/gem_gpgpu_fill.c
index 76f4d7c6..74a227f6 100644
--- a/tests/i915/gem_gpgpu_fill.c
+++ b/tests/i915/gem_gpgpu_fill.c
@@ -68,7 +68,6 @@ create_buf(data_t *data, int width, int height, uint8_t color, uint32_t region)
struct intel_buf *buf;
uint8_t *ptr;
uint32_t handle;
- uint64_t size = SIZE;
int i;
buf = calloc(1, sizeof(*buf));
@@ -78,7 +77,7 @@ create_buf(data_t *data, int width, int height, uint8_t color, uint32_t region)
* Legacy code uses 32 bpp after buffer creation.
* Let's do the same due to keep shader intact.
*/
- handle = gem_create_in_memory_regions(data->drm_fd, &size, region);
+ handle = gem_create_in_memory_regions(data->drm_fd, SIZE, region);
intel_buf_init_using_handle(data->bops, handle, buf,
width/4, height, 32, 0,
I915_TILING_NONE, 0);