Store 64-bit offset values and use libdrm's built-in drm_mmap() function
instead of mmap() to ensure the full 64-bit offset is used.
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
struct drm_tegra_bo {
struct drm_tegra *drm;
uint32_t handle;
- uint32_t offset;
+ uint64_t offset;
uint32_t flags;
uint32_t size;
atomic_t ref;
bo->offset = args.offset;
- bo->map = mmap(0, bo->size, PROT_READ | PROT_WRITE, MAP_SHARED,
- drm->fd, bo->offset);
+ bo->map = drm_mmap(NULL, bo->size, PROT_READ | PROT_WRITE, MAP_SHARED,
+ drm->fd, bo->offset);
if (bo->map == MAP_FAILED) {
bo->map = NULL;
return -errno;