Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 307181
b: refs/heads/master
c: 83d4092
h: refs/heads/master
i:
  307179: c230151
v: v3
  • Loading branch information
Chris Wilson authored and Daniel Vetter committed Apr 18, 2012
1 parent d3c7017 commit cfb5526
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a1e969e0332de7a430e62822cee8f2ec8d83cd7c
refs/heads/master: 83d4092b0381e5dd6f312b2ec57121dcf0fcbade
50 changes: 35 additions & 15 deletions trunk/drivers/gpu/drm/i915/intel_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -7658,14 +7658,14 @@ static int intel_gen2_queue_flip(struct drm_device *dev,

ret = intel_pin_and_fence_fb_obj(dev, obj, LP_RING(dev_priv));
if (ret)
goto out;
goto err;

/* Offset into the new buffer for cases of shared fbs between CRTCs */
offset = crtc->y * fb->pitches[0] + crtc->x * fb->bits_per_pixel/8;

ret = BEGIN_LP_RING(6);
if (ret)
goto out;
goto err_unpin;

/* Can't queue multiple flips, so wait for the previous
* one to finish before executing the next.
Expand All @@ -7682,7 +7682,11 @@ static int intel_gen2_queue_flip(struct drm_device *dev,
OUT_RING(obj->gtt_offset + offset);
OUT_RING(0); /* aux display base address, unused */
ADVANCE_LP_RING();
out:
return 0;

err_unpin:
intel_unpin_fb_obj(obj);
err:
return ret;
}

Expand All @@ -7699,14 +7703,14 @@ static int intel_gen3_queue_flip(struct drm_device *dev,

ret = intel_pin_and_fence_fb_obj(dev, obj, LP_RING(dev_priv));
if (ret)
goto out;
goto err;

/* Offset into the new buffer for cases of shared fbs between CRTCs */
offset = crtc->y * fb->pitches[0] + crtc->x * fb->bits_per_pixel/8;

ret = BEGIN_LP_RING(6);
if (ret)
goto out;
goto err_unpin;

if (intel_crtc->plane)
flip_mask = MI_WAIT_FOR_PLANE_B_FLIP;
Expand All @@ -7721,7 +7725,11 @@ static int intel_gen3_queue_flip(struct drm_device *dev,
OUT_RING(MI_NOOP);

ADVANCE_LP_RING();
out:
return 0;

err_unpin:
intel_unpin_fb_obj(obj);
err:
return ret;
}

Expand All @@ -7737,11 +7745,11 @@ static int intel_gen4_queue_flip(struct drm_device *dev,

ret = intel_pin_and_fence_fb_obj(dev, obj, LP_RING(dev_priv));
if (ret)
goto out;
goto err;

ret = BEGIN_LP_RING(4);
if (ret)
goto out;
goto err_unpin;

/* i965+ uses the linear or tiled offsets from the
* Display Registers (which do not change across a page-flip)
Expand All @@ -7760,7 +7768,11 @@ static int intel_gen4_queue_flip(struct drm_device *dev,
pipesrc = I915_READ(PIPESRC(intel_crtc->pipe)) & 0x0fff0fff;
OUT_RING(pf | pipesrc);
ADVANCE_LP_RING();
out:
return 0;

err_unpin:
intel_unpin_fb_obj(obj);
err:
return ret;
}

Expand All @@ -7776,11 +7788,11 @@ static int intel_gen6_queue_flip(struct drm_device *dev,

ret = intel_pin_and_fence_fb_obj(dev, obj, LP_RING(dev_priv));
if (ret)
goto out;
goto err;

ret = BEGIN_LP_RING(4);
if (ret)
goto out;
goto err_unpin;

OUT_RING(MI_DISPLAY_FLIP |
MI_DISPLAY_FLIP_PLANE(intel_crtc->plane));
Expand All @@ -7791,7 +7803,11 @@ static int intel_gen6_queue_flip(struct drm_device *dev,
pipesrc = I915_READ(PIPESRC(intel_crtc->pipe)) & 0x0fff0fff;
OUT_RING(pf | pipesrc);
ADVANCE_LP_RING();
out:
return 0;

err_unpin:
intel_unpin_fb_obj(obj);
err:
return ret;
}

Expand All @@ -7813,18 +7829,22 @@ static int intel_gen7_queue_flip(struct drm_device *dev,

ret = intel_pin_and_fence_fb_obj(dev, obj, ring);
if (ret)
goto out;
goto err;

ret = intel_ring_begin(ring, 4);
if (ret)
goto out;
goto err_unpin;

intel_ring_emit(ring, MI_DISPLAY_FLIP_I915 | (intel_crtc->plane << 19));
intel_ring_emit(ring, (fb->pitches[0] | obj->tiling_mode));
intel_ring_emit(ring, (obj->gtt_offset));
intel_ring_emit(ring, (MI_NOOP));
intel_ring_advance(ring);
out:
return 0;

err_unpin:
intel_unpin_fb_obj(obj);
err:
return ret;
}

Expand Down

0 comments on commit cfb5526

Please sign in to comment.