<?xml version='1.0' encoding='utf-8' ?>
<!--  If you are running a bot please visit this policy page outlining rules you must respect. http://www.livejournal.com/bots/  -->
<rss version='2.0' xmlns:lj='http://www.livejournal.org/rss/lj/1.0/' xmlns:media='http://search.yahoo.com/mrss/' xmlns:atom10='http://www.w3.org/2005/Atom'>
<channel>
  <title>airlied</title>
  <link>http://airlied.livejournal.com/</link>
  <description>airlied - LiveJournal.com</description>
  <lastBuildDate>Mon, 14 May 2012 17:05:58 GMT</lastBuildDate>
  <generator>LiveJournal / LiveJournal.com</generator>
  <lj:journal>airlied</lj:journal>
  <lj:journalid>5891031</lj:journalid>
  <lj:journaltype>personal</lj:journaltype>
  <atom10:link rel='hub' href='http://pubsubhubbub.appspot.com/' />
  <image>
    <url>http://l-userpic.livejournal.com/34369888/5891031</url>
    <title>airlied</title>
    <link>http://airlied.livejournal.com/</link>
    <width>80</width>
    <height>68</height>
  </image>

<item>
  <guid isPermaLink='true'>http://airlied.livejournal.com/75980.html</guid>
  <pubDate>Mon, 14 May 2012 17:05:58 GMT</pubDate>
  <title>ripping the X server a new driver API</title>
  <link>http://airlied.livejournal.com/75980.html</link>
  <description>So I&apos;ve been slowly writing the hotplug support v3 in between all the real jobs I have to do.&lt;br /&gt;&lt;br /&gt;[side note: When I started out on hotplug. one of my goals was to avoid changing the server API/ABI too much so I could continue side by side testing.]&lt;br /&gt;&lt;br /&gt;how did I get to v3?&lt;br /&gt;v0.1: was called dynerama it failed miserably and proved that using Xinerama as the plugging layer was a bad plan.&lt;br /&gt;v1: was the first time I decided to use an impedance layer between some server objects and driver objects.&lt;br /&gt;v2: was the a major rebase of v1.&lt;br /&gt;&lt;br /&gt;v2 was trucking along nicely and I managed to get the design to the stage where PRIME offloading intel/nouveau worked, USB device hotplug with udl worked, and GPU switch worked between two drivers. However v2 duplicated a lot of code and invented a whole new set of API objects called DrvXRec, so DrvScreenRec, DrvPixmapRec, DrvGCRec etc, this lead me to looking at the pain of merging this into the drivers and the server, and my goals of avoiding changing the API/ABI was getting in my way.&lt;br /&gt;&lt;br /&gt;So before starting v3 I decided to rework some of the server &quot;APIs&quot;.&lt;br /&gt;&lt;br /&gt;The X server has two main bodies of code, one called DIX, and one called DDX. The DIX (device independent X) code and the DDX (Device dependent X code). In the X.org tree the dix lives up in the top level dirs, and for X.org server the DDX lives in hw/xfree86. The main object with info about protocol screens and GPUs is called ScreenRec in the DDX and ScrnInfoRec in the DIX. These are stored in two arrays, screenInfo.screens in the DIX and xf86Screens in the DDX, when code wants to convert between these it can do one of a few things.&lt;br /&gt;&lt;br /&gt;a) lookup by index, both structs have an index value, so to go from ScrnInfo to Screen you look at screenInfo.screens[scrninfo-&amp;gt;scrnIndex] and other way is xf86Screens[screen-&amp;gt;myNum]. This is like the I didn&apos;t try and make an API, I just exposed everything.&lt;br /&gt;&lt;br /&gt;b) ScrnInfo has a ScreenPtr in it, so some code can do ScrnInfo-&amp;gt;pScreen to get the pointer to the dix struct. But this pointer is initialised after a bunch of code is called, so you really can&apos;t guarantee this pointer is going to be useful for you.&lt;br /&gt;&lt;br /&gt;c) XF86SCRNINFO uses the DIX private subsystem to lookup the Scrn in the Screen&apos;s privates. This is the least used and probably slowest method.&lt;br /&gt;&lt;br /&gt;So also screenInfo.screens contains the protocol screens we exposed to the clients, so this array cannot really change or move around. So I&apos;d like to add screeninfo.gpuscreens and xf86GPUScreens and not have drivers know which set of info they are working on, however (a) totally screws this idea, since the indices are always looked up directly in the global arrays.&lt;br /&gt;&lt;br /&gt;Now lots of the Screen/ScrnInfo APIs exposed to the drivers pass an int index as the first parameter, the function in the driver then goes and looks up the global arrays.&lt;br /&gt;&lt;br /&gt;So my first API changes introduce some standard conversion functions xf86ScreenToScrn and xf86ScrnToScreen, and converts a lot of the server to use those. Yay an API. The second set of changes then changes all of the index passing APIs to pass ScrnInfoPtr or ScreenPtr, so the drivers don&apos;t go poking into global arrays. Now this is a major API change, it will involve slightly messy code in drivers that want to work with both servers, but I can&apos;t see a nicer way to do it. I&apos;ve done a compat header file that will hopefully allows to cover a lot of this stuff where we don&apos;t see it.&lt;br /&gt;&lt;br /&gt;I&apos;ve ono other API introduction on the list, Glyph Pictures are another global array indexed by screen index, I&apos;ve gone and added an accessor function so that drivers don&apos;t use the index anymore to get at the array contents directly.&lt;br /&gt;&lt;br /&gt;Once this stuff lands in the server, a team of people will go forward and port the drivers to the new APIs (who am I kidding).</description>
  <comments>http://airlied.livejournal.com/75980.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>2</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://airlied.livejournal.com/75555.html</guid>
  <pubDate>Thu, 22 Dec 2011 17:28:41 GMT</pubDate>
  <title>update on hotplug server</title>
  <link>http://airlied.livejournal.com/75555.html</link>
  <description>No new videos yet, need to fix some more rendering bugs so it looks nicer :)&lt;br /&gt;&lt;br /&gt;So I&apos;ve been working towards 3 setups:&lt;br /&gt;&lt;br /&gt;a) intel rendering + nouveau offload&lt;br /&gt;b) nouveau rendering + DVI output + intel LVDS output&lt;br /&gt;c) hotplug USB with either intel or nvidia rendering.&lt;br /&gt;&lt;br /&gt;Categorisation of devices roles:&lt;br /&gt;I&apos;ve identified 4 devices roles so far:&lt;br /&gt;preferred master: the device is happy to be master&lt;br /&gt;reluctant master: the device can be a master but would rather not be&lt;br /&gt;offload slave: device can be used as an additional DRI2 renderer for a master&lt;br /&gt;output slave: device can be used an additional output for a master&lt;br /&gt;&lt;br /&gt;For the 3 setups above:&lt;br /&gt;a) intel would be preferred master, nvidia would be offload slave&lt;br /&gt;b) nvidia would be preferred master, intel would be output slave&lt;br /&gt;c) usb devices would be output slaves, however if no master exists, usb device would be reluctant master.&lt;br /&gt;&lt;br /&gt;I&apos;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&apos;ll have to get back to them. But the code works and doesn&apos;t oops randomly which is good.&lt;br /&gt;&lt;br /&gt;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.&lt;br /&gt;&lt;br /&gt;So I&apos;ve done nearly all the work to share between intel and nouveau and I&apos;ve done the kernel driver work for udl, but I haven&apos;t done the last piece in userspace for (c), which is to use the shared pixmap as usb scanout via the modesetting driver.&lt;br /&gt;&lt;br /&gt;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.&lt;br /&gt;&lt;br /&gt;So the current short-term TODO is:&lt;br /&gt;fix some issues with my nouveau/exa port rendering&lt;br /&gt;fix some issues with xcompmgr&lt;br /&gt;add usb output slave support.&lt;br /&gt;&lt;br /&gt;Medium-term TODO:&lt;br /&gt;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&apos;ll see on screen, however we probably want a lot of this to be client driven (i.e. gnome-settings-daemon).&lt;br /&gt;&lt;br /&gt;Longer term TODO:&lt;br /&gt;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 :)&lt;br /&gt;&lt;br /&gt;[1] &lt;a href=&apos;http://cgit.freedesktop.org/~airlied/linux/log/?h=drm-prime-dmabuf&apos; rel=&apos;nofollow&apos;&gt;http://cgit.freedesktop.org/~airlied/linux/log/?h=drm-prime-dmabuf&lt;/a&gt;</description>
  <comments>http://airlied.livejournal.com/75555.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>5</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://airlied.livejournal.com/75405.html</guid>
  <pubDate>Fri, 21 Oct 2011 11:15:25 GMT</pubDate>
  <title>hotplug demo video (teaching X.org new tricks).</title>
  <link>http://airlied.livejournal.com/75405.html</link>
  <description>So today I managed to see something on screen doing X.org hotplug work. So I present to you live X.org plugging.&lt;br /&gt;&lt;br /&gt;&lt;a href=&apos;http://www.youtube.com/watch?v=g54y80blzRU&apos; rel=&apos;nofollow&apos;&gt;http://www.youtube.com/watch?v=g54y80blzRU&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Pretty much is a laptop running xf86-video-modesetting driver, with my server, an xterm + metacity. Plug in a USB displaylink device, with a kernel drm driver I wrote for it. (Sneaky xrefresh in the background). and the USB device displays the xterm and metacity.&lt;br /&gt;&lt;br /&gt;So what actually happens?&lt;br /&gt;&lt;br /&gt;The X server at the start had loaded drivers using udev, and the a new driver ABI. It exports one X protocol screen and plugs an internal DrvScreen into it.&lt;br /&gt;&lt;br /&gt;When the hotplug happens, the server inits another DrvScreen for the new device, and plugs it into the single protocol screen. It also copies all the driver level pixmaps/pictures/GCs into the new driver. The single protocol screen at the bottom layer multiplexes across the plugged in drvscreens.&lt;br /&gt;&lt;br /&gt;This is like Xinerama pushed down a lot further in the stack, so instead of doing iterations at the protocol level, we do it down at the acceleration level. Also I have randr code hooked up so all the outputs appear no matter what GPU they are from.&lt;br /&gt;&lt;br /&gt;This isn&apos;t exactly what I want for USB hotplug, ideally we&apos;d use the main GPU to render stuff and only scanout using the USB device, but this is step one. I also need the ability to add/remove drvscreens and all the associated data in order to support dynamic GPU switching.&lt;br /&gt;&lt;br /&gt;The real solution is a still a long ways off, but this is just a small light in a long tunnel, I&apos;ve been hacking on this on/off for over a year now, so its nice to see something visible for the first time.</description>
  <comments>http://airlied.livejournal.com/75405.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>9</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://airlied.livejournal.com/75131.html</guid>
  <pubDate>Tue, 19 Jul 2011 10:00:08 GMT</pubDate>
  <title>first impression of google plus</title>
  <link>http://airlied.livejournal.com/75131.html</link>
  <description>If you&apos;ve seen the social network, you know when he launches &quot;The Facebook&quot; the first time he needs his friend with the non-nerd contacts email list, I get the feeling that google plus never got this step.&lt;br /&gt;&lt;br /&gt;When I joined facebook it was because my mother sent me an invite.&lt;br /&gt;&lt;br /&gt;The thing is finding out what my nerd friends are doing is easy, they are always on irc or mailing lists or twittering. I&apos;m not sure what google+ adds to this.</description>
  <comments>http://airlied.livejournal.com/75131.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://airlied.livejournal.com/74826.html</guid>
  <pubDate>Wed, 11 May 2011 07:56:32 GMT</pubDate>
  <title>glibc - inconsistent interfaces due to arrogance</title>
  <link>http://airlied.livejournal.com/74826.html</link>
  <description>To start off, I don&apos;t actually mind arrogant people as long as they back their attitude up with some semblance of sanity, however arrogance without ability pisses me off, and it seems that its the number 1 trait to be a maintainer of glibc.&lt;br /&gt;&lt;br /&gt;Today someone pointed out F_SETOWN_EX to me which I can use to fix a problem in the X server, however trying to use gettid made me realise why these guys are considered such fuckwits.&lt;br /&gt;&lt;br /&gt;&lt;a href=&apos;http://sourceware.org/bugzilla/show_bug.cgi?id=6399&apos; rel=&apos;nofollow&apos;&gt;http://sourceware.org/bugzilla/show_bug.cgi?id=6399&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;WTF? glibc exposes 3 interfaces that need the result of gettid passed to them and internally relies on gettid to implement raise properly and it won&apos;t expose the interface. Notice in the bug he never addresses the problems, just closes it with &quot;CLOSED ARROGANCE&quot;.&lt;br /&gt;&lt;br /&gt;Other recent glibc fuckwittery includes the whole overlapping memcpy issues in F14 breaking flash for everyone, and trying to remove the rpc implementation a week before the F15 final release freeze, so that if the package had gotten in and packages that needed a rebuild for say a security fix would mean linking the fixed package against a different RPC library than the original which could cause untold pains.&lt;br /&gt;&lt;br /&gt;So really if glibc could DIACF already thanks.</description>
  <comments>http://airlied.livejournal.com/74826.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>19</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://airlied.livejournal.com/74519.html</guid>
  <pubDate>Tue, 29 Mar 2011 00:11:55 GMT</pubDate>
  <title>upgraded planet.kernel.org + planet.freedesktop.org planet software to venus</title>
  <link>http://airlied.livejournal.com/74519.html</link>
  <description>This is a test post hidden in an informational post.&lt;br /&gt;&lt;br /&gt;I&apos;ve upgraded the planet generator software for planet.kernel.org and planet.freedesktop.org to the latest venus codebase.&lt;br /&gt;&lt;br /&gt;This was mainly due to the older planet software running p.fd.o taking down the webserver once or twice this week.&lt;br /&gt;&lt;br /&gt;Hopefully it doesn&apos;t do any damage.</description>
  <comments>http://airlied.livejournal.com/74519.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://airlied.livejournal.com/74260.html</guid>
  <pubDate>Sun, 23 Jan 2011 23:25:19 GMT</pubDate>
  <title>LCA 2011</title>
  <link>http://airlied.livejournal.com/74260.html</link>
  <description>First day of LCA 2011 at Kelvin Grove QUT Brisbane.&lt;br /&gt;&lt;br /&gt;I&apos;ll be organising the Southern Plumbers mini conference today, and will be speaking on Thursday at 11:30 AM about graphics drivers (who&apos;d have guessed).</description>
  <comments>http://airlied.livejournal.com/74260.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://airlied.livejournal.com/74176.html</guid>
  <pubDate>Tue, 07 Dec 2010 04:42:55 GMT</pubDate>
  <title>working t410s intel/nvidia basic switching</title>
  <link>http://airlied.livejournal.com/74176.html</link>
  <description>git repo:&lt;br /&gt;&lt;a href=&apos;http://git.kernel.org/?p=linux/kernel/git/airlied/drm-testing.git&apos; rel=&apos;nofollow&apos;&gt;http://git.kernel.org/?p=linux/kernel/git/airlied/drm-testing.git&lt;/a&gt;&lt;br /&gt;branch: drm-nvidia-switch&lt;br /&gt;&lt;br /&gt;So I have a T410s with an LVDS panel and switchable graphics between intel and nvidia. I&apos;ve gotten the basic switching support just like we have on the intel/amd combination.&lt;br /&gt;&lt;br /&gt;The code is a start towards generic nvidia/nvidia and intel/nvidia switching but its missing some bits. The MUX switch on some GPUs relies on passing a parameter to the WMI function that we aren&apos;t passing, luckily the lenovo doesn&apos;t need this parameter at the moment so it works fine. Other laptops in this range may require the parameter.&lt;br /&gt;&lt;br /&gt;I&apos;ll try and get some more info on the magic value we need to pass on other systems to make it work better, other systems like the Sony Vaios have a number of muxable outputs listed in a table, that the intel acpi code prints out at drm.debug=0x4. Again the lenovo doesn&apos;t have this table.&lt;br /&gt;&lt;br /&gt;Other issues:&lt;br /&gt;once switched and powered off the Intel, we get log spam from the IPS driver about the MCP limits.&lt;br /&gt;nouveau gets a 1024x768 console since we can&apos;t detect the LVDS panel at startup.&lt;br /&gt;&lt;br /&gt;also, this only works with open source drivers, i915 and nouveau.</description>
  <comments>http://airlied.livejournal.com/74176.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>24</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://airlied.livejournal.com/73890.html</guid>
  <pubDate>Tue, 09 Nov 2010 01:09:27 GMT</pubDate>
  <title>some info on intel/nvidia switchable</title>
  <link>http://airlied.livejournal.com/73890.html</link>
  <description>Okay I sat down for a few hours last week with a switchable Intel/NVidia GPU laptop, and at least worked out some more info. I&apos;m going to braindump it here.&lt;br /&gt;&lt;br /&gt;Firstly in intel_acpi.c jbarnes has worked out some of the values for outputs in the ACPI tables esp around what is and isn&apos;t MUXed.&lt;br /&gt;&lt;br /&gt;Now we had suspected that one of the nvidia GPU DSM methods (method 5) might actually do something, but a deeper investigation along with mjg59 made us realise it isn&apos;t the mux control, so we started looking elsewhere.&lt;br /&gt;&lt;br /&gt;So we tracked down the MXDS method which is attached to the ACPI outputs per GPU, there is one on the LVDS for the internal GPU and one on the LVDS for the external GPU. So it appears that this is the mux switching object. Looking further up it appears that this is called via a WMI interface, so to do this all properly it looks like we need to write a WMI driver to call the mux switching, instead of just banging on ACPI methods.&lt;br /&gt;&lt;br /&gt;So going forward a WMI driver needs to be written to which you pass the ACPI output IDs to the WMI MXDS method, and it should switch the mux.&lt;br /&gt;&lt;br /&gt;Now despite this we didn&apos;t actually get the switching to happen, nouveau never got an auxch connection to the panel on the laptop, so I&apos;d really like to see if anyone is useful enough to take this knowledge and make it do something on an LVDS laptop, all I  have locally are a big pile of hacks.&lt;br /&gt;&lt;br /&gt;Thanks to Jesse Barnes for the laptop, and Matthew Garrett for the ACPI decoding.&lt;br /&gt;&lt;br /&gt;[update: one commentor asked about Macs, they have a non-WMI, non-ACPI method of handling things, sidolin on #nouveau at one stage mostly reverse engineering the mux, which was just reading/writing some memory mapped I/O ports to do the switch, not sure how far he is from pushing some patches out].</description>
  <comments>http://airlied.livejournal.com/73890.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>8</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://airlied.livejournal.com/73491.html</guid>
  <pubDate>Sat, 25 Sep 2010 03:29:40 GMT</pubDate>
  <title>Southern Plumbers Miniconf CFP (LCA 2011 - Brisbane)</title>
  <link>http://airlied.livejournal.com/73491.html</link>
  <description>As part of LCA 2011, we are organising a mini-conference to provide a place for low-level system developers to gather and discuss interesting aspects of the kernel and lowlevel userspace. This miniconf is aimed at a similar audience to the Linux Plumbers Conference.&lt;br /&gt;&lt;br /&gt;We&apos;d really like to have talks that are entry points to open floor discussions and interactive sessions, though if a talk is interesting enough it will be considered depending on the quality of other submissions.&lt;br /&gt;&lt;br /&gt;Areas of interest:&lt;br /&gt;	- Linux kernel&lt;br /&gt;	- X.org / Mesa&lt;br /&gt;	- toolchain/gdb (not deep compiler stuff, more system interactions)&lt;br /&gt;	- udev/u*/*Kit/hal replacements&lt;br /&gt;	- systemd/upstart/sysvinit&lt;br /&gt;	- virtualisation&lt;br /&gt;&lt;br /&gt;The Southern Plumbers mini-conference is planned for Monday 24th Jan 2011.&lt;br /&gt;&lt;br /&gt;Please send all submissions to airlied@gmail.com. Submissions will close on Friday, October 29th (when I leave for the real Linux Plumbers Conference), though I may accept submission over the week of LPC as well if I can drum up interest.&lt;br /&gt;&lt;br /&gt;CFP available at &lt;a href=&apos;http://planet.kernel.org/splca/cfp.txt&apos; rel=&apos;nofollow&apos;&gt;http://planet.kernel.org/splca/cfp.txt&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;--&lt;br /&gt;Dave Airlie and Matthew Wilcox.</description>
  <comments>http://airlied.livejournal.com/73491.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://airlied.livejournal.com/73337.html</guid>
  <pubDate>Sat, 03 Jul 2010 01:28:52 GMT</pubDate>
  <title>embedded GPU : what are they hiding?</title>
  <link>http://airlied.livejournal.com/73337.html</link>
  <description>So to follow on from my posting stating my position wrt kernel drivers for closed source userspace drivers, lets take a look at the embedded GPU industry and Linux kernel relationship.&lt;br /&gt;&lt;br /&gt;What does the embedded industry get from Linux?&lt;br /&gt;&lt;br /&gt;They get a kernel which is royalty free, with 1000s of man-years of development experience and resources. Before Linux these vendors either sourced an OS on a royalty basis from some closed-shop, or rolled their own in-house one.&lt;br /&gt;&lt;br /&gt;Now people might say &quot;but the embedded GPU industry has to support Windows as well&quot;, but take one look at NVIDIA Tegra One and you can see the embedded windows marketplace is less than important, NVIDIA Tegra Two is all about the Linux, whereas they were pretty much only talking to MS on Tegra one.&lt;br /&gt;&lt;br /&gt;So Linux is a great boon for this industry, and means they can produce higher quality products for a lower cost (or lower quality products at a lower cost in some cases). So really there are probably two games in town for these embedded vendors, selling into Apple or selling into Linux centric developments, like Android, Meego, Linaro.&lt;br /&gt;&lt;br /&gt;So what are they actually hiding in userspace?&lt;br /&gt;&lt;br /&gt;The main thing they seem to be hiding is shader compilers and their GPU assembler code, things that convert from GLES into the assembler code for their GPUs. This stuff isn&apos;t rocket science but it probably is where most of their speed up and tricks are hidden. &lt;br /&gt;&lt;br /&gt;So why do they think it valuable?&lt;br /&gt;&lt;br /&gt;I think all 3D IP vendors dream of becoming Imagination Technologies, they need to learn there is already one Imagination Technologies and the only way to easily disrupt their revenue stream and sell into other SOCs is to be disruptive, not just follow the herd. They also probably had to spend a lot of money writing a decent GPU compiler from scratch, whereas most embedded firmware is a lot more trivial, so they probably think they need to directly recoup the costs from this development instead of giving it away. The thing is they are hw vendors, the sw is a sunk cost, opening it would actually make future maintenance easier. HW companies never do well at SW and they would be best to just open it and try and involve some community development around it.&lt;br /&gt;&lt;br /&gt;Is the value of this IP more valuable than what the receive from Linux?&lt;br /&gt;&lt;br /&gt;This is the crux of my issue with these vendors, they are receiving the Linux kernel for free, but don&apos;t want to contribute anything back. They know they can&apos;t sell into any where else except Linux driven products, but they insist on keeping their development methodologies from the days of Windows and their own in-house OSes. Those days are gone, but they cling to the idea that for some reason they can produce a better GPU stack on their own than they could in collaboration with other, despite the fact that the kernel that forms the basis for their sales was developed in this fashion. They also all use gcc as the compiler for their CPUs again proving the insanity.&lt;br /&gt;&lt;br /&gt;Isn&apos;t it up to them what they do?&lt;br /&gt;&lt;br /&gt;Totally, but its also up to the Linux community to push back against them. The thing is they&apos;d never have opened any code if it wasn&apos;t for the GPL making them at least open the kernel portions, they don&apos;t care about freedom or GPL, they care about their bottom line, and doing the least amount of work to remain legal and make money. Now they are getting all this wonderful software for free, Linux phone sales are driving their bottom line, but they still don&apos;t want to play the game by the rules of the kernel. They want to have their cake and eat it too. (the cake is a lie). Hence they spend their time creating their own solutions in private, releasing what they have to comply with legalese but never actually allowing people the freedom to use their devices.&lt;br /&gt;&lt;br /&gt;So shouldn&apos;t we give a little?&lt;br /&gt;&lt;br /&gt;The thing is two major vendors have been pushing Imagination Technologies for years to open something, these guys are aiming to sell thousands-&amp;gt;millions of devices, we have gotten the ugliest kernel shim in the world in 4 years of trying. All the other vendors are only willing to give that little. I don&apos;t personally think any of them want to open this stuff and will hide behind IP excuses for ever.&lt;br /&gt;&lt;br /&gt;What will make them change their minds?&lt;br /&gt;&lt;br /&gt;a) money and lots of it. If google or olpc can demand open driver commitments (in contracts, not handwaving agreements) then I suspect these vendors will quickly realise the value of their IP is dwarved by the value of sales. This probably means a major chance for one of the vendors to control a lot of the space in the Linux world.&lt;br /&gt;&lt;br /&gt;b) disruptive vendor, one vendor realises before the others that opening their IP will lead to more sales than keeping it closed and also lead to the chance of more people optimising their technology and leveraging other work in the industry.&lt;br /&gt;&lt;br /&gt;So are you saying they should drop all their in-house developed solutions?&lt;br /&gt;&lt;br /&gt;No I&apos;m saying that the driver for their hardware is a single entity, and if the whole entity isn&apos;t open, then none of it is truly open. So if they don&apos;t want to release an open userspace, then they don&apos;t get to merge their open kernel bits to support the closed userspace. We have to keep the maintenance burden on them, so it keeps costing them money to track newer kernels, and they don&apos;t get community support from other vendors who have committed to doing things right.&lt;br /&gt;&lt;br /&gt;So why should they re-write drivers?&lt;br /&gt;&lt;br /&gt;This happens in Linux the whole time, with nearly every new technology. Wireless, RAID, SATA for example, all have had vendors trying to push complete stacks of their own writing, you&apos;ll notice over time the drivers that are actually written to the current stacks work best, an the crazy vendors drivers are often horror shows. &lt;br /&gt;&lt;br /&gt;What would be nice to happen?&lt;br /&gt;&lt;br /&gt;It would be great if there was a hero with time/funding and involvement in the ARM GPU community to take over being maintainer of these solutions, from kernel all the way to userspace. Vendor driver writers could ask this person for advice, and they could have some sort of working group where they develop a stack based around current Linux technologies, like GEM/TTM/DRI2/Mesa/Gallium3D. If you take a look at the mesa stack lately, there has been a lot of work on making it work as an EGL/GLES stack as well as a classic GL stack. Then vendors would supply open drivers compliant with this stack, and just sell lots of chips.&lt;br /&gt;&lt;br /&gt;What would be most likely negative solution?&lt;br /&gt;&lt;br /&gt;We get what we have now, they maintain the 5-6 GPU stacks in their own world, and never talk to each other, and it costs them more and more money going forward to maintain. Some  hero reverse engineers one or two of the GPU architecture, maybe some hero writes a open driver stack from docs under NDA or with open docs.&lt;br /&gt;&lt;br /&gt;I may update this post as I have more thoughts ;-)</description>
  <comments>http://airlied.livejournal.com/73337.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>15</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://airlied.livejournal.com/73115.html</guid>
  <pubDate>Thu, 01 Jul 2010 23:42:14 GMT</pubDate>
  <title>open source kernel bits with closed source userspaces</title>
  <link>http://airlied.livejournal.com/73115.html</link>
  <description>[I posted this to lkml earlier - discussion should happen there not in comments here, but its nice to have somewhere easy to point people at].&lt;br /&gt;&lt;br /&gt;Now this is just my opinion as maintainer of the drm, and doesn&apos;t&lt;br /&gt;reflect anyone or any official policy, I&apos;ve also no idea if Linus&lt;br /&gt;agrees or not.&lt;br /&gt;&lt;br /&gt;We are going to start to see a number of companies in the embedded&lt;br /&gt;space submitting 3D drivers for mobile devices to the kernel. I&apos;d like&lt;br /&gt;to clarify my position once so they don&apos;t all come asking the same&lt;br /&gt;questions.&lt;br /&gt;&lt;br /&gt;If you aren&apos;t going to create an open userspace driver (either MIT or&lt;br /&gt;LGPL) then don&apos;t waste time submitting a kernel driver to me.&lt;br /&gt;&lt;br /&gt;My reasons are as follows, the thing is you can probably excuse some&lt;br /&gt;of these on a point by point basis, but you need to justify why closed&lt;br /&gt;userspace on all points.&lt;br /&gt;&lt;br /&gt;a) licensing, Alan Cox pointed this out before, if you wrote a GPL&lt;br /&gt;kernel driver, then wrote a closed userspace on top, you open up a&lt;br /&gt;while world of derived work issues. Can the userspace operate on a&lt;br /&gt;non-GPL kernel without major modifications etc. This is a can of worms&lt;br /&gt;I&apos;d rather not enter into, and there are a few workarounds.&lt;br /&gt;&lt;br /&gt;b) verifying the sanity of the userspace API.&lt;br /&gt;1. Security: GPUs can do a lot of damage if left at home alone, since&lt;br /&gt;mostly you are submitting command streams unverified into the GPU and&lt;br /&gt;won&apos;t tell us what they mean, there is little way we can work out if&lt;br /&gt;the GPU is going to over-write my passwd file to get 5 fps more in&lt;br /&gt;quake. Now newer GPUs have at least started having MMUs, but again&lt;br /&gt;we&apos;ve no idea if that is the only way they work without docs or a lot&lt;br /&gt;of trust.&lt;br /&gt;&lt;br /&gt;2. General API suitability and versioning. How do we check that API is&lt;br /&gt;sane wrt to userspace, if we can&apos;t verify the userspace. What happens&lt;br /&gt;if the API has lots of 32/64 compat issues or things like that, and&lt;br /&gt;when we fix them the binary userspace breaks? How do we know, how do&lt;br /&gt;we test etc. What happens if a security issue forces us to break the&lt;br /&gt;userspace API? how do we fix the userspace driver and test to confirm?&lt;br /&gt;&lt;br /&gt;c) supplying docs in lieu of an open userspace&lt;br /&gt;If you were to fully document the GPU so we could verify the&lt;br /&gt;security/api aspects it leaves us in the position of writing our own&lt;br /&gt;driver. Now writing that driver on top of the current kernel driver&lt;br /&gt;would probably limit any innovation, and most people would want to&lt;br /&gt;write a new kernel driver from scratch. Now we end up with two drivers&lt;br /&gt;fighting, how do we pick which one to load at boot? can we ever do a&lt;br /&gt;generic distro kernel for that device (assuming ARM ever solves that&lt;br /&gt;issue).&lt;br /&gt;&lt;br /&gt;I&apos;ve also noticed a trend to just reinvent the whole wheel instead of&lt;br /&gt;writing a drm/kms driver and having that as the API, again maintainer&lt;br /&gt;nightmares are made of this.&lt;br /&gt;&lt;br /&gt;d) you are placing the maintenance burden in the wrong place&lt;br /&gt;&lt;br /&gt;So you&apos;ve upstreamed the kernel bits, kept the good userspace bits to&lt;br /&gt;yourselfs, are stroking them on your lap like some sort of Dr Evil,&lt;br /&gt;now why should the upstream kernel maintainers take the burden when&lt;br /&gt;you won&apos;t actually give them the stuff to really make their hardware&lt;br /&gt;work? This goes for nvidia type situations as well, the whole point is&lt;br /&gt;to place the maintainer burden at the feet of the people causing the&lt;br /&gt;problems in an effort to make them change. Allowing even an hour of&lt;br /&gt;that burden to be transferred upstream, means more profit for them,&lt;br /&gt;but nothing in return for us.</description>
  <comments>http://airlied.livejournal.com/73115.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>3</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://airlied.livejournal.com/72817.html</guid>
  <pubDate>Tue, 04 May 2010 23:30:46 GMT</pubDate>
  <title>lolbuntu</title>
  <link>http://airlied.livejournal.com/72817.html</link>
  <description>Ted with the smackdown:&lt;br /&gt;&lt;br /&gt;&lt;a href=&apos;https://bugs.launchpad.net/ubuntu/+source/linux/+bug/543617/comments/20&apos; rel=&apos;nofollow&apos;&gt;https://bugs.launchpad.net/ubuntu/+source/linux/+bug/543617/comments/20&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Update:&lt;br /&gt;when you can&apos;t fix bugs in your &quot;enterprise distro&quot; file them against someone elses community distro:&lt;br /&gt;&lt;a href=&apos;https://bugzilla.redhat.com/show_bug.cgi?id=588930&apos; rel=&apos;nofollow&apos;&gt;https://bugzilla.redhat.com/show_bug.cgi?id=588930&lt;/a&gt;</description>
  <comments>http://airlied.livejournal.com/72817.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://airlied.livejournal.com/72455.html</guid>
  <pubDate>Fri, 16 Apr 2010 05:19:46 GMT</pubDate>
  <title>engineering FAIL</title>
  <link>http://airlied.livejournal.com/72455.html</link>
  <description>So we bought an Electrolux front-loader washing machine just over a year ago, all ready for the amount of washing a baby produces!!&lt;br /&gt;&lt;br /&gt;a few days ago, the drum stopped spinning. I did all the filter cleaning etc the manual recommended but still no moving drum. So as I was ringing the warranty repair people I decided to use a lot more force than I&apos;d consider using on something under warranty. This was followed by the sound of a coin dropping somewhere inside and the drum moving again. However it still wouldn&apos;t move under power. So I called Electrolux who gave me the is Tuesday 2 weeks good for you?.&lt;br /&gt;&lt;br /&gt;So I decided to have a look myself, took the lid off and low and behold the drive belt had snapped in half. So today I bought a new drive belt from a spares place and tonight I shall endeavour to resurrect the washer.&lt;br /&gt;&lt;br /&gt;Now some net searching over the course of last night discovered this is a really common problem on these washing machines. The washing machine when faced with the prospect of coins will just let a coin enter between the two drums and once there it can then jam the inner and outer drums together and cause the drive belt to snap or the motor to give up. Now I&apos;m not the best person at taking money out of my jeans and stuff goes into the wash sometimes before I notice, but really who thinks selling a washing machine that can die when faced with one or two accidental coins is a) something you can sell, b) something you can apparently say isn&apos;t a warranty fault as there is a sticker on the thing saying not to put coins in it. I think if Electrolux came to fix it would cost nearly 1/4 the price of the washing machine if the warranty didn&apos;t cover it.&lt;br /&gt;&lt;br /&gt;So I&apos;m hoping to abuse my google juice to say to everyone &quot;DON&apos;T BUY ELECTROLUX FRONT LOAD WASHING MACHINES&quot; because they obviously don&apos;t think about using them in the real world.</description>
  <comments>http://airlied.livejournal.com/72455.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>8</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://airlied.livejournal.com/72345.html</guid>
  <pubDate>Wed, 24 Mar 2010 03:30:14 GMT</pubDate>
  <title>radeontool 1.6.1 released</title>
  <link>http://airlied.livejournal.com/72345.html</link>
  <description>I&apos;ve just done a 1.6.1 release of radeontool from my personal repo, it contains both&lt;br /&gt;radeontool and avivotool, and is probably full of ugly but whats in distros now is older&lt;br /&gt;and worse.&lt;br /&gt;&lt;br /&gt;radeontool (and avivotool) are lowlevel tools to tweak register and dump state on radeon&lt;br /&gt;GPUs, they also can parse parts of the BIOS data tables.&lt;br /&gt;&lt;br /&gt;Tarballs are at&lt;br /&gt;&lt;a href=&apos;http://people.freedesktop.org/~airlied/radeontool/&apos; rel=&apos;nofollow&apos;&gt;http://people.freedesktop.org/~airlied/radeontool/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;git://people.freedesktop.org/~airlied/radeontool.git&lt;br /&gt;&lt;br /&gt;Main changes:&lt;br /&gt;r128 support from Jonathan Nieder&lt;br /&gt;Some new legacy table decoding added&lt;br /&gt;cleanups</description>
  <comments>http://airlied.livejournal.com/72345.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://airlied.livejournal.com/72187.html</guid>
  <pubDate>Thu, 18 Mar 2010 01:59:57 GMT</pubDate>
  <title>two X servers one graphics card.</title>
  <link>http://airlied.livejournal.com/72187.html</link>
  <description>So sane multi-seat handling was something I wanted to make KMS do at some point and designed for but never quite implemented.&lt;br /&gt;&lt;br /&gt;So in an attempt to maybe get help out people who are interesting in this I&apos;ve gotten two seats on a single card working here to a demoable level.&lt;br /&gt;&lt;br /&gt;&lt;a href=&apos;http://people.freedesktop.org/~airlied/multiseat/&apos; rel=&apos;nofollow&apos;&gt;http://people.freedesktop.org/~airlied/multiseat/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;contains a kernel patch + libdrm patch.&lt;br /&gt;&lt;br /&gt;The kernel patch pretty much contains 3 pieces:&lt;br /&gt;&lt;br /&gt;(a) ability to create &quot;render&quot; device nodes with an attached list of output resources it controls (crtcs/encoders/connectors).&lt;br /&gt;(b) hardcoded render node setup for my X1900 - two parts - core drm creates 3 devices nodes, radeon driver assigns hardcoded&lt;br /&gt;resources to the nodes - in this case render node 0 gets a crtc + DVI + encoders, and node 1 gets the other crtc/DVI/encoders, and&lt;br /&gt;render node 2 gets no outputs.&lt;br /&gt;(c) drm mapping fixups for multiple device nodes - this is something we should probably cleanup independently of this patch.&lt;br /&gt;&lt;br /&gt;the libdrm patch just contains support to use an env var to pick the device path.&lt;br /&gt;&lt;br /&gt;With this xorg.conf and the two startx wrappers I can run two X servers separately.&lt;br /&gt;&lt;br /&gt;TODO:&lt;br /&gt;(a) define a kernel/user interface to set seats and nodes up. The DRM control node is there specifically for this purpose but I never got around to specifying this interface. It basically needs a few methods:&lt;br /&gt; 1. Create new render node with output configuration.&lt;br /&gt; 2. Remove render node.&lt;br /&gt;These would have to rely on their being no users of the render or legacy device nodes in advance. The kernel would&lt;br /&gt;also have to get the driver to validate the output configuration. The output configuration would be a list of IDs for crtcs/encoders/connectors.&lt;br /&gt;&lt;br /&gt;(b) maybe add a drm device path to xorg.conf so each card section can specify one, would help get away from BusID also.&lt;br /&gt;&lt;br /&gt;(c) make a sane userspace interface to use it all - I suspect you&apos;d need something in gdm/ConsoleKit to configure this sort of&lt;br /&gt;thing, you&apos;d have to construct per-card multi-seat profiles with a list of the outputs and stuff you want on each seat etc.&lt;br /&gt;&lt;br /&gt;At this point I&apos;m just trying to flesh out my backlog of projects and figure out how long they will take to do properly, feel free if someone is interested in picking this up and running with it.</description>
  <comments>http://airlied.livejournal.com/72187.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>14</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://airlied.livejournal.com/71734.html</guid>
  <pubDate>Fri, 12 Mar 2010 06:16:59 GMT</pubDate>
  <title>GPU offloading - PRIME - proof of concept</title>
  <link>http://airlied.livejournal.com/71734.html</link>
  <description>THIS IS A PROOF OF CONCEPT - its not going to be upstream unless someone else dedicates their life to it, (btw anyone know anyone in ASUS?)&lt;br /&gt;&lt;br /&gt;So NVIDIA unveiled their optimus GPU selection solution for Windows 7, so I decided to see what it would take to implement something similar under DRI. I&apos;ve named it PRIME for obvious reasons.&lt;br /&gt;&lt;br /&gt;Goals:&lt;br /&gt;1. Allow a second GPU to render 3D apps onto the screen of the first, pickable from the client side.&lt;br /&gt;2. Just target the rendering side, I&apos;m assuming the GPU power up/down is similiar to what was done for the older switching method.&lt;br /&gt;&lt;br /&gt;Restrictions + limitations:&lt;br /&gt;1. Must have compositing manager running&lt;br /&gt;2. Must have second screen configured for slave card (doesn&apos;t need to be used)&lt;br /&gt;&lt;br /&gt;Test system:&lt;br /&gt;Intel 945 IGP + radeon r200 PCI card - yes this won&apos;t be a speed demon.&lt;br /&gt;&lt;br /&gt;Terms:&lt;br /&gt;Master: the IGP displaying the output - intel&lt;br /&gt;Slave: the GPU rendering the app - radeon r200 in this case.&lt;br /&gt;&lt;br /&gt;Step 1: kernel support&lt;br /&gt;&lt;br /&gt;&lt;a href=&apos;http://git.kernel.org/?p=linux/kernel/git/airlied/drm-testing.git;a=shortlog;h=refs/heads/drm-prime-test&apos; rel=&apos;nofollow&apos;&gt;http://git.kernel.org/?p=linux/kernel/git/airlied/drm-testing.git;a=shortlog;h=refs/heads/drm-prime-test&lt;/a&gt;&lt;br /&gt;&lt;a href=&apos;http://cgit.freedesktop.org/~airlied/drm/log/?h=prime-test&apos; rel=&apos;nofollow&apos;&gt;http://cgit.freedesktop.org/~airlied/drm/log/?h=prime-test&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The kernel requirements were simple, we needed a way to share a memory managed object between two kernel device drivers.&lt;br /&gt;The kernel has a GEM namespace per device, however this isn&apos;t good enough to share with other devices, so I introduced a new PRIME namespace with two ioctls. One ioctl allows the master device to associate a device buffer handle with a name in the prime namespace, and the other allows the slave device to associate a prime namespace handle with a buffer. When the master creates a prime buffer the kernel associates the list of pages with the handle, and when the slave looks up the same handle it retrieves the list of pages and fakes up a TTM buffer populated with those pages as backing store. I&apos;ve added the concept of slave object to TTM to allow for this.&lt;br /&gt;&lt;br /&gt;The drm repo contains the API wrappers + intel + radeon pieces to call the association functions for buffer objects.&lt;br /&gt;&lt;br /&gt;Step two: DRI2 Protocol&lt;br /&gt;&lt;a href=&apos;http://people.freedesktop.org/~airlied/prime/0001-dri2proto-add-prime-token.patch&apos; rel=&apos;nofollow&apos;&gt;http://people.freedesktop.org/~airlied/prime/0001-dri2proto-add-prime-token.patch&lt;/a&gt;&lt;br /&gt;&lt;a href=&apos;http://people.freedesktop.org/~airlied/prime/0001-prime-support-for-mesa.patch&apos; rel=&apos;nofollow&apos;&gt;http://people.freedesktop.org/~airlied/prime/0001-prime-support-for-mesa.patch&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;From the X server point of view a recent change to the DRI2 layer allowed for multiple device driver names to be associated with a DRI2 end point. The client can request either a DRI or VDPAU device name currently. I firstly extended the DRI2 protocol, to add a new buffer type, called PRIME, and added a hack to mesa&apos;s glx loader to request the prime driver if an environment variable was specified.&lt;br /&gt;&lt;br /&gt;Step 3: X server DRI2 module + drivers&lt;br /&gt;&lt;br /&gt;&lt;a href=&apos;http://people.freedesktop.org/~airlied/prime/0001-intel-add-prime-master-support.patch&apos; rel=&apos;nofollow&apos;&gt;http://people.freedesktop.org/~airlied/prime/0001-intel-add-prime-master-support.patch&lt;/a&gt;&lt;br /&gt;&lt;a href=&apos;http://cgit.freedesktop.org/~airlied/xf86-video-ati/log/?h=prime-test&apos; rel=&apos;nofollow&apos;&gt;http://cgit.freedesktop.org/~airlied/xf86-video-ati/log/?h=prime-test&lt;/a&gt;&lt;br /&gt;&lt;a href=&apos;http://people.freedesktop.org/~airlied/prime/0001-dri2-prime-hackfest.patch&apos; rel=&apos;nofollow&apos;&gt;http://people.freedesktop.org/~airlied/prime/0001-dri2-prime-hackfest.patch&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;This was the messiest bit and still requires a lot of change. First up I added an interface for the drivers to register as PRIME master and slaves. Intel driver registers as master, radeon as slave for my demo. We store these in an array. When a client connects and requests prime driver, we mark the drawable and redirect the dri2 buffer creation requests to the slave screen driver. Also the drm authentication is sent to both kernel drms. It then hooks the swapbuffers command where it does a region copy, and redirects this to the slave driver, and damages the pixmap in the master driver. Now the &quot;interesting&quot; part, my original implementation simply grabbed the window pixmap at the dri2 create buffers time, however there is an ordering issue with compositing, this pixmap is pre-composite redirection so isn&apos;t actually the pixmap you want to tell the kernel to bind to both gpus. This turned out to function badly, I could see gears all stretched over the front buffer.&lt;br /&gt;&lt;br /&gt;So a quick coke + chocolate break later, I had enough sugar to bash out the hack that now exists. DRI2 calls the slave driver copy region callback, which checks if the drawable pixmap is on the same screen, if its not, it checks if we&apos;ve marked the pixmap as a prime pixmap (i.e. one that belongs to the master). It is, it swaps in the slaves copy, otherwise it callsback into DRI2. This callback calls the Intel driver to make the buffer object backing the pixmap, shareable, and returns the handle,then calls into radeon with the handle to create a new pixmap pointing at the shared buffer object. Once all that is done, radeon copies the back buffer to the shared front pixmap, we return and damage is posted and the compositor grabs the window pixmap and displays it. &lt;br /&gt;&lt;br /&gt;So does it work?&lt;br /&gt;On my blistering fast test system with X + xcompmgr running glxgears was going at 150fps from the r200 PCI card. Hopefully I can get some time on a faster system or one of the dual laptops.&lt;br /&gt;&lt;br /&gt;Caveats:&lt;br /&gt;- When a window manager is running the gears get all corrupted, this looks like the clipping and/or stride matching between&lt;br /&gt;the drivers isn&apos;t correct. I suspect something with reparenting and decorations, I&apos;m not enough of an X guru to understand this yet, hopefully one of the other hackers can fill me in. Also before it gets reparented and redirected a frame can land on the real front buffer, again clipping should take care of this, but isn&apos;t working yet. I need to workout how clipping and that stuff works in X/DRI2. - talk to ppl about clipping then JDI.&lt;br /&gt;- Once a client has connected as a prime, we don&apos;t tear it down properly, so later clients can end marked as prime. - work out some sort of resources to turn stuff off&lt;br /&gt;- Reference counting on the pages in the kernel is iffy, currently i915 ups the page list refcount but never drops it. solution JDI&lt;br /&gt;- hardcoded /dev/dri paths in dri2 for slave device - solution JDI&lt;br /&gt;- radeon driver could in theory be a prime master - solution JDI&lt;br /&gt;- nouveau could support prime master/slave also. - solution nouveau guys JDI&lt;br /&gt;- requires an ugly second screen in xorg.conf to load the slave driver. Can we have a 0 sized screen or maybe a rootless second screen.  - solution : rearchitect X server to allow drivers without screens (6m-1yr work)&lt;br /&gt;- pageflipping needs to be hacked off in intel driver. - work out and then JDI&lt;br /&gt;&lt;br /&gt;Where is the video?&lt;br /&gt;Once I get it working with a window manager on a useful machine I might do a video of two gears going.&lt;br /&gt;&lt;br /&gt;Where now?&lt;br /&gt;Well this is a purely academic exercise so far, after a week of kernel fighting I decided to do something new and cool. To make this as good as Windows we need to seriously re-architect the X server + drivers. At the moment you can&apos;t load an X driver without having a screen to attach it to, I don&apos;t really want a screen for the slave driver, however I still have to have one all setup and doing nothing and hopefully not getting in the way. We&apos;d need to separate screen + drivers a lot better. Having some sort of dynamic screens would probably fall out of this work if someone decides to actually do it.&lt;br /&gt;&lt;br /&gt;The kernel bits aren&apos;t as ugly as I thought but I&apos;m not sure if upstreaming them is a good idea without the others bits. The refcounting definitely needs work also the cleanup when clients exit.&lt;br /&gt;&lt;br /&gt;DRI2 needs some more changes, I might try and flesh it out a bit more and then talk to krh about a sane interface.&lt;br /&gt;&lt;br /&gt;I&apos;m probably going to get forced task switch quite soon, so I might just get to having this running on a W500 or T500, before dropping it for 6 months, so if anyone wants a neat project to play with and has the hw feel free to try and take this on.&lt;br /&gt;&lt;br /&gt;&lt;ob begging=&quot;begging&quot;&gt;&lt;br /&gt;ASUS feel free to send me one of the real optimus laptops and I&apos;ll get nouveau guys hooked up and try and RE the nvidia DMA engine.&lt;br /&gt;&lt;/ob&gt;</description>
  <comments>http://airlied.livejournal.com/71734.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>10</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://airlied.livejournal.com/71434.html</guid>
  <pubDate>Fri, 26 Feb 2010 05:04:56 GMT</pubDate>
  <title>GPU switching update</title>
  <link>http://airlied.livejournal.com/71434.html</link>
  <description>Okay I&apos;ve been busy elsewhere but dragged myself back to try and finish this for upstream&lt;br /&gt;&lt;br /&gt;v10 of the patch is up&lt;br /&gt;&lt;a href=&apos;http://people.freedesktop.org/~airlied/vgaswitcheroo/0001-vga_switcheroo-initial-implementation-v10.patch&apos; rel=&apos;nofollow&apos;&gt;http://people.freedesktop.org/~airlied/vgaswitcheroo/0001-vga_switcheroo-initial-implementation-v10.patch&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;changes are mainly that mjg59 was right about keeping ugly things in the drivers.&lt;br /&gt;&lt;br /&gt;adding ATRM support to get the ROMs on ATI hybrid for the discrete card was actually a pain with the previous code design,&lt;br /&gt;so I moved lots of it around again, and now the discrete ROM can be retrieved via the ATRM method.&lt;br /&gt;&lt;br /&gt;I&apos;ve tested it on the W500 and it works as well as before, which means still the 3rd or 4th switch fails and locks the machine up,&lt;br /&gt;I need to debug this further.&lt;br /&gt;&lt;br /&gt;The refactored code should hopefully make it easier to fill in the nvidia/nvidia and intel/nvidia blanks for mjg59.&lt;br /&gt;&lt;br /&gt;Update 1: v11 is now up&lt;br /&gt;&lt;a href=&apos;http://people.freedesktop.org/~airlied/vgaswitcheroo/0001-vga_switcheroo-initial-implementation-v11.patch&apos; rel=&apos;nofollow&apos;&gt;http://people.freedesktop.org/~airlied/vgaswitcheroo/0001-vga_switcheroo-initial-implementation-v11.patch&lt;/a&gt;&lt;br /&gt;It should fix the failure to switch to IGD the 2nd time hopefully.&lt;br /&gt;&lt;br /&gt;Update 2: v13 is now up, it blindly implements nvidia DSM changing, but I&apos;ve no idea if it works. Hopefully someone can test it and give me some feedback. Its nearly all guesswork from work mjg59 did.</description>
  <comments>http://airlied.livejournal.com/71434.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>16</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://airlied.livejournal.com/71261.html</guid>
  <pubDate>Mon, 08 Feb 2010 23:58:05 GMT</pubDate>
  <title>whats in drm-radeon-testing?</title>
  <link>http://airlied.livejournal.com/71261.html</link>
  <description>I&apos;ll try and post these regularly when I make major additions/removals.&lt;br /&gt;&lt;br /&gt;drm-radeon-testing is the cutting edge KMS radeon branch, it is going to be rebased and things will be added/removed as they are worked on by developers. So you can base patches on it but you should talk to the developer who owns the area first.&lt;br /&gt;&lt;br /&gt;git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6.git drm-radeon-testing&lt;br /&gt;&lt;br /&gt;I&apos;ve just pushed a rebased tree now with the following:&lt;br /&gt;&lt;br /&gt;latest i2c algo + hw i2c engine code + all fixes squashed: This adds support for hw i2c engines found on radeons and&lt;br /&gt;exposes them + sw i2c buses to userspace so i2c tools can use them. (agd5f).&lt;br /&gt;&lt;br /&gt;pll algorithm reworking + quirks: cleans up the code to allow for the selection of the old pll algorithm on some hardware. (agd5f)&lt;br /&gt;&lt;br /&gt;pm support so far: Adds all the current PM patches - just does engine reclocking so far using the power tables from the BIOS. (Zajec/agd5f)&lt;br /&gt;&lt;br /&gt;Evergreen (Radeon HD 5xxx) support: basic KMS support for the evergreen range of devices - no irqs or accel yet. (agd5f)&lt;br /&gt;&lt;br /&gt;radeon unlocked ioctl support (airlied)&lt;br /&gt;&lt;br /&gt;bad CS recording (glisse)&lt;br /&gt;&lt;br /&gt;misc cleanups/fixes - Dell/Sun server support ported from userspace hopefully.&lt;br /&gt;&lt;br /&gt;The tree did contain Jerome&apos;s r600 CS checker but I&apos;ve dropped it for now at his request as he has newer patches&lt;br /&gt;in testing.</description>
  <comments>http://airlied.livejournal.com/71261.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>3</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://airlied.livejournal.com/71012.html</guid>
  <pubDate>Thu, 04 Feb 2010 02:16:12 GMT</pubDate>
  <title>video of GPU switching</title>
  <link>http://airlied.livejournal.com/71012.html</link>
  <description>Here&apos;s a really badly shot video of GPU switching in action ;-0 - whiteouts are mostly be logging out and in ;-)&lt;br /&gt;&lt;br /&gt;&lt;lj-embed id=&quot;1&quot; /&gt;</description>
  <comments>http://airlied.livejournal.com/71012.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>20</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://airlied.livejournal.com/70828.html</guid>
  <pubDate>Wed, 03 Feb 2010 07:07:43 GMT</pubDate>
  <title>hybrid graphics : the story continues (part 3)</title>
  <link>http://airlied.livejournal.com/70828.html</link>
  <description>v6 of the patch + another patch which needs some work before I can merge it are available now.&lt;br /&gt;&lt;br /&gt;This mainly cleans up the patch architecture a lot and allow for Matthew to put his nvidia code in easier hopefully. Its moves the ATPX specific code to the radeon driver.&lt;br /&gt;&lt;br /&gt;The second patch is from an experiment that I videod on a webcam but am now failing to upload, I&apos;ll probably get a better video tomorrow, the lighting was fairly bad for it today.&lt;br /&gt;&lt;br /&gt;It basically allows for a delayed gpu switch ( it changes the debugfs API ), and allows gpu drivers to block the switch.&lt;br /&gt;&lt;br /&gt;The switch file now takes ON/OFF like always, but the PCI IDs input is gone. There are 4 commands&lt;br /&gt;&lt;br /&gt;IGD - try and switch now to the integrated device - can fail if drm drivers block it (mainly if X has the device open)&lt;br /&gt;DIS - try and switch now to the discrete device - can fail if drm drivers block it (X again).&lt;br /&gt;DIGD - try a delayed switch to integrated device&lt;br /&gt;DDIS - try a delayed switch to discrete device.&lt;br /&gt;&lt;br /&gt;So with X running you can echo DDIS to the file and log off X, it&apos;ll then switch as soon as X closes the drm device, and when&lt;br /&gt;gdm restarts X it&apos;ll be running on the discrete GPU. If we had a shiny GUI on top of this it&apos;d be as close as MacOSX can do it.&lt;br /&gt;When you select to do a delayed switch we power up the other GPU straight away so the switch is quicker. &lt;br /&gt;&lt;br /&gt;It needs more debugging, some open issues include:&lt;br /&gt;&lt;br /&gt;after a few switches it can die on its ass&lt;br /&gt;powering up the Intel glitches the display even when running the AMD&lt;br /&gt;there may be race conditions in the patch, probably need a mutex around device open + this stuff&lt;br /&gt;suspend/resume - since we D3 the card, if you do an s/r cycle it&apos;ll resume it, we need a flag in the&lt;br /&gt;driver to say its powered off by the mux and to ignore s/r cycles - I&apos;ve started adding this to radeon.&lt;br /&gt;&lt;br /&gt;mjg59 has access to an nvidia laptop and is looking closely at how to make that all work.</description>
  <comments>http://airlied.livejournal.com/70828.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>13</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://airlied.livejournal.com/70480.html</guid>
  <pubDate>Tue, 02 Feb 2010 05:49:55 GMT</pubDate>
  <title>hybrid graphics on Linux (Part 2)</title>
  <link>http://airlied.livejournal.com/70480.html</link>
  <description>Okay v4 of the patch is available at&lt;br /&gt;&lt;br /&gt;&lt;a href=&apos;http://people.freedesktop.org/~airlied/vgaswitcheroo/&apos; rel=&apos;nofollow&apos;&gt;http://people.freedesktop.org/~airlied/vgaswitcheroo/&lt;/a&gt;&lt;br /&gt;&lt;a href=&apos;http://people.freedesktop.org/~airlied/vgaswitcheroo/0001-vga_switcheroo-initial-implementation-v4.patch&apos; rel=&apos;nofollow&apos;&gt;http://people.freedesktop.org/~airlied/vgaswitcheroo/0001-vga_switcheroo-initial-implementation-v4.patch&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;First thing I added was power up/down methods. This calls the DRM suspend/resume methods + along with the cut power for discrete GPU. I&apos;m not sure dynamic Windows ever does this as it seems to take a bit of work, I suspect they just run the second GPU in really low power modes. This is slow because we have to repost the ATI card after turning it back on.&lt;br /&gt;&lt;br /&gt;I then talked to mjg59 and worked over the ATPX detection. I removed all the DMI code and it should detect *any* laptop that uses ATPX (i.e. ATI/ATI and Intel/ATI) from what I can see. I&apos;ve tested on Lenovo W500 and T500 now and it appears to work on both. Would be nice if someone on a ATI/ATI and/or ASUS ATI/ATI or ATI/Intel machines could give it a whirl. I think the main problem with ATI/ATI is the poweroff methods have a hardcoded Intel PCI ID. I&apos;ve no idea yet how to tell on an ATI/ATI which device is the IGD and which is discrete. Its probably more than likely the IGD is the one with the ATPX method on it.&lt;br /&gt;&lt;br /&gt;It doesn&apos;t switch off at boot yet but I&apos;ve added commands to let you do it.&lt;br /&gt;&lt;br /&gt;echo &quot;OFF&quot; &amp;gt; switch - turns off the not in use card, so if Intel and ATI are on at boot, it will turn off ATI&lt;br /&gt;echo &quot;ON&quot; &amp;gt; switch - turns back on not in use card&lt;br /&gt;echo &quot;PCIID&quot; &amp;gt; switch - causes a switch with full off/on cycles.&lt;br /&gt;&lt;br /&gt;nvidia combos appear to use a DSM method and in theory nouveau_acpi.c should be detecting that, so it might be possible for someone to hook that up.&lt;br /&gt;&lt;br /&gt;I&apos;ve also started looking at some desktop integration via gdm or logout - but its not my usual place to code so going is a bit slower ;-)</description>
  <comments>http://airlied.livejournal.com/70480.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>9</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://airlied.livejournal.com/70348.html</guid>
  <pubDate>Mon, 01 Feb 2010 09:03:08 GMT</pubDate>
  <title>hybrid graphics on Linux</title>
  <link>http://airlied.livejournal.com/70348.html</link>
  <description>So someone thought it would be a good idea to make laptops with two graphics chips in them and switch betweem them to save power.&lt;br /&gt;&lt;br /&gt;Now other OSes support this to varying degrees, I think XP + MacOSX require a logout cycle and Vista/Win7 can dynamically switch while running, while Linux basically falls over in a heap.&lt;br /&gt;&lt;br /&gt;So I sat down today with a Lenovo W500 which has an Intel GM45 and AMD Radeon 3650 Mobility in it, and I wrote a patch to try and get closer to the XP/MacOSX level.&lt;br /&gt;&lt;br /&gt;The result of one days straight hacking is at:&lt;br /&gt;&lt;a href=&apos;http://people.freedesktop.org/~airlied/vgaswitcheroo/&apos; rel=&apos;nofollow&apos;&gt;http://people.freedesktop.org/~airlied/vgaswitcheroo/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The patch is totally focused on the Lenovo W500, other switchers will need to add stuff to this codebase.&lt;br /&gt;&lt;br /&gt;So what works?&lt;br /&gt;Boot in switchable graphics - which boots with intel and radeon turned on&lt;br /&gt;KMS drivers load for radeon and intel, radeon BIOS stored in start of VRAM (driver hacked to read it)&lt;br /&gt;bind to both drivers + fbs for both.&lt;br /&gt;mount debugfs - cat /sys/kernel/debug/vgaswitcheroo/switch&lt;br /&gt;2&lt;br /&gt;0 :0000:01:00.0&lt;br /&gt;1+:0000:00:02.0&lt;br /&gt;shows the 02.0 (intel) device is in charge of the MUX.&lt;br /&gt;goto runlevel 5, play with X under the Intel driver, goto runlevel 3 kill X&lt;br /&gt;at fbcon echo &quot;0000:01:00.0&quot; &amp;gt; /sys/kernel/debug/vgaswitcheroo/switch&lt;br /&gt;barely glitches console and switches&lt;br /&gt;goto runlevel 5, play with X under the ATI driver, goto runlevel 3 kill X&lt;br /&gt;echo &quot;0000:00:02.0&quot; &amp;gt; /sys/kernel/debug/vgaswitcheroo/switch&lt;br /&gt;goto runlevel 5, play with X under intel again.&lt;br /&gt;wash and repeat.&lt;br /&gt;&lt;br /&gt;What does it do?&lt;br /&gt;So far its just switching the MUX using the ACPI method and remapping all the console to the other framebuffer device,&lt;br /&gt;it also reset the bits that denotes which devices is the boot vga device which X uses to pick the primary GPU. This&lt;br /&gt;means X doesn&apos;t need an xorg.conf to switch. (I think all those patches are in upstream X server).&lt;br /&gt;&lt;br /&gt;What does it not do?&lt;br /&gt;It doesn&apos;t powerdown the radeon when its not in use yet. I know the ACPI call to power it off/on, and since I have&lt;br /&gt;the BIOS I should be able to repost it. So I&apos;ll try adding the callbacks into the KMS driver to do this soon.&lt;br /&gt;It doesn&apos;t poewrdown the intel when its not in use yet. Not sure what I can do here, since there is no ACPI method to turn&lt;br /&gt;it off. I think I can just D3 the GPU, and use the normal s/r paths to bring it back. Again requires more investigation.&lt;br /&gt;The whole what ACPI + methods map to what device, how the mux ids match etc will probably all need to be stored in the DMI table.&lt;br /&gt;Anything not a Lenovo W500 - probably not that hard to add other Intel/AMD variants to this, add DMI and mux switching method.&lt;br /&gt;nouveau isn&apos;t hooked up - this could probably be done by some interested party - the driver hooks so far aren&apos;t very hard.&lt;br /&gt;No idea about ATI/ATI or NV/NV ones either.&lt;br /&gt;&lt;br /&gt;I&apos;m really hoping interested community people can make this actually useful to them on other hw, I won&apos;t have permanent access to the W500 to keep this all tested in the future.&lt;br /&gt;&lt;br /&gt;Can we do dynamic switch without restarting X?&lt;br /&gt;No. X needs a lot of work, a lot more than the day it took to hack the kernel.&lt;br /&gt;&lt;br /&gt;How do we go forward?&lt;br /&gt;We probably need to add gdm support to move this forward. A logout button that is &quot;Switch GPU&quot;, that gdm kills the X server,&lt;br /&gt;then hits the switch port and starts a new X server. I&apos;ll try and talk to some gdm hackers over the next few days.&lt;br /&gt;I&apos;ll try and push this into a git tree against Linus current, and we can add tested patches for other machines as they go in.&lt;br /&gt;Also the DMI section is only imaginary of what I think others might need, we might have to rip it all out. Also I&apos;ve no idea&lt;br /&gt;if there are ACPI methods to query the switchable modes etc.</description>
  <comments>http://airlied.livejournal.com/70348.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>12</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://airlied.livejournal.com/69950.html</guid>
  <pubDate>Fri, 22 Jan 2010 03:18:39 GMT</pubDate>
  <title>LCA 2010 talk</title>
  <link>http://airlied.livejournal.com/69950.html</link>
  <description>So I originally was going to attend LCA 2010 for the week, but real life interjected and I couldn&apos;t abandon family commitments for that long, so I ended up doing a crazy cross-Tasman dash. As well as the change in flights, Isabel came down with a virus and Gia also got it, I think I got a milder version of it, but they both seem alright by the time I left but I had little sleep the previous two nights.&lt;br /&gt;&lt;br /&gt;So I flew on Wednesday morning, got in Wed afternoon, met up with ppl, had a couple of beers, wrote slides, slept, finished slides, went to Thur morning, drugged myself up on Nurofen Plus to combat viral effects, gave my talk, went to see ajax talk, went to professional network dinner, went for beers with ajax + benh (listening to an American and a Frenchman speaking about wine while listening to drum n bass in a Wellington pub was a bit wierd). Decided to push on through, so got back to room at 3am or so, checked out/left for airport at 4:20am, flew at 6:20am, into BNE at 7am, home, bed, sleep for a few hours and mind Isabel for afternoon.&lt;br /&gt;&lt;br /&gt;So my talk was &quot;So you&apos;ve put kernel graphics drivers in the kernel... what next? can I haz ponies?&quot;. My slide deck is off the 0-content style + lots of pictures of various ponies, which I&apos;ve found, they&apos;ll be on the LCA site soon and I&apos;ll upload them when I plug that laptop in again.&lt;br /&gt;&lt;br /&gt;(a) stop people reading ahead of your bullet points so they don&apos;t doze off while you are catching up&lt;br /&gt;(b) gives them something to look at apart from me while they actually have to listen to me :-P&lt;br /&gt;&lt;br /&gt;It seemed well received, the room was pretty packed out (ppl standing/sitting - LCA schedulers you listening?) and I don&apos;t think the sickness or lack of decent preparation made a big difference. I&apos;d like to apologise for not even mentioning SGX/poulsbo, I&apos;m not sure how but it totally slipped my mind, but the situation hasn&apos;t really changed in terms of how screwed it is.</description>
  <comments>http://airlied.livejournal.com/69950.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>1</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://airlied.livejournal.com/69648.html</guid>
  <pubDate>Thu, 17 Dec 2009 05:22:43 GMT</pubDate>
  <title>radeontool 1.6.0  released</title>
  <link>http://airlied.livejournal.com/69648.html</link>
  <description>I&apos;ve just done a 1.6.0 release of radeontool from my personal repo, it contains both&lt;br /&gt;radeontool and avivotool, and is probably full of ugly but whats in distros now is older&lt;br /&gt;and worse.&lt;br /&gt;&lt;br /&gt;radeontool (and avivotool) are lowlevel tools to tweak register and dump state on radeon&lt;br /&gt;GPUs, they also can parse parts of the BIOS data tables.&lt;br /&gt;&lt;br /&gt;Tarballs are at&lt;br /&gt;&lt;a href=&apos;http://people.freedesktop.org/~airlied/radeontool/&apos; rel=&apos;nofollow&apos;&gt;http://people.freedesktop.org/~airlied/radeontool/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;git://people.freedesktop.org/~airlied/radeontool.git</description>
  <comments>http://airlied.livejournal.com/69648.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
</channel>
</rss>

