Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/exynos: kill exynos_drm_private::pipe

The field duplicates drm_dev->mode_config.num_crtc.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>

authored by

Andrzej Hajda and committed by
Inki Dae
f44d3d2f d644951c

+11 -42
+4 -14
drivers/gpu/drm/exynos/exynos5433_drm_decon.c
··· 586 586 { 587 587 struct decon_context *ctx = dev_get_drvdata(dev); 588 588 struct drm_device *drm_dev = data; 589 - struct exynos_drm_private *priv = drm_dev->dev_private; 590 589 struct exynos_drm_plane *exynos_plane; 591 590 enum exynos_drm_output_type out_type; 592 591 unsigned int win; 593 592 int ret; 594 593 595 594 ctx->drm_dev = drm_dev; 596 - ctx->pipe = priv->pipe++; 595 + ctx->pipe = drm_dev->mode_config.num_crtc; 597 596 drm_dev->max_vblank_count = 0xffffffff; 598 597 599 598 for (win = ctx->first_win; win < WINDOWS_NR; win++) { ··· 614 615 : EXYNOS_DISPLAY_TYPE_LCD; 615 616 ctx->crtc = exynos_drm_crtc_create(drm_dev, &exynos_plane->base, 616 617 out_type, &decon_crtc_ops, ctx); 617 - if (IS_ERR(ctx->crtc)) { 618 - ret = PTR_ERR(ctx->crtc); 619 - goto err; 620 - } 618 + if (IS_ERR(ctx->crtc)) 619 + return PTR_ERR(ctx->crtc); 621 620 622 621 decon_clear_channels(ctx->crtc); 623 622 624 - ret = drm_iommu_attach_device(drm_dev, dev); 625 - if (ret) 626 - goto err; 627 - 628 - return ret; 629 - err: 630 - priv->pipe--; 631 - return ret; 623 + return drm_iommu_attach_device(drm_dev, dev); 632 624 } 633 625 634 626 static void decon_unbind(struct device *dev, struct device *master, void *data)
+2 -9
drivers/gpu/drm/exynos/exynos7_drm_decon.c
··· 130 130 static int decon_ctx_initialize(struct decon_context *ctx, 131 131 struct drm_device *drm_dev) 132 132 { 133 - struct exynos_drm_private *priv = drm_dev->dev_private; 134 - int ret; 135 - 136 133 ctx->drm_dev = drm_dev; 137 - ctx->pipe = priv->pipe++; 134 + ctx->pipe = drm_dev->mode_config.num_crtc; 138 135 139 136 decon_clear_channels(ctx->crtc); 140 137 141 - ret = drm_iommu_attach_device(drm_dev, ctx->dev); 142 - if (ret) 143 - priv->pipe--; 144 - 145 - return ret; 138 + return drm_iommu_attach_device(drm_dev, ctx->dev); 146 139 } 147 140 148 141 static void decon_ctx_remove(struct decon_context *ctx)
-3
drivers/gpu/drm/exynos/exynos_drm_drv.h
··· 193 193 * otherwise default one. 194 194 * @da_space_size: size of device address space. 195 195 * if 0 then default value is used for it. 196 - * @pipe: the pipe number for this crtc/manager. 197 196 * @pending: the crtcs that have pending updates to finish 198 197 * @lock: protect access to @pending 199 198 * @wait: wait an atomic commit to finish ··· 202 203 203 204 struct device *dma_dev; 204 205 void *mapping; 205 - 206 - unsigned int pipe; 207 206 208 207 /* for atomic commit */ 209 208 u32 pending;
+2 -7
drivers/gpu/drm/exynos/exynos_drm_fimd.c
··· 982 982 { 983 983 struct fimd_context *ctx = dev_get_drvdata(dev); 984 984 struct drm_device *drm_dev = data; 985 - struct exynos_drm_private *priv = drm_dev->dev_private; 986 985 struct exynos_drm_plane *exynos_plane; 987 986 unsigned int i; 988 987 int ret; 989 988 990 989 ctx->drm_dev = drm_dev; 991 - ctx->pipe = priv->pipe++; 990 + ctx->pipe = drm_dev->mode_config.num_crtc; 992 991 993 992 for (i = 0; i < WINDOWS_NR; i++) { 994 993 ctx->configs[i].pixel_formats = fimd_formats; ··· 1017 1018 if (is_drm_iommu_supported(drm_dev)) 1018 1019 fimd_clear_channels(ctx->crtc); 1019 1020 1020 - ret = drm_iommu_attach_device(drm_dev, dev); 1021 - if (ret) 1022 - priv->pipe--; 1023 - 1024 - return ret; 1021 + return drm_iommu_attach_device(drm_dev, dev); 1025 1022 } 1026 1023 1027 1024 static void fimd_unbind(struct device *dev, struct device *master,
+1 -3
drivers/gpu/drm/exynos/exynos_drm_vidi.c
··· 156 156 static int vidi_ctx_initialize(struct vidi_context *ctx, 157 157 struct drm_device *drm_dev) 158 158 { 159 - struct exynos_drm_private *priv = drm_dev->dev_private; 160 - 161 159 ctx->drm_dev = drm_dev; 162 - ctx->pipe = priv->pipe++; 160 + ctx->pipe = drm_dev->mode_config.num_crtc; 163 161 164 162 return 0; 165 163 }
+2 -6
drivers/gpu/drm/exynos/exynos_mixer.c
··· 900 900 priv = drm_dev->dev_private; 901 901 902 902 mixer_ctx->drm_dev = drm_dev; 903 - mixer_ctx->pipe = priv->pipe++; 903 + mixer_ctx->pipe = drm_dev->mode_config.num_crtc; 904 904 905 905 /* acquire resources: regs, irqs, clocks */ 906 906 ret = mixer_resources_init(mixer_ctx); ··· 918 918 } 919 919 } 920 920 921 - ret = drm_iommu_attach_device(drm_dev, mixer_ctx->dev); 922 - if (ret) 923 - priv->pipe--; 924 - 925 - return ret; 921 + return drm_iommu_attach_device(drm_dev, mixer_ctx->dev); 926 922 } 927 923 928 924 static void mixer_ctx_remove(struct mixer_context *mixer_ctx)