summaryrefslogtreecommitdiff
path: root/tests/kms_prime.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/kms_prime.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/kms_prime.c')
-rw-r--r--tests/kms_prime.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/kms_prime.c b/tests/kms_prime.c
index ea459414..5cdb5597 100644
--- a/tests/kms_prime.c
+++ b/tests/kms_prime.c
@@ -112,10 +112,10 @@ static void prepare_scratch(int exporter_fd, struct dumb_bo *scratch,
igt_calc_fb_size(exporter_fd, mode->hdisplay, mode->vdisplay, DRM_FORMAT_XRGB8888,
DRM_FORMAT_MOD_NONE, &scratch->size, &scratch->pitch);
if (gem_has_lmem(exporter_fd))
- scratch->handle = gem_create_in_memory_regions(exporter_fd, &scratch->size,
+ scratch->handle = gem_create_in_memory_regions(exporter_fd, scratch->size,
REGION_LMEM(0), REGION_SMEM);
else
- scratch->handle = gem_create_in_memory_regions(exporter_fd, &scratch->size,
+ scratch->handle = gem_create_in_memory_regions(exporter_fd, scratch->size,
REGION_SMEM);
ptr = gem_mmap__device_coherent(exporter_fd, scratch->handle, 0, scratch->size,