[haiku-development] Re: S3 Savage 1400x1050 Accelerated Drawing Problem

  • From: "Stephan Assmus" <superstippi@xxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Fri, 12 Sep 2008 17:42:55 +0200

> Von: Gerald Zajac <zajacg@xxxxxxxxxxxxx>
> Axel Dörfler wrote:
> > Gerald Zajac <zajacg@xxxxxxxxxxxxx> wrote:
> >   
> >> There are two possible fixes for this problem.  One is to disable 
> >> accelerated drawing for 1400x1050 on the chips that have this 
> >> problem, 
> >> and the other fix is change the width to 1392 or 1408 (which are 
> >> divisible by 32) when setting the mode.  I prefer the second option 
> >> where a width of 1392 used.  The list of modes would be unchanged and 
> >> would list 1400x1050 as one of the modes;  however, when the mode is 
> >> set, h_display in struct display_timing will be changed to 1392.  
> >> 1392 
> >> will be used instead of 1408 because on a laptop display such as the 
> >> Thinkpad T23 1408 causes the rightmost 8 pixels to be off the right 
> >> edge 
> >> of the display;  whereas, 1392 causes only a very narrow blank strip 
> >> on 
> >> the left edge of the screen.  With an external monitor, the user is 
> >> not 
> >> aware that the display width is not exactly 1400.  Note that the 
> >> width 
> >> will be changed only for the chips that have this problem.
> >>
> >> If there are no serious objections, I will implement the my preferred 
> >> fix as described above.
> >>     
> >
> > The usual way for cases like this is to make the bitmap larger, not 
> > smaller - the user won't notice the extra space anywhere (ie. it won't 
> > be shown, only the internal frame buffer is larger).
> > IOW you would not change what the display_mode returns, but only change 
> > frame_buffer_config::bytes_per_row.
> >
> >   
> Axel, I'm not sure I understand what you are saying.  Do you mean that I 
> should set the display width to 1408 when I set the mode so that the 
> chip will draw properly, and then set frame_buffer_config::bytes_per_row 
> to 1400 so that Haiku does not use more that 1400 pixels for the width?

No, the other way around. This is exactly what bytes_per_row is for, to cover 
the case when you need more bytes per row then necessary just for pixel data 
because of certain alignment restrictions. So you would do it like this:

width = 1400;
height = 1050;
bytes_per_row = 1408 * bytes_per_pixel;
frameBuffer = malloc(bytes_per_row * height);

And this way your graphics hardware has the correct alignment and there is at 
the same time just the right amount of pixels on the screen.

Best regards,
-Stephan

Other related posts: