summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Szyprowski <m.szyprowski@samsung.com>2018-03-26 15:09:48 +0200
committerMarek Szyprowski <m.szyprowski@samsung.com>2018-03-26 15:14:51 +0200
commit4ec5f1081b9c5decaf91f6f394677f92eed10e0f (patch)
tree71d9ea9acc6fd07f049ad8acc7f263f31bbe435a
parenta25c7e06b01a3c8cf23ed2b11a95cc86f2f242fb (diff)
downloadlinux-exynos-4ec5f1081b9c5decaf91f6f394677f92eed10e0f.tar.gz
linux-exynos-4ec5f1081b9c5decaf91f6f394677f92eed10e0f.tar.bz2
linux-exynos-4ec5f1081b9c5decaf91f6f394677f92eed10e0f.zip
drm/exynos: ipp: Move buffer setup to separate function
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Change-Id: I5bb5c2126a701a5b8e03846aca797ac0b77c5d71
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_ipp.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_ipp.c b/drivers/gpu/drm/exynos/exynos_drm_ipp.c
index 7cd050cbb0a5..c70b752a0f70 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_ipp.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_ipp.c
@@ -670,8 +670,7 @@ static int exynos_drm_ipp_check_scale_limits(
return 0;
}
-static int exynos_drm_ipp_task_check(struct exynos_drm_ipp_task *task,
- struct drm_file *filp)
+static int exynos_drm_ipp_task_check(struct exynos_drm_ipp_task *task)
{
struct exynos_drm_ipp *ipp = task->ipp;
const struct exynos_drm_ipp_formats *src_fmt, *dst_fmt;
@@ -752,6 +751,20 @@ static int exynos_drm_ipp_task_check(struct exynos_drm_ipp_task *task,
if (ret)
return ret;
+ DRM_DEBUG_DRIVER("Task %pK: all checks done.\n", task);
+
+ return ret;
+}
+
+static int exynos_drm_ipp_task_setup_buffers(struct exynos_drm_ipp_task *task,
+ struct drm_file *filp)
+{
+ struct exynos_drm_ipp *ipp = task->ipp;
+ struct exynos_drm_ipp_buffer *src = &task->src, *dst = &task->dst;
+ int ret = 0;
+
+ DRM_DEBUG_DRIVER("Setting buffer for task %pK\n", task);
+
ret = exynos_drm_ipp_task_setup_buffer(ipp->dev, src, filp);
if (ret) {
DRM_DEBUG_DRIVER("Task %pK: src buffer setup failed\n", task);
@@ -763,7 +776,7 @@ static int exynos_drm_ipp_task_check(struct exynos_drm_ipp_task *task,
return ret;
}
- DRM_DEBUG_DRIVER("Task %pK: all checks done.\n", task);
+ DRM_DEBUG_DRIVER("Task %pK: buffers prepared.\n", task);
return ret;
}
@@ -996,7 +1009,11 @@ int exynos_drm_ipp_commit_ioctl(struct drm_device *dev, void *data,
if (ret)
goto free;
- ret = exynos_drm_ipp_task_check(task, file_priv);
+ ret = exynos_drm_ipp_task_check(task);
+ if (ret)
+ goto free;
+
+ ret = exynos_drm_ipp_task_setup_buffers(task, file_priv);
if (ret || arg->flags & DRM_EXYNOS_IPP_FLAG_TEST_ONLY)
goto free;