Commit Graph

153 Commits

Author SHA1 Message Date
Yu Qiaowei bb47c8ad34 video: rockchip: rga3: fix import failure does not return error code
Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: Ie1295d10b48b5e9775f0b66eeb0fd21bb916dded
2023-11-29 11:09:26 +08:00
Yu Qiaowei 38cfa875e4 video: rockchip: rga3: modify rga_win_data formats config
Change-Id: I83e1be5313e4e6d18c19c7c50dce9b7b685da6b1
Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
2023-11-23 10:51:07 +08:00
Yu Qiaowei af706ad8bf video: rockchip: rga3: fix iommu device sync cache causing crash
When the iommu device calls the dma_sync_single_xx API, it will be
regarded as being called through iova by default, so the physical
address obtained will be invalid.

Update driver version to 1.3.1

Change-Id: I0a2c8fcecd556eccee499e06f41d790043f1fa0d
Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
2023-11-09 18:29:36 +08:00
Yu Qiaowei 4ddda80541 video: rockchip: rga3: fix the error report of Coverity
1. Fix the issue of scheduler and hardware maximum count mismatch.
2. Fix the issue of potential GCD returning 0.

Change-Id: I083553e69ab60549b26465b5d1437e817575856f
Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
2023-11-09 18:29:36 +08:00
Yu Qiaowei 59b58f06c5 video: rockchip: rga3: refining time-consuming logs
1. Add map/unmap time-consuming
2. Use more intuitive log printing

Change-Id: Id70bc4cce42bb33580ceaf18220fe2454481e78d
Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
2023-11-07 17:40:44 +08:00
Yu Qiaowei ce094aa86b video: rockchip: rga3: changing to close acquire_fence_fd in user-space
Since GKI disables closing fd in the kernel, the acquire fence fd should be
closed in user-space.

Update driver version to 1.3.0

Change-Id: I9bf85d6a39b3564332fc00dc9fce01678dc1ce3b
Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
2023-09-13 18:16:22 +08:00
Yu Qiaowei 9e5cbd33fc video: rockchip: rga3: add check_csc
Change-Id: I178d07038e233b9cf8943f57660e61bf7e64bcd2
Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
2023-09-13 18:16:22 +08:00
Yu Qiaowei 4beff868e2 video: rockchip: rga3: add full_csc clip config
Change-Id: I197b68977ab7be01837967b2b85596e897cd4d99
Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
2023-09-13 18:16:22 +08:00
Yu Qiaowei 7291693b01 video: rockchip: rga3: compatible with legacy global alpha config
Change-Id: I8dcccad5638f1fa7f16dcd9945562596cae047bc
Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
2023-09-13 18:16:22 +08:00
Yu Qiaowei 9312cd2335 video: rockchip: rga3: support fg/bg global alpha
Change-Id: I64d2446d494e179e9e2024c14bc768c2ed0dca47
Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
2023-09-13 18:16:22 +08:00
Yu Qiaowei 038764c6c9 video: rockchip: rga3: remove old alpha config parameter
Change-Id: Idde78fa5ab7cd6cc341538814f4b7bbfc51e1c90
Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
2023-07-07 14:20:19 +08:00
Yu Qiaowei 95eb7b7b3f video: rockchip: rga3: Modify the log printing of alpha config
Change-Id: I789463d1a20869b7f265193e1b31fc7005354ebc
Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
2023-07-07 14:20:19 +08:00
Yu Qiaowei b9708581c2 video: rockchip: rga3: remove the magic number in rga3 alpha config
Change-Id: I8367ff38ce7d33df31a84f1cccd1926a1a912ab2
Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
2023-07-07 14:20:19 +08:00
Yu Qiaowei a82c6b3355 video: rockchip: rga3: remove the magic number in rga2 alpha config
Change-Id: I4d52001a3ba036883b474ea68414526ee1567827
Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
2023-07-07 14:20:19 +08:00
Yu Qiaowei 1d2f80aa5e video: rockchip: rga3: add mm_flag 'RGA_MEM_FORCE_FLUSH_CACHE'
Use the RGA_MEM_FORCE_FLUSH_CACHE flag to force the flush cache for
the current buffer, not by judging the memory type.

Update driver version to 1.2.27

Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: Ife6d26faf59c1e33a2cddc389ded7c93b63a22a5
2023-06-27 20:01:30 +08:00
Yu Qiaowei bfe46724a3 video: rockchip: rga3: adapt to kernel-6.1/5.10/4.19
Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: Ie38ae6b0fc6037bfeee5b19077ff339f39933bc4
2023-06-26 19:40:55 +08:00
Yu Qiaowei 87845a44c8 video: rockchip: rga3: fix compile errors on stable-4.19-rv1126
Update driver version to 1.2.26

Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: I048c44201f34af5d4391b2ce097ba592b5f0b5c1
2023-05-10 14:20:04 +08:00
Yu Qiaowei d1e360f3b0 video: rockchip: rga3: fix timeout not returning error code
Update driver version to 1.2.25

Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: I718ccbbe3512de3194b5a5b4da549971b3999d14
2023-03-02 09:34:37 +08:00
Yu Qiaowei 2c2f6687dc video: rockchip: rga3: improve the resolution limitation of VSP
When the horizontal input exceeds 2k (here refers to 1996), need to switch
from BI-cubic to BI-linear. When there is an HSD(horizontal scale down),
need to check the horizontal input after the HSD.

Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: I3e4ceeb0e85811ccb131c22fe77ebaa571b8a922
2023-03-02 09:34:37 +08:00
Yu Qiaowei cc646fcd14 Revert "video: rockchip: rga3: disable memory when RGA power off to save power"
This reverts commit 0a7cd35e38.

Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: I3d2c7a40ee3e0bc18fe802ce0b7a7e089ab58f3d
2023-02-13 14:55:44 +08:00
Yu Qiaowei dd3f143de6 video: rockchip: rga3: support tile8*8 mode
Update driver version to 1.2.24

Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: I821f4f41da8b446c437027360356b903c8f3000b
2023-02-01 14:27:41 +08:00
Yu Qiaowei 0a7cd35e38 video: rockchip: rga3: disable memory when RGA power off to save power
Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: I6499783fff415dcf62b03f44d1736157ae04eedf
2022-12-28 16:53:47 +08:00
Yu Qiaowei 159107474b video: rockchip: rga3: fix buffer_handle leak on abnormal exit
Update driver version to 1.2.23

Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: I011ea7aef6428969080f7835d1358e4b772b9b8f
2022-12-09 20:37:08 +08:00
Yu Qiaowei e78c862107 video: rockchip: rga3: modify the error message of rga_mm
1. More logs about virtual address mapping failures.
2. Fix wrong channel name printing.

Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: I7559507552dbc617c66819859be58aa8df83561c
2022-12-09 20:37:08 +08:00
Yu Qiaowei 97e91ee429 video: rockchip: rga3: remove useless delay for rga3 software reset
Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: I244542e3a2df37b2b9ecf2d95204aa575ec65ee4
2022-11-24 19:02:24 +08:00
Yu Qiaowei b843cf6902 video: rockchip: rga3: add iommu fault irq_handler
Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: I9c8159e48a9e7c7a01b8e9b155c52a7f57603ab2
2022-11-24 19:02:24 +08:00
Yu Qiaowei f13dae5b9c video: rockchip: rga3: iommu device uses slave mode
Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: I1ab682d3ee687ae13ba4d7c252d1d9ec25875efd
2022-11-21 17:47:25 +08:00
Yu Qiaowei 4bcdb727b2 video: rockchip: rga3: fix leak of release_fence_fd
When there is no acquire_fence, the allocated release_fence_fd must be
closed when the job submission fails, and it is unreasonable to require
user-space to close.

Update driver version to 1.2.22

Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: Ie7c3006968dbb1ba22e21d6de65037183386112e
2022-11-14 19:40:19 +08:00
Yu Qiaowei 79893a8747 video: rockchip: rga3: add more error logs for hardware behavior.
1. Add job-state to detect hardware interrupt behavior. Easy to distinguish
   the timeout of hardware interrupt top-half/bottom-half.
2. Print more error description according to register.

Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: I0179bb59ae6a467fdb1e28643c2c19f7eb4bc5d5
2022-10-31 17:15:55 +08:00
Yu Qiaowei 19805cc2b8 video: rockchip: rga3: move rga*_ops to rga*_reg_info.h
Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: I8f81e5b11873af76e32dc112dd89a1bc0ef4bcf5
2022-10-31 17:15:55 +08:00
Yu Qiaowei 1514f2ab39 video: rockchip: rga3: add backend-ops read_back_reg()
Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: I2b24271214f8beeda06f7da0e97f009967a7d83e
2022-10-31 17:15:55 +08:00
Yu Qiaowei 21624c6edb video: rockchip: rga3: add definitions for sys_ctrl and intr registers
Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: Ib25837d9807de75b62e9c8258ff440c86fdab609
2022-10-31 17:15:55 +08:00
Yu Qiaowei 7c55f51007 video: rockchip: rga3: modify the debug log of irq
Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: I18f4d02e22c0a2afb0754d3ed92ec2539037d10e
2022-10-31 17:15:55 +08:00
Yu Qiaowei b7cda70045 video: rockchip: rga3: modify the process of session exit
When the session exits, there is no need to operate the rga_job directly.

Update driver version to 1.2.21

Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: I0369dce427dc749795803eae064dc80e33747a7e
2022-10-28 16:25:49 +08:00
Yu Qiaowei dc81be56db video: rockchip: rga3: add reference counting in rga_job
fixup 'BUG: KASAN: use-after-free in rga_job_next'

Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: I93bbe7723f923482dd8598f8a7155efdf6cb46d6
2022-10-28 16:25:49 +08:00
Yu Qiaowei 0664d56706 video: rockchip: rga3: remove useless functions in rga_job.c
Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: I25b4af91709baaff89bed290aadcb419e5c2f6f7
2022-10-21 17:55:54 +08:00
Yu Qiaowei 482424b9aa video: rockchip: rga3: support rga2_iommu
Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: Ic4d4ad1e4cd6490aa487b272003130eb0504219f
2022-10-08 11:06:52 +08:00
Yu Qiaowei 1e81983bed video: rockchip: rga3: Fixed the crash caused by RGA2 using dma_buf_fd
When rga2 uses sgt to generate the page table, length should be used
instead of dma_length, which will cause the length of the sgt after
the default_mapping_core to be the length of the entire dma_buf.

Update driver version to 1.2.20

Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: I07ad619b41554ededc0c5ade552a3bc176fef3f7
2022-09-23 16:47:12 +08:00
Yu Qiaowei e125f2a0b5 video: rockchip: rga3: modify the printing of hardware version
Update driver version to 1.2.19

Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: Ibd9d4a0bc31e2e9b829743619f67d8e13db9332c
2022-09-08 10:13:29 +08:00
Yu Qiaowei 34a6033f02 video: rockchip: rga3: remove PM's dependency on CONFIG_ROCKCHIP_FPGA
Not all fpga need PM, enable RGA_DISABLE_PM to disable PM when not needed.

Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: I9ebc20c1795eb30d60a1cb727a7a7b91b5b5728e
2022-09-08 10:13:13 +08:00
Yu Qiaowei 7f955d290c video: rockchip: rga3: use macros to control the working mode of RGA2
When RGA2_USE_MASTER_MODE is 1, master mode is used, when it is 0,
slave mode is used.

Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: I0b8356e02f58b5fadcec41dd310bd55192d2aa47
2022-09-07 21:16:52 +08:00
Yu Qiaowei 0e45c6e151 video: rockchip: rga3: used to mark provisional releases
Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: Id68e61b9a659b47ab480a93042201b8d891a7e8e
2022-08-26 11:39:49 +08:00
Yu Qiaowei cc04e2a51d video: rockchip: rga3: Compatible without for_each_sgtable_sg
When updating the driver alone on 4.19, there may be a commit without this.
commit 3d9c15bc2e91f ("BACKPORT: scatterlist: add generic wrappers for iterating over sgtable objects")

Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: Ib7f89d98f7aa876c6e0d86929c4ed6db1a23dd70
2022-08-25 21:25:44 +08:00
Yu Qiaowei 4d223f6c65 video: rockchip: rga3: move rga_dma_sync_flush_range to rga_dma_buf.c
Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: I2a58ada9e12bba51afe15de55d3f75b28834f931
2022-08-18 21:02:00 +08:00
Yu Qiaowei deedcb50d4 video: rockchip: rga3: enable dump_image only when CONFIG_NO_GKI
kernel_read()/kernel_write() are missing from GKI symbol list.

Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: Id8c15e682e6187f551aa48ee28d23944d71b72f6
2022-08-18 20:07:35 +08:00
Yu Qiaowei 3164a01108 video: rockchip: rga3: RGA3 complete support rotation+mirror scene
Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: I28900311ddeb042f99b34bab34f448631ffc2763
2022-08-17 16:56:13 +08:00
Yu Qiaowei 83e96ce187 video: rockchip: rga3: Async mode will pass error code through fence
Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: I2354d6d2e0253aa061c759fef39aa29af54119e7
2022-08-17 16:56:13 +08:00
Yu Qiaowei 783ba8db79 video: rockchip: rga3: Modify YUV10bit of RGA3 to default to compact mode
Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: I310839f124e4c3e4ef7aa0e81f4cc780893377db
2022-08-09 19:01:49 +08:00
Yu Qiaowei a322f85b91 video: rockchip: rga3: Fix compilation error on kernel-4.19
drivers/video/rockchip/rga3/rga_iommu.c:38:11: error: implicit declaration of function 'kmap' [-Werror=implicit-function-declaration]
   vaddr = kmap(pages[taipage_num - 1]);

Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: I3f570c4812f4c308001cdd894799682faa18203e
2022-07-28 20:45:00 +08:00
Yu Qiaowei 0e669c6e25 video: rockchip: rga3: Fix for CONFIG_ROCKCHIP_FPGA=y
drivers/video/rockchip/rga3/rga_drv.c:1036:3: error: implicit declaration of function 'rga_power_enable_all' [-Werror=implicit-function-declaration]
   rga_power_enable_all();
   ^~~~~~~~~~~~~~~~~~~~
drivers/video/rockchip/rga3/rga_drv.c:1040:3: error: implicit declaration of function 'rga_power_disable_all' [-Werror=implicit-function-declaration]
   rga_power_disable_all();
   ^~~~~~~~~~~~~~~~~~~~~
drivers/video/rockchip/rga3/rga_drv.c: In function 'rga_drv_probe':
drivers/video/rockchip/rga3/rga_drv.c:1526:1: warning: label 'failed' defined but not used [-Wunused-label]
error, forbidden warning:rga_drv.c:1526
 failed:
 ^~~~~~
drivers/video/rockchip/rga3/rga_drv.c:1376:6: warning: unused variable 'i' [-Wunused-variable]
error, forbidden warning:rga_drv.c:1376
  int i, irq;

Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: I3a7bd21a2351b474df654a81b93f7f0c1560aac1
2022-07-28 20:43:22 +08:00