summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm
diff options
context:
space:
mode:
authorSean Paul <seanpaul@chromium.org>2014-04-24 20:41:20 +0900
committerChanho Park <chanho61.park@samsung.com>2014-11-18 11:47:32 +0900
commit6f505477a2c32c3b971d2f056a711551347b853d (patch)
treedcf21ee4efe732909f8696ba468304fb3e02e785 /drivers/gpu/drm
parent17a21d601fda2b28b4946b4f608a33befc6077e9 (diff)
downloadlinux-3.10-6f505477a2c32c3b971d2f056a711551347b853d.tar.gz
linux-3.10-6f505477a2c32c3b971d2f056a711551347b853d.tar.bz2
linux-3.10-6f505477a2c32c3b971d2f056a711551347b853d.zip
drm/exynos: Use manager_op initialize in fimd
This patch implements the intitialize manager op in fimd. This will allow us to keep track of drm_dev in context instead of using subdev, which in turn makes it easier to remove subdev from fimd. Signed-off-by: Sean Paul <seanpaul@chromium.org> Signed-off-by: Inki Dae <inki.dae@samsung.com>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_fimd.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
index 1bd588ec4ee..7508fd5f061 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
@@ -112,6 +112,7 @@ struct fimd_win_data {
struct fimd_context {
struct exynos_drm_subdrv subdrv;
+ struct drm_device *drm_dev;
int irq;
struct drm_crtc *crtc;
struct clk *bus_clk;
@@ -669,7 +670,6 @@ static irqreturn_t fimd_irq_handler(int irq, void *dev_id)
{
struct fimd_context *ctx = (struct fimd_context *)dev_id;
struct exynos_drm_subdrv *subdrv = &ctx->subdrv;
- struct drm_device *drm_dev = subdrv->drm_dev;
struct exynos_drm_manager *manager = subdrv->manager;
u32 val;
@@ -680,11 +680,11 @@ static irqreturn_t fimd_irq_handler(int irq, void *dev_id)
writel(VIDINTCON1_INT_FRAME, ctx->regs + VIDINTCON1);
/* check the crtc is detached already from encoder */
- if (manager->pipe < 0)
+ if (manager->pipe < 0 || !ctx->drm_dev)
goto out;
- drm_handle_vblank(drm_dev, manager->pipe);
- exynos_drm_crtc_finish_pageflip(drm_dev, manager->pipe);
+ drm_handle_vblank(ctx->drm_dev, manager->pipe);
+ exynos_drm_crtc_finish_pageflip(ctx->drm_dev, manager->pipe);
/* set wait vsync event to zero and wake up queue. */
if (atomic_read(&ctx->wait_vsync_event)) {
@@ -875,6 +875,16 @@ static int fimd_activate(struct fimd_context *ctx, bool enable)
return 0;
}
+static int fimd_mgr_initialize(struct device *subdrv_dev,
+ struct drm_device *drm_dev)
+{
+ struct fimd_context *ctx = get_fimd_context(subdrv_dev);
+
+ ctx->drm_dev = drm_dev;
+
+ return 0;
+}
+
static void fimd_dpms(struct device *subdrv_dev, int mode)
{
struct fimd_context *ctx = get_fimd_context(subdrv_dev);
@@ -911,6 +921,7 @@ static void fimd_dpms(struct device *subdrv_dev, int mode)
}
static struct exynos_drm_manager_ops fimd_manager_ops = {
+ .initialize = fimd_mgr_initialize,
.dpms = fimd_dpms,
.apply = fimd_apply,
.commit = fimd_commit,