From 7ea3da0e50669753497cc90cef8b4e56a676b2ae Mon Sep 17 00:00:00 2001 From: Mark Kettenis Date: Tue, 30 Apr 2013 19:56:47 +0000 Subject: Clear the right pixels when scrolling backwards. Fixes issue reported by tedu@ --- sys/dev/pci/drm/i915/i915_drv.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'sys/dev/pci') diff --git a/sys/dev/pci/drm/i915/i915_drv.c b/sys/dev/pci/drm/i915/i915_drv.c index 592d7077280..2b522e651d5 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.22 2013/04/21 14:41:26 kettenis Exp $ */ +/* $OpenBSD: i915_drv.c,v 1.23 2013/04/30 19:56:46 kettenis Exp $ */ /* * Copyright (c) 2008-2009 Owain G. Ainsworth * @@ -764,10 +764,11 @@ inteldrm_copyrows(void *cookie, int src, int dst, int num) 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 stride = ri->ri_font->fontheight * ri->ri_stride; int i; if (dst == 0) { - int delta = src * ri->ri_font->fontheight * ri->ri_stride; + int delta = src * stride; bzero(ri->ri_bits, delta); sc->sc_offset += delta; @@ -779,7 +780,8 @@ inteldrm_copyrows(void *cookie, int src, int dst, int num) ri->ri_origbits -= size; } } else { - int delta = dst * ri->ri_font->fontheight * ri->ri_stride; + int delta = dst * stride; + bzero(ri->ri_bits + num * stride, delta); sc->sc_offset -= delta; ri->ri_bits -= delta; @@ -789,8 +791,6 @@ inteldrm_copyrows(void *cookie, int src, int dst, int num) ri->ri_bits += size; ri->ri_origbits += size; } - - bzero(ri->ri_bits, delta); } for (i = 0; i < helper->crtc_count; i++) { -- cgit v1.2.3