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

drm/exynos/decon5433: implement frame counter

DECON in Exynos5433 has frame counter, it can be used to implement
get_vblank_counter callback.

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
0586feba 73b7b44f

+24
+12
drivers/gpu/drm/exynos/exynos5433_drm_decon.c
··· 166 166 return frm; 167 167 } 168 168 169 + static u32 decon_get_vblank_counter(struct exynos_drm_crtc *crtc) 170 + { 171 + struct decon_context *ctx = crtc->ctx; 172 + 173 + if (test_bit(BIT_SUSPENDED, &ctx->flags)) 174 + return 0; 175 + 176 + return decon_get_frame_count(ctx, false); 177 + } 178 + 169 179 static void decon_setup_trigger(struct decon_context *ctx) 170 180 { 171 181 if (!(ctx->out_type & (IFTYPE_I80 | I80_HW_TRG))) ··· 574 564 .disable = decon_disable, 575 565 .enable_vblank = decon_enable_vblank, 576 566 .disable_vblank = decon_disable_vblank, 567 + .get_vblank_counter = decon_get_vblank_counter, 577 568 .atomic_begin = decon_atomic_begin, 578 569 .update_plane = decon_update_plane, 579 570 .disable_plane = decon_disable_plane, ··· 594 583 595 584 ctx->drm_dev = drm_dev; 596 585 ctx->pipe = priv->pipe++; 586 + drm_dev->max_vblank_count = 0xffffffff; 597 587 598 588 for (win = ctx->first_win; win < WINDOWS_NR; win++) { 599 589 int tmp = (win == ctx->first_win) ? 0 : win;
+11
drivers/gpu/drm/exynos/exynos_drm_crtc.c
··· 142 142 exynos_crtc->ops->disable_vblank(exynos_crtc); 143 143 } 144 144 145 + static u32 exynos_drm_crtc_get_vblank_counter(struct drm_crtc *crtc) 146 + { 147 + struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc); 148 + 149 + if (exynos_crtc->ops->get_vblank_counter) 150 + return exynos_crtc->ops->get_vblank_counter(exynos_crtc); 151 + 152 + return 0; 153 + } 154 + 145 155 static const struct drm_crtc_funcs exynos_crtc_funcs = { 146 156 .set_config = drm_atomic_helper_set_config, 147 157 .page_flip = drm_atomic_helper_page_flip, ··· 161 151 .atomic_destroy_state = drm_atomic_helper_crtc_destroy_state, 162 152 .enable_vblank = exynos_drm_crtc_enable_vblank, 163 153 .disable_vblank = exynos_drm_crtc_disable_vblank, 154 + .get_vblank_counter = exynos_drm_crtc_get_vblank_counter, 164 155 }; 165 156 166 157 struct exynos_drm_crtc *exynos_drm_crtc_create(struct drm_device *drm_dev,
+1
drivers/gpu/drm/exynos/exynos_drm_drv.h
··· 133 133 void (*commit)(struct exynos_drm_crtc *crtc); 134 134 int (*enable_vblank)(struct exynos_drm_crtc *crtc); 135 135 void (*disable_vblank)(struct exynos_drm_crtc *crtc); 136 + u32 (*get_vblank_counter)(struct exynos_drm_crtc *crtc); 136 137 int (*atomic_check)(struct exynos_drm_crtc *crtc, 137 138 struct drm_crtc_state *state); 138 139 void (*atomic_begin)(struct exynos_drm_crtc *crtc);