summaryrefslogtreecommitdiffstats
path: root/sys/dev/fb/creator_vt.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/fb/creator_vt.c')
-rw-r--r--sys/dev/fb/creator_vt.c30
1 files changed, 13 insertions, 17 deletions
diff --git a/sys/dev/fb/creator_vt.c b/sys/dev/fb/creator_vt.c
index 18a42b9..f811f30 100644
--- a/sys/dev/fb/creator_vt.c
+++ b/sys/dev/fb/creator_vt.c
@@ -186,21 +186,20 @@ creatorfb_bitblt_bitmap(struct vt_device *vd, const struct vt_window *vw,
struct creatorfb_softc *sc = vd->vd_softc;
u_long line;
uint32_t fgc, bgc;
- int c;
+ int c, l;
uint8_t b, m;
fgc = sc->fb.fb_cmap[fg];
bgc = sc->fb.fb_cmap[bg];
b = m = 0;
- /* Don't try to put off screen pixels */
- if (((x + width) > vd->vd_width) || ((y + height) >
- vd->vd_height))
- return;
-
line = (sc->fb.fb_stride * y) + 4*x;
- for (; height > 0; height--) {
- for (c = 0; c < width; c++) {
+ for (l = 0;
+ l < height && y + l < vw->vw_draw_area.tr_end.tp_row;
+ l++) {
+ for (c = 0;
+ c < width && x + c < vw->vw_draw_area.tr_end.tp_col;
+ c++) {
if (c % 8 == 0)
b = *pattern++;
else
@@ -258,20 +257,17 @@ creatorfb_bitblt_text(struct vt_device *vd, const struct vt_window *vw,
term_rect_t drawn_area;
- drawn_area.tr_begin.tp_col = area->tr_begin.tp_col * vf->vf_width +
- vw->vw_draw_area.tr_begin.tp_col;
- drawn_area.tr_begin.tp_row = area->tr_begin.tp_row * vf->vf_height +
- vw->vw_draw_area.tr_begin.tp_row;
- drawn_area.tr_end.tp_col = area->tr_end.tp_col * vf->vf_width +
- vw->vw_draw_area.tr_begin.tp_col;
- drawn_area.tr_end.tp_row = area->tr_end.tp_row * vf->vf_height +
- vw->vw_draw_area.tr_begin.tp_row;
+ drawn_area.tr_begin.tp_col = area->tr_begin.tp_col * vf->vf_width;
+ drawn_area.tr_begin.tp_row = area->tr_begin.tp_row * vf->vf_height;
+ drawn_area.tr_end.tp_col = area->tr_end.tp_col * vf->vf_width;
+ drawn_area.tr_end.tp_row = area->tr_end.tp_row * vf->vf_height;
if (vt_is_cursor_in_area(vd, &drawn_area)) {
creatorfb_bitblt_bitmap(vd, vw,
vd->vd_mcursor->map, vd->vd_mcursor->mask,
vd->vd_mcursor->width, vd->vd_mcursor->height,
- vd->vd_mx_drawn, vd->vd_my_drawn,
+ vd->vd_mx_drawn + vw->vw_draw_area.tr_begin.tp_col,
+ vd->vd_my_drawn + vw->vw_draw_area.tr_begin.tp_row,
vd->vd_mcursor_fg, vd->vd_mcursor_bg);
}
#endif
OpenPOWER on IntegriCloud