List of APIs to create/operate on NvSciBufObj.
Functions | |
NvSciError | NvSciBufObjDup (NvSciBufObj bufObj, NvSciBufObj *dupObj) |
Creates a new NvSciBufObj holding reference to the same Memory object to which input NvSciBufObj holds the reference. More... | |
NvSciError | NvSciBufAttrListReconcileAndObjAlloc (const NvSciBufAttrList attrListArray[], size_t attrListCount, NvSciBufObj *bufObj, NvSciBufAttrList *newConflictList) |
Reconciles the input unreconciled NvSciBufAttrList(s) into a new reconciled NvSciBufAttrList and allocates NvSciBufObj that meets all the constraints in the reconciled NvSciBufAttrList. More... | |
void | NvSciBufObjFree (NvSciBufObj bufObj) |
Removes reference to the Memory object by destroying the NvSciBufObj. More... | |
NvSciError | NvSciBufObjGetAttrList (NvSciBufObj bufObj, NvSciBufAttrList *bufAttrList) |
Retrieves the reconciled NvSciBufAttrList whose attributes define the constraints of the allocated buffer from the NvSciBufObj. More... | |
NvSciError | NvSciBufObjGetCpuPtr (NvSciBufObj bufObj, void **ptr) |
Gets the CPU virtual address (VA) of the read/write buffer referenced by the NvSciBufObj. More... | |
NvSciError | NvSciBufObjGetConstCpuPtr (NvSciBufObj bufObj, const void **ptr) |
Gets the CPU virtual address (VA) of the read-only buffer referenced by the NvSciBufObj. More... | |
NvSciError | NvSciBufObjFlushCpuCacheRange (NvSciBufObj bufObj, uint64_t offset, uint64_t len) |
Flushes the given len bytes at starting offset in the buffer referenced by the NvSciBufObj. More... | |
NvSciError | NvSciBufObjAlloc (NvSciBufAttrList reconciledAttrList, NvSciBufObj *bufObj) |
Allocates a buffer that satisfies all the constraints defined by the attributes of the specified reconciled NvSciBufAttrList, and outputs a new NvSciBufObj referencing the Memory object containing the allocated buffer properties. More... | |
NvSciError | NvSciBufObjDupWithReducePerm (NvSciBufObj bufObj, NvSciBufAttrValAccessPerm reducedPerm, NvSciBufObj *newBufObj) |
Creates a new memory object containing a buffer handle representing the new NvSciBufAttrValAccessPerm to the same buffer for the buffer handle contained in the input memory object referenced by the input NvSciBufObj and creates a new NvSciBufObj referencing it provided NvSciBufAttrValAccessPerm are less than permissions represented by buffer handle in the memory object referenced by input NvSciBufObj. More... | |
NvSciError | NvSciBufObjGetPixels (NvSciBufObj bufObj, const NvSciBufRect *rect, void **dstPtrs, const uint32_t *dstPtrSizes, const uint32_t *dstPitches) |
Gets pixels from the buffer represented by memory object pointed to by bufObj provided NvSciBufGeneralAttrKey_Types is set to NvSciBufType_Image and CPU access to the buffer is requested via NvSciBufGeneralAttrKey_NeedCpuAccess in the unreconciled NvSciBufAttrList(s) used for bufObj allocation by the peer intending to call this API. More... | |
NvSciError | NvSciBufObjPutPixels (NvSciBufObj bufObj, const NvSciBufRect *rect, const void **srcPtrs, const uint32_t *srcPtrSizes, const uint32_t *srcPitches) |
Writes pixels to the buffer represented by memory object pointed to by bufObj provided NvSciBufGeneralAttrKey_Types is set to NvSciBufType_Image, NvSciBufAccessPerm_ReadWrite permissions are requested for the bufObj via NvSciBufGeneralAttrKey_RequiredPerm and CPU access to the buffer is requested via NvSciBufGeneralAttrKey_NeedCpuAccess in the unreconciled NvSciBufAttrList(s) used for bufObj allocation by the peer intending to call this API. More... | |
NvSciError NvSciBufAttrListReconcileAndObjAlloc | ( | const NvSciBufAttrList | attrListArray[], |
size_t | attrListCount, | ||
NvSciBufObj * | bufObj, | ||
NvSciBufAttrList * | newConflictList | ||
) |
Reconciles the input unreconciled NvSciBufAttrList(s) into a new reconciled NvSciBufAttrList and allocates NvSciBufObj that meets all the constraints in the reconciled NvSciBufAttrList.
[in] | attrListArray | Array containing unreconciled NvSciBufAttrList(s) to reconcile. Valid value: Array of valid unreconciled NvSciBufAttrList(s) where array size is at least 1. |
[in] | attrListCount | The number of unreconciled NvSciBufAttrList(s) in attrListArray . Valid value: 1 to SIZE_MAX. |
[out] | bufObj | The new NvSciBufObj. |
[out] | newConflictList | Unreconciled NvSciBufAttrList consisting of the key/value pairs which caused the reconciliation failure. This field is populated only if the reconciliation failed. |
Usage considerations
NvSciError NvSciBufObjAlloc | ( | NvSciBufAttrList | reconciledAttrList, |
NvSciBufObj * | bufObj | ||
) |
Allocates a buffer that satisfies all the constraints defined by the attributes of the specified reconciled NvSciBufAttrList, and outputs a new NvSciBufObj referencing the Memory object containing the allocated buffer properties.
[in] | reconciledAttrList | The reconciled NvSciBufAttrList. |
[out] | bufObj | The new NvSciBufObj. |
Usage considerations
NvSciError NvSciBufObjDup | ( | NvSciBufObj | bufObj, |
NvSciBufObj * | dupObj | ||
) |
Creates a new NvSciBufObj holding reference to the same Memory object to which input NvSciBufObj holds the reference.
[in] | bufObj | NvSciBufObj from which new NvSciBufObj needs to be created. |
[out] | dupObj | The new NvSciBufObj. |
Usage considerations
NvSciError NvSciBufObjDupWithReducePerm | ( | NvSciBufObj | bufObj, |
NvSciBufAttrValAccessPerm | reducedPerm, | ||
NvSciBufObj * | newBufObj | ||
) |
Creates a new memory object containing a buffer handle representing the new NvSciBufAttrValAccessPerm to the same buffer for the buffer handle contained in the input memory object referenced by the input NvSciBufObj and creates a new NvSciBufObj referencing it provided NvSciBufAttrValAccessPerm are less than permissions represented by buffer handle in the memory object referenced by input NvSciBufObj.
When this is the case, the new memory object will contains a new NvSciBufAttrList which is cloned from the original NvSciBufAttrList associated with the input NvSciBufObj, but with the requested NvSciBufAttrValAccessPerm.
This interface has same effect as calling NvSciBufObjDup() if NvSciBufAttrValAccessPerm are the same as the permissions represented by the buffer handle in the memory object referenced by the input NvSciBufObj.
[in] | bufObj | NvSciBufObj. |
[in] | reducedPerm | Reduced access permissions that need to be imposed on the new NvSciBufObj (see NvSciBufAttrValAccessPerm). Valid value: NvSciBufAccessPerm_Readonly or NvSciBufAccessPerm_ReadWrite, which is <= NvSciBufAttrValAccessPerm represented by the value of the NvSciBufGeneralAttrKey_ActualPerm key in the reconciled NvSciBufAttrList associated with the input NvSciBufObj. |
[out] | newBufObj | The new NvSciBufObj with new permissions. |
Usage considerations
NvSciError NvSciBufObjFlushCpuCacheRange | ( | NvSciBufObj | bufObj, |
uint64_t | offset, | ||
uint64_t | len | ||
) |
Flushes the given len
bytes at starting offset
in the buffer referenced by the NvSciBufObj.
Flushing is done only when NvSciBufGeneralAttrKey_CpuNeedSwCacheCoherency key is set in reconciled NvSciBufAttrList to true.
[in] | bufObj | The NvSciBufObj. |
[in] | offset | The starting offset in memory of the NvSciBufObj. Valid value: 0 to buffer size - 1. |
[in] | len | The length (in bytes) to flush. Valid value: 1 to buffer size - offset. |
Usage considerations
void NvSciBufObjFree | ( | NvSciBufObj | bufObj | ) |
Removes reference to the Memory object by destroying the NvSciBufObj.
[in] | bufObj | The NvSciBufObj to deallocate. |
Usage considerations
NvSciError NvSciBufObjGetAttrList | ( | NvSciBufObj | bufObj, |
NvSciBufAttrList * | bufAttrList | ||
) |
Retrieves the reconciled NvSciBufAttrList whose attributes define the constraints of the allocated buffer from the NvSciBufObj.
[in] | bufObj | The NvSciBufObj to retrieve the NvSciBufAttrList from. |
[out] | bufAttrList | The retrieved reconciled NvSciBufAttrList. |
Usage considerations
NvSciError NvSciBufObjGetConstCpuPtr | ( | NvSciBufObj | bufObj, |
const void ** | ptr | ||
) |
Gets the CPU virtual address (VA) of the read-only buffer referenced by the NvSciBufObj.
[in] | bufObj | The NvSciBufObj. |
[out] | ptr | the CPU virtual address (VA). |
Usage considerations
NvSciError NvSciBufObjGetCpuPtr | ( | NvSciBufObj | bufObj, |
void ** | ptr | ||
) |
Gets the CPU virtual address (VA) of the read/write buffer referenced by the NvSciBufObj.
[in] | bufObj | The NvSciBufObj. |
[out] | ptr | The CPU virtual address (VA). |
Usage considerations
NvSciError NvSciBufObjGetPixels | ( | NvSciBufObj | bufObj, |
const NvSciBufRect * | rect, | ||
void ** | dstPtrs, | ||
const uint32_t * | dstPtrSizes, | ||
const uint32_t * | dstPitches | ||
) |
Gets pixels from the buffer represented by memory object pointed to by bufObj provided NvSciBufGeneralAttrKey_Types is set to NvSciBufType_Image and CPU access to the buffer is requested via NvSciBufGeneralAttrKey_NeedCpuAccess in the unreconciled NvSciBufAttrList(s) used for bufObj allocation by the peer intending to call this API.
[in] | bufObj | NvSciBufObj. |
[in] | rect | NvSciBufRect defining the subset of the surface to be copied to user provided surface. Valid value: rect can be NULL. If rect is NULL, then entire surface represented by NvSciBufObj is copied to user surface. rect can only be non-NULL for NvSciSurfType_RGBA or NvSciSurfType_RAW, it must be NULL for NvSciSurfType_YUV. If rect is non-NULL then x0 or x1 co-ordinate shall not exceed the plane width represented by NvSciBufImageAttrKey_PlaneWidth. Similarly, y0 or y1 co-ordinate shall not exceed the plane height represented by NvSciBufImageAttrKey_PlaneHeight. x0 co-ordinate cannot be greater than x1 co-ordinate. Similarly, y0 co-ordinate cannot be greater than y1 co-ordinate. Width represented by rect (x1 - x0) in bytes shall not exceed the dstPitches supplied by user. |
[out] | dstPtrs | an array of pointers to user's planes. For RGBA, RAW and single plane YUV images, it is assumed that the array will have single member representing single user plane. For YUV surfaces with more than one plane, it is assumed that user provides separate plane pointers for Y, U and V planes (where Y is the first plane, U is the second plane, and V is the third plane). For RGB surfaces with three planes, it is assumed that user provides separate plane pointers for R, G and B planes (where R is the first plane, G is the second plane, and B is the third plane) Valid value: dstPtrs must be non-NULL. Every array member of dstPtrs must be non-NULL. param[in] dstPtrSizes an array of plane's sizes. Each size in the dstPtrSizes array shall correspond to the plane at the same index in dstPtrs. Valid value: dstPtrSizes must be non-NULL. Each array member of the dstPtrSizes must be non-zero. |
[in] | dstPitches | an array of pitches. Each member in array shall correspond to the pitch of plane at the same index in dstPtrs. Valid value: dstPitches must be non-NULL. |
Usage considerations
NvSciError NvSciBufObjPutPixels | ( | NvSciBufObj | bufObj, |
const NvSciBufRect * | rect, | ||
const void ** | srcPtrs, | ||
const uint32_t * | srcPtrSizes, | ||
const uint32_t * | srcPitches | ||
) |
Writes pixels to the buffer represented by memory object pointed to by bufObj provided NvSciBufGeneralAttrKey_Types is set to NvSciBufType_Image, NvSciBufAccessPerm_ReadWrite permissions are requested for the bufObj via NvSciBufGeneralAttrKey_RequiredPerm and CPU access to the buffer is requested via NvSciBufGeneralAttrKey_NeedCpuAccess in the unreconciled NvSciBufAttrList(s) used for bufObj allocation by the peer intending to call this API.
[in] | bufObj | NvSciBufObj. |
[in] | rect | NvSciBufRect defining the subset of the surface to be copied from user provided surface. Valid value: rect can be NULL. If rect is NULL, then entire user surface is copied to bufObj. rect can only be non-NULL for NvSciSurfType_RGBA or NvSciSurfType_RAW, it must be NULL for NvSciSurfType_YUV. If rect is non-NULL then x0 or x1 co-ordinate shall not exceed the plane width represented by NvSciBufImageAttrKey_PlaneWidth. Similarly, y0 or y1 co-ordinate shall not exceed the plane height represented by NvSciBufImageAttrKey_PlaneHeight. x0 co-ordinate cannot be greater than x1 co-ordinate. Similarly, y0 co-ordinate cannot be greater than y1 co-ordinate. Width represented by rect (x1 - x0) in bytes shall not exceed the srcPitches supplied by user. |
[in] | srcPtrs | an array of pointers to user's planes. For RGBA, RAW and single plane YUV images, it is assumed that the array will have single member representing single user plane. For YUV surfaces with more than one plane, it is assumed that user provides separate plane pointers for Y, U and V planes (where Y is the first plane, U is the second plane, and V is the third plane). For RGB surfaces with three planes, it is assumed that user provides separate plane pointers for R, G and B planes (where R is the first plane, G is the second plane, and B is the third plane) Valid value: srcPtrs must be non-NULL. Every array member of srcPtrs must be non-NULL. param[in] srcPtrSizes an array of plane's sizes. Each size in the srcPtrSizes array shall correspond to the plane at the same index in srcPtrs. Valid value: srcPtrSizes must be non-NULL. Each array member of the srcPtrSizes must be non-zero. |
[in] | srcPitches | an array of pitches. Each member in array shall correspond to the pitch of plane at the same index in srcPtrs. Valid value: srcPitches must be non-NULL. |
Usage considerations