MODE_FIFO flickering/corrupt

elhobbs
Posts: 358
Joined: Thu Jul 02, 2009 1:19 pm

MODE_FIFO flickering/corrupt

Post by elhobbs » Mon Sep 19, 2011 1:56 pm

does display mode MODE_FIFO work in DSi mode? when I use the following code all I get a flickering mess with vertical lines that appear at varying thicknesses. I have the buffer filled with a left to righ gradient, the buffer is an aligned u16 array in main memory.

Code: Select all

DMA0_SRC = (u32)buffer;
DMA0_DEST = (u32)&REG_DISP_MMEM_FIFO;
 DMA0_CR = DMA_ENABLE | DMA_DISP_FIFO | DMA_REPEAT | DMA_DST_FIX | DMA_32_BIT | 4;
are there any special considerations/timings that need to be taken into consideration? a working example of this would be appreciated if anyone has one.

z.g
Posts: 22
Joined: Thu Dec 18, 2008 8:33 pm

Re: MODE_FIFO flickering/corrupt

Post by z.g » Mon Sep 19, 2011 11:01 pm

DC_FlushRange(buffer,size);

elhobbs
Posts: 358
Joined: Thu Jul 02, 2009 1:19 pm

Re: MODE_FIFO flickering/corrupt

Post by elhobbs » Tue Sep 20, 2011 12:05 am

z.g wrote:DC_FlushRange(buffer,size);
this is not the issue as I am writing to buffer through the uncached mirror - I used memUncached to get the pointer for writing. I use the original cached address for setting the dma registers. that may account for some flickering but not the extent that I am seeing. every once in a while I get a flash of it looking correct then a bunch of frames with vertical lines.

zeromus
Posts: 212
Joined: Wed Mar 31, 2010 6:05 pm

Re: MODE_FIFO flickering/corrupt

Post by zeromus » Tue Sep 20, 2011 7:18 pm

I couldnt get it to work with memUncached at all. My theory is that so many of the memory hits happen at the same time as a DMA that the cpu gets seriously stalled repeatedly. Whereas if you go through cached memory, some writes can happen behind the scenes inbetween DMAs. going through cached memory and DC_FlushAll(), my stuff worked. --mostly. There are still periodic glitches that I don't understand. I can't solve them with a double buffer, so I am somewhat at a loss to explain it.
I'm testing on a dsi not in dsi mode.

elhobbs
Posts: 358
Joined: Thu Jul 02, 2009 1:19 pm

Re: MODE_FIFO flickering/corrupt

Post by elhobbs » Tue Sep 20, 2011 9:51 pm

zeromus - thanks for taking a look at this. It was driving me crazy. It sounds like MODE_FIFO is probably a lost cause. Do you know of any games that use it?

zeromus
Posts: 212
Joined: Wed Mar 31, 2010 6:05 pm

Re: MODE_FIFO flickering/corrupt

Post by zeromus » Tue Sep 20, 2011 10:51 pm

splinter cell chaos theory uses it, in an exceedingly complex manner (combined with capture) for its thermal view. I can't recall any other games offhand, but I'm sure there are some others, but I don't know them. Unfortunately, I have been unsuccessful so far in recruiting interns to create a masterlist of games vs hardware features to use as a test case reference.

elhobbs
Posts: 358
Joined: Thu Jul 02, 2009 1:19 pm

Re: MODE_FIFO flickering/corrupt

Post by elhobbs » Wed Sep 21, 2011 1:43 am

I found the issue that was causing problems. the dma needs to be enabled at 60hz. I was trying to decode a video stream and I was missing 60 fps. I made a test program and added the dma enable to a vblank handler and it fixed it for the test program. hopefully it works in my solution as well.

zeromus
Posts: 212
Joined: Wed Mar 31, 2010 6:05 pm

Re: MODE_FIFO flickering/corrupt

Post by zeromus » Wed Sep 21, 2011 6:52 am

yeah i can confirm the dma goes into disabled state after it finishes the frame.

elhobbs
Posts: 358
Joined: Thu Jul 02, 2009 1:19 pm

Re: MODE_FIFO flickering/corrupt

Post by elhobbs » Wed Sep 21, 2011 1:43 pm

the vblank interrupt did not work in my program. it does work better. the top of the frame is aligned properly, but by time it reaches the bottom everything is kicked over horizontally by about 8-32 pixels with it wrapped to the other side of the screen. it varies each frame so there is quite a bit of bouncing back and forth.

zeromus
Posts: 212
Joined: Wed Mar 31, 2010 6:05 pm

Re: MODE_FIFO flickering/corrupt

Post by zeromus » Wed Sep 21, 2011 6:39 pm

are you double buffering?

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests