video: rockchip: rga3: using async mode to print log when async is disabled

Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: If97d123618d0ab406e77002d79bd0780162c9c2b
This commit is contained in:
Yu Qiaowei
2024-11-13 17:33:03 +08:00
committed by Tao Huang
parent e3a10aac75
commit b8cbadd8c5
3 changed files with 13 additions and 6 deletions

View File

@@ -58,12 +58,12 @@ static inline int rga_dma_fence_get_status(struct dma_fence *fence)
#else
static inline struct dma_fence *rga_dma_fence_alloc(void)
{
return NULL;
return ERR_PTR(-EINVAL);
}
static inline int rga_dma_fence_get_fd(struct dma_fence *fence)
{
return 0;
return -1;
}
static inline struct dma_fence *rga_get_dma_fence_from_fd(int fence_fd)
@@ -80,7 +80,7 @@ static inline int rga_dma_fence_add_callback(struct dma_fence *fence,
dma_fence_func_t func,
void *private)
{
return 0;
return -EINVAL;
}
static inline void rga_dma_fence_put(struct dma_fence *fence)
@@ -93,7 +93,7 @@ static inline void rga_dma_fence_signal(struct dma_fence *fence, int error)
static inline int rga_dma_fence_get_status(struct dma_fence *fence)
{
return 0;
return -EINVAL;
}
#endif /* #ifdef CONFIG_SYNC_FILE */

View File

@@ -936,6 +936,13 @@ static long rga_ioctl(struct file *file, uint32_t cmd, unsigned long arg)
return -EBUSY;
}
if (cmd == RGA_BLIT_ASYNC && !IS_ENABLED(CONFIG_ROCKCHIP_RGA_ASYNC)) {
rga_log("The current driver does not support asynchronous mode, please enable CONFIG_ROCKCHIP_RGA_ASYNC.\n");
up_read(&rga_drvdata->rwsem);
return -EINVAL;
}
switch (cmd) {
case RGA_BLIT_SYNC:
case RGA_BLIT_ASYNC:

View File

@@ -1254,9 +1254,9 @@ int rga_request_submit(struct rga_request *request)
if (request->sync_mode == RGA_BLIT_ASYNC) {
release_fence = rga_dma_fence_alloc();
if (IS_ERR(release_fence)) {
if (IS_ERR_OR_NULL(release_fence)) {
rga_req_err(request, "Can not alloc release fence!\n");
ret = IS_ERR(release_fence);
ret = IS_ERR(release_fence) ? PTR_ERR(release_fence) : -EINVAL;
goto err_reset_request;
}
request->release_fence = release_fence;