V2D
Introduction to the functions and usage of the spacemit platform V2D module.
Module Introduction
The spacemit platform V2D driver provides hardware acceleration for 2D graphics.
Function Introduction
Driver Model The V2D driver uses a character device driver model and communicates with user space via the /dev/v2d_dev device file.
open:
Function called when the device is opened.
read:
Function to read data from the device.
write():
Function to write data to the device.
ioctl():
Function to handle control commands.
release():
Function called when the device is closed.
Basic Functions The V2D driver supports 2D graphics fill, scaling, rotation, cropping, format conversion, and other functions.
Source Code Structure Introduction
The spacemit platform V2D driver source code structure, under the kernel directory:
drivers/soc/spacemit$ tree v2d
v2d
|-- csc_matrix.h
|-- Kconfig
|-- Makefile
|-- v2d_drv.c // v2d 驱动
|-- v2d_drv.h
|-- v2d_hw.c
|-- v2d_iommu.c // v2d iommu 驱动
|-- v2d_priv.h
|-- v2d_reg.h
关键特性
特性
特性 | 特性说明 |
---|---|
颜色填充 | 支持图像颜色填充功能。 |
旋转 | 支持图像0°,90°,180°,270°旋转,及镜像功能。 |
裁剪 | 支持图像裁剪功能。 |
缩放 | 支持图像1/8~8倍的缩放功能功能。 |
格式转换 | 支持YUV,RGB颜色空间转换功能。 |
性能参数
功能 | 性能规格 |
---|---|
颜色填充 | 1920x1080@200 FPS |
格式转换 | 1920x1080@200 FPS |
配置介绍
主要包括V2D驱动使能配置和dts配置。
CONFIG配置
CONFIG_SPACEMIT_V2D:spacemit平台V2D驱动配置选项,默认情况,此选项为Y。
Device Drivers --->
SOC (System On Chip) specific Drivers --->
<*> Spacemit V2D Engine Driver