diff options
| author | Shawn Guo <shawn.guo@linaro.org> | 2017-01-09 06:25:40 -0500 |
|---|---|---|
| committer | Sean Paul <seanpaul@chromium.org> | 2017-01-18 08:56:59 -0500 |
| commit | a3c764e9884aad26176f149a7490daac978dd209 (patch) | |
| tree | 1891f82fb34d0e7b49f2f6d11e6a0abba0956b15 | |
| parent | 01f8c951c25f9a87f2e9dbc09ceca274e80fff4e (diff) | |
drm: exynos: use crtc helper drm_crtc_from_index()
Use drm_crtc_from_index() to find drm_crtc for given index, so that we
do not need to maintain a pointer array in struct exynos_drm_private.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Cc: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: http://patchwork.freedesktop.org/patch/msgid/1483961145-18453-2-git-send-email-shawnguo@kernel.org
| -rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_crtc.c | 6 | ||||
| -rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_drv.h | 10 |
2 files changed, 2 insertions, 14 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_crtc.c b/drivers/gpu/drm/exynos/exynos_drm_crtc.c index 2530bf57716a..309c8ee52524 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_crtc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_crtc.c | |||
| @@ -109,9 +109,6 @@ static const struct drm_crtc_helper_funcs exynos_crtc_helper_funcs = { | |||
| 109 | static void exynos_drm_crtc_destroy(struct drm_crtc *crtc) | 109 | static void exynos_drm_crtc_destroy(struct drm_crtc *crtc) |
| 110 | { | 110 | { |
| 111 | struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc); | 111 | struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc); |
| 112 | struct exynos_drm_private *private = crtc->dev->dev_private; | ||
| 113 | |||
| 114 | private->crtc[exynos_crtc->pipe] = NULL; | ||
| 115 | 112 | ||
| 116 | drm_crtc_cleanup(crtc); | 113 | drm_crtc_cleanup(crtc); |
| 117 | kfree(exynos_crtc); | 114 | kfree(exynos_crtc); |
| @@ -134,7 +131,6 @@ struct exynos_drm_crtc *exynos_drm_crtc_create(struct drm_device *drm_dev, | |||
| 134 | void *ctx) | 131 | void *ctx) |
| 135 | { | 132 | { |
| 136 | struct exynos_drm_crtc *exynos_crtc; | 133 | struct exynos_drm_crtc *exynos_crtc; |
| 137 | struct exynos_drm_private *private = drm_dev->dev_private; | ||
| 138 | struct drm_crtc *crtc; | 134 | struct drm_crtc *crtc; |
| 139 | int ret; | 135 | int ret; |
| 140 | 136 | ||
| @@ -149,8 +145,6 @@ struct exynos_drm_crtc *exynos_drm_crtc_create(struct drm_device *drm_dev, | |||
| 149 | 145 | ||
| 150 | crtc = &exynos_crtc->base; | 146 | crtc = &exynos_crtc->base; |
| 151 | 147 | ||
| 152 | private->crtc[pipe] = crtc; | ||
| 153 | |||
| 154 | ret = drm_crtc_init_with_planes(drm_dev, crtc, plane, NULL, | 148 | ret = drm_crtc_init_with_planes(drm_dev, crtc, plane, NULL, |
| 155 | &exynos_crtc_funcs, NULL); | 149 | &exynos_crtc_funcs, NULL); |
| 156 | if (ret < 0) | 150 | if (ret < 0) |
diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h b/drivers/gpu/drm/exynos/exynos_drm_drv.h index 80c4d5b81689..cf6e08cb35a7 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.h +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h | |||
| @@ -211,12 +211,6 @@ struct drm_exynos_file_private { | |||
| 211 | struct exynos_drm_private { | 211 | struct exynos_drm_private { |
| 212 | struct drm_fb_helper *fb_helper; | 212 | struct drm_fb_helper *fb_helper; |
| 213 | 213 | ||
| 214 | /* | ||
| 215 | * created crtc object would be contained at this array and | ||
| 216 | * this array is used to be aware of which crtc did it request vblank. | ||
| 217 | */ | ||
| 218 | struct drm_crtc *crtc[MAX_CRTC]; | ||
| 219 | |||
| 220 | struct device *dma_dev; | 214 | struct device *dma_dev; |
| 221 | void *mapping; | 215 | void *mapping; |
| 222 | 216 | ||
| @@ -231,9 +225,9 @@ struct exynos_drm_private { | |||
| 231 | static inline struct exynos_drm_crtc * | 225 | static inline struct exynos_drm_crtc * |
| 232 | exynos_drm_crtc_from_pipe(struct drm_device *dev, int pipe) | 226 | exynos_drm_crtc_from_pipe(struct drm_device *dev, int pipe) |
| 233 | { | 227 | { |
| 234 | struct exynos_drm_private *private = dev->dev_private; | 228 | struct drm_crtc *crtc = drm_crtc_from_index(dev, pipe); |
| 235 | 229 | ||
| 236 | return to_exynos_crtc(private->crtc[pipe]); | 230 | return to_exynos_crtc(crtc); |
| 237 | } | 231 | } |
| 238 | 232 | ||
| 239 | static inline struct device *to_dma_dev(struct drm_device *dev) | 233 | static inline struct device *to_dma_dev(struct drm_device *dev) |
