AllocSurface#

Fully qualified name: cupva_utils::AllocSurface

Defined in cupva_host_utils.hpp

void *cupva_utils::AllocSurface(
const PlaneSize *ps,
const int32_t planeCount,
const cupva::SurfaceFormatType format = cupva::SurfaceFormatType::BLOCK_LINEAR,
)#

Allocate a surface that is accessable by PVA engine.

Usage considerations

  • Allowed context for the API call

    • Interrupt handler: No

    • Signal handler: No

    • Thread-safe: No

    • Re-entrant: No

    • Async/Sync: Sync

  • Required privileges: None

  • Allowed execution state

    • Initialization: Yes

    • Operational: Yes

    • Reinit/Deinit Preparation: Yes

  • Maturity: GA

Parameters:
  • ps – [in] Pointer to PlaneSize structs.

  • planeCount – [in] Specifies the number of planes.

  • format – [in] Specifies surface format. There are two formats supported: PITCH_LINEAR and BLOCK_LINEAR.

Throws:
  • cupva::Exception(InvalidArgument) – The number of planes exceeds the maximum.

  • cupva::Exception(InvalidArgument) – An invalid allocation size was provided.

  • cupva::Exception(InternalError) – Failed to allocate VA.

Returns:

The device pointer pointing to the allocated memory.

Pre:

None