i915: fix vbl swap for multi-master

patch from F9 tree
main
Dave Airlie 2008-05-08 16:14:33 +10:00
parent 442e124123
commit 2a78ad2264
1 changed files with 22 additions and 15 deletions

View File

@ -198,9 +198,6 @@ static void i915_vblank_tasklet(struct drm_device *dev)
if ((counter[pipe] - vbl_swap->sequence) > (1<<23)) if ((counter[pipe] - vbl_swap->sequence) > (1<<23))
continue; continue;
master_priv = vbl_swap->minor->master->driver_priv;
sarea_priv = master_priv->sarea_priv;
list_del(list); list_del(list);
dev_priv->swaps_pending--; dev_priv->swaps_pending--;
drm_vblank_put(dev, pipe); drm_vblank_put(dev, pipe);
@ -249,16 +246,6 @@ static void i915_vblank_tasklet(struct drm_device *dev)
i915_kernel_lost_context(dev); i915_kernel_lost_context(dev);
upper[0] = upper[1] = 0;
slice[0] = max(sarea_priv->planeA_h / nhits, 1);
slice[1] = max(sarea_priv->planeB_h / nhits, 1);
lower[0] = sarea_priv->planeA_y + slice[0];
lower[1] = sarea_priv->planeB_y + slice[0];
offsets[0] = sarea_priv->front_offset;
offsets[1] = sarea_priv->back_offset;
offsets[2] = sarea_priv->third_offset;
num_pages = sarea_priv->third_handle ? 3 : 2;
DRM_SPINLOCK(&dev->drw_lock); DRM_SPINLOCK(&dev->drw_lock);
@ -272,8 +259,6 @@ static void i915_vblank_tasklet(struct drm_device *dev)
upper[1] = lower[1], lower[1] += slice[1]) { upper[1] = lower[1], lower[1] += slice[1]) {
int init_drawrect = 1; int init_drawrect = 1;
if (i == nhits)
lower[0] = lower[1] = sarea_priv->height;
list_for_each(hit, &hits) { list_for_each(hit, &hits) {
struct drm_i915_vbl_swap *swap_hit = struct drm_i915_vbl_swap *swap_hit =
@ -282,6 +267,24 @@ static void i915_vblank_tasklet(struct drm_device *dev)
int num_rects, plane, front, back; int num_rects, plane, front, back;
unsigned short top, bottom; unsigned short top, bottom;
sarea_priv = master_priv->sarea_priv;
upper[0] = upper[1] = 0;
slice[0] = max(sarea_priv->planeA_h / nhits, 1);
slice[1] = max(sarea_priv->planeB_h / nhits, 1);
lower[0] = sarea_priv->planeA_y + slice[0];
lower[1] = sarea_priv->planeB_y + slice[0];
offsets[0] = sarea_priv->front_offset;
offsets[1] = sarea_priv->back_offset;
offsets[2] = sarea_priv->third_offset;
num_pages = sarea_priv->third_handle ? 3 : 2;
if (i == nhits)
lower[0] = lower[1] = sarea_priv->height;
pitchropcpp = (sarea_priv->pitch * cpp) | (0xcc << 16) |
(cpp << 23) | (1 << 24);
drw = drm_get_drawable_info(dev, swap_hit->drw_id); drw = drm_get_drawable_info(dev, swap_hit->drw_id);
if (!drw) if (!drw)
@ -294,6 +297,8 @@ static void i915_vblank_tasklet(struct drm_device *dev)
continue; continue;
} }
master_priv = swap_hit->minor->master->driver_priv;
if (init_drawrect) { if (init_drawrect) {
int width = sarea_priv->width; int width = sarea_priv->width;
int height = sarea_priv->height; int height = sarea_priv->height;
@ -332,6 +337,8 @@ static void i915_vblank_tasklet(struct drm_device *dev)
(2 * plane)) & 0x3; (2 * plane)) & 0x3;
back = (front + 1) % num_pages; back = (front + 1) % num_pages;
for (num_rects = drw->num_rects; num_rects--; rect++) { for (num_rects = drw->num_rects; num_rects--; rect++) {
int y1 = max(rect->y1, top); int y1 = max(rect->y1, top);
int y2 = min(rect->y2, bottom); int y2 = min(rect->y2, bottom);