diff --git a/drivers/video/tegra/nvmap/nvmap_ioctl.c b/drivers/video/tegra/nvmap/nvmap_ioctl.c index 4519a46a..b8a22681 100644 --- a/drivers/video/tegra/nvmap/nvmap_ioctl.c +++ b/drivers/video/tegra/nvmap/nvmap_ioctl.c @@ -1354,6 +1354,8 @@ int nvmap_ioctl_query_heap_params(struct file *filp, void __user *arg) heap = nvmap_dev->heaps[i].carveout; op.total = nvmap_query_heap_size(heap); op.free = heap->free_size; + if (nvmap_dev->heaps[i].carveout->is_compression_co) + op.granule_size = nvmap_dev->heaps[i].carveout->granule_size; break; } } @@ -1367,6 +1369,7 @@ int nvmap_ioctl_query_heap_params(struct file *filp, void __user *arg) if (ret) goto exit; op.free = free_mem; + op.granule_size = PAGE_SIZE; } if (copy_to_user(arg, &op, sizeof(op))) diff --git a/include/uapi/linux/nvmap.h b/include/uapi/linux/nvmap.h index c35472d7..1a771c22 100644 --- a/include/uapi/linux/nvmap.h +++ b/include/uapi/linux/nvmap.h @@ -239,6 +239,7 @@ struct nvmap_query_heap_params { __u64 total; __u64 free; __u64 largest_free_block; + __u32 granule_size; }; /**