Revert "drm/exynos: implement an optimized page_flip"
authorMandeep Singh Baines <msb@chromium.org>
Wed, 7 Nov 2012 20:35:46 +0000 (12:35 -0800)
committerGerrit <chrome-bot@google.com>
Wed, 14 Nov 2012 00:53:29 +0000 (16:53 -0800)
This reverts commit 69518a3c650de9186f345a5e7feaddbadfc394d0.

We want to be able to call page_flip from mode_set and mode_set_base
so that all functions which cause a buffer to be scanned out are
synchronized.

BUG=chrome-os-partner:15349,chrome-os-partner:14965
TEST=Multiple VT switch, HDMI plug/unplug, sign in/out, suspend/resume,
     idle suspend/resume.

Change-Id: I198962b65bb8a1ab5b885c053c19f7f8077cb9c6
Signed-off-by: Mandeep Singh Baines <msb@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/37571

drivers/gpu/drm/exynos/exynos_drm_crtc.c
drivers/gpu/drm/exynos/exynos_drm_display.h
drivers/gpu/drm/exynos/exynos_drm_encoder.c
drivers/gpu/drm/exynos/exynos_drm_encoder.h
drivers/gpu/drm/exynos/exynos_drm_fimd.c
drivers/gpu/drm/exynos/exynos_mixer.c

index e8271b4..3fefe88 100644 (file)
@@ -98,32 +98,6 @@ void exynos_drm_overlay_update(struct exynos_drm_overlay *overlay,
                        overlay->crtc_width, overlay->crtc_height);
 }
 
-static void exynos_drm_crtc_page_flip_apply(struct drm_crtc *crtc,
-                                           struct drm_framebuffer *fb)
-{
-       struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc);
-       struct exynos_drm_overlay *overlay = &exynos_crtc->overlay;
-       int nr = exynos_drm_format_num_buffers(fb->pixel_format);
-       int i;
-
-       for (i = 0; i < nr; i++) {
-               struct exynos_drm_gem_buf *buffer;
-
-               buffer = exynos_drm_fb_buffer(fb, i);
-               overlay->dma_addr[i] = buffer->dma_addr;
-               overlay->vaddr[i] = buffer->kvaddr;
-
-               DRM_DEBUG_KMS("buffer: %d, vaddr = 0x%lx, dma_addr = 0x%lx\n",
-                               i, (unsigned long)overlay->vaddr[i],
-                               (unsigned long)overlay->dma_addr[i]);
-       }
-
-       exynos_drm_fn_encoder(crtc, overlay,
-                       exynos_drm_encoder_crtc_page_flip);
-       exynos_drm_fn_encoder(crtc, &exynos_crtc->pipe,
-                       exynos_drm_encoder_crtc_commit);
-}
-
 static void exynos_drm_crtc_update(struct drm_crtc *crtc,
                                   struct drm_framebuffer *fb)
 {
@@ -321,7 +295,8 @@ void exynos_drm_kds_callback(void *callback_parameter, void *callback_extra_para
        struct kds_resource_set *prev_kds;
        unsigned long flags;
 
-       exynos_drm_crtc_page_flip_apply(crtc, fb);
+       exynos_drm_crtc_update(crtc, fb);
+       exynos_drm_crtc_apply(crtc);
 
        spin_lock_irqsave(&dev->event_lock, flags);
        prev_kds = exynos_crtc->pending_kds;
index ce40e17..8cc5283 100644 (file)
@@ -57,7 +57,6 @@ struct exynos_panel_ops {
  * @power: Sets the controller's power to mode
  * @dpms: Same as power, but called in different places. Best to avoid it
  * @mode_set: Sets the controller to output mode
- * @page_flip: Updates the controller's dma pointer
  * @commit: Applies controller level settings (as opposed to window level)
  * @apply: Commits the changes on all of the controller's windows
  * @win_commit: Commits the changes on only one window
@@ -71,7 +70,6 @@ struct exynos_controller_ops {
        int (*power)(void *ctx, int mode);
        int (*dpms)(void *ctx, int mode);
        void (*mode_set)(void *ctx, struct exynos_drm_overlay *overlay);
-       void (*page_flip)(void *ctx, struct exynos_drm_overlay *overlay);
        void (*commit)(void *ctx);
        void (*apply)(void *ctx);
        void (*win_commit)(void *ctx, int zpos);
index 236cdba..46bed28 100644 (file)
@@ -509,13 +509,3 @@ void exynos_drm_encoder_crtc_disable(struct drm_encoder *encoder, void *data)
                display->controller_ops->win_disable(display->controller_ctx,
                                zpos);
 }
-
-void exynos_drm_encoder_crtc_page_flip(struct drm_encoder *encoder, void *data)
-{
-       struct exynos_drm_display *display = exynos_drm_get_display(encoder);
-       struct exynos_drm_overlay *overlay = data;
-
-       if (display->controller_ops->page_flip)
-               display->controller_ops->page_flip(display->controller_ctx,
-                               overlay);
-}
index af9b762..8a9f0fa 100644 (file)
@@ -46,7 +46,6 @@ void exynos_drm_encoder_dpms_from_crtc(struct drm_encoder *encoder,
                                        void *data);
 void exynos_drm_encoder_crtc_dpms(struct drm_encoder *encoder, void *data);
 void exynos_drm_encoder_crtc_mode_set(struct drm_encoder *encoder, void *data);
-void exynos_drm_encoder_crtc_page_flip(struct drm_encoder *encoder, void *data);
 void exynos_drm_encoder_crtc_disable(struct drm_encoder *encoder, void *data);
 
 #endif
index 76a77e4..75a002c 100644 (file)
@@ -434,28 +434,6 @@ static void mie_set_6bit_dithering(struct fimd_context *ctx)
        }
 }
 
-static void fimd_win_page_flip(void *ctx, struct exynos_drm_overlay *overlay)
-{
-       struct fimd_context *fimd_ctx = ctx;
-       int win = overlay->zpos;
-       struct fimd_win_data *win_data;
-       unsigned long offset;
-
-       if (win == DEFAULT_ZPOS)
-               win = fimd_ctx->default_win;
-
-       if (win < 0 || win > WINDOWS_NR)
-               return;
-
-       win_data = &fimd_ctx->win_data[win];
-
-       offset = overlay->fb_x * (overlay->bpp >> 3);
-       offset += overlay->fb_y * overlay->fb_pitch;
-
-       win_data->dma_addr = overlay->dma_addr[0] + offset;
-       win_data->vaddr = overlay->vaddr[0] + offset;
-}
-
 static void fimd_win_commit(void *ctx, int zpos)
 {
        struct fimd_context *fimd_ctx = ctx;
@@ -676,7 +654,6 @@ static struct exynos_controller_ops fimd_controller_ops = {
        .disable_vblank = fimd_disable_vblank,
        .power = fimd_power,
        .mode_set = fimd_win_mode_set,
-       .page_flip = fimd_win_page_flip,
        .commit = fimd_commit,
        .apply = fimd_apply,
        .win_commit = fimd_win_commit,
index acfe3b4..0f0f412 100644 (file)
@@ -821,28 +821,6 @@ static void mixer_win_mode_set(void *ctx,
        win_data->scan_flags = overlay->scan_flag;
 }
 
-static void mixer_win_page_flip(void *ctx, struct exynos_drm_overlay *overlay)
-{
-       struct mixer_context *mixer_ctx = ctx;
-       struct hdmi_win_data *win_data;
-       int win = overlay->zpos;
-
-       if (win == DEFAULT_ZPOS)
-               win = MIXER_DEFAULT_WIN;
-
-       if (win < 0 || win > MIXER_WIN_NR) {
-               DRM_ERROR("overlay plane[%d] is wrong\n", win);
-               return;
-       }
-
-       win_data = &mixer_ctx->win_data[win];
-
-       win_data->dma_addr = overlay->dma_addr[0];
-       win_data->vaddr = overlay->vaddr[0];
-       win_data->chroma_dma_addr = overlay->dma_addr[1];
-       win_data->chroma_vaddr = overlay->vaddr[1];
-}
-
 static void mixer_win_commit(void *ctx, int zpos)
 {
        struct mixer_context *mctx = ctx;
@@ -1122,7 +1100,6 @@ static struct exynos_controller_ops mixer_ops = {
 
        /* overlay */
        .mode_set               = mixer_win_mode_set,
-       .page_flip              = mixer_win_page_flip,
        .apply                  = mixer_apply,
        .win_commit             = mixer_win_commit,
        .win_disable            = mixer_win_disable,