Skip to contentSkip to conversation

Voyager Video support color depths?

DISCUSSION Russell McGuire 2 participants 2 messages Feb 7, 2006 – Feb 8, 2006 1 message not in the archive

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive

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

#2 lore raw

RE: Floating point math in kernel interrupt -- am I doing this right?(repost)

In reply to a message not in the archive

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));
}