From owner-svn-src-user@FreeBSD.ORG Wed Oct 23 19:45:15 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 42B7FD65; Wed, 23 Oct 2013 19:45:15 +0000 (UTC) (envelope-from ray@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 304FD2B3A; Wed, 23 Oct 2013 19:45:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9NJjFYY018903; Wed, 23 Oct 2013 19:45:15 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9NJjEhb018900; Wed, 23 Oct 2013 19:45:14 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201310231945.r9NJjEhb018900@svn.freebsd.org> From: Aleksandr Rybalko Date: Wed, 23 Oct 2013 19:45:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r257013 - in user/ed/newcons/sys: dev/fb dev/vt/hw/fb sys X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Oct 2013 19:45:15 -0000 Author: ray Date: Wed Oct 23 19:45:14 2013 New Revision: 257013 URL: http://svnweb.freebsd.org/changeset/base/257013 Log: Use copy method which maybe defined by framebuffer provider, but not just memmove. Sponsored by: The FreeBSD Foundation Modified: user/ed/newcons/sys/dev/fb/fbd.c user/ed/newcons/sys/dev/vt/hw/fb/vt_fb.c user/ed/newcons/sys/sys/fbio.h Modified: user/ed/newcons/sys/dev/fb/fbd.c ============================================================================== --- user/ed/newcons/sys/dev/fb/fbd.c Wed Oct 23 19:13:39 2013 (r257012) +++ user/ed/newcons/sys/dev/fb/fbd.c Wed Oct 23 19:45:14 2013 (r257013) @@ -154,6 +154,15 @@ vt_fb_mem_wr4(struct fb_info *sc, uint32 } static void +vt_fb_mem_copy(struct fb_info *sc, uint32_t offset_to, uint32_t offset_from, + uint32_t size) +{ + + memmove((void *)(sc->fb_vbase + offset_to), (void *)(sc->fb_vbase + + offset_from), size); +} + +static void vt_fb_indir_wr1(struct fb_info *sc, uint32_t o, uint8_t v) { @@ -177,6 +186,14 @@ vt_fb_indir_wr4(struct fb_info *sc, uint sc->fb_write(sc->fb_priv, o, &v, 4); } +static void +vt_fb_indir_copy(struct fb_info *sc, uint32_t offset_to, uint32_t offset_from, + uint32_t size) +{ + + sc->copy(sc->fb_priv, offset_to, offset_from, size); +} + static int fb_probe(struct fb_info *info) { @@ -192,12 +209,14 @@ fb_probe(struct fb_info *info) info->wr1 = &vt_fb_indir_wr1; info->wr2 = &vt_fb_indir_wr2; info->wr4 = &vt_fb_indir_wr4; + info->copy = &vt_fb_indir_copy; } else if (info->fb_vbase != 0) { if (info->fb_pbase == 0) info->fb_flags |= FB_FLAG_NOMMAP; info->wr1 = &vt_fb_mem_wr1; info->wr2 = &vt_fb_mem_wr2; info->wr4 = &vt_fb_mem_wr4; + info->copy = &vt_fb_mem_copy; } else return (ENXIO); Modified: user/ed/newcons/sys/dev/vt/hw/fb/vt_fb.c ============================================================================== --- user/ed/newcons/sys/dev/vt/hw/fb/vt_fb.c Wed Oct 23 19:13:39 2013 (r257012) +++ user/ed/newcons/sys/dev/vt/hw/fb/vt_fb.c Wed Oct 23 19:45:14 2013 (r257013) @@ -90,9 +90,8 @@ vt_fb_blank(struct vt_device *vd, term_c } /* Copy line0 to all other lines. */ /* XXX will copy with borders. */ - for (o = 1; o < info->fb_height; o++) { - memmove((void *)(info->fb_vbase + o * info->fb_stride), - (void *)info->fb_vbase, info->fb_stride); + for (o = info->fb_stride; o < info->fb_size; o += info->fb_stride) { + info->copy(info, o, 0, info->fb_stride); } } Modified: user/ed/newcons/sys/sys/fbio.h ============================================================================== --- user/ed/newcons/sys/sys/fbio.h Wed Oct 23 19:13:39 2013 (r257012) +++ user/ed/newcons/sys/sys/fbio.h Wed Oct 23 19:45:14 2013 (r257013) @@ -119,6 +119,8 @@ typedef int fb_write_t(void *priv, int o typedef int fb_read_t(void *priv, int offset, void *data, int size); /* XXX: should use priv instead of fb_info too. */ +typedef void fb_copy_t(struct fb_info *sc, uint32_t offset_to, uint32_t offset_from, + uint32_t size); typedef void fb_wr1_t(struct fb_info *sc, uint32_t offset, uint8_t value); typedef void fb_wr2_t(struct fb_info *sc, uint32_t offset, uint16_t value); typedef void fb_wr4_t(struct fb_info *sc, uint32_t offset, uint32_t value); @@ -139,6 +141,7 @@ struct fb_info { fb_wr1_t *wr1; fb_wr2_t *wr2; fb_wr4_t *wr4; + fb_copy_t *copy; fb_enter_t *enter; fb_leave_t *leave;