Skip to content

Commit 2701932

Browse files
Andrzej Hajdadaeinki
authored andcommitted
drm/exynos: add helper to get crtc from pipe
The helper abstracts out conversion from pipeline to crtc. Currently it is used in two places, but there will be more uses in next patches. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
1 parent 3d30ec5 commit 2701932

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

drivers/gpu/drm/exynos/exynos_drm_crtc.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,8 @@ struct exynos_drm_crtc *exynos_drm_crtc_create(struct drm_device *drm_dev,
157157

158158
int exynos_drm_crtc_enable_vblank(struct drm_device *dev, unsigned int pipe)
159159
{
160-
struct exynos_drm_private *private = dev->dev_private;
161-
struct exynos_drm_crtc *exynos_crtc =
162-
to_exynos_crtc(private->crtc[pipe]);
160+
struct exynos_drm_crtc *exynos_crtc = exynos_drm_crtc_from_pipe(dev,
161+
pipe);
163162

164163
if (exynos_crtc->ops->enable_vblank)
165164
return exynos_crtc->ops->enable_vblank(exynos_crtc);
@@ -169,9 +168,8 @@ int exynos_drm_crtc_enable_vblank(struct drm_device *dev, unsigned int pipe)
169168

170169
void exynos_drm_crtc_disable_vblank(struct drm_device *dev, unsigned int pipe)
171170
{
172-
struct exynos_drm_private *private = dev->dev_private;
173-
struct exynos_drm_crtc *exynos_crtc =
174-
to_exynos_crtc(private->crtc[pipe]);
171+
struct exynos_drm_crtc *exynos_crtc = exynos_drm_crtc_from_pipe(dev,
172+
pipe);
175173

176174
if (exynos_crtc->ops->disable_vblank)
177175
exynos_crtc->ops->disable_vblank(exynos_crtc);

drivers/gpu/drm/exynos/exynos_drm_drv.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,14 @@ struct exynos_drm_private {
232232
wait_queue_head_t wait;
233233
};
234234

235+
static inline struct exynos_drm_crtc *
236+
exynos_drm_crtc_from_pipe(struct drm_device *dev, int pipe)
237+
{
238+
struct exynos_drm_private *private = dev->dev_private;
239+
240+
return to_exynos_crtc(private->crtc[pipe]);
241+
}
242+
235243
static inline struct device *to_dma_dev(struct drm_device *dev)
236244
{
237245
struct exynos_drm_private *priv = dev->dev_private;

0 commit comments

Comments
 (0)