Better way to disable rendering.

Investigation into how Linux on the PS3 might lead to homebrew development.

Moderators: cheriff, emoon

Post Reply
IronPeter
Posts: 207
Joined: Mon Aug 06, 2007 12:46 am
Contact:

Better way to disable rendering.

Post by IronPeter »

There is approx ~20 megs of xdrmemory used as virtual screen buffer.

This memory is mapped to GPU and is very useful for GPU data storing ( dynamic vertex and index buffers, dynamic textures, fifo buffer ).

I want to use this memory in the exclusive mode. The problem is ioctl for FB does not affect this memory usage by X driver. Blitting is stopped, but X rendering is still active.

I want to do simpe thing - stop X rendering, use virtual screen buffer memory for my purposes, restart X rendering.

What is the easiest way to do that?
jimparis
Posts: 1145
Joined: Fri Jun 10, 2005 4:21 am
Location: Boston

Post by jimparis »

The ioctl for the FB shouldn't affect whether the FB uses the memory either, maybe you're just getting lucky and it happens to be on the back-buffer that doesn't overlap with the region you're using?

I'd imagine X is just mmaping the memory, and as far as I know you can't force munmap. Maybe you could temporarily change the mappings in the kernel so it goes to some dummy region that you don't care about? Or just stop the X process so that it's not actually writing to it.
IronPeter
Posts: 207
Joined: Mon Aug 06, 2007 12:46 am
Contact:

Post by IronPeter »

>it happens to be on the back-buffer that doesn't overlap with the region you're using?

Yes, I can use the higher region of this memory, megs 8-20. X driver uses begin of this region. I want to have the whole region in the exclusive mode.

>Or just stop the X process so that it's not actually writing to it.

Yes, I want to stop X process and restart it. But virtual frame buffer will be filled with my own data, I want X driver to redraw all windows. Remapping is not an option, the key idea is to reduce memory consumption.

How can I stop X driver and restart it? Even console rendering must be disabled...
jimparis
Posts: 1145
Joined: Fri Jun 10, 2005 4:21 am
Location: Boston

Post by jimparis »

Yes, I want to stop X process and restart it. But virtual frame buffer will be filled with my own data, I want X driver to redraw all windows. Remapping is not an option, the key idea is to reduce memory consumption.

How can I stop X driver and restart it? Even console rendering must be disabled...
You could literally stop the X process, ie. do the equivalent of sending it SIGSTOP/SIGCONT. But that won't trigger it to redraw. I guess you could do an xrefresh from userspace, but I think if you really want X to cooperate with you then you'll have to use a different video driver than fbdev.
unsolo
Posts: 155
Joined: Mon Apr 16, 2007 2:39 am
Location: OSLO Norway

Post by unsolo »

I just finished my rectangle fill function for EXA backend on spu's

Going to work on rectangle copy today which is the same spu.

By simply throwing off this to write to /dev/null instead the FB could become "free"

Another point is that when running X you only need around 1900 x 1200*4 B for the framebuffer as X does not run it double buffered.

The Mplayer vo is currently set up to use the virual double buffered mode.
But how long time does a blit take ? 9.2MB/24GB is 0.4 ms so i recon this can be stripped from that as well

Isn't having one draw in gpu + one in ram double buffering enough!

This is a driver thing and can / are beeing looked at.

cheers
Don't do it alone.
User avatar
mc
Posts: 211
Joined: Wed Jan 12, 2005 7:32 am
Location: Linköping

Post by mc »

One thing that might be worth trying is to use the VT_ACTIVATE ioctl to switch to a different virtual console, and then set it to graphics mode with KDSETMODE to prevent the vt driver from rendering text or cursor to it. Then you ought to get exclusive access to the fb memory. X will start rendering again when you switch back to its virtual console.
Flying at a high speed
Having the courage
Getting over crisis
I rescue the people
Post Reply