/* our private data here */
};
-static int gralloc_alloc_buffer(alloc_device_t* dev,
- size_t size, int usage, buffer_handle_t* pHandle);
-
/*****************************************************************************/
int fb_device_open(const hw_module_t* module, const char* name,
/*****************************************************************************/
static struct hw_module_methods_t gralloc_module_methods = {
-open: gralloc_device_open
+ .open = gralloc_device_open
};
/* version_major is for module_api_verison
* lock_ycbcr is for MODULE_API_VERSION_0_2
*/
struct private_module_t HAL_MODULE_INFO_SYM = {
-base: {
- common: {
- tag: HARDWARE_MODULE_TAG,
- module_api_version: GRALLOC_MODULE_API_VERSION_0_2,
- hal_api_version: 0,
- id: GRALLOC_HARDWARE_MODULE_ID,
- name: "Graphics Memory Allocator Module",
- author: "The Android Open Source Project",
- methods: &gralloc_module_methods
+ .base = {
+ .common = {
+ .tag = HARDWARE_MODULE_TAG,
+ .module_api_version = GRALLOC_MODULE_API_VERSION_0_2,
+ .hal_api_version = 0,
+ .id = GRALLOC_HARDWARE_MODULE_ID,
+ .name = "Graphics Memory Allocator Module",
+ .author = "The Android Open Source Project",
+ .methods = &gralloc_module_methods
+ },
+ .registerBuffer = gralloc_register_buffer,
+ .unregisterBuffer = gralloc_unregister_buffer,
+ .lock = gralloc_lock,
+ .unlock = gralloc_unlock,
+ .perform = NULL,
+ .lock_ycbcr = gralloc_lock_ycbcr,
},
- registerBuffer: gralloc_register_buffer,
- unregisterBuffer: gralloc_unregister_buffer,
- lock: gralloc_lock,
- unlock: gralloc_unlock,
- perform: NULL,
- lock_ycbcr: gralloc_lock_ycbcr,
-},
-framebuffer: 0,
-flags: 0,
-numBuffers: 0,
-bufferMask: 0,
-lock: PTHREAD_MUTEX_INITIALIZER,
-currentBuffer: 0,
-ionfd: -1,
+ .framebuffer = 0,
+ .flags = 0,
+ .numBuffers = 0,
+ .bufferMask = 0,
+ .lock = PTHREAD_MUTEX_INITIALIZER,
+ .currentBuffer = 0,
+ .ionfd = -1,
};
/*****************************************************************************/
int h_aligned = ALIGN( h, AFBC_PIXELS_PER_BLOCK );
int nblocks = w / AFBC_PIXELS_PER_BLOCK * h_aligned / AFBC_PIXELS_PER_BLOCK;
- if ( size != NULL )
+ if ( size )
{
size = w * h_aligned * bpp +
ALIGN( nblocks * AFBC_HEADER_BUFFER_BYTES_PER_BLOCKENTRY, AFBC_BODY_BUFFER_BYTE_ALIGNMENT );
private_module_t* m = reinterpret_cast<private_module_t*>
(dev->common.module);
- gralloc_module_t* module = reinterpret_cast<gralloc_module_t*>
- (dev->common.module);
err = gralloc_alloc_rgb(m->ionfd, w, h, format, usage, ion_flags, &hnd,
&stride);
return 0;
}
-static int gralloc_unmap(gralloc_module_t const* module, buffer_handle_t handle)
+static int gralloc_unmap(gralloc_module_t const* module __unused, buffer_handle_t handle)
{
private_handle_t* hnd = (private_handle_t*)handle;
size_t chroma_vstride = 0;
return gralloc_unmap(module, hnd);
}
-static pthread_mutex_t sMapLock = PTHREAD_MUTEX_INITIALIZER;
-
/*****************************************************************************/
int gralloc_register_buffer(gralloc_module_t const* module,
}
int gralloc_lock(gralloc_module_t const* module,
- buffer_handle_t handle, int usage,
- int l, int t, int w, int h,
+ buffer_handle_t handle, int usage __unused,
+ int l __unused, int t __unused, int w __unused, int h __unused,
void** vaddr)
{
// this is called when a buffer is being locked for software
*vaddr = INT_TO_PTR(hnd->base);
if (hnd->format == HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_SPN)
- vaddr[1] = vaddr[0] + (hnd->stride * hnd->vstride) + ext_size;
+ vaddr[1] = (int*)vaddr[0] + (hnd->stride * hnd->vstride) + ext_size;
else if (hnd->format == HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_SPN_S10B)
- vaddr[1] = vaddr[0] + (hnd->stride * hnd->vstride) + ext_size + (ALIGN(hnd->width / 4, 16) * hnd->vstride) + 64;
+ vaddr[1] = (int*)vaddr[0] + (hnd->stride * hnd->vstride) + ext_size + (ALIGN(hnd->width / 4, 16) * hnd->vstride) + 64;
#ifdef USES_EXYNOS_CRC_BUFFER_ALLOC
if (!gralloc_crc_allocation_check(hnd->format, hnd->width, hnd->height, hnd->flags))
return 0;
}
-int gralloc_lock_ycbcr(gralloc_module_t const* module,
+int gralloc_lock_ycbcr(gralloc_module_t const* module __unused,
buffer_handle_t handle, int usage,
- int l, int t, int w, int h,
+ int l __unused, int t __unused, int w __unused, int h __unused,
android_ycbcr *ycbcr)
{
if (private_handle_t::validate(handle) < 0)
private_handle_t(int fd, int size, int flags) :
fd(fd), fd1(-1), fd2(-1), magic(sMagic), flags(flags), size(size),
- offset(0), format(0), internal_format(0), frameworkFormat(0), width(0), height(0), stride(0),
- vstride(0), is_compressible(0), compressed_out(0), handle(0), handle1(0), handle2(0), base(0), base1(0), base2(0), prefer_compression(PREFER_COMPRESSION_NO_CHANGE), dssRatio(0)
+ offset(0), format(0), width(0), height(0), stride(0), vstride(0), frameworkFormat(0),
+ handle(0), handle1(0), handle2(0), base(0), base1(0), base2(0),
+ dssRatio(0), prefer_compression(PREFER_COMPRESSION_NO_CHANGE),
+ internal_format(0), is_compressible(0), compressed_out(0)
+
{
version = sizeof(native_handle);
numInts = sNumInts() + 2;
private_handle_t(int fd, int size, int flags, int w,
int h, int format, uint64_t internal_format, int frameworkFormat, int stride, int vstride, int is_compressible) :
fd(fd), fd1(-1), fd2(-1), magic(sMagic), flags(flags), size(size),
- offset(0), format(format), internal_format(internal_format), frameworkFormat(frameworkFormat), width(w), height(h), stride(stride),
- vstride(vstride), is_compressible(is_compressible), compressed_out(0), handle(0), handle1(0), handle2(0), base(0), base1(0), base2(0), prefer_compression(PREFER_COMPRESSION_NO_CHANGE), dssRatio(0)
+ offset(0), format(format), width(w), height(h), stride(stride), vstride(vstride), frameworkFormat(frameworkFormat),
+ handle(0), handle1(0), handle2(0), base(0), base1(0), base2(0),
+ dssRatio(0), prefer_compression(PREFER_COMPRESSION_NO_CHANGE),
+ internal_format(internal_format), is_compressible(is_compressible), compressed_out(0)
+
{
version = sizeof(native_handle);
numInts = sNumInts() + 2;
private_handle_t(int fd, int fd1, int size, int flags, int w,
int h, int format, uint64_t internal_format, int frameworkFormat, int stride, int vstride, int is_compressible) :
fd(fd), fd1(fd1), fd2(-1), magic(sMagic), flags(flags), size(size),
- offset(0), format(format), internal_format(internal_format), frameworkFormat(frameworkFormat), width(w), height(h), stride(stride),
- vstride(vstride), is_compressible(is_compressible), compressed_out(0), handle(0), handle1(0), handle2(0), base(0), base1(0), base2(0), prefer_compression(PREFER_COMPRESSION_NO_CHANGE), dssRatio(0)
+ offset(0), format(format), width(w), height(h), stride(stride), vstride(vstride), frameworkFormat(frameworkFormat),
+ handle(0), handle1(0), handle2(0), base(0), base1(0), base2(0),
+ dssRatio(0), prefer_compression(PREFER_COMPRESSION_NO_CHANGE),
+ internal_format(internal_format), is_compressible(is_compressible), compressed_out(0)
+
{
version = sizeof(native_handle);
numInts = sNumInts() + 1;
private_handle_t(int fd, int fd1, int fd2, int size, int flags, int w,
int h, int format, uint64_t internal_format, int frameworkFormat, int stride, int vstride, int is_compressible) :
fd(fd), fd1(fd1), fd2(fd2), magic(sMagic), flags(flags), size(size),
- offset(0), format(format), internal_format(internal_format), frameworkFormat(frameworkFormat), width(w), height(h), stride(stride),
- vstride(vstride), is_compressible(is_compressible), compressed_out(0), handle(0), handle1(0), handle2(0), base(0), base1(0), base2(0), prefer_compression(PREFER_COMPRESSION_NO_CHANGE), dssRatio(0)
+ offset(0), format(format), width(w), height(h), stride(stride), vstride(vstride), frameworkFormat(frameworkFormat),
+ handle(0), handle1(0), handle2(0), base(0), base1(0), base2(0),
+ dssRatio(0), prefer_compression(PREFER_COMPRESSION_NO_CHANGE),
+ internal_format(internal_format), is_compressible(is_compressible), compressed_out(0)
+
{
version = sizeof(native_handle);
numInts = sNumInts();