GrallocFuncs

Overview

Related Modules:

Display

Description:

Defines pointers to the memory driver functions.

Summary

Data Fields

Variable Name

Description

AllocMem )(GrallocBufferbuffer)

int32_t( 

Allocates memory based on the parameters passed by the GUI.

FreeMem )(GrallocBufferbuffer)

void( 

Releases memory.

Mmap )(GrallocBufferbuffer)

void ( 

Maps memory with a specified physical address and size to memory without cache in the process’s address space.

MmapCache )(GrallocBuffer buffer)

void ( 

Maps memory with a specified physical address and size to memory with cache in the process’s address space.

Unmap )(GrallocBufferbuffer)

int32_t( 

Unmaps memory, that is, removes any mappings in the process’s address space.

FlushCache )(GrallocBufferbuffer)

int32_t( 

Flushes data from the cache to memory and invalidates the data in the cache.

FlushMCache )(GrallocBufferbuffer)

int32_t( 

Flushes data from the cache mapping to Mmap to memory and invalidates the data in the cache.

Details

Field Documentation

AllocMem

  1. int32_t(*GrallocFuncs::AllocMem)([GrallocBuffer]($api-api-SmartVision-Devices-GrallocBuffer.md)*buffer)

Description:

Allocates memory based on the parameters passed by the GUI.

Parameters:

Name

Description

hdlIndicates the pointer to the handle of memory.
typeIndicates the type of memory to allocate. The value[/table/tgroup/tbody/row/entry/div {“”}) [/table/tgroup/tbody/row/entry/div/div {“”}) 0 (div] (div] indicates memory without cache, [/table/tgroup/tbody/row/entry/div {“”}) [/table/tgroup/tbody/row/entry/div/div {“”}) 1 (div] (div] indicates memory with cache, and[/table/tgroup/tbody/row/entry/div {“”}) [/table/tgroup/tbody/row/entry/div/div {“”}) 2 (div] (div] indicates shared memory.
sizeIndicates the size of memory to allocate, in bytes.

Returns:

Returns 0 if the operation is successful; returns an error code defined in DispErrCode otherwise.

FlushCache

  1. int32_t(*GrallocFuncs::FlushCache)([GrallocBuffer]($api-api-SmartVision-Devices-GrallocBuffer.md)*buffer)

Description:

Flushes data from the cache to memory and invalidates the data in the cache.

Parameters:

Name

Description

hdlIndicates the pointer to the handle of the cache.
sizeIndicates the size of the cache from which data is to flush.

Returns:

Returns 0 if the operation is successful; returns an error code defined in DispErrCode otherwise.

FlushMCache

  1. int32_t(*GrallocFuncs::FlushMCache)([GrallocBuffer]($api-api-SmartVision-Devices-GrallocBuffer.md)*buffer)

Description:

Flushes data from the cache mapping to Mmap to memory and invalidates the data in the cache.

Parameters:

Name

Description

hdlIndicates the pointer to the handle of the cache.
sizeIndicates the size of the cache from which data is to flush.

Returns:

Returns 0 if the operation is successful; returns an error code defined in DispErrCode otherwise.

FreeMem

  1. void(*GrallocFuncs::FreeMem)([GrallocBuffer]($api-api-SmartVision-Devices-GrallocBuffer.md)*buffer)

Description:

Releases memory.

Parameters:

Name

Description

hdlIndicates the pointer to the handle of memory that has been applied for.

Mmap

  1. void*(*GrallocFuncs::Mmap)([GrallocBuffer]($api-api-SmartVision-Devices-GrallocBuffer.md)*buffer)

Description:

Maps memory with a specified physical address and size to memory without cache in the process’s address space.

Parameters:

Name

Description

phyAddrIndicates the physical address of memory to map.
sizeIndicates the size of memory to map.

Returns:

Returns the pointer to a valid address if the operation is successful; returns NULL otherwise.

MmapCache

  1. void*(*GrallocFuncs::MmapCache)([GrallocBuffer]($api-api-SmartVision-Devices-GrallocBuffer.md)*buffer)

Description:

Maps memory with a specified physical address and size to memory with cache in the process’s address space.

Parameters:

Name

Description

phyAddrIndicates the physical address of memory to map.
sizeIndicates the size of memory to map.

Returns:

Returns the pointer to a valid address if the operation is successful; returns NULL otherwise.

Unmap

  1. int32_t(*GrallocFuncs::Unmap)([GrallocBuffer]($api-api-SmartVision-Devices-GrallocBuffer.md)*buffer)

Description:

Unmaps memory, that is, removes any mappings in the process’s address space.

Parameters:

Name

Description

virAddrIndicates the pointer to the virtual address of memory to unmap.
sizeIndicates the size of memory to unmap.

Returns:

Returns 0 if the operation is successful; returns an error code defined in DispErrCode otherwise.