On Fri, Nov 30, 2001 at 09:17:07AM -0700, Derrik Pates wrote:
> On Fri, 30 Nov 2001, Gareth Hughes wrote:
> 
> > If I remember correctly, the hardware requires pitches to be multiples
> > of 64 (that's pixels, not bytes).  It's been a while, but we don't do
> > that sort of thing for nothing...
> 
> Well, how would an 800x600 display work on it then? The iBook's display is
> 800x600, and as it works now (the 64 X pScrn->bitsPerPixel value) the X
> server always gets the wrong line pitch (832) because 800 is not a round
> multiple of 64. With the existing code, the X server has to be forced into
> doing the "right" thing. With my change, it does the right thing
> completely by itself.
> 
> I don't have the Rage128 docs, I can only tell you what I'm seeing here -
> and that's what I'm seeing. If the docs claim that the line pitch must be
> a multiple of 64 pixels, maybe the docs are incorrect. (Would it be the
> first time?)

I'm not familiar with your problem, or your proposed fix.

Two things, however:

1) These pitches may have nothing to do with the current mode.  Mode
   initialization probably touches different registers.

2) If the pitch register looks like this, say:

        Bits            Field

        0 - 12          Pitch, in multiples of 64 pixels
        ...             ...

(and I seem to remember that all the ATI cards look like this), then
there is no way to program a pitch that *isn't* a multiple of 64
pixels.  Hence:

        /* Offset in multiples of some large number.  Radeon has
         * 4k alignment, from memory -- something large in any case.
         */
        hw_offset = real_offset / 4096;

        /* Pitch in multiples of 64 pixels.
         */
        hw_pitch = real_pitch / 64;

        reg.src_pitch_offset = ((hw_pitch  <<  0) |
                                (hw_offset << 12));

Of course, it's been almost a year since I worked on that part of the
driver, so I may be completely wrong.

Note that even though a surface is allocated with a pitch that is a
multiple of 64 pixels (832 in this case), the RAMDAC may only scan out
the first 800 pixels or whatever the current mode is set to.

-- Gareth

_______________________________________________
Dri-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to