Skip to content

Commit

Permalink
exynos4: gralloc changes for oss hwcomposer
Browse files Browse the repository at this point in the history
Change-Id: I7b3ac2404fed7d07ef672c99f47bb36f8b80dafd
  • Loading branch information
javifo committed Mar 27, 2017
1 parent 90ce74a commit 999f319
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions exynos4/hal/include/gralloc_priv.h
Expand Up @@ -141,6 +141,7 @@ struct private_handle_t {

/* Following members are for ION memory only */
int ion_client;
void *ion_memory;

#ifdef __cplusplus
static const int sNumInts = 21;
Expand Down
3 changes: 3 additions & 0 deletions exynos4/hal/libgralloc_ump/alloc_device.cpp
Expand Up @@ -332,6 +332,7 @@ static int gralloc_alloc_buffer(alloc_device_t* dev, size_t size, int usage,
hnd->uoffset = ((EXYNOS4_ALIGN(hnd->width, 16) * EXYNOS4_ALIGN(hnd->height, 16)));
hnd->voffset = ((EXYNOS4_ALIGN((hnd->width / 2), 16) * EXYNOS4_ALIGN((hnd->height / 2), 16)));
hnd->paddr = ion_paddr;
hnd->ion_memory = ion_map(ion_fd, size, 0);

ALOGD_IF(debug_level > 0, "%s hnd->format=0x%x hnd->uoffset=%d hnd->voffset=%d hnd->paddr=%x hnd->bpp=%d", __func__, hnd->format, hnd->uoffset, hnd->voffset, hnd->paddr, hnd->bpp);
return 0;
Expand Down Expand Up @@ -636,6 +637,8 @@ static int alloc_device_free(alloc_device_t* dev, buffer_handle_t handle)
}

if (hnd->flags & private_handle_t::PRIV_FLAGS_USES_ION) {
if (hnd->ion_memory > 0)
munmap(hnd->ion_memory, hnd->size);
ion_free(hnd->fd);
}

Expand Down

0 comments on commit 999f319

Please sign in to comment.