drm/atomic-helper: Massage swap_state signature somewhat
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 9 Jun 2016 22:06:32 +0000 (00:06 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 10 Jun 2016 14:52:12 +0000 (16:52 +0200)
- dev is redundant, we have state->atomic
- add stall parameter, which must be set when swapping needs to stall
  for preceeding commits to stop looking at ->state pointers. Currently
  all drivers need this to be, just prep work for a glorious future.

v2: Rebased on top of

commit e7cf0963f816fa44190caaf51aeffaa614c340c6
Author: Gerd Hoffmann <kraxel@redhat.com>
Date:   Tue May 31 08:50:47 2016 +0200

    virtio-gpu: add atomic_commit function

Cc: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1465509992-19284-1-git-send-email-daniel.vetter@ffwll.ch
Link: http://patchwork.freedesktop.org/patch/msgid/1465388359-8070-2-git-send-email-daniel.vetter@ffwll.ch
14 files changed:
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c
drivers/gpu/drm/drm_atomic_helper.c
drivers/gpu/drm/exynos/exynos_drm_drv.c
drivers/gpu/drm/i915/intel_display.c
drivers/gpu/drm/mediatek/mtk_drm_drv.c
drivers/gpu/drm/msm/msm_atomic.c
drivers/gpu/drm/omapdrm/omap_drv.c
drivers/gpu/drm/rcar-du/rcar_du_kms.c
drivers/gpu/drm/rockchip/rockchip_drm_fb.c
drivers/gpu/drm/sti/sti_drv.c
drivers/gpu/drm/tegra/drm.c
drivers/gpu/drm/vc4/vc4_kms.c
drivers/gpu/drm/virtio/virtgpu_display.c
include/drm/drm_atomic_helper.h

index 6485fa5bee8b4b33a29c313fcb810237c1aca6bd..9ecf16c7911d9d6a33f4bb326f6af83c504221a3 100644 (file)
@@ -519,7 +519,7 @@ static int atmel_hlcdc_dc_atomic_commit(struct drm_device *dev,
        }
 
        /* Swap the state, this is the point of no return. */
-       drm_atomic_helper_swap_state(dev, state);
+       drm_atomic_helper_swap_state(state, true);
 
        if (async)
                queue_work(dc->wq, &commit->work);
index 4b2c1d27e74b308f02765cd320e2511837b858f7..aa2cad9227914fcde2d9c198fe790b67ccd8c4b2 100644 (file)
@@ -1167,7 +1167,7 @@ int drm_atomic_helper_commit(struct drm_device *dev,
         * the software side now.
         */
 
-       drm_atomic_helper_swap_state(dev, state);
+       drm_atomic_helper_swap_state(state, true);
 
        /*
         * Everything below can be run asynchronously without the need to grab
@@ -1538,8 +1538,8 @@ EXPORT_SYMBOL(drm_atomic_helper_cleanup_planes);
 
 /**
  * drm_atomic_helper_swap_state - store atomic state into current sw state
- * @dev: DRM device
  * @state: atomic state
+ * @stall: stall for proceeding commits
  *
  * This function stores the atomic state into the current state pointers in all
  * driver objects. It should be called after all failing steps have been done
@@ -1561,8 +1561,8 @@ EXPORT_SYMBOL(drm_atomic_helper_cleanup_planes);
  * 5. Call drm_atomic_helper_cleanup_planes() with @state, which since step 3
  * contains the old state. Also do any other cleanup required with that state.
  */
-void drm_atomic_helper_swap_state(struct drm_device *dev,
-                                 struct drm_atomic_state *state)
+void drm_atomic_helper_swap_state(struct drm_atomic_state *state,
+                                 bool stall)
 {
        int i;
        struct drm_connector *connector;
index 843b21c540b3fcdc6d24bdc07be55b9c7d16a735..4a679fb9bb02126db687c89f902150b816b05916 100644 (file)
@@ -299,7 +299,7 @@ int exynos_atomic_commit(struct drm_device *dev, struct drm_atomic_state *state,
        priv->pending |= commit->crtcs;
        spin_unlock(&priv->lock);
 
-       drm_atomic_helper_swap_state(dev, state);
+       drm_atomic_helper_swap_state(state, true);
 
        if (nonblock)
                schedule_work(&commit->work);
index 60cba1956c0d3d5e3bed9c83ebc7fddabf0c6994..a59cc0e2e5caf2d547645df3bccbdc4979819801 100644 (file)
@@ -13726,7 +13726,7 @@ static int intel_atomic_commit(struct drm_device *dev,
                return ret;
        }
 
-       drm_atomic_helper_swap_state(dev, state);
+       drm_atomic_helper_swap_state(state, true);
        dev_priv->wm.distrust_bios_wm = false;
        dev_priv->wm.skl_results = intel_state->wm_results;
        intel_shared_dpll_commit(state);
index 06a417b2f91e0fb7a89489350a04517a5e73f486..c33bf98c5d5e212cdada03cd0d3c95ef3fefc70d 100644 (file)
@@ -91,7 +91,7 @@ static int mtk_atomic_commit(struct drm_device *drm,
        mutex_lock(&private->commit.lock);
        flush_work(&private->commit.work);
 
-       drm_atomic_helper_swap_state(drm, state);
+       drm_atomic_helper_swap_state(state, true);
 
        if (async)
                mtk_atomic_schedule(private, state);
index 8c3b463620bdb9adc2053bce08af0cd67bb7ad60..4a8a6f1f1151a7a824ce0da479e8cd3cb956e9a6 100644 (file)
@@ -238,7 +238,7 @@ int msm_atomic_commit(struct drm_device *dev,
         * the software side now.
         */
 
-       drm_atomic_helper_swap_state(dev, state);
+       drm_atomic_helper_swap_state(state, true);
 
        /*
         * Everything below can be run asynchronously without the need to grab
index 3b702230a88c3514acff58728ec88d87d97d57b9..6b97011154bf1a7cfb44798f3549f0d8871e2c9a 100644 (file)
@@ -174,7 +174,7 @@ static int omap_atomic_commit(struct drm_device *dev,
        spin_unlock(&priv->commit.lock);
 
        /* Swap the state, this is the point of no return. */
-       drm_atomic_helper_swap_state(dev, state);
+       drm_atomic_helper_swap_state(state, true);
 
        if (nonblock)
                schedule_work(&commit->work);
index 86c109b16876bca474f2867a33b43aaa3a205df8..6bb032d8ac6bbd28dcce4df4c4f56374678ebab7 100644 (file)
@@ -327,7 +327,7 @@ static int rcar_du_atomic_commit(struct drm_device *dev,
        }
 
        /* Swap the state, this is the point of no return. */
-       drm_atomic_helper_swap_state(dev, state);
+       drm_atomic_helper_swap_state(state, true);
 
        if (nonblock)
                schedule_work(&commit->work);
index 755cfdba61cd21f0f5b7f93743f1bb843c1cbf5f..3348c0878d4bbde4540b396428ed9013a6b4e57f 100644 (file)
@@ -289,7 +289,7 @@ int rockchip_drm_atomic_commit(struct drm_device *dev,
        mutex_lock(&commit->lock);
        flush_work(&commit->work);
 
-       drm_atomic_helper_swap_state(dev, state);
+       drm_atomic_helper_swap_state(state, true);
 
        commit->dev = dev;
        commit->state = state;
index b440617a7019c676006a73d426feadb2ed9f8f87..dd2c400c4a46e2943f1ec0d49c41fae2ed2c8a34 100644 (file)
@@ -215,7 +215,7 @@ static int sti_atomic_commit(struct drm_device *drm,
         * the software side now.
         */
 
-       drm_atomic_helper_swap_state(drm, state);
+       drm_atomic_helper_swap_state(state, true);
 
        if (nonblock)
                sti_atomic_schedule(private, state);
index b59c3bf0df4443420a236f032d8af0c6345482d6..a177a42a98491a8baee7894852686f29e6c2fdd7 100644 (file)
@@ -93,7 +93,7 @@ static int tegra_atomic_commit(struct drm_device *drm,
         * the software side now.
         */
 
-       drm_atomic_helper_swap_state(drm, state);
+       drm_atomic_helper_swap_state(state, true);
 
        if (nonblock)
                tegra_atomic_schedule(tegra, state);
index 39c0b2048bfd92cd0ef16d6d8ec91713a9fdc6ea..8f4d5ffc32bef716e99283b748fd52daf454a3f2 100644 (file)
@@ -148,7 +148,7 @@ static int vc4_atomic_commit(struct drm_device *dev,
         * the software side now.
         */
 
-       drm_atomic_helper_swap_state(dev, state);
+       drm_atomic_helper_swap_state(state, true);
 
        /*
         * Everything below can be run asynchronously without the need to grab
index d82ae1cddfcf7a0251e29ed96fa9e9931612c83e..3d0fa049b34cd1c415add58456ef125aa6c58c68 100644 (file)
@@ -395,7 +395,7 @@ static int vgdev_atomic_commit(struct drm_device *dev,
        if (nonblock)
                return -EBUSY;
 
-       drm_atomic_helper_swap_state(dev, state);
+       drm_atomic_helper_swap_state(state, true);
        drm_atomic_helper_wait_for_fences(dev, state);
 
        drm_atomic_helper_commit_modeset_disables(dev, state);
index 1877a7c18d8e715b7a44be82c3d5e01e31366035..51c57eaa2c8fb769d32350c3a214566238b19145 100644 (file)
@@ -71,8 +71,8 @@ void drm_atomic_helper_commit_planes_on_crtc(struct drm_crtc_state *old_crtc_sta
 void drm_atomic_helper_disable_planes_on_crtc(struct drm_crtc *crtc,
                                              bool atomic);
 
-void drm_atomic_helper_swap_state(struct drm_device *dev,
-                                 struct drm_atomic_state *state);
+void drm_atomic_helper_swap_state(struct drm_atomic_state *state,
+                                 bool stall);
 
 /* implementations for legacy interfaces */
 int drm_atomic_helper_update_plane(struct drm_plane *plane,