NVIDIA BSP provides a kernel module, nvidia-drm.ko
, which registers a DRM driver with the DRM subsystem of the Linux kernel. It supports PRIME when Linux kernel configuration CONFIG_DRM is enabled and Atomic modeset when CONFIG_DRM and CONFIG_DRM_KMS_HELPER are enabled. NVIDIA's DRM KMS support is disabled by default, but can be enabled with the 'modeset' kernel module parameter. For example,
modprobe -r nvidia_drm ; modprobe nvidia_drm modeset=1
The Userland interfaces section of the Linux GPU Driver Developer's Guide provides high-level info about the DRM interfaces exposed to user space.
The following is the list of nvidia-drm specific IOCTLs supported on Jetson Linux. These are defined in nvidia-drm-ioctl.h
which is packaged inside BSP sources (Linux_for_Tegra/source/public/nvidia_kernel_display_driver_source.tbz2)
struct drm_nvidia_gem_alloc_nvkms_memory_params { uint32_t handle; /* OUT */ uint8_t block_linear; /* IN */ uint8_t compressible; /* IN/OUT */ uint16_t __pad; uint64_t memory_size; /* IN */ uint32_t flags; /* IN */ };
handle
Gem handle for the allocated memory
block_linear
When set to 1, uses block linear memory layout. Otherwise, uses linear (pitch) memory layout.
compressible
It serves as both input and output parameters. When set to 1, the driver will try to allocate compressible buffer. If compressible buffer is allocated, this parameter will be set to 1. Otherwise, set it to 0.
memory_size
Size of the memory to be allocated.
flags
The NV_GEM_ALLOC_NO_SCANOUT flag is currently supported. When this flag is used, allocated memory may not be physically contiguous. Otherwise, it allocates physically contiguous memory.
This structure describes parameters to DRM_IOCTL_NVIDIA_GEM_ALLOC_NVKMS_MEMORY which allocates HW buffer encapsulated within the GEM buffer object.
struct drm_nvidia_gem_map_offset_params { uint32_t handle; /* IN Handle to gem object */ uint32_t __pad; uint64_t offset; /* OUT Fake offset */ };
handle
GEM handle for the buffer to be mmap'ed.
offset
This parameter returns a fake offset which can be used in the mmap(2).
flags
The NV_GEM_ALLOC_NO_SCANOUT flag is currently supported. When this flag is in use, allocated memory may not be physically contiguous. Otherwise, it allocates physically contiguous memory.
This structure describes parameters to DRM_IOCTL_NVIDIA_GEM_MAP_OFFSET, which returns a fake offset to use in mmap(2) to mmap the GEM buffer allocated using DRM_IOCTL_NVIDIA_GEM_ALLOC_NVKMS_MEMORY.
Owner Module/Drivers | Group | Property Name | Type | Property Values | Object Attached | Description/Restrictions |
---|---|---|---|---|---|---|
nvidia-drm | Plane | NV_DRM_OUT_FENCE_PTR | RANGE | Min=0, Max=U64_MAX | Plane | This is an atomic per-plane property that clients can use to request an out-fence fd for a particular plane that's being flipped. Note that this property does NOT have the same behavior as the standard 'OUT_FENCE_PTR' property - the fd that's returned via 'NV_DRM_OUT_FENCE_PTR' will only be signaled once the buffers in the corresponding flip are flipped away from. To use this property, the client needs to call set property function with the user mode pointer as value. Once the driver has post syncpt fd from the flip reply, it will copy post syncpt fd at the location pointed by the user mode pointer. |