PS3 GPU Driver: Difference between revisions

From PS3 Developer wiki
Jump to navigation Jump to search
Line 42: Line 42:
cd ps3gpu_test
cd ps3gpu_test
make
make
./ps3gpu_test
 
sudo ./ps3gpu_test
context id 0
control handle 0x10000000000 size 4096
fifo handle 0x40000000000 gpu addr 0x08d000000
FIFO put 0x0d000000 get 0x0d000000 ref 0xdeadbabe
reset GPU state handle 0x50000000000 gpu addr 0x0d010000
FIFO put 0x0d00000c get 0x0d00000c ref 0xcafef00d
VRAM handle 0x60000000000 gpu addr 0x00000000
cursor handle 0x70000000000 gpu addr 0x00900000
</pre>
</pre>



Revision as of 17:56, 22 September 2012

Introduction

  • FreeBSD character device which gives you direct access to PS3 GPU from user-space.

Features

  • Upto 3 GPU contexts simultaneously (LV1 limit is 3 contexts per LPAR).
  • Direct control of GPU FIFO from user-space.
  • Support of hardware cursors.
  • Dynamic allocation of GART memory.
  • Mapping of GART memory into GPU address space is done by the driver. That means user-space applications do not have to worry about it.
  • Access to GART and VRAM memory through mmap syscall.
  • Heap management for GART and VRAM memory.
  • Support of display buffers.

Kernel Driver

Building

  • You can cross-compile the kernel module or build it natively on PS3 FreeBSD.
  • The kernel module and the kernel should match. That means the kernel module should be build against the same kernel source else the kernel module cannot be loaded (The same applies on Linux).
cd /usr/devel
env MAKEOBJDIRPREFIX=/usr/obj/PS3 SYSDIR=/usr/devel/sys make TARGET=powerpc TARGET_ARCH=powerpc64 buildenv
cd /home/glevand/ps3gpu
make
ls -l ps3gpu.ko

Test

kldload ./ps3gpu.ko

cd ps3gpu_test
make

sudo ./ps3gpu_test
context id 0
control handle 0x10000000000 size 4096
fifo handle 0x40000000000 gpu addr 0x08d000000
FIFO put 0x0d000000 get 0x0d000000 ref 0xdeadbabe
reset GPU state handle 0x50000000000 gpu addr 0x0d010000
FIFO put 0x0d00000c get 0x0d00000c ref 0xcafef00d
VRAM handle 0x60000000000 gpu addr 0x00000000
cursor handle 0x70000000000 gpu addr 0x00900000

To restore your console:

vidcontrol < /dev/ttyv0 80x25

Screenshots

X11 Driver

Building


Test

Screenshots

Future Work

  • Use ps3gpu driver for syscons.