Merge branch 'drm-intel-fixes' into drm-intel-next
authorChris Wilson <chris@chris-wilson.co.uk>
Tue, 7 Dec 2010 23:00:20 +0000 (23:00 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Tue, 7 Dec 2010 23:02:08 +0000 (23:02 +0000)
Conflicts:
drivers/gpu/drm/i915/i915_gem.c
drivers/gpu/drm/i915/intel_dp.c

1  2 
drivers/gpu/drm/i915/i915_gem.c
drivers/gpu/drm/i915/intel_dp.c
drivers/gpu/drm/i915/intel_lvds.c
drivers/gpu/drm/i915/intel_ringbuffer.c

index b57ce033e42a1caaa4852d0d4b74b8d667e9a61f,275ec6ed43ae7dcc4f396322909296e00305c617..27fa2a1b26a56dfc5066248c74c257ad9672804d
@@@ -3356,9 -4374,20 +3356,24 @@@ i915_gem_busy_ioctl(struct drm_device *
                 * use this buffer rather sooner than later, so issuing the required
                 * flush earlier is beneficial.
                 */
-               if (obj->base.write_domain & I915_GEM_GPU_DOMAINS)
 -              if (obj->write_domain & I915_GEM_GPU_DOMAINS) {
 -                      i915_gem_flush_ring(dev, file_priv,
 -                                          obj_priv->ring,
 -                                          0, obj->write_domain);
 -              } else if (obj_priv->ring->outstanding_lazy_request) {
++              if (obj->base.write_domain & I915_GEM_GPU_DOMAINS) {
 +                      i915_gem_flush_ring(dev, obj->ring,
 +                                          0, obj->base.write_domain);
++              } else if (obj->ring->outstanding_lazy_request ==
++                         obj->last_rendering_seqno) {
++                      struct drm_i915_gem_request *request;
++
+                       /* This ring is not being cleared by active usage,
+                        * so emit a request to do so.
+                        */
 -                      u32 seqno = i915_add_request(dev,
 -                                                   NULL, NULL,
 -                                                   obj_priv->ring);
 -                      if (seqno == 0)
++                      request = kzalloc(sizeof(*request), GFP_KERNEL);
++                      if (request)
++                              ret = i915_add_request(dev,
++                                                     NULL, request,
++                                                     obj->ring);
++                      else
+                               ret = -ENOMEM;
+               }
  
                /* Update the active list for the hardware's current position.
                 * Otherwise this only updates on a delayed timer or when irqs
Simple merge
Simple merge