Hi,

> > AFAIR fix->line_length was not set because encode_fix could be called
> > before the video mode was actually set up. Or maybe because I could not
> > figure out how to derive line_len from the hw pars.
>
> Well, originally fb_fix_screeninfo.line_length didn't exist, and
> applications just had to look at fb_var_screeninfo.xres_virtual.
>
> Good user applications use fb_fix_screeninfo.line_length if it exists,
> else they fall back to fb_var_screeninfo.xres_virtual.

That'll be as you say - I remember having trouble with the kernel-internal
fbcon driver early on when I started working on atafb. May have been some
other parameter being messed up.

> > Anyway, I'll give it a shot - what I need to know is what units line_length
> > will use - bytes, or pixels?
>
> bytes.

OK.

> > And should line_length be derived from xres or xres_virtual?
>
> fb_var_screeninfo.xres_virtual (+ padding, if needed).
>
> fb_fix_screeninfo.line_length is the number of bytes to add to move one
> pixel down.

No padding, so it's just a matter of recalculating xres_virtual from
line_width and offset.

This should do it - only I've been unable to get ARAnyM boot into falh16
at all, so it's untested.

--- drivers/video/atafb.c.org   2008-02-22 08:13:14.000000000 +0100
+++ drivers/video/atafb.c       2008-02-23 08:22:06.000000000 +0100
@@ -906,6 +906,7 @@
        fix->xpanstep = 1;
        fix->ypanstep = 1;
        fix->ywrapstep = 0;
+       fix->line_length = 0;
        if (par->hw.falcon.mono) {
                fix->type = FB_TYPE_PACKED_PIXELS;
                fix->type_aux = 0;
@@ -917,8 +918,10 @@
                /* Is this ok or should it be DIRECTCOLOR? */
                fix->visual = FB_VISUAL_TRUECOLOR;
                fix->xpanstep = 2;
+               /* FIXME: cfb driver needs line_length */
+               fix->line_length = (par->hw.falcon.line_width + 
par->hw.falcon.line_offset) * par->hw.falcon.bpp / 8;
+               printk(KERN_INFO "atafb: falcon_encode_fix -- line_length = 
%d\n", fix->line_length);
        }
-       fix->line_length = 0;
        fix->accel = FB_ACCEL_ATARIBLITT;
        return 0;
 }

Adjust the printk to show other hw parameters if the calculated
line_length is wrong.

Cheers,

        Michael



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to