From: Gustavo Padovan Date: Wed, 26 Nov 2014 18:43:27 +0000 (-0200) Subject: drm/exynos: remove drm_dev from struct exynos_drm_manager X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=eb88e422c502a7a1628cc919020e2ebf59450d4d;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git drm/exynos: remove drm_dev from struct exynos_drm_manager manager-drm_dev is only accessed by exynos_drm_crtc_create() so this patch pass drm_dev as argument on exynos_drm_crtc_create() and remove it from struct exynos_drm_manager. Signed-off-by: Gustavo Padovan Signed-off-by: Inki Dae --- diff --git a/drivers/gpu/drm/exynos/exynos_drm_crtc.c b/drivers/gpu/drm/exynos/exynos_drm_crtc.c index 224b9af70224..1eb5750a59c9 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_crtc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_crtc.c @@ -299,12 +299,13 @@ static void exynos_drm_crtc_attach_mode_property(struct drm_crtc *crtc) drm_object_attach_property(&crtc->base, prop, 0); } -int exynos_drm_crtc_create(struct exynos_drm_manager *manager, int pipe, +int exynos_drm_crtc_create(struct exynos_drm_manager *manager, + struct drm_device *drm_dev, int pipe, enum exynos_drm_output_type type) { struct exynos_drm_crtc *exynos_crtc; struct drm_plane *plane; - struct exynos_drm_private *private = manager->drm_dev->dev_private; + struct exynos_drm_private *private = drm_dev->dev_private; struct drm_crtc *crtc; int ret; @@ -319,7 +320,7 @@ int exynos_drm_crtc_create(struct exynos_drm_manager *manager, int pipe, exynos_crtc->manager = manager; exynos_crtc->pipe = pipe; exynos_crtc->type = type; - plane = exynos_plane_init(manager->drm_dev, 1 << pipe, + plane = exynos_plane_init(drm_dev, 1 << pipe, DRM_PLANE_TYPE_PRIMARY); if (IS_ERR(plane)) { ret = PTR_ERR(plane); @@ -331,7 +332,7 @@ int exynos_drm_crtc_create(struct exynos_drm_manager *manager, int pipe, private->crtc[pipe] = crtc; - ret = drm_crtc_init_with_planes(manager->drm_dev, crtc, plane, NULL, + ret = drm_crtc_init_with_planes(drm_dev, crtc, plane, NULL, &exynos_crtc_funcs); if (ret < 0) goto err_crtc; diff --git a/drivers/gpu/drm/exynos/exynos_drm_crtc.h b/drivers/gpu/drm/exynos/exynos_drm_crtc.h index a705941527d1..d7690e9e3e20 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_crtc.h +++ b/drivers/gpu/drm/exynos/exynos_drm_crtc.h @@ -17,7 +17,8 @@ #include "exynos_drm_drv.h" -int exynos_drm_crtc_create(struct exynos_drm_manager *manager, int pipe, +int exynos_drm_crtc_create(struct exynos_drm_manager *manager, + struct drm_device *drm_dev, int pipe, enum exynos_drm_output_type type); int exynos_drm_crtc_enable_vblank(struct drm_device *dev, int pipe); void exynos_drm_crtc_disable_vblank(struct drm_device *dev, int pipe); diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h b/drivers/gpu/drm/exynos/exynos_drm_drv.h index a3ae95f1a40b..2d801a8402d2 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.h +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h @@ -211,7 +211,6 @@ struct exynos_drm_manager_ops { */ struct exynos_drm_manager { struct list_head list; - struct drm_device *drm_dev; struct drm_crtc *crtc; struct exynos_drm_manager_ops *ops; }; diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c index 1a6e354a9f2d..f67f11c702ca 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c @@ -298,7 +298,7 @@ static int fimd_mgr_initialize(struct exynos_drm_manager *mgr, struct exynos_drm_private *priv; priv = drm_dev->dev_private; - mgr->drm_dev = ctx->drm_dev = drm_dev; + ctx->drm_dev = drm_dev; ctx->pipe = priv->pipe++; /* attach this sub driver to iommu mapping if supported. */ @@ -1076,7 +1076,7 @@ static int fimd_bind(struct device *dev, struct device *master, void *data) struct drm_device *drm_dev = data; fimd_mgr_initialize(&ctx->manager, drm_dev); - exynos_drm_crtc_create(&ctx->manager, ctx->pipe, + exynos_drm_crtc_create(&ctx->manager, drm_dev, ctx->pipe, EXYNOS_DISPLAY_TYPE_LCD); if (ctx->display) exynos_drm_create_enc_conn(drm_dev, ctx->display); diff --git a/drivers/gpu/drm/exynos/exynos_drm_vidi.c b/drivers/gpu/drm/exynos/exynos_drm_vidi.c index 3cee0fd8f626..03687db8f565 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_vidi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_vidi.c @@ -301,7 +301,7 @@ static int vidi_mgr_initialize(struct exynos_drm_manager *mgr, struct vidi_context *ctx = manager_to_vidi(mgr); struct exynos_drm_private *priv = drm_dev->dev_private; - mgr->drm_dev = ctx->drm_dev = drm_dev; + ctx->drm_dev = drm_dev; ctx->pipe = priv->pipe++; return 0; @@ -558,7 +558,7 @@ static int vidi_bind(struct device *dev, struct device *master, void *data) vidi_mgr_initialize(&ctx->manager, drm_dev); - ret = exynos_drm_crtc_create(&ctx->manager, ctx->pipe, + ret = exynos_drm_crtc_create(&ctx->manager, drm_dev, ctx->pipe, EXYNOS_DISPLAY_TYPE_VIDI); if (ret) { DRM_ERROR("failed to create crtc.\n"); diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c index 50ae1e3d9578..c8adcf2d9d23 100644 --- a/drivers/gpu/drm/exynos/exynos_mixer.c +++ b/drivers/gpu/drm/exynos/exynos_mixer.c @@ -862,7 +862,7 @@ static int mixer_initialize(struct exynos_drm_manager *mgr, struct exynos_drm_private *priv; priv = drm_dev->dev_private; - mgr->drm_dev = mixer_ctx->drm_dev = drm_dev; + mixer_ctx->drm_dev = drm_dev; mixer_ctx->pipe = priv->pipe++; /* acquire resources: regs, irqs, clocks */ @@ -1261,7 +1261,7 @@ static int mixer_bind(struct device *dev, struct device *manager, void *data) if (ret) return ret; - ret = exynos_drm_crtc_create(&ctx->manager, ctx->pipe, + ret = exynos_drm_crtc_create(&ctx->manager, drm_dev, ctx->pipe, EXYNOS_DISPLAY_TYPE_HDMI); if (ret) { mixer_mgr_remove(&ctx->manager);