提交 eb88e422 编写于 作者: G Gustavo Padovan 提交者: Inki Dae

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: NGustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: NInki Dae <inki.dae@samsung.com>
上级 5d1741ad
......@@ -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;
......
......@@ -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);
......
......@@ -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;
};
......
......@@ -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);
......
......@@ -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");
......
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册