diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2013-04-17 21:34:59 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2013-04-17 21:34:59 +0000 |
commit | 71f71adbe039167999dee8f9be61b498a8cb33bc (patch) | |
tree | 09404dcb21d66254cee7def074cac4fb9827d989 /sys/dev | |
parent | 59241162a9c7cf86cd3ba74f87f2eee371ffe07d (diff) |
Also accelerate scrolling backwards.
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/pci/drm/i915/i915_drv.c | 38 |
1 files changed, 27 insertions, 11 deletions
diff --git a/sys/dev/pci/drm/i915/i915_drv.c b/sys/dev/pci/drm/i915/i915_drv.c index c0b269d4e17..1e5e70a7319 100644 --- a/sys/dev/pci/drm/i915/i915_drv.c +++ b/sys/dev/pci/drm/i915/i915_drv.c @@ -1,4 +1,4 @@ -/* $OpenBSD: i915_drv.c,v 1.19 2013/04/17 20:04:04 kettenis Exp $ */ +/* $OpenBSD: i915_drv.c,v 1.20 2013/04/17 21:34:58 kettenis Exp $ */ /* * Copyright (c) 2008-2009 Owain G. Ainsworth <oga@openbsd.org> * @@ -759,22 +759,38 @@ inteldrm_copyrows(void *cookie, int src, int dst, int num) struct rasops_info *ri = cookie; struct inteldrm_softc *sc = ri->ri_hw; - if (dst == 0 && (src + num) == ri->ri_rows) { + if ((dst == 0 && (src + num) == ri->ri_rows) || + (src == 0 && (dst + num) == ri->ri_rows)) { struct inteldrm_softc *dev_priv = sc; struct drm_fb_helper *helper = &dev_priv->fbdev->helper; size_t size = dev_priv->fbdev->ifb.obj->base.size / 2; - int delta = src * ri->ri_font->fontheight * ri->ri_stride; int i; - bzero(ri->ri_bits, delta); + if (dst == 0) { + int delta = src * ri->ri_font->fontheight * ri->ri_stride; + bzero(ri->ri_bits, delta); + + sc->sc_offset += delta; + ri->ri_bits += delta; + ri->ri_origbits += delta; + if (sc->sc_offset > size) { + sc->sc_offset -= size; + ri->ri_bits -= size; + ri->ri_origbits -= size; + } + } else { + int delta = dst * ri->ri_font->fontheight * ri->ri_stride; + + sc->sc_offset -= delta; + ri->ri_bits -= delta; + ri->ri_origbits -= delta; + if (sc->sc_offset < 0) { + sc->sc_offset += size; + ri->ri_bits += size; + ri->ri_origbits += size; + } - sc->sc_offset += delta; - ri->ri_bits += delta; - ri->ri_origbits += delta; - if (sc->sc_offset > size) { - sc->sc_offset -= size; - ri->ri_bits -= size; - ri->ri_origbits -= size; + bzero(ri->ri_bits, delta); } for (i = 0; i < helper->crtc_count; i++) { |