Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/riastradh-drm2]: src/sys/external/bsd/drm2/dist/drm/i915 Half-arsed conv...



details:   https://anonhg.NetBSD.org/src/rev/2144da0c2d2e
branches:  riastradh-drm2
changeset: 788404:2144da0c2d2e
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Wed Jul 24 03:39:05 2013 +0000

description:
Half-arsed conversion of i915 pending flip queue to drm_waitqueues.

diffstat:

 sys/external/bsd/drm2/dist/drm/i915/i915_drv.h      |   6 ++++++
 sys/external/bsd/drm2/dist/drm/i915/intel_display.c |  21 +++++++++++++++++++++
 2 files changed, 27 insertions(+), 0 deletions(-)

diffs (64 lines):

diff -r c62353703c50 -r 2144da0c2d2e sys/external/bsd/drm2/dist/drm/i915/i915_drv.h
--- a/sys/external/bsd/drm2/dist/drm/i915/i915_drv.h    Wed Jul 24 03:38:48 2013 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/i915_drv.h    Wed Jul 24 03:39:05 2013 +0000
@@ -890,7 +890,13 @@
 
        struct drm_crtc *plane_to_crtc_mapping[3];
        struct drm_crtc *pipe_to_crtc_mapping[3];
+#ifdef __NetBSD__
+       /* XXX The locking scheme looks broken.  This mutex is a stop-gap.  */
+       struct mutex pending_flip_lock;
+       drm_waitqueue_t pending_flip_queue;
+#else
        wait_queue_head_t pending_flip_queue;
+#endif
 
        struct intel_pch_pll pch_plls[I915_NUM_PLLS];
        struct intel_ddi_plls ddi_plls;
diff -r c62353703c50 -r 2144da0c2d2e sys/external/bsd/drm2/dist/drm/i915/intel_display.c
--- a/sys/external/bsd/drm2/dist/drm/i915/intel_display.c       Wed Jul 24 03:38:48 2013 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/intel_display.c       Wed Jul 24 03:39:05 2013 +0000
@@ -2960,12 +2960,25 @@
 {
        struct drm_device *dev = crtc->dev;
        struct drm_i915_private *dev_priv = dev->dev_private;
+#ifdef __NetBSD__              /* XXX DRM_WAIT_UNINTERRUPTIBLE_UNTIL */
+       int error = 0;
+#endif
 
        if (crtc->fb == NULL)
                return;
 
+#ifdef __NetBSD__              /* XXX DRM_WAIT_UNINTERRUPTIBLE_UNTIL */
+       mutex_lock(&dev_priv->pending_flip_lock);
+       do {
+               DRM_WAIT_UNTIL(error, &dev_priv->pending_flip_queue,
+                   &dev_priv->pending_flip_lock,
+                   !intel_crtc_has_pending_flip(crtc));
+       } while (error);
+       mutex_unlock(&dev_priv->pending_flip_lock);
+#else
        wait_event(dev_priv->pending_flip_queue,
                   !intel_crtc_has_pending_flip(crtc));
+#endif
 
        mutex_lock(&dev->struct_mutex);
        intel_finish_fb(crtc->fb);
@@ -7149,9 +7162,17 @@
 
        obj = work->old_fb_obj;
 
+#ifdef __NetBSD__              /* XXX */
+       atomic_clear_mask(1 << intel_crtc->plane, &obj->pending_flip);
+       mutex_lock(&dev_priv->pending_flip_lock);
+       DRM_WAKEUP_ONE(&dev_priv->pending_flip_queue,
+           &dev_priv->pending_flip_lock);
+       mutex_unlock(&dev_priv->pending_flip_lock);
+#else
        atomic_clear_mask(1 << intel_crtc->plane,
                          &obj->pending_flip.counter);
        wake_up(&dev_priv->pending_flip_queue);
+#endif
 
        queue_work(dev_priv->wq, &work->work);
 



Home | Main Index | Thread Index | Old Index