From b64cbbc3d871b5ef90de3205332099a7f51c4dcc Mon Sep 17 00:00:00 2001 From: Marek Szyprowski Date: Mon, 26 Mar 2018 15:09:48 +0200 Subject: [PATCH] drm/exynos: ipp: Move buffer setup to separate function Signed-off-by: Marek Szyprowski Change-Id: I57d31254f3f7c677ee350c83f732a674e7f6d557 --- drivers/gpu/drm/exynos/exynos_drm_ipp.c | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_ipp.c b/drivers/gpu/drm/exynos/exynos_drm_ipp.c index 4fcbef5..26374e5 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_ipp.c +++ b/drivers/gpu/drm/exynos/exynos_drm_ipp.c @@ -560,8 +560,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; @@ -642,6 +641,19 @@ 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_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(src, filp); if (ret) { DRM_DEBUG_DRIVER("Task %pK: src buffer setup failed\n", task); @@ -653,7 +665,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; } @@ -859,7 +871,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; -- 2.7.4