svn commit: r257013 - in user/ed/newcons/sys: dev/fb dev/vt/hw/fb sys
Aleksandr Rybalko
ray at FreeBSD.org
Wed Oct 23 19:45:15 UTC 2013
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;
More information about the svn-src-user
mailing list