xboxscene.org forums

Author Topic: Linux 3D GPU Access on PS3  (Read 432 times)

PS3Scene

  • Archived User
  • Hero Member
  • *
  • Posts: 832
Linux 3D GPU Access on PS3
« on: November 28, 2007, 10:38:00 PM »

Linux 3D GPU Access on PS3
Posted by XanTium | 29-11-2007 0:02 EST

 
From forums.ps2dev.org:
Quote

Here is a draft of the separate kernel module:
git clone http://mandos.homelinux.org/~glaurung/git/ps3rsx.git
I've updated the Xorg driver accordingly:
git clone http://mandos.homelinux.org/~glaurung/git/xf86-video-ps3.git

It is not yet finished, and mostly untested, but it shows my plan for the interface with userspace. Basically we have two options to access the FIFO:
- exclusive: we disable framebuffer redraw, allocate a context, then use the FIFO workaround to start running the context's FIFO and use it until the application is over. No other application can use the GPU, and any blit from either the fb driver or another context would break the application in exclusive mode. That's how we've been using the RSX so far.
- shared: we allocate a context, then run the FIFO for some time using a fake blit (size 0x0). When commands are finished processing, a new fake blit is needed to kick the FIFO again and process more commands. In the meantime, other contexts (including FB driver) can use the GPU. Note that contexts are not preempted, so if we put FIFO in a loop, other contexts are not able to execute commands (and we get error -24 for FB blit). So this is cooperative sharing.

I want to be able to support both modes. The former is easier to use and more efficient (useful for e.g. 3D demo or game), while the latter allows mixing multiple users of the GPU (e.g. Desktop usage, with one context for Xorg, one for GLX, and one for VRAM used as swap). The current module provides those two modes, with one ioctl() to enter exclusive mode, and one ioctl for one-shot kicking of the fifo (shared mode). The Xorg driver still uses exclusive mode ATM; I've code for shared mode but it needs testing and benchmarking. My short term goal is usable Desktop usage (X is improved, now we need more RAM).

On the long term, my plan is to add RAMIN/VRAM memory management to the module, have libps3rsx provide the user space API for FIFO control and object instanciation. Also, Xorg driver should use libps3rsx to avoid code duplication. Maybe when can then move slowly from ps3rsx.ko/librsx to drm/libdrm API (but keep exclusive mode option in parallel). Sound good?

Full Story: forums.ps2dev.org (via eurasia.nu)



Logged

mlmadmax

  • Archived User
  • Hero Member
  • *
  • Posts: 701
Linux 3D GPU Access on PS3
« Reply #1 on: November 28, 2007, 11:53:00 PM »

Sweet I can't wait for this to come to fruition.

Just to clarify they have accesed the rsx but haven't compiled anything anyone can really use yet right?
Logged

lmaolmao

  • Archived User
  • Jr. Member
  • *
  • Posts: 71
Linux 3D GPU Access on PS3
« Reply #2 on: November 29, 2007, 03:35:00 AM »

ooooh,  i understand the title and odd words.  but what i would like to see out of this is overlay in videolan or another media player.  that would mean 1080p videos running smoothly would it not?!
Logged

Ribs

  • Archived User
  • Newbie
  • *
  • Posts: 2
Linux 3D GPU Access on PS3
« Reply #3 on: November 29, 2007, 03:35:00 AM »

QUOTE(lmaolmao @ Nov 29 2007, 12:35 PM) View Post

ooooh,  i understand the title and odd words.  but what i would like to see out of this is overlay in videolan or another media player.  that would mean 1080p videos running smoothly would it not?!

Not yet.

I've managed to compile the kernel module and the xorg driver. Once running, there is a lot of missing graphics, and everything is garbage mainly.

Video playback was not garbage, but no smoother than with the regular framebuffer driver. A disappointment for me, but these are *very* early days yet.

This time next year, we should really begin to see the fruits of all this hard work.
Logged

openxdkman

  • Archived User
  • Hero Member
  • *
  • Posts: 550
Linux 3D GPU Access on PS3
« Reply #4 on: November 29, 2007, 04:15:00 AM »

You can do a lot already, but you need serious linux skills. You need to fully control the custom source of your own linux kernel.

Don't despair, the graphic stuff itself will be reusable in many solutions. One of them is ps3link that will work just like ps2link. There will be also ready to install linux distros or even LiveCD soon.

I predict some incredible blooming of homebrew on ps3 in early 2008.

Logged

Ribs

  • Archived User
  • Newbie
  • *
  • Posts: 2
Linux 3D GPU Access on PS3
« Reply #5 on: November 29, 2007, 06:30:00 AM »

QUOTE(openxdkman @ Nov 29 2007, 01:15 PM) View Post

You can do a lot already, but you need serious linux skills. You need to fully control the custom source of your own linux kernel.

Not really. That's the whole point of the module. The module exists so you don't have to patch the kernel anymore. I was able to get the module to build and install cleanly on the stock Ubuntu kernel. I did have to download the kernel headers, however (a simple apt-get).

I agree it's not in the hands of the linux 'noob' right now. But, like yourself, I predict that things will get a lot easier as time progresses. We are very much on the brink of some seriously cool stuff happening.
Logged

the_nerdy

  • Archived User
  • Jr. Member
  • *
  • Posts: 62
Linux 3D GPU Access on PS3
« Reply #6 on: November 29, 2007, 08:52:00 AM »

My only concern is if this is going to really fully work, or if your going to work your way into a dead end. I mean, the console has been out for almost 1 year now and very little progress made.  Even though if what you got is going to work fully, this is a huge step up.  But once the graphics are going, what other aditions need to be fixed?

Sorry to be skeptical,  I want to see the PS3 support homebrew before the Xbox360 does.  I belive the homebrew scene for the ps3 is the only way sony is going to make it in the console business.  And having XMBC on the PS3 would really kick consiering their is a blueray drive

So I'm just asking to make all possible fast, for the fact the X360 will be behind and devolpers will be concentrating just on the PS3 and put the 360 in it's place.



Would'nt you all rather have a more powerfull console for homebrew?    SD card slot access smile.gif

Thanks RIBS!!!


Keep up the good work and tell your team to do the same

Very proud of you.
Logged

bucko

  • Recovered User
  • Hero Member
  • *
  • Posts: 4255
Linux 3D GPU Access on PS3
« Reply #7 on: November 29, 2007, 10:38:00 AM »

If only Sony would make it official mad.gif, hell i'd even buy it for a £5er or somet if Sony is scared of losing money on it.
Logged

lmaolmao

  • Archived User
  • Jr. Member
  • *
  • Posts: 71
Linux 3D GPU Access on PS3
« Reply #8 on: November 29, 2007, 04:06:00 PM »

QUOTE(Ribs @ Nov 29 2007, 12:11 PM) *

Not yet.

I've managed to compile the kernel module and the xorg driver. Once running, there is a lot of missing graphics, and everything is garbage mainly.

Video playback was not garbage, but no smoother than with the regular framebuffer driver. A disappointment for me, but these are *very* early days yet.

This time next year, we should really begin to see the fruits of all this hard work.


thanks for the info.  i cant wait for the day the ps3 has a xbmc functionality through linux.  it maybe a pipe dream, but would be very nice indeed.
Logged

d-range

  • Archived User
  • Full Member
  • *
  • Posts: 151
Linux 3D GPU Access on PS3
« Reply #9 on: November 30, 2007, 03:22:00 AM »

QUOTE(the_nerdy @ Nov 29 2007, 06:28 PM) View Post

My only concern is if this is going to really fully work, or if your going to work your way into a dead end. I mean, the console has been out for almost 1 year now and very little progress made.  Even though if what you got is going to work fully, this is a huge step up.  But once the graphics are going, what other aditions need to be fixed?


I think 1 year to find a way to work around the security layer Sony implemented around the GPU & other hardware *and* write a preliminary driver that does blitting, textured triangles, etc. on an undocumented GPU is not long. The FIFO hole was only found a few months ago, and now it's already almost possible to write an accelerated Xv driver that enables smooth full HD movie playback.

If this will ever lead to a complete 3D driver that supports all sorts of shader programs, texture formats, etc, I seriously doubt that. But even the most basic stuff is already a huge step forward.
Logged

XBLamer

  • Archived User
  • Jr. Member
  • *
  • Posts: 86
Linux 3D GPU Access on PS3
« Reply #10 on: December 01, 2007, 01:59:00 PM »

I agree this is a huge break through and props to ironpeter for finding the hole but I have a few concerns

1) We are a long way off seeing opengl running (unless nvidea opens up the spec) at best all we have the limited functionality of the PS3 RSX project.

2) Sony can close the hole at any time and only those with a modded ps3 or who decide not to connect or run a game can avoid the fix.  


Actually it makes me wonder why sony have not closed this yet. My only logic is they are watching to see the progress. If they could get an opengl prog that leverages the SPE's of the cell and limitedf functionality of the Nvidea they could use a lower cost GPU. The MIT licence the work is being done under would allow them reuse  the code. Toshiba  I would imagine are also watching this closely for similiar reasons.

It's early days yet but my bet is  sony won't close this hole until there is significant progress and by that time the manufacture cost of ps3 will be more in line with sale price so they may just officially support the code.  The only thing that would stop this is if the big game developers move to the open platform and sony stop getting their royalty kick backs.

This post has been edited by XBLamer: Dec 1 2007, 10:01 PM
Logged

dotrat1989

  • Archived User
  • Newbie
  • *
  • Posts: 16
Linux 3D GPU Access on PS3
« Reply #11 on: December 02, 2007, 09:30:00 PM »

I know this gives us access to the RSX GPU through linux on the PS3 but will this potentionally lead us with true homebrew and beable to play backups? I mean I don't want to keep my PS3 in the basement to collect dust if I know I can't play PS3 games in the future...
Logged