Page 1 of 1

Virtual Display on OS X

PostPosted: Wed Oct 22, 2014 7:06 pm
by masovies

I purchased this book to learn how to write a driver for an emulated display, but did not find much help.

I have written one with IOFrameBuffer, but it is not hardware accelerated and am not sure where I am going wrong. Do you have any guidance/is there an easier way to trick OS X into thinking there is a display connected that you can drag windows to (GPU accelerated/60fps)?

Re: Virtual Display on OS X

PostPosted: Thu Oct 23, 2014 4:02 pm
by morpheus
First, the book was meant as a general internals book, not an immediate one-stop-shop for specific questions such as a virtual display, which is extremely driver-specific.

That said, I aim to cover the [Mobile]FrameBuffer architecture in more detail in the 2nd edition. That, too, won't be at a level of "here's a source code for a virtual display", though the more I think about it the more it strikes me as a good idea for a proof of concept. At least a screengrab from IOMobileFramebuffer on iOS, which is fairly straightforward. So thanks for the idea.

In terms of virtual displays on OS X, screen sharing provides a complete VNC solution to clone the display - if you just wanted to grab the display, you could piggy back on top of that. If you want a full virtual display, there's only so much that hardware acceleration could do here in the first place, especially when we are looking at > 2k resolution - the data is going to be very heavy in those cases. dragging windows is handled by GL/CL, which means the GPU needs to do the work. you could *try* messing with the resolution at the GPU level (if it supports a higher resolution) then projecting (mapping) only some of the window onto the "real" screen, thereby getting an unmapped FrameBuffer which you can then do whatever with.