summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHyungwon Hwang <human.hwang@samsung.com>2015-08-24 19:33:27 +0900
committerSeung-Woo Kim <sw0312.kim@samsung.com>2016-12-14 13:50:43 +0900
commitb2a03f91c2ddd0b999f549337278d2443099c3d7 (patch)
tree64d69ed8d395e68cbaef2486ff0f82420c9871ed
parent5b62dd3472f8e4e75a2efd65324f4f17d755e20a (diff)
drm/exynos: gsc: normalize invalid buf idx from userspace
At least in the one frame processing mode which is the only mode supported by the current gsc driver, the buf idx is not meaningful for the driver. Because only one address in the buffer is valid at a time, so it is OK to convert the invalid buf idx from userspace to a valid idx, process the frame, and return the result with original buf idx. Signed-off-by: Hyungwon Hwang <human.hwang@samsung.com> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Change-Id: I8257cd39e33382f214ce4573e4a79f15ea498aab
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_gsc.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_gsc.c b/drivers/gpu/drm/exynos/exynos_drm_gsc.c
index 6adafba9f40f..a01e0e75ef00 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_gsc.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_gsc.c
@@ -836,10 +836,7 @@ static int gsc_src_set_addr(struct device *dev,
DRM_DEBUG_KMS("prop_id[%d]buf_id[%d]buf_type[%d]\n",
property->prop_id, buf_id, buf_type);
- if (buf_id > GSC_MAX_SRC) {
- dev_info(ippdrv->dev, "invalid buf_id %d.\n", buf_id);
- return -EINVAL;
- }
+ buf_id %= GSC_MAX_SRC;
/* address register set */
switch (buf_type) {
@@ -1301,10 +1298,7 @@ static int gsc_dst_set_addr(struct device *dev,
DRM_DEBUG_KMS("prop_id[%d]buf_id[%d]buf_type[%d]\n",
property->prop_id, buf_id, buf_type);
- if (buf_id > GSC_MAX_DST) {
- dev_info(ippdrv->dev, "invalid buf_id %d.\n", buf_id);
- return -EINVAL;
- }
+ buf_id %= GSC_MAX_DST;
/* address register set */
switch (buf_type) {