airlied 12/22/11 05:28 pm update on hotplug server No new videos yet, need to fix some more rendering bugs so it looks nicer :)



So I've been working towards 3 setups:



a) intel rendering + nouveau offload

b) nouveau rendering + DVI output + intel LVDS output

c) hotplug USB with either intel or nvidia rendering.



Categorisation of devices roles:

I've identified 4 devices roles so far:

preferred master: the device is happy to be master

reluctant master: the device can be a master but would rather not be

offload slave: device can be used as an additional DRI2 renderer for a master

output slave: device can be used an additional output for a master



For the 3 setups above:

a) intel would be preferred master, nvidia would be offload slave

b) nvidia would be preferred master, intel would be output slave

c) usb devices would be output slaves, however if no master exists, usb device would be reluctant master.



I've rebased the prime work[1] on top of the dma-buf upstream work, and worked through most of the lifetime problems. Some locking issues still exist, and I'll have to get back to them. But the code works and doesn't oops randomly which is good.



prime is the kernel magic needed for this work, as it allows sharing of a buffer between two drm drivers, so for (a) it shares the dri2 front pixmap between devices, for (b/c) it shares a pixmap that the rendering gpu copies dirty updates to and the output slaves use as their scanout pixmap.



So I've done nearly all the work to share between intel and nouveau and I've done the kernel driver work for udl, but I haven't done the last piece in userspace for (c), which is to use the shared pixmap as usb scanout via the modesetting driver.



Today I hacked in a switch on the first randr command, so I can start the X server with intel as master and nouveau in offload mode. I can run gears on intel or nouveau, then after the randr command and another randr command to set a mode, the X server migrates everything to the nouveau driver, puts it in master mode, and places the intel driver into output slave mode. It seems to render my xterm + metacity content fine.



So the current short-term TODO is:

fix some issues with my nouveau/exa port rendering

fix some issues with xcompmgr

add usb output slave support.



Medium-term TODO:

worked out how to control this stuff, via randr protocol. How much information do we need to expose to clients about GPUs, and how do we control them. Open issues with atomicity of updates to avoid major uglys. Switching from intel master to nvidia master + intel outputs, means we have to reconfigure the Intel output to point at the new pixmap, but the more steps we put in there for clients to do, the more ugly and flashing we'll see on screen, however we probably want a lot of this to be client driven (i.e. gnome-settings-daemon).



Longer term TODO:

Get GLX_ARB_robustness done, now that Ian has done the context creation stuff, this should be a lot more trivial. (so trivial someone else could do it :)



[1] http://cgit.freedesktop.org/~airlied/linux/log/?h=drm-prime-dmabuf back to top back to top Mike Lothian 2011-12-22 07:06 pm (UTC) This is great news. I'm looking forward to this working with Radeons too



I've been a very naughty boy this year Santa and booting into Windows to play games :-( back to top tomasm 2011-12-23 01:02 am (UTC) Looks like you're more than busy enough with nouveau :) but do you have a proposed naming convention for radeon? Should (e.g.) $(driver)_is_optimus or $(driver)_is_$(hybrid_state_name) be used for other drm drivers?



> How much information do we need to expose to clients about GPUs



Some people are going to want absolutely everything exposed, whether or not it's a good idea. back to top airlied 2011-12-24 05:45 pm (UTC) basic radeon support should just be a matter of porting the driver, I just don't really have any laptops that require radeon here, and so I've been concentrating on the one laptop I do have. back to top LLStarks 2011-12-24 05:10 pm (UTC) Is there a script to build all of the trees?



Thanks again for all of your hard work. back to top airlied 2011-12-24 05:46 pm (UTC) Not really, currently you have to build my dri2proto, server, and drivers I think for all the bits, though the server is pretty much hacked to work on my laptop, it has a section in hw/xfree86/common/xf86DrvHelper.c that picks the configuration I want to hack on.



Leave a comment 5 comments