Skip to content

Commit 6acc57e

Browse files
committed
Merge branch 'main' of github.com:airockchip/librga
2 parents edc2572 + 75af4dd commit 6acc57e

File tree

74 files changed

+1143
-686
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+1143
-686
lines changed

CHANGELOG.md

+56
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,61 @@
11
# 更新日志
22

3+
## 1.10.1 (2024-03-06)
4+
5+
该版本RGA驱动建议更新至1.3.0及以上版本,最低支持1.2.4。
6+
7+
### 新增
8+
9+
- 新增支持芯片RK3576。
10+
- 新增支持格式A8、Y8、YUV444_SP定义。
11+
- 新增支持配置压缩模式RKFBC64x4、AFBC32x8 split mode。
12+
- 新增支持配置TILE4x4模式。
13+
- 新增支持配置缩放插值算法。
14+
- 新增imsetAlphaBit(),支持配置ARGB5551/ABGR5551 alpha映射。
15+
16+
### 优化
17+
18+
- 优化示例代码CMake编译配置。
19+
20+
### 变更
21+
22+
- 源码更新包由原百度网盘迁移至联想网盘。
23+
- 最低要求的CMake版本由原3.5更改为3.12。
24+
- imresize() interpolation参数支持配置。
25+
- RGA2不支持RGBA5551/BGRA5551/RGBA4444/BGRA4444格式。
26+
27+
### 修复
28+
29+
- 修复ARGB5551/ABGR5551/ARGB4444/ABGR4444格式内存排列错误的问题。
30+
- 修复旧接口RkRgaIsReady()返回值异常的错误。
31+
32+
## 1.10.0_[9] (2023-12-11)
33+
34+
该版本RGA驱动建议更新至1.3.0及以上版本,最低支持1.2.4。
35+
36+
### 新增
37+
38+
- 增加关于性能影响的Q&A。
39+
- rgaImDemo支持更多功能
40+
- 支持RV1106直接运行。
41+
- 增加更多blend模式。
42+
- 颜色填充支持自定义颜色。
43+
44+
### 变更
45+
46+
- 旧接口(RockchipRga API、C_API)维持原有功能,不支持globalAlpha功能。
47+
48+
### 修复
49+
50+
- 修复RK1808无法获取硬件信息的错误。
51+
- 更正rga_req结构体错误的预留内存大小。
52+
- 修正示例代码中一些退出流程。
53+
- 修复示例代码中GraphicBuffer无法分配内存的问题。
54+
55+
- 修复importbuffer API返回值非预期。
56+
- 修复调用旧接口导致fd 0被异常关闭的问题。
57+
- 修复旧接口配置blend模式失效的问题。
58+
359
## 1.10.0 (2023-09-12)
460

561
该版本RGA驱动建议更新至1.3.0及以上版本,最低支持1.2.4。

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ RGA (Raster Graphic Acceleration Unit)是一个独立的2D硬件加速器,可
66

77
#### RGA API
88

9-
- 当前预编译仓库API版本:1.10.0
9+
- 当前预编译仓库API版本:1.10.1
1010

1111
- 获取源码方式:
1212

docs/Rockchip_Developer_Guide_RGA_CN.md

+60-38
Large diffs are not rendered by default.

docs/Rockchip_Developer_Guide_RGA_EN.md

+58-39
Large diffs are not rendered by default.

docs/Rockchip_FAQ_RGA_CN.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,9 @@ API版本号分为主版本号、次版本号、修订版本号、编译版本
104104

105105
https://github.com/airockchip/librga
106106

107-
- 百度网盘链接
108-
109-
https://eyun.baidu.com/s/3jJ9Aiz0
107+
- 联想网盘链接
108+
109+
https://console.zbox.filez.com/l/fuGojC(提取码:rkrga)
110110

111111

112112

@@ -127,9 +127,9 @@ API版本号分为主版本号、次版本号、修订版本号、编译版本
127127

128128
当发现版本不满足要求时,可以通过以下方式获取源码更新kernel。
129129

130-
- 百度网盘链接
131-
132-
https://eyun.baidu.com/s/3dGhufEL
130+
- 联想网盘链接
131+
132+
https://console.zbox.filez.com/l/7oOrKO(提取码:rkrga)
133133

134134

135135

@@ -146,11 +146,11 @@ API版本号分为主版本号、次版本号、修订版本号、编译版本
146146

147147
通常发布的SDK中是版本是匹配的,但是出于一些应用对高版本librga.so的依赖,可以使用以下百度网盘链接获取RGA模块代码更新包:
148148

149-
https://eyun.baidu.com/s/3i6sbsDR
149+
https://console.zbox.filez.com/l/mu2SOR(提取码:rkrga)
150150

151151
- update-to-MULTI_RGA
152152

153-
原有驱动为RGA Device Driver、RGA2 Device Driver时,使用该更新包更新驱动到RGA multicore Device Driver,并更新匹配版本的librga。
153+
原有驱动为RGA Device Driver、RGA2 Device Driver时,使用该更新包更新驱动到RGA multicore Device Driver,并更新匹配版本的librga。
154154

155155
- MUTIL_RGA
156156

docs/Rockchip_FAQ_RGA_EN.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,10 @@ The API version number consists of major, minor, revision and build. The four le
9898

9999
https://github.com/airockchip/librga
100100

101-
- Baidu Cloud:
102-
103-
104-
https://eyun.baidu.com/s/3jJ9Aiz0
101+
- Zbox Cloud:
102+
103+
104+
https://console.zbox.filez.com/l/fuGojC (fetch code: rkrga)
105105

106106

107107

@@ -123,9 +123,9 @@ The driver version number consists of major, minor, revision and build. The four
123123

124124
When it is found that the version does not meet the requirements, you can obtain the source code or precompiled library files in the following ways.
125125

126-
- Baidu Cloud:
127-
128-
https://eyun.baidu.com/s/3dGhufEL
126+
- Zbox Cloud:
127+
128+
https://console.zbox.filez.com/l/7oOrKO (fetch code: rkrga)
129129

130130

131131

@@ -142,11 +142,11 @@ When using RGA, you need to confirm that the current operating environment can w
142142

143143
Usually the released SDK version matches, but because some applications depend on the higher version librga.so, you can use the following Baidu Cloud link to obtain the RGA module code update package:
144144

145-
https://eyun.baidu.com/s/3i6sbsDR
145+
https://console.zbox.filez.com/l/mu2SOR (fetch code: rkrga)
146146

147147
- update-to-MULTI_RGA
148148

149-
When the original driver is RGA Device Driver or RGA2 Device Driver, use this update package to update the driver to RGA multicore Device Driver and update the matching version of librga.
149+
When the original driver is RGA Device Driver or RGA2 Device Driver, use this update package to update the driver to RGA multicore Device Driver and update the matching version of librga.
150150

151151
- MUTIL_RGA
152152

include/drmrga.h

+5-1
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,11 @@ typedef struct rga_info {
310310
int job_handle;
311311
};
312312

313-
char reserve[402];
313+
uint16_t rgba5551_flags;
314+
uint8_t rgba5551_alpha0;
315+
uint8_t rgba5551_alpha1;
316+
317+
char reserve[398];
314318
} rga_info_t;
315319

316320

include/im2d_buffer.h

+1
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ IM_API rga_buffer_t wrapbuffer_handle(rga_buffer_handle_t handle,
176176
int wstride, int hstride);
177177
#endif
178178

179+
void imsetAlphaBit(rga_buffer_t *buf, uint8_t alpha0, uint8_t alpha1);
179180
void imsetOpacity(rga_buffer_t *buf, uint8_t alpha);
180181
void imsetColorSpace(rga_buffer_t *buf, IM_COLOR_SPACE_MODE mode);
181182

include/im2d_type.h

+39-5
Original file line numberDiff line numberDiff line change
@@ -87,21 +87,29 @@ typedef enum {
8787
IM_MOSAIC = 1 << 27,
8888
IM_OSD = 1 << 28,
8989
IM_PRE_INTR = 1 << 29,
90+
IM_ALPHA_BIT_MAP = 1 << 30,
9091
} IM_USAGE;
9192

9293
typedef enum {
9394
IM_RASTER_MODE = 1 << 0,
94-
IM_FBC_MODE = 1 << 1,
95-
IM_TILE_MODE = 1 << 2,
95+
IM_AFBC16x16_MODE = 1 << 1,
96+
IM_TILE8x8_MODE = 1 << 2,
97+
IM_TILE4x4_MODE = 1 << 3,
98+
IM_RKFBC64x4_MODE = 1 << 4,
99+
IM_AFBC32x8_MODE = 1 << 5,
100+
/* legacy */
101+
IM_FBC_MODE = IM_AFBC16x16_MODE,
102+
IM_TILE_MODE = IM_TILE8x8_MODE,
96103
} IM_RD_MODE;
97104

98105
typedef enum {
99106
IM_SCHEDULER_RGA3_CORE0 = 1 << 0,
100107
IM_SCHEDULER_RGA3_CORE1 = 1 << 1,
101108
IM_SCHEDULER_RGA2_CORE0 = 1 << 2,
109+
IM_SCHEDULER_RGA2_CORE1 = 1 << 3,
102110
IM_SCHEDULER_RGA3_DEFAULT = IM_SCHEDULER_RGA3_CORE0,
103111
IM_SCHEDULER_RGA2_DEFAULT = IM_SCHEDULER_RGA2_CORE0,
104-
IM_SCHEDULER_MASK = 0x7,
112+
IM_SCHEDULER_MASK = 0xf,
105113
IM_SCHEDULER_DEFAULT = 0,
106114
} IM_SCHEDULER_CORE;
107115

@@ -157,12 +165,26 @@ typedef enum {
157165
IM_DOWN_SCALE,
158166
} IM_SCALE;
159167

168+
/* legacy */
160169
typedef enum {
161170
INTER_NEAREST,
162171
INTER_LINEAR,
163172
INTER_CUBIC,
164173
} IM_SCALE_MODE;
165174

175+
typedef enum {
176+
IM_INTERP_DEFAULT = 0,
177+
IM_INTERP_LINEAR = 1,
178+
IM_INTERP_CUBIC = 2,
179+
IM_INTERP_AVERAGE = 3,
180+
181+
IM_INTERP_MASK = 0xf,
182+
IM_INTERP_HORIZ_SHIFT = 0,
183+
IM_INTERP_VERTI_SHIFT = 4,
184+
IM_INTERP_HORIZ_FLAG = 0x1 << 8,
185+
IM_INTERP_VERTI_FLAG = 0x1 << 9,
186+
} IM_INTER_MODE;
187+
166188
typedef enum {
167189
IM_CONFIG_SCHEDULER_CORE,
168190
IM_CONFIG_PRIORITY,
@@ -294,7 +316,13 @@ typedef struct {
294316
int format; /* format */
295317

296318
int color_space_mode; /* color_space_mode */
297-
int global_alpha; /* global_alpha, the default should be 0xff */
319+
union {
320+
int global_alpha; /* global_alpha, the default should be 0xff */
321+
struct {
322+
uint16_t alpha0;
323+
uint16_t alpha1;
324+
} alpha_bit; /* alpha bit(e.g. RGBA5551), 0: alpha0, 1: alpha1 */
325+
};
298326
int rd_mode;
299327

300328
/* legacy */
@@ -424,7 +452,9 @@ typedef struct im_opt {
424452

425453
im_intr_config_t intr_config;
426454

427-
char reserve[128];
455+
int interp;
456+
457+
char reserve[124];
428458
} im_opt_t;
429459

430460
typedef struct im_handle_param {
@@ -433,4 +463,8 @@ typedef struct im_handle_param {
433463
uint32_t format;
434464
} im_handle_param_t;
435465

466+
#define IM_INTERP_HORIZ(x) ( ((x) & IM_INTERP_MASK) << IM_INTERP_HORIZ_SHIFT | IM_INTERP_HORIZ_FLAG )
467+
#define IM_INTERP_VERTI(x) ( ((x) & IM_INTERP_MASK) << IM_INTERP_VERTI_SHIFT | IM_INTERP_VERTI_FLAG )
468+
#define IM_INTERP(h,v) ( IM_INTERP_HORIZ(h) | IM_INTERP_VERTI(v) )
469+
436470
#endif /* _RGA_IM2D_TYPE_H_ */

include/im2d_version.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
/* RGA im2d api verison */
2626
#define RGA_API_MAJOR_VERSION 1
2727
#define RGA_API_MINOR_VERSION 10
28-
#define RGA_API_REVISION_VERSION 0
29-
#define RGA_API_BUILD_VERSION 5
28+
#define RGA_API_REVISION_VERSION 1
29+
#define RGA_API_BUILD_VERSION 0
3030

3131
#define RGA_API_SUFFIX
3232

include/rga.h

+12
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,15 @@ typedef enum _Rga_SURF_FORMAT {
136136
RK_FORMAT_ABGR_4444 = 0x2f << 8, /* [0:16] A:B:G:R 4:4:4:4 little endian */
137137

138138
RK_FORMAT_RGBA2BPP = 0x30 << 8, /* [0:1] Color:Alpha 1:1 little endian */
139+
RK_FORMAT_A8 = 0x31 << 8, /* [0:7] Alpha */
140+
141+
RK_FORMAT_YCbCr_444_SP = 0x32 << 8, /* 2 plane YCbCr little endian
142+
* plane 0: [0:7] Y
143+
* plane 1: non-subsampled [0:15] Cb:Cr 8:8 */
144+
RK_FORMAT_YCrCb_444_SP = 0x33 << 8, /* 2 plane YCrCb little endian
145+
* plane 0: [0:7] Y
146+
* plane 1: non-subsampled [0:15] Cr:Cb 8:8 */
147+
RK_FORMAT_Y8 = 0x34 << 8, /* [0:7] zero:Y 4:4 little endian */
139148

140149
RK_FORMAT_UNKNOWN = 0x100 << 8,
141150
} RgaSURF_FORMAT;
@@ -168,6 +177,9 @@ enum {
168177
RGA3_SCHEDULER_CORE0 = 1 << 0,
169178
RGA3_SCHEDULER_CORE1 = 1 << 1,
170179
RGA2_SCHEDULER_CORE0 = 1 << 2,
180+
RGA2_SCHEDULER_CORE1 = 1 << 3,
181+
RGA_CORE_MASK = 0xf,
182+
RGA_NONE_CORE = 0x0,
171183
};
172184

173185
/* RGA3 rd_mode */

libs/AndroidNdk/arm64-v8a/librga.a

28.7 KB
Binary file not shown.

libs/AndroidNdk/arm64-v8a/librga.so

0 Bytes
Binary file not shown.

libs/AndroidNdk/armeabi-v7a/librga.a

2.42 KB
Binary file not shown.

libs/AndroidNdk/armeabi-v7a/librga.so

4 KB
Binary file not shown.

libs/Linux/gcc-aarch64/librga.a

7.26 KB
Binary file not shown.

libs/Linux/gcc-aarch64/librga.so

4 KB
Binary file not shown.

libs/Linux/gcc-armhf/librga.a

4.97 KB
Binary file not shown.

libs/Linux/gcc-armhf/librga.so

4 KB
Binary file not shown.

libs/Linux/gcc-uclib-armhf/librga.a

4.97 KB
Binary file not shown.

libs/Linux/gcc-uclib-armhf/librga.so

4 KB
Binary file not shown.

samples/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.5)
1+
cmake_minimum_required(VERSION 3.12)
22

33
if (EXISTS ${BUILD_TOOLCHAINS_PATH})
44
message("load ${BUILD_TOOLCHAINS_PATH}")

samples/allocator_demo/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.5)
1+
cmake_minimum_required(VERSION 3.12)
22

33
if (EXISTS ${BUILD_TOOLCHAINS_PATH})
44
message("load ${BUILD_TOOLCHAINS_PATH}")

samples/allocator_demo/cmake-linux-rv1106-1103.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ SCRIPT_DIR=$(cd $(dirname ${BASH_SOURCE[0]}); pwd)
44
SAMPLES_DIR=${SCRIPT_DIR}/..
55

66
# Modify to the local toolchain path.
7-
TOOLCHAIN_PATH=${SAMPLES_DIR}/../toolchains/toolchain_linux.cmake
8-
LIBRGA_PATH=${SAMPLES_DIR}/../build/build_linux/install/lib
9-
BUILD_DIR=build/build_linux
7+
TOOLCHAIN_PATH=${SAMPLES_DIR}/../toolchains/toolchain_linux_1106.cmake
8+
LIBRGA_PATH=${SAMPLES_DIR}/../build/build_linux_1106/install/lib
9+
BUILD_DIR=build/build_linux_1106
1010
BUILD_TYPE=Release
1111

1212
rm -rf $BUILD_DIR

samples/allocator_demo/src/rga_allocator_dma32_demo.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ int main(void) {
5959
* Allocate dma_buf within 4G from dma32_heap,
6060
* return dma_fd and virtual address.
6161
*/
62-
ret = dma_buf_alloc(DMA_HEAP_DMA32_UNCACHE_PATCH, dst_buf_size, &dst_dma_fd, (void **)&dst_buf);
62+
ret = dma_buf_alloc(DMA_HEAP_DMA32_UNCACHED_PATH, dst_buf_size, &dst_dma_fd, (void **)&dst_buf);
6363
if (ret < 0) {
6464
printf("alloc dma32_heap buffer failed!\n");
6565
return -1;

samples/allocator_demo/src/rga_allocator_drm_phy_demo.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ int main(void) {
6969
dst_height = 720;
7070
dst_format = RK_FORMAT_RGBA_8888;
7171

72-
src_alloc_flags |= ROCKCHIP_BO_CONTIG;
73-
dst_alloc_flags |= ROCKCHIP_BO_CONTIG;
72+
src_alloc_flags |= RGA_UTILS_ROCKCHIP_BO_CONTIG;
73+
dst_alloc_flags |= RGA_UTILS_ROCKCHIP_BO_CONTIG;
7474

7575
/*
7676
* Allocate a physically continuous drm_buf, return dma_fd and

samples/alpha_demo/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.5)
1+
cmake_minimum_required(VERSION 3.12)
22

33
if (EXISTS ${BUILD_TOOLCHAINS_PATH})
44
message("load ${BUILD_TOOLCHAINS_PATH}")

samples/alpha_demo/src/CMakeLists.txt

+10
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,16 @@ target_link_libraries(rga_alpha_3channel_demo
2828
)
2929
install(TARGETS rga_alpha_3channel_demo DESTINATION ${CMAKE_INSTALL_BINDIR})
3030

31+
# rga_alpha_3channel_demo
32+
add_executable(rga_alpha_rgba5551_demo
33+
rga_alpha_rgba5551_demo.cpp
34+
)
35+
target_link_libraries(rga_alpha_rgba5551_demo
36+
utils_obj
37+
${RGA_LIB}
38+
)
39+
install(TARGETS rga_alpha_rgba5551_demo DESTINATION ${CMAKE_INSTALL_BINDIR})
40+
3141
# rga_alpha_yuv_demo
3242
add_executable(rga_alpha_yuv_demo
3343
rga_alpha_yuv_demo.cpp

0 commit comments

Comments
 (0)