Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 Jul 2010 19:18:30 -0400
From:      Jung-uk Kim <jkim@FreeBSD.org>
To:        freebsd-stable@FreeBSD.org
Cc:        David DEMELIER <demelier.david@gmail.com>
Subject:   Re: Strange video mode output with VESA
Message-ID:  <201007161918.32195.jkim@FreeBSD.org>
In-Reply-To: <201007161522.54572.jkim@FreeBSD.org>
References:  <877004.53626.qm@web59106.mail.re1.yahoo.com> <AANLkTinQI1UZUlmVluv10Obr5ibrKFu29qbYynkcrOzz@mail.gmail.com> <201007161522.54572.jkim@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--Boundary-00=_IjOQMTqa4EQrJwW
Content-Type: text/plain;
  charset="utf-8"
Content-Transfer-Encoding: 8bit
Content-Disposition: inline

On Friday 16 July 2010 03:22 pm, Jung-uk Kim wrote:
> On Friday 16 July 2010 03:00 pm, David DEMELIER wrote:
> > 2010/6/19 paradox <ddkprog@yahoo.com>:
> > >>On Wednesday 02 June 2010 04:25 pm, David DEMELIER wrote:
> > >>> Hi there,
> > >>>
> > >>> I was so happy to see that VESA is available for amd64, but
> > >>> unfortunately it does not work really well for me. Take a
> > >>> look at this picture :
> > >>>
> > >>> http://img717.imageshack.us/img717/7311/dsc00399h.jpg
> > >>>
> > >>> My laptop is a 15,6" so the best resolution is 1366x768, I
> > >>> tried this
> > >>>
> > >>> : vidcontrol MODE_496. As you can see on the picture all the
> > >>> : lines are
> > >>>
> > >>> completely everywhere, if I mouse the cursor they move away
> > >>> (I'm not drunk!).
> > >>>
> > >>> I have SC_PIXEL_MODE in my kernel config.
> > >>>
> > >>> The console terminal is okay until I don't excess 1280x960x32
> > >>> video mode.
> > >>>
> > >>> Do you have any idea to fix this ?
> > >>
> > >>It is kinda known problem. 占쏙옙If the mode has larger bytes per
> > >> scan line than the minimum, few characters per line are lost
> > >> when the screen is scrolled up or down, i.e., framebuffer
> > >> copies of whole screen. 占쏙옙When you move the mouse onto the
> > >> line, entire line is redrawn and restored. 占쏙옙That's what you
> > >> are seeing. 占쏙옙Ed might have a better idea how to fix it
> > >> (CC'ed).
> > >>
> > >>Jung-uk Kim
> > >
> > > this is incorrent calculate the scan lines in the vesa driver
> > > Jung-uk Kim should to fix it
> >
> > But Jung-uk Kim said Ed' should fix it so we are in an infinite
> > loop :-
>
> No, I didn't say that.  What I meant was "Ed may be a better
> qualified person to fix syscons vs. terminal emulator interaction
> issues." :-(

Can you please try the attached patch?

--Boundary-00=_IjOQMTqa4EQrJwW
Content-Type: text/plain;
  charset="utf-8";
  name="scvgarndr.c.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename="scvgarndr.c.diff"

--- sys/dev/syscons/scvgarndr.c	2010-03-24 11:40:18.000000000 -0400
+++ sys/dev/syscons/scvgarndr.c	2010-07-16 19:05:12.000000000 -0400
@@ -728,12 +728,15 @@
 	vm_offset_t e;
 	u_char *f;
 	u_short col1, col2, color;
-	int line_width, pixel_size;
+	int line_width, off_width;
+	int font_size, pixel_size;
 	int i, j, k;
 	int a;
 
 	line_width = scp->sc->adp->va_line_width;
 	pixel_size = scp->sc->adp->va_info.vi_pixel_size;
+	off_width = line_width - scp->xpixel * pixel_size;
+	font_size = scp->font_size;
 
 	d = VIDEO_MEMORY_POS(scp, from, 8 * pixel_size);
 
@@ -752,9 +755,9 @@
 		}
 
 		e = d;
-		f = &(scp->font[sc_vtb_getc(&scp->vtb, i) * scp->font_size]);
+		f = &(scp->font[sc_vtb_getc(&scp->vtb, i) * font_size]);
 
-		for (j = 0; j < scp->font_size; ++j, ++f) {
+		for (j = 0; j < font_size; ++j, ++f) {
 			for (k = 0; k < 8; ++k) {
 				color = *f & (1 << (7 - k)) ? col1 : col2;
 				vga_drawpxl(e + pixel_size * k, color);
@@ -766,8 +769,8 @@
 		d += 8 * pixel_size;
 
 		if ((i % scp->xsize) == scp->xsize - 1)
-			d += scp->xoff * 16 * pixel_size +
-			     (scp->font_size - 1) * line_width;
+			d += off_width + scp->xoff * pixel_size * font_size +
+			    (font_size - 1) * line_width;
 	}
 }
 

--Boundary-00=_IjOQMTqa4EQrJwW--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201007161918.32195.jkim>