summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/exynos/exynos_drm_fimd.c
diff options
context:
space:
mode:
authorJoonyoung Shim <jy0922.shim@samsung.com>2015-01-30 10:43:02 +0300
committerInki Dae <inki.dae@samsung.com>2015-02-07 10:38:41 +0300
commit92dc7a047b02be447a51baa93deb0c0f694241a5 (patch)
tree11e7a89d575d5146d116aff452271e7c86ef4eee /drivers/gpu/drm/exynos/exynos_drm_fimd.c
parent0f04cf8df0b20a97369cb634663fef0578cbf273 (diff)
downloadlinux-92dc7a047b02be447a51baa93deb0c0f694241a5.tar.xz
drm/exynos: use driver internal struct
Use driver internal struct as argument instead of struct exynos_drm_crtc except functions of exynos_drm_crtc_ops and instead of struct exynos_drm_display except functions of exynos_drm_display_ops. It can reduce unnecessary variable declaration. Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
Diffstat (limited to 'drivers/gpu/drm/exynos/exynos_drm_fimd.c')
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_fimd.c43
1 files changed, 18 insertions, 25 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
index 39f7fa7b8d34..925fc69af1a0 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
@@ -253,9 +253,8 @@ static void fimd_enable_shadow_channel_path(struct fimd_context *ctx, int win,
writel(val, ctx->regs + SHADOWCON);
}
-static void fimd_clear_channel(struct exynos_drm_crtc *crtc)
+static void fimd_clear_channel(struct fimd_context *ctx)
{
- struct fimd_context *ctx = crtc->ctx;
int win, ch_enabled = 0;
DRM_DEBUG_KMS("%s\n", __FILE__);
@@ -280,7 +279,7 @@ static void fimd_clear_channel(struct exynos_drm_crtc *crtc)
unsigned int state = ctx->suspended;
ctx->suspended = 0;
- fimd_wait_for_vblank(crtc);
+ fimd_wait_for_vblank(ctx->crtc);
ctx->suspended = state;
}
}
@@ -302,7 +301,7 @@ static int fimd_ctx_initialize(struct fimd_context *ctx,
* If any channel is already active, iommu will throw
* a PAGE FAULT when enabled. So clear any channel if enabled.
*/
- fimd_clear_channel(ctx->crtc);
+ fimd_clear_channel(ctx);
ret = drm_iommu_attach_device(ctx->drm_dev, ctx->dev);
if (ret) {
DRM_ERROR("drm_iommu_attach failed.\n");
@@ -823,9 +822,8 @@ static void fimd_win_disable(struct exynos_drm_crtc *crtc, int zpos)
win_data->enabled = false;
}
-static void fimd_window_suspend(struct exynos_drm_crtc *crtc)
+static void fimd_window_suspend(struct fimd_context *ctx)
{
- struct fimd_context *ctx = crtc->ctx;
struct fimd_win_data *win_data;
int i;
@@ -833,13 +831,12 @@ static void fimd_window_suspend(struct exynos_drm_crtc *crtc)
win_data = &ctx->win_data[i];
win_data->resume = win_data->enabled;
if (win_data->enabled)
- fimd_win_disable(crtc, i);
+ fimd_win_disable(ctx->crtc, i);
}
}
-static void fimd_window_resume(struct exynos_drm_crtc *crtc)
+static void fimd_window_resume(struct fimd_context *ctx)
{
- struct fimd_context *ctx = crtc->ctx;
struct fimd_win_data *win_data;
int i;
@@ -850,26 +847,24 @@ static void fimd_window_resume(struct exynos_drm_crtc *crtc)
}
}
-static void fimd_apply(struct exynos_drm_crtc *crtc)
+static void fimd_apply(struct fimd_context *ctx)
{
- struct fimd_context *ctx = crtc->ctx;
struct fimd_win_data *win_data;
int i;
for (i = 0; i < WINDOWS_NR; i++) {
win_data = &ctx->win_data[i];
if (win_data->enabled)
- fimd_win_commit(crtc, i);
+ fimd_win_commit(ctx->crtc, i);
else
- fimd_win_disable(crtc, i);
+ fimd_win_disable(ctx->crtc, i);
}
- fimd_commit(crtc);
+ fimd_commit(ctx->crtc);
}
-static int fimd_poweron(struct exynos_drm_crtc *crtc)
+static int fimd_poweron(struct fimd_context *ctx)
{
- struct fimd_context *ctx = crtc->ctx;
int ret;
if (!ctx->suspended)
@@ -893,16 +888,16 @@ static int fimd_poweron(struct exynos_drm_crtc *crtc)
/* if vblank was enabled status, enable it again. */
if (test_and_clear_bit(0, &ctx->irq_flags)) {
- ret = fimd_enable_vblank(crtc);
+ ret = fimd_enable_vblank(ctx->crtc);
if (ret) {
DRM_ERROR("Failed to re-enable vblank [%d]\n", ret);
goto enable_vblank_err;
}
}
- fimd_window_resume(crtc);
+ fimd_window_resume(ctx);
- fimd_apply(crtc);
+ fimd_apply(ctx);
return 0;
@@ -915,10 +910,8 @@ bus_clk_err:
return ret;
}
-static int fimd_poweroff(struct exynos_drm_crtc *crtc)
+static int fimd_poweroff(struct fimd_context *ctx)
{
- struct fimd_context *ctx = crtc->ctx;
-
if (ctx->suspended)
return 0;
@@ -927,7 +920,7 @@ static int fimd_poweroff(struct exynos_drm_crtc *crtc)
* suspend that connector. Otherwise we might try to scan from
* a destroyed buffer later.
*/
- fimd_window_suspend(crtc);
+ fimd_window_suspend(ctx);
clk_disable_unprepare(ctx->lcd_clk);
clk_disable_unprepare(ctx->bus_clk);
@@ -944,12 +937,12 @@ static void fimd_dpms(struct exynos_drm_crtc *crtc, int mode)
switch (mode) {
case DRM_MODE_DPMS_ON:
- fimd_poweron(crtc);
+ fimd_poweron(crtc->ctx);
break;
case DRM_MODE_DPMS_STANDBY:
case DRM_MODE_DPMS_SUSPEND:
case DRM_MODE_DPMS_OFF:
- fimd_poweroff(crtc);
+ fimd_poweroff(crtc->ctx);
break;
default:
DRM_DEBUG_KMS("unspecified mode %d\n", mode);