Commit f44d3d2f authored by Andrzej Hajda's avatar Andrzej Hajda Committed by Inki Dae

drm/exynos: kill exynos_drm_private::pipe

The field duplicates drm_dev->mode_config.num_crtc.
Signed-off-by: default avatarAndrzej Hajda <a.hajda@samsung.com>
Signed-off-by: default avatarInki Dae <inki.dae@samsung.com>
parent d644951c
...@@ -586,14 +586,13 @@ static int decon_bind(struct device *dev, struct device *master, void *data) ...@@ -586,14 +586,13 @@ static int decon_bind(struct device *dev, struct device *master, void *data)
{ {
struct decon_context *ctx = dev_get_drvdata(dev); struct decon_context *ctx = dev_get_drvdata(dev);
struct drm_device *drm_dev = data; struct drm_device *drm_dev = data;
struct exynos_drm_private *priv = drm_dev->dev_private;
struct exynos_drm_plane *exynos_plane; struct exynos_drm_plane *exynos_plane;
enum exynos_drm_output_type out_type; enum exynos_drm_output_type out_type;
unsigned int win; unsigned int win;
int ret; int ret;
ctx->drm_dev = drm_dev; ctx->drm_dev = drm_dev;
ctx->pipe = priv->pipe++; ctx->pipe = drm_dev->mode_config.num_crtc;
drm_dev->max_vblank_count = 0xffffffff; drm_dev->max_vblank_count = 0xffffffff;
for (win = ctx->first_win; win < WINDOWS_NR; win++) { for (win = ctx->first_win; win < WINDOWS_NR; win++) {
...@@ -615,21 +614,12 @@ static int decon_bind(struct device *dev, struct device *master, void *data) ...@@ -615,21 +614,12 @@ static int decon_bind(struct device *dev, struct device *master, void *data)
: EXYNOS_DISPLAY_TYPE_LCD; : EXYNOS_DISPLAY_TYPE_LCD;
ctx->crtc = exynos_drm_crtc_create(drm_dev, &exynos_plane->base, ctx->crtc = exynos_drm_crtc_create(drm_dev, &exynos_plane->base,
out_type, &decon_crtc_ops, ctx); out_type, &decon_crtc_ops, ctx);
if (IS_ERR(ctx->crtc)) { if (IS_ERR(ctx->crtc))
ret = PTR_ERR(ctx->crtc); return PTR_ERR(ctx->crtc);
goto err;
}
decon_clear_channels(ctx->crtc); decon_clear_channels(ctx->crtc);
ret = drm_iommu_attach_device(drm_dev, dev); return drm_iommu_attach_device(drm_dev, dev);
if (ret)
goto err;
return ret;
err:
priv->pipe--;
return ret;
} }
static void decon_unbind(struct device *dev, struct device *master, void *data) static void decon_unbind(struct device *dev, struct device *master, void *data)
......
...@@ -130,19 +130,12 @@ static void decon_clear_channels(struct exynos_drm_crtc *crtc) ...@@ -130,19 +130,12 @@ static void decon_clear_channels(struct exynos_drm_crtc *crtc)
static int decon_ctx_initialize(struct decon_context *ctx, static int decon_ctx_initialize(struct decon_context *ctx,
struct drm_device *drm_dev) struct drm_device *drm_dev)
{ {
struct exynos_drm_private *priv = drm_dev->dev_private;
int ret;
ctx->drm_dev = drm_dev; ctx->drm_dev = drm_dev;
ctx->pipe = priv->pipe++; ctx->pipe = drm_dev->mode_config.num_crtc;
decon_clear_channels(ctx->crtc); decon_clear_channels(ctx->crtc);
ret = drm_iommu_attach_device(drm_dev, ctx->dev); return drm_iommu_attach_device(drm_dev, ctx->dev);
if (ret)
priv->pipe--;
return ret;
} }
static void decon_ctx_remove(struct decon_context *ctx) static void decon_ctx_remove(struct decon_context *ctx)
......
...@@ -193,7 +193,6 @@ struct drm_exynos_file_private { ...@@ -193,7 +193,6 @@ struct drm_exynos_file_private {
* otherwise default one. * otherwise default one.
* @da_space_size: size of device address space. * @da_space_size: size of device address space.
* if 0 then default value is used for it. * if 0 then default value is used for it.
* @pipe: the pipe number for this crtc/manager.
* @pending: the crtcs that have pending updates to finish * @pending: the crtcs that have pending updates to finish
* @lock: protect access to @pending * @lock: protect access to @pending
* @wait: wait an atomic commit to finish * @wait: wait an atomic commit to finish
...@@ -204,8 +203,6 @@ struct exynos_drm_private { ...@@ -204,8 +203,6 @@ struct exynos_drm_private {
struct device *dma_dev; struct device *dma_dev;
void *mapping; void *mapping;
unsigned int pipe;
/* for atomic commit */ /* for atomic commit */
u32 pending; u32 pending;
spinlock_t lock; spinlock_t lock;
......
...@@ -982,13 +982,12 @@ static int fimd_bind(struct device *dev, struct device *master, void *data) ...@@ -982,13 +982,12 @@ static int fimd_bind(struct device *dev, struct device *master, void *data)
{ {
struct fimd_context *ctx = dev_get_drvdata(dev); struct fimd_context *ctx = dev_get_drvdata(dev);
struct drm_device *drm_dev = data; struct drm_device *drm_dev = data;
struct exynos_drm_private *priv = drm_dev->dev_private;
struct exynos_drm_plane *exynos_plane; struct exynos_drm_plane *exynos_plane;
unsigned int i; unsigned int i;
int ret; int ret;
ctx->drm_dev = drm_dev; ctx->drm_dev = drm_dev;
ctx->pipe = priv->pipe++; ctx->pipe = drm_dev->mode_config.num_crtc;
for (i = 0; i < WINDOWS_NR; i++) { for (i = 0; i < WINDOWS_NR; i++) {
ctx->configs[i].pixel_formats = fimd_formats; ctx->configs[i].pixel_formats = fimd_formats;
...@@ -1018,11 +1017,7 @@ static int fimd_bind(struct device *dev, struct device *master, void *data) ...@@ -1018,11 +1017,7 @@ static int fimd_bind(struct device *dev, struct device *master, void *data)
if (is_drm_iommu_supported(drm_dev)) if (is_drm_iommu_supported(drm_dev))
fimd_clear_channels(ctx->crtc); fimd_clear_channels(ctx->crtc);
ret = drm_iommu_attach_device(drm_dev, dev); return drm_iommu_attach_device(drm_dev, dev);
if (ret)
priv->pipe--;
return ret;
} }
static void fimd_unbind(struct device *dev, struct device *master, static void fimd_unbind(struct device *dev, struct device *master,
......
...@@ -156,10 +156,8 @@ static void vidi_disable(struct exynos_drm_crtc *crtc) ...@@ -156,10 +156,8 @@ static void vidi_disable(struct exynos_drm_crtc *crtc)
static int vidi_ctx_initialize(struct vidi_context *ctx, static int vidi_ctx_initialize(struct vidi_context *ctx,
struct drm_device *drm_dev) struct drm_device *drm_dev)
{ {
struct exynos_drm_private *priv = drm_dev->dev_private;
ctx->drm_dev = drm_dev; ctx->drm_dev = drm_dev;
ctx->pipe = priv->pipe++; ctx->pipe = drm_dev->mode_config.num_crtc;
return 0; return 0;
} }
......
...@@ -900,7 +900,7 @@ static int mixer_initialize(struct mixer_context *mixer_ctx, ...@@ -900,7 +900,7 @@ static int mixer_initialize(struct mixer_context *mixer_ctx,
priv = drm_dev->dev_private; priv = drm_dev->dev_private;
mixer_ctx->drm_dev = drm_dev; mixer_ctx->drm_dev = drm_dev;
mixer_ctx->pipe = priv->pipe++; mixer_ctx->pipe = drm_dev->mode_config.num_crtc;
/* acquire resources: regs, irqs, clocks */ /* acquire resources: regs, irqs, clocks */
ret = mixer_resources_init(mixer_ctx); ret = mixer_resources_init(mixer_ctx);
...@@ -918,11 +918,7 @@ static int mixer_initialize(struct mixer_context *mixer_ctx, ...@@ -918,11 +918,7 @@ static int mixer_initialize(struct mixer_context *mixer_ctx,
} }
} }
ret = drm_iommu_attach_device(drm_dev, mixer_ctx->dev); return drm_iommu_attach_device(drm_dev, mixer_ctx->dev);
if (ret)
priv->pipe--;
return ret;
} }
static void mixer_ctx_remove(struct mixer_context *mixer_ctx) static void mixer_ctx_remove(struct mixer_context *mixer_ctx)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment