linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Voyager Video support color depths?
       [not found] <mailman.294.1139321937.857.linuxppc-embedded@ozlabs.org>
@ 2006-02-07 19:20 ` Russell McGuire
  2006-02-08  8:32 ` Floating point math in kernel interrupt -- am I doing this right?(repost) Jeremy Friesner
  1 sibling, 0 replies; 3+ messages in thread
From: Russell McGuire @ 2006-02-07 19:20 UTC (permalink / raw)
  To: linuxppc-embedded

Everyone,

I had a question about the various video support that has been tested with
the 2.4.25 DENX Kernel.

To date I have had pretty good luck with by making sure I have compiled the
kernel with the Voyager.h file set at 32 BPP mode.

For speed optimization I wanted to cut it back to 16 BPP mode, however I
couldn't hardly get it to boot the machine after I did this change by
changing '#define SCREEN_BPP 16'. Most attempts the kernel would lock up
before a login prompt was available. When I tried SCREEN_BPP at 8 then it
booted fine, however QT/Embedded had terrible colors.

I was wondering if I should be looking for the trouble in some other code,
or perhaps hardware, or if this is a known bug in the SM501 / Voyager
driver, or perhaps the linux frame buffer driver.

Thanks all,

-Russ

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: Floating point math in kernel interrupt -- am I doing this right?(repost)
       [not found] <mailman.294.1139321937.857.linuxppc-embedded@ozlabs.org>
  2006-02-07 19:20 ` Voyager Video support color depths? Russell McGuire
@ 2006-02-08  8:32 ` Jeremy Friesner
  1 sibling, 0 replies; 3+ messages in thread
From: Jeremy Friesner @ 2006-02-08  8:32 UTC (permalink / raw)
  To: linuxppc-embedded

Hi all,

I figured out what was wrong with my FPU save/restore code:  I was neglecting to save and restore the state of the FPSCR register.  Thanks to all who helped me figure it out!

For the sake of the list archives, I've pasted my fixed FP save/restore routines below.

-Jeremy

---------------------- snip -------------------------------

/* macros to save and restore floating point register state */
# define SAVE=5FFPR(x)    {=5F=5Fasm=5F=5F =5F=5Fvolatile=5F=5F ("stfd " #x ", " #x "*8(%0)\n" : : "b" (saved=5Ffpr));}
# define RESTORE=5FFPR(x) {=5F=5Fasm=5F=5F =5F=5Fvolatile=5F=5F ("lfd  " #x ", " #x "*8(%0)\n" : : "b" (saved=5Ffpr));}    

/* Set up floating-point-enabled-mode */
uint32 saved=5Fmsr;        /* space for the MSR register (32 bits) */
uint32 saved=5Ffpscr[1*2]; /* space for the FPSCR register (64 bits) */
uint32 saved=5Ffpr[14*2];  /* space for the 14 floating point registers I'll use (64 bits each) */
{
   uint32 msr;

   /* Save existing MSR for later */
   =5F=5Fasm=5F=5F =5F=5Fvolatile=5F=5F ("mfmsr %0" : "=3Dr" (msr) : );
   saved=5Fmsr =3D msr;

   /* Enable floating point */
   msr |=3D MSR=5FFP;
   msr &=3D ~(MSR=5FFE0 | MSR=5FFE1);
   =5F=5Fasm=5F=5F =5F=5Fvolatile=5F=5F ("mtmsr %0\n\tisync" : : "r" (msr));

   /* Save the floating point registers that will be used, so that we won't screw up user processes */
   SAVE=5FFPR(0);  SAVE=5FFPR(1);  SAVE=5FFPR(2);  SAVE=5FFPR(3);  SAVE=5FFPR(4);
   SAVE=5FFPR(5);  SAVE=5FFPR(6);  SAVE=5FFPR(7);  SAVE=5FFPR(8);  SAVE=5FFPR(9);
   SAVE=5FFPR(10); SAVE=5FFPR(11); SAVE=5FFPR(12); SAVE=5FFPR(13);

   /* Save existing FPSCR, by first retrieving it into FPR0, then storing FPR0 to the stack */
   =5F=5Fasm=5F=5F =5F=5Fvolatile=5F=5F ("mffs 0\n\tstfd 0, 0(%0)\n" : : "b" (saved=5Ffpscr));
}                

DoFloatingPointMathHere();

/* End floating-point-enabled-mode */
{
   /* Restore FPSCR, by first loading it into FPR0, then calling mtfsf to put it back into the register */
   =5F=5Fasm=5F=5F =5F=5Fvolatile=5F=5F ("lfd 0, 0(%0)\n\tmtfsf 0xFF,0" : : "b" (saved=5Ffpscr));

   /* Restore the FP registers that may have been munged */
   RESTORE=5FFPR(0);  RESTORE=5FFPR(1);  RESTORE=5FFPR(2);  RESTORE=5FFPR(3);  RESTORE=5FFPR(4);
   RESTORE=5FFPR(5);  RESTORE=5FFPR(6);  RESTORE=5FFPR(7);  RESTORE=5FFPR(8);  RESTORE=5FFPR(9);
   RESTORE=5FFPR(10); RESTORE=5FFPR(11); RESTORE=5FFPR(12); RESTORE=5FFPR(13);

   /* Restore MSR */
   =5F=5Fasm=5F=5F =5F=5Fvolatile=5F=5F ("mtmsr %0\n" "isync" : : "r" (saved=5Fmsr));
}
 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: Voyager Video support color depths?
@ 2006-02-08  9:29 Martin Krause
  0 siblings, 0 replies; 3+ messages in thread
From: Martin Krause @ 2006-02-08  9:29 UTC (permalink / raw)
  To: linuxppc-embedded

Hi Russ,

linuxppc-embedded-bounces@ozlabs.org wrote on :
> I had a question about the various video support that has been tested
> with the 2.4.25 DENX Kernel.
>=20
> To date I have had pretty good luck with by making sure I have
> compiled the kernel with the Voyager.h file set at 32 BPP mode.
>=20
> For speed optimization I wanted to cut it back to 16 BPP mode,
> however I couldn't hardly get it to boot the machine after I did this
> change by changing '#define SCREEN_BPP 16'. Most attempts the kernel

You are using an old driver. Please try the current top of git one.

The driver now supports kernel parameters. To set the color depth during
booting you could use for example:

video=3Dvoyager:bpp=3D16

> would lock up before a login prompt was available. When I tried
> SCREEN_BPP at 8 then it booted fine, however QT/Embedded had terrible
> colors.

Support for 8 bpp mode should be improved in the current driver.

> I was wondering if I should be looking for the trouble in some other
> code, or perhaps hardware, or if this is a known bug in the SM501 /
> Voyager driver, or perhaps the linux frame buffer driver.

How is your SM501 connected to your CPU? Which board are you using?
The default configuration of the driver assumes tht the SM501 is
connected via the SH4-Interface, not PCI.

Regards,
Martin

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-02-08  9:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.294.1139321937.857.linuxppc-embedded@ozlabs.org>
2006-02-07 19:20 ` Voyager Video support color depths? Russell McGuire
2006-02-08  8:32 ` Floating point math in kernel interrupt -- am I doing this right?(repost) Jeremy Friesner
2006-02-08  9:29 Voyager Video support color depths? Martin Krause

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).