The hunt for HV's FIFO/Push buffer...

Technical discussion on the newly released and hard to find PS3.

Moderators: cheriff, emoon

Post Reply
stesmi
Posts: 9
Joined: Wed Dec 19, 2007 2:13 pm

Post by stesmi »

LoaderDude wrote:Well, I took the leap and upgraded my Gutsy + ps3rsx to 2.10.

Petitboot came up but failed while attempting to start the X-server.
Backing off to fbdev still works with the same old (painful) performance. Needless to say, the rsx is sorely missed.

I'm ready to pull down source and start tinkering.
Give me a shout if there's something you'd like me to try.
I'd try what IronPeter asked for although I'm pretty sure it'll fail ...
IronPeter wrote:Test is very simple. Try in the kernel mode

u64 a = 0, b = 0;
lv1_gpu_memory_allocate( 0, 0, 0, 0, 0, &a, &b );
printk( "%8x %8x %8x %8x \n", (u32)a, (u32)(a>>32), (u32)b, (u32)(b>>32) );

It is better to try that call before any RSX stuff ( for example in the ps3fb.c ).
Note that you don't need ps3rsx, etc at all for this, you just need a kernel tree that you've configured correctly, modify ps3fb.c and compile it, start it and see what it displays. So all the ps3rsx/modifying xorg.conf is not necessary at all for this test. Then write here what the results were.
User avatar
boxbuilder
Posts: 15
Joined: Sat Nov 17, 2007 3:13 pm

Post by boxbuilder »

Troll and Triangle are now working :-D
I found the new (different) mknods.sh in the init directory, and ran it, worked beautiful. Thanks for the n00b support IronPeter, I'm anxious to see the New Year's version. It would be cool if the demo moved, and made the rsx draw it's max number of triangles per frame (although anything cool is usually super hard to code.)

Should I make a howto or (try to) put my patched kernel build onto a gentoo live cd, and put the 3d stuff in the init script?
ps2devman
Posts: 259
Joined: Mon Oct 09, 2006 3:56 pm

Post by ps2devman »

Sure, boxbuilder, the more tutorial we get, the merrier Xmas will be!

Just don't upgrade fw to 2.10 now...

Message to all (nasty) hackers : Need to design a downgrade procedure...
ralferoo
Posts: 122
Joined: Sat Mar 03, 2007 9:14 am
Contact:

Post by ralferoo »

Geert Uytterhoeven wrote:As of PS3 firmware version 2.10, the GPU command buffer size must be at least 2 MiB large.
Now, I got to wondering why the command buffer size was increased unless they're expecting to fill it with lots of commands... perhaps there are now methods that allow the queue to be manipulated and official 3D isn't far off? </hoping>
IronPeter
Posts: 207
Joined: Mon Aug 06, 2007 12:46 am
Contact:

Post by IronPeter »

> official 3D isn't far off

I hope also. Nice thing is that fb offset is still 64K. fb and fifo alias in memory. Looks like bug or preparing to 2D driver.
ps2devman
Posts: 259
Joined: Mon Oct 09, 2006 3:56 pm

Post by ps2devman »

Let's cross fingers but we can't be sure about what Sony has in mind...

So, in case it turns into a bloody war, here are the links to 2.01 fw
(lastest fw known to allow 70% of RSX control under Linux)

http://dus01.ps3.update.playstation.net ... 3UPDAT.PUP

http://deu01.ps3.update.playstation.net ... 3UPDAT.PUP

They won't remain online for long...

2.01 will allow to get both RSX funs and ability to play recent games.
(But if are not forced to, no need to upgrade at all)
jonwil
Posts: 18
Joined: Mon Nov 12, 2007 8:57 pm

Post by jonwil »

Have Sony made any official comments about 3D? Is there evidence that they are deliberatly blocking 3D?
IronPeter
Posts: 207
Joined: Mon Aug 06, 2007 12:46 am
Contact:

Post by IronPeter »

jonwil, you do not understand. With this update Sony also breaks half of linux installations. PS3 linux code holder Levand Geoff did not know about these changes.
Panajev2001a
Posts: 100
Joined: Sat Aug 20, 2005 3:25 am

Post by Panajev2001a »

IronPeter wrote:jonwil, you do not understand. With this update Sony also breaks half of linux installations. PS3 linux code holder Levand Geoff did not know about these changes.
Luckily I did not update to the very latest kboot.bld, I updated to FW 2.10 and the only thing that is not working anymore is ps3rsx kmod and naturally the ps3rsx Xorg driver, but Linux boots fine on the very latest custom kernel (compiled it this morning).
Oobles
Site Admin
Posts: 347
Joined: Sat Jan 17, 2004 9:49 am
Location: Melbourne, Australia
Contact:

Post by Oobles »

I've just posted a message to the main page.

http://ps2dev.org/News/Is_Sony_blocking_3D_access%3F

Have a read and let me know what you think?

Reply in this other thread I setup.

http://forums.ps2dev.org/viewtopic.php?p=62372

David. aka Oobles.
laichung
Posts: 123
Joined: Fri May 06, 2005 2:02 pm

Post by laichung »

Does this matter?

ps3fb: Update for firmware 2.10

As of PS3 firmware version 2.10, the GPU command buffer size must be at least 2
MiB large. Since we use only a small part of the GPU command buffer and don't
want to waste precious XDR memory, move the GPU command buffer back to the
start of the XDR memory reserved for ps3fb and let the unused part overlap with
the actual frame buffer.

From here:
http://git.kernel.org/?p=linux/kernel/g ... e263b14a7e
ps2devman
Posts: 259
Joined: Mon Oct 09, 2006 3:56 pm

Post by ps2devman »

You told everything we wanted to express oobles. Thanks a lot.
IronPeter
Posts: 207
Joined: Mon Aug 06, 2007 12:46 am
Contact:

2.10 features

Post by IronPeter »

Nice if somebody is able to test lv1_gpu_context_attribute entries.

You can follow testing methodology from this page:
http://wiki.ps2dev.org/ps3:hypervisor:l ... _attribute

I very want to see push buffer after valid FB_SETUP call in FW 2.1. Just dump fifo buffer after that call in ps3fb.c and post that dump.

FIFO hunting is started again :).

Peter.
d-range
Posts: 60
Joined: Fri Oct 26, 2007 8:22 pm

Re: 2.10 features

Post by d-range »

IronPeter wrote:Nice if somebody is able to test lv1_gpu_context_attribute entries.

You can follow testing methodology from this page:
http://wiki.ps2dev.org/ps3:hypervisor:l ... _attribute

I very want to see push buffer after valid FB_SETUP call in FW 2.1. Just dump fifo buffer after that call in ps3fb.c and post that dump.

FIFO hunting is started again :).

Peter.
Is it of any use to you if I try different calls with different parameters on my 2.01 FW? If so, what exactly should I be looking for?
IronPeter
Posts: 207
Joined: Mon Aug 06, 2007 12:46 am
Contact:

Post by IronPeter »

d-range, any nontrivial push buffers.

So you must memset( 0 ) fifo buffer, make lv1_gpu_context_attribute call, dump fifo bufer ( if there are any non zero values ). Any nonzero values are interesting for me.

Push buffer after FB_SETUP in ps3fb.c is the first candidate to investigate.

PS. FW 2.01 is not very interesting. FW 2.10 is.
d-range
Posts: 60
Joined: Fri Oct 26, 2007 8:22 pm

Post by d-range »

IronPeter wrote:...

PS. FW 2.01 is not very interesting. FW 2.10 is.
Ok... I don't want to upgrade to 2.10 for the moment (or anytime for that matter, if RSX turns out impossible after 2.01), so I guess I can only wait until someone finds something for 2.10+. How probable do you think it is you could find another hidden HV call if you had a box with 2.10 yourself? Maybe we could set up some donation scheme to get you a second PS3 to play with ;-). I know I'd be willing to chip in for some $$$ if it would mean a robust and safe RSX driver that won't be bombed by every fw upgrade.
dispo4
Posts: 1
Joined: Fri Dec 21, 2007 5:26 am

Post by dispo4 »

Hello, I follow your discussion, and even if I don't understand all about that your saying, I can test something for you, because I've PS3 EU 40GB model, and I want to help you :)
I'm still at 2.01, and Iwon't upgrade since the 2.1 fw don't allow good rsx...
I've got PS3, and I want to help people who want to test hacked possibility on PS3 ;)
LoaderDude
Posts: 2
Joined: Wed Dec 19, 2007 10:54 am

Post by LoaderDude »

I have upgraded to 2.10 and I am more than willing to get the dump.

I currently have a clean Gutsy install (no custom kernel or kernel sources).

I'd like some instructions on what exactly to install (kernel/sources), where to get it, and what to run so I don't goof up the test.
- </\\/\\> -
hermes
Posts: 25
Joined: Tue Mar 30, 2004 5:22 am
Location: Spain

Post by hermes »

IronPeter wrote:d-range, any nontrivial push buffers.

So you must memset( 0 ) fifo buffer, make lv1_gpu_context_attribute call, dump fifo bufer ( if there are any non zero values ). Any nonzero values are interesting for me.

Push buffer after FB_SETUP in ps3fb.c is the first candidate to investigate.

PS. FW 2.01 is not very interesting. FW 2.10 is.

IronPeter, i have my custom YDL 2.6.16 firmware modified with 20MB of XRAM and the FIFO Buffer with 2MB of size.

Now, it work (before, it fail because the 64KB of FIFO size as i say to you in my PM).

I have dumped this area yesterday:

http://mods.elotrolado.net/~hermes/ps3/fifo.zip

This fifo dump is obtained after of the enter_direct() function, without the "init_ramin" code

ctrl[0x10]==ctrl[0x11]== 0xe201448 (fifo offset is 18MB in my case: 18 MB of XRAM and after, 2 MB of FIFO area)

I can see as you can alloc 254 MB of DDR Maximum (the wiki say 252MB) and when i use 0 to the DDR_SIZE, i can access to the 254MB directly (i test it using 256MB of size on ioremap functions, etc). I think is the same as 2.01 fw

When i try to send the ramin init code, it hang, but i have a little log :)

This is the line, before of enter_direct() function that i am triying:

ramin_write_dword_to_dword_offset( gpu, 0x64cb8, 0xfeed0003 );

This is the code:

Code: Select all

static void ramin_write_dword_to_dword_offset&#40; struct gpu *gpu, uint32_t addr, uint32_t data &#41;
&#123;
  uint32_t *fifo = gpu->fifo.virt;
  uint32_t *ctrl = gpu->ctrl.virt;
  uint32_t *vram = gpu->vram.virt;
  uint32_t off = addr & 63;
uint32_t fifo_base;
int count=0;

&#123;
    int wptr;
    int ret;
    wptr =&#40;ctrl&#91;0x10&#93; & &#40;gpu->fifo.len - 1&#41;&#41;/4;
   ret = prepare_ramin_read_line256&#40;&fifo&#91;wptr&#93;, addr - off &#41;;
    fifo_push&#40;gpu, ret&#41;;
fprintf&#40;fi,"Ctrl1 %x %x\n",Ctrl&#91;0x10&#93;,Ctrl&#91;0x11&#93;&#41;;
 fifo_wait&#40;gpu&#41;;
fprintf&#40;fi,"Ctrl2 %x %x\n",Ctrl&#91;0x10&#93;,Ctrl&#91;0x11&#93;&#41;;
  &#125;
  //wait...
  usleep&#40; 1000 &#41;;
  //patch with data
  vram&#91;off&#93; = endian&#40; data &#41;;
  //wait...
  usleep&#40; 1000 &#41;;
  //copy data back
  &#123;
    int wptr;
    int ret;

    wptr = &#40;ctrl&#91;0x10&#93; & &#40;gpu->fifo.len - 1&#41;&#41; / 4;

    ret = prepare_ramin_write_line256&#40;&fifo&#91;wptr&#93;, addr - off &#41;;
    fifo_push&#40;gpu, ret&#41;;
fprintf&#40;fi,"Ctrl3 %x %x\n",Ctrl&#91;0x10&#93;,Ctrl&#91;0x11&#93;&#41;;
    fifo_wait&#40;gpu&#41;;
fprintf&#40;fi,"Ctrl4 %x %x\n",Ctrl&#91;0x10&#93;,Ctrl&#91;0x11&#93;&#41;;

  &#125;

&#125;


And this is the log:

Start
Ctrl1 e2014ac e201448
Ctrl2 e2014ac e2014ac
Ctrl3 e201510 e2014ac

it fail on the prepare_ramin_write_line256 function (it wait fifo forever )

I have tested with differents usleep() time, and the same result.

Then, i change the prepare_ramin_read_line256() function by prepare_ramin_write_line256: the idea is to known if write access is prohibited, and i obtain:

Start
Ctrl1 e2014ac e201448
Ctrl2 e2014ac e2014ac
Ctrl3 e201510 e2014ac


So the first write work, but the second write hang.

Hypothesis: it can be a problem when blitting a large region (very short time now) or when the FIFO stops, close the door to the next packet

Greetings
Pit0711
Posts: 54
Joined: Thu Mar 24, 2005 5:45 am
Location: Old Europe -Germany-

Post by Pit0711 »

time to keep new things secret
IronPeter
Posts: 207
Joined: Mon Aug 06, 2007 12:46 am
Contact:

Post by IronPeter »

hermes, Ctrl1 e2014ac e201448 just means that DMA engine of RSX read FIFO buffer. Any advance in ctrl regs does not mean success of execution.

The function prepare_ramin_read_line256 copies memory line from upper vidmem into CPU accessible area. I am pretty sure that RSX hangs up doing that copy.

Your push buffer dump contains xdr->ddr memory blit. It is not very interesting, push buffer *just* after FB_SETUP is more valuable.
Last edited by IronPeter on Fri Dec 21, 2007 8:08 pm, edited 1 time in total.
hermes
Posts: 25
Joined: Tue Mar 30, 2004 5:22 am
Location: Spain

Post by hermes »

IronPeter wrote:hermes, Ctrl1 e2014ac e201448 just means that DMA engine of RSX read FIFO buffer. Any advance in ctrl regs does not mean success of execution.

The function prepare_ramin_read_line256 copies memory line from upper vidmem into CPU accessible are. I am pretty sure that RSX hangs up doing that copy.

Your push buffer dump contains xdr->ddr memory blit. It is not very interesting, push buffer *just* after FB_SETUP is more valuable.
Yes, i know. (i am learning to use the DMA's :) )

IronPeter, i have modified prepare_ramin_read to read differents blocks of the DDR memory: i can see it work if the address < 254MB, but for example it return 256 bytes filled with 0x7fffffff when i try to read the hash table (RAMHT).

The fifo ends but the dma hangs (exception?)
ps2devman
Posts: 259
Joined: Mon Oct 09, 2006 3:56 pm

Post by ps2devman »

I think the next move will be to try to autodetect fw>=2.10 and have two code branches, so on fw<2.10 rsx hack is used, and otherwise, something similar based on spu is used. With that kind of intelligent library we will be able to produce homebrew code that everyone will be able to use (with better performance when running on fw<2.10). Time to mix rsx and spu madly!
Akta77
Posts: 40
Joined: Sun Dec 09, 2007 9:57 pm
Location: France (Paris)

Post by Akta77 »

ps2devman wrote:I think the next move will be to try to autodetect fw>=2.10 and have two code branches, so on fw<2.10 rsx hack is used, and otherwise, something similar based on spu is used. With that kind of intelligent library we will be able to produce homebrew code that everyone will be able to use (with better performance when running on fw<2.10). Time to mix rsx and spu madly!
Maybe we could simply *ask* sony a little help on how to achieve our goal (have a functional 2D (3D) accelerated driver under Linux the way they want. Guys here do not want to hack PS3 for playing "backup" games, just to release the power of the system under Linux.
As IronPeter & Glaurung are programming this driver (unofficial for now) maybe sony would be pleased to have someone doing this for "free".
I agree this is an idealistic view not taking in account all the "business" stuff involved here by Sony and his official partners. But don't they say "OpenPlatform"?

Regards
ouasse
Posts: 80
Joined: Mon Jul 30, 2007 5:58 am
Location: Paris, France

Post by ouasse »

to ironPeter, ps2devman and other RSX investigators.

I can provide you with ssh access to my PS3 with fw 2.10, with all the necessary privileges you need for your testings.

The ps3 is a european 60 GB model, with FW 2.10.

The system is a Debian lenny with original 2.6.16 kernel (all custom kernels don't run since the fw 2.10 upgrade). I can change the setup if needed.

contact me by private message if interested.
ps2devman
Posts: 259
Joined: Mon Oct 09, 2006 3:56 pm

Post by ps2devman »

@ouasse, thx for the offer. But I'm beginner on PS3 indeed. I will try installing fedora7 today with a nice tutorial boxbuilder sent me. Since I go from zero, I will complete it if data are missing. I will submit it to oobles after that. Just publishing code to test on your doomed firmware will be enough for now, for me at least. I will try to create games with what we have... Enough slacking...

@akta77, sure, go ahead, take an airplane ticket to Japan and meet the big Sony boss there. Don't forget to say hello to Ken Kutagari who has been sent into a golden cell (no pun intended)...
Akta77
Posts: 40
Joined: Sun Dec 09, 2007 9:57 pm
Location: France (Paris)

Post by Akta77 »

ps2devman wrote:
@akta77, sure, go ahead, take an airplane ticket to Japan and meet the big Sony boss there. Don't forget to say hello to Ken Kutagari who has been sent into a golden cell (no pun intended)...
No need to take a plane :p Moreover its a big "pollution" machine!
Some have started a petition for that. Did you signed it?

http://www.petitiononline.com/RSX/petition.html

It's all about "mass power", but i will contact SCEE for more informations !

Regards
naivri
Posts: 6
Joined: Tue Dec 11, 2007 4:02 pm

Post by naivri »

I signed the petition

11500 Signatures Total

good start
bocaJ
Posts: 6
Joined: Thu Dec 20, 2007 7:17 am

Post by bocaJ »

While I appreciate the sentiment, online petitions aren't worth the paper they are printed on...
Akta77
Posts: 40
Joined: Sun Dec 09, 2007 9:57 pm
Location: France (Paris)

Post by Akta77 »

bocaJ wrote:While I appreciate the sentiment, online petitions aren't worth the paper they are printed on...
Anyway, this is not the subject of this topic (but it is a very interesting discussion :) ).

All of you guys that have already updated should do like ouasse so hard coders could find another fifo trick ;p

I wish all of us a merry christmas & an happy new 2008 year!!!
Post Reply