NVIDIA DriveOS Linux SDK API Reference

7.2.5.0 Early Access Release

Detailed Description

An exposed (not opaque) structure representing a surface.

Use constraints for the structure:

  1. Clients should always initialize NvRmSurface structs using either NvRmSurfaceSetup() or NvRmMultiplanarSurfaceSetup().
  2. Clients should treat all members of NvRmSurface struct as read-only and not modify them directly.
  3. Clients are responsible for managing the backing memory for read/write operations:
    1. allocating and releasing the backing memory.
    2. mapping and unmapping the backing memory to CPU address space.
    3. providing the backing memory and mapped pointer to the NvRmSurface via NvRmSurfaceSetDeviceMemory()
  4. Functions operating with NvRmSurface struct are not thread-safe. Clients are responsible for synchronizing the access if multiple threads are accessing the struct.
  5. NvRmSurface structs should not be shared with other processes. NvRmSurface can hold a reference to NvRmMemoryHandle and respective mapping to the CPU virtual address space which are invalid if shared with multiple processes.
Note
On Android/HOS, this struct must be tightly packed and the pointer 64-bit aligned for sharing across 32-bit/64-bit process boundaries, even though the pointer is never actually shared. This is enforced by compile-time asserts.

Definition at line 553 of file nvrm_surface_fusa.h.

Data Fields

NvU32 Width
 The width of the surface. More...
 
NvU32 Height
 The height of the surface. More...
 
NvColorFormat ColorFormat
 The color format of the surface, e.g., ::NvColorFormat_A8R8G8B8. More...
 
NvRmSurfaceLayout Layout
 The layout of the surface, usually, NvRmSurfaceLayout_Blocklinear. More...
 
NvU32 Pitch
 The pitch of the surface in bytes. More...
 
NvRmMemHandle hMem
 If the surface is backed by an RM memory alloc, the handle of that memory alloc and the offset where the surface starts within that alloc. More...
 
NvU32 Offset
 The offset where the surface starts within that allocation. More...
 
NvRmMemKind Kind
 The "kind" of the surface. More...
 
NvU32 BlockHeightLog2
 The log2(block_height_in_number_of_gobs) of the surface. More...
 
NvDisplayScanFormat DisplayScanFormat
 The display scan format of the surface - progressive/interlaced. More...
 
NvU32 SecondFieldOffset
 For interlaced surfaces, SecondFieldOffset represents the offset of all of the odd lines relative to the start of the allocation. More...
 
NvU64 Flags
 Flags, See NVRM_SURFACE_FLAG_* NvRmSurfaceFlags. More...
 
NvU64 Size
 Size of the surface, in bytes, including all necessary padding and metadata. More...
 
NvU32 CdeHorizontalCompbitsOffset
 Offset, within the main surface allocation, of the CDE compbits for HW engines that traverse the surface horizontally. More...
 
NvU32 CdeVerticalCompbitsOffset
 Offset, within the main surface allocation, of the CDE compbits for HW engines that traverse the surface vertically. More...
 
NvU32 CdeScatterBufferOffset
 Offset, within the main surface allocation, of a buffer containing data for supporting CDE decompression of scattered 4k pages. More...
 
void * pBase
 If the surface is not backed by an RM alloc, the pointer to the storage. More...
 

Field Documentation

◆ BlockHeightLog2

NvU32 NvRmSurfaceRec::BlockHeightLog2

The log2(block_height_in_number_of_gobs) of the surface.

Used only if the Layout is blocklinear.

Definition at line 592 of file nvrm_surface_fusa.h.

◆ CdeHorizontalCompbitsOffset

NvU32 NvRmSurfaceRec::CdeHorizontalCompbitsOffset

Offset, within the main surface allocation, of the CDE compbits for HW engines that traverse the surface horizontally.

If the consumer doesn't support CDE or this field is 0, surfaces will always be passed to it uncompressed. In this case the compbits offset need not be programmed into HW.

Definition at line 621 of file nvrm_surface_fusa.h.

◆ CdeScatterBufferOffset

NvU32 NvRmSurfaceRec::CdeScatterBufferOffset

Offset, within the main surface allocation, of a buffer containing data for supporting CDE decompression of scattered 4k pages.

The contents are chip-specific, N bits of scatter data per 4k surface data page, filled in by kernel. 0 means no allocation.

Definition at line 635 of file nvrm_surface_fusa.h.

◆ CdeVerticalCompbitsOffset

NvU32 NvRmSurfaceRec::CdeVerticalCompbitsOffset

Offset, within the main surface allocation, of the CDE compbits for HW engines that traverse the surface vertically.

If the consumer doesn't support CDE or this field is 0, surfaces will always be passed to it uncompressed. In this case the compbits offset need not be programmed into HW.

Definition at line 628 of file nvrm_surface_fusa.h.

◆ ColorFormat

NvColorFormat NvRmSurfaceRec::ColorFormat

The color format of the surface, e.g., ::NvColorFormat_A8R8G8B8.

Definition at line 561 of file nvrm_surface_fusa.h.

◆ DisplayScanFormat

NvDisplayScanFormat NvRmSurfaceRec::DisplayScanFormat

The display scan format of the surface - progressive/interlaced.

Definition at line 595 of file nvrm_surface_fusa.h.

◆ Flags

NvU64 NvRmSurfaceRec::Flags

Flags, See NVRM_SURFACE_FLAG_* NvRmSurfaceFlags.

Definition at line 608 of file nvrm_surface_fusa.h.

◆ Height

NvU32 NvRmSurfaceRec::Height

The height of the surface.

Definition at line 558 of file nvrm_surface_fusa.h.

◆ hMem

NvRmMemHandle NvRmSurfaceRec::hMem

If the surface is backed by an RM memory alloc, the handle of that memory alloc and the offset where the surface starts within that alloc.

Expected to be set by the client after a successful NvRmSurfaceSetup call.

Definition at line 576 of file nvrm_surface_fusa.h.

◆ Kind

NvRmMemKind NvRmSurfaceRec::Kind

The "kind" of the surface.

Describes the data layout within a block. Used only if the Layout is blocklinear. NvRmMemKind_Pitch is used to signify "not blocklinear"

Definition at line 588 of file nvrm_surface_fusa.h.

◆ Layout

NvRmSurfaceLayout NvRmSurfaceRec::Layout

The layout of the surface, usually, NvRmSurfaceLayout_Blocklinear.

Definition at line 564 of file nvrm_surface_fusa.h.

◆ Offset

NvU32 NvRmSurfaceRec::Offset

The offset where the surface starts within that allocation.

Must be aligned to no less than the word size of ColorFormat. (For example, it must be 16-bit aligned for R5G6B5 data.) Expected to be set by the client after a successful NvRmSurfaceSetup call.

Definition at line 582 of file nvrm_surface_fusa.h.

◆ pBase

void* NvRmSurfaceRec::pBase

If the surface is not backed by an RM alloc, the pointer to the storage.

If the surface is backed by an RM alloc, pBase must be either NULL or point to a CPU visible mapping of the RM alloc. This pointer must be aligned to no less than the word size of ColorFormat. Expected to be set by the client after a successful NvRmSurfaceSetup call.

Definition at line 649 of file nvrm_surface_fusa.h.

◆ Pitch

NvU32 NvRmSurfaceRec::Pitch

The pitch of the surface in bytes.

The exact meaning of this value depends on Layout. For pitch linear surfaces, this is the byte offset from a pixel in line l to the pixel in line l+1. For blocklinear surfaces, this is the aligned byte size of one "row of blocks", is useful to calculate size requirements for blocklinear surfaces.

Definition at line 571 of file nvrm_surface_fusa.h.

◆ SecondFieldOffset

NvU32 NvRmSurfaceRec::SecondFieldOffset

For interlaced surfaces, SecondFieldOffset represents the offset of all of the odd lines relative to the start of the allocation.

Interlaced surfaces first store all even-numbered rows of a surface (0, 2, 4, 6, ...) followed by all odd-numbered rows (1, 3, 5, 7, ...). SecondFieldOffset represents the byte offset of the odd-numbered rows relative to the start of the allocation. This member must be aligned to the layout specifications. For non-interlaced surfaces, SecondFieldOffset is zero and has no semantic meaning.

Definition at line 605 of file nvrm_surface_fusa.h.

◆ Size

NvU64 NvRmSurfaceRec::Size

Size of the surface, in bytes, including all necessary padding and metadata.

The size of the memory allocation that is used for storing the surface pixels must be larger than or equal to this value.

Definition at line 613 of file nvrm_surface_fusa.h.

◆ Width

NvU32 NvRmSurfaceRec::Width

The width of the surface.

Definition at line 556 of file nvrm_surface_fusa.h.


The documentation for this struct was generated from the following file: