<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Geek on Two Wheels</title>
	<atom:link href="http://yangman.ca/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://yangman.ca/blog</link>
	<description>Grease, hacks, and shiny-blinky things</description>
	<lastBuildDate>Thu, 18 Mar 2010 02:40:57 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>It&#8217;s Facebook Caturday</title>
		<link>http://yangman.ca/blog/2010/03/17/its-facebook-caturday/</link>
		<comments>http://yangman.ca/blog/2010/03/17/its-facebook-caturday/#comments</comments>
		<pubDate>Thu, 18 Mar 2010 02:31:51 +0000</pubDate>
		<dc:creator>yangman</dc:creator>
				<category><![CDATA[Random]]></category>
		<category><![CDATA[cats]]></category>
		<category><![CDATA[caturday]]></category>
		<category><![CDATA[Facebook]]></category>

		<guid isPermaLink="false">http://yangman.ca/blog/?p=391</guid>
		<description><![CDATA[It&#8217;s not often that I check my Facebook account.  And, when I do, usually because someone is organizing some event using it, I rarely pay much attention.  Today, however, was an exception:

It&#8217;s caturday, apparently.
(Not shown: a link about cats further down the page.)
]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s not often that I check my Facebook account.  And, when I do, usually because someone is organizing some event using it, I rarely pay much attention.  Today, however, was an exception:</p>
<p><img class="alignnone size-full wp-image-392" title="Facebook Caturday" src="http://yangman.ca/blog/wp-content/uploads/2010/03/facebook-caturday.png" alt="" width="434" height="850" /></p>
<p>It&#8217;s <a href="http://en.wikipedia.org/wiki/Lolcat">caturday</a>, apparently.</p>
<p>(Not shown: a <a href="http://news.nationalgeographic.com/news/2010/03/photogalleries/100312-cat-species-rain-forest-pictures/#highest-big-cat-diversity-leopard_16730_600x450.jpg">link about cats</a> further down the page.)</p>
]]></content:encoded>
			<wfw:commentRss>http://yangman.ca/blog/2010/03/17/its-facebook-caturday/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Never Underestimate A Bit</title>
		<link>http://yangman.ca/blog/2010/02/10/never-underestimate-a-bit/</link>
		<comments>http://yangman.ca/blog/2010/02/10/never-underestimate-a-bit/#comments</comments>
		<pubDate>Wed, 10 Feb 2010 08:16:40 +0000</pubDate>
		<dc:creator>yangman</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[Hacking]]></category>
		<category><![CDATA[radeonhd]]></category>

		<guid isPermaLink="false">http://yangman.ca/blog/?p=384</guid>
		<description><![CDATA[The longer it takes to fix a bug, the smaller the fix will be.
When I first read this little gem of wisdom on DadHacker, I literally laughed out loud.  It was the same month that we finally resolved the once-infamous fd.o bug #13405.
#13405 was filed against xf86-video-radeonhd towards the end of November, 2007.  xf86-video-ati has [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>The longer it takes to fix a bug, the smaller the fix will be.</p></blockquote>
<p>When I first read this <a href="http://www.dadhacker.com/blog/?p=1117">little gem of wisdom</a> on <a href="http://www.dadhacker.com/blog/">DadHacker</a>, I literally laughed out loud.  It was the same month that we finally resolved the once-infamous <a href="http://bugs.freedesktop.org/show_bug.cgi?id=13405">fd.o bug #13405</a>.</p>
<p>#13405 was filed against xf86-video-radeonhd towards the end of November, 2007.  xf86-video-ati has a counterpart as <a href="http://bugs.freedesktop.org/show_bug.cgi?id=19215">bug #19215</a>, but filed almost a year later.   Despite a handful of very bright core developers and a few dedicated newbies (including yours truly) looking very closely at the problem, the fix was not to be committed until early May of 2009.</p>
<p>That&#8217;s over <em>seventeen months</em>.</p>
<p>To be fair, I don&#8217;t think there were any serious attempts at actually resolving the bug until I came along a year after its initial filing, eager to prove to the open source world that I have what it takes.  Even accounting for that, however, this was a process that took roughly five months.</p>
<p>In that time, a couple other commits fixing cursor corruption were made, but they turned out to be additional bugs that were only affecting certain hardware.  While both happened under equally peculiar circumstances, the original bug remained unresolved, despite multiple pairs of eyes and man hour investment in the double digits.</p>
<p>Finally, in the first week of May, 2009, the ever-awesome <a href="http://www.botchco.com/agd5f/">Alex Deucher</a> made <a href="http://cgit.freedesktop.org/xorg/driver/xf86-video-ati/commit/?id=da58e351b6398fa18b1d9c1a57a6e49b285f610f">commit da58e351</a> to xf86-video-ati, which I promptly ported to radeonhd, finally closing a year-and-a-half old bug.</p>
<p>So, what was the problem that plagued us for so long?</p>
<blockquote>
<pre><code>-	RHDRegWrite(Cursor, Cursor-&gt;RegOffset + D1CUR_CONTROL, 0);
+	RHDRegWrite(Cursor, Cursor-&gt;RegOffset + D1CUR_CONTROL, 0x00000200);</code></pre>
</blockquote>
<p><a href="http://cgit.freedesktop.org/xorg/driver/xf86-video-radeonhd/commit/?id=6f378a0d63df5fad86e16504c9d15c17849a67d3">One bit</a>.</p>
<p>Laugh out loud, indeed.</p>
]]></content:encoded>
			<wfw:commentRss>http://yangman.ca/blog/2010/02/10/never-underestimate-a-bit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>In Thirty Year&#8217;s Time</title>
		<link>http://yangman.ca/blog/2010/02/04/in-thirty-years-time/</link>
		<comments>http://yangman.ca/blog/2010/02/04/in-thirty-years-time/#comments</comments>
		<pubDate>Thu, 04 Feb 2010 09:31:11 +0000</pubDate>
		<dc:creator>yangman</dc:creator>
				<category><![CDATA[Random]]></category>
		<category><![CDATA[awesome]]></category>
		<category><![CDATA[fu manchu]]></category>

		<guid isPermaLink="false">http://yangman.ca/blog/?p=380</guid>
		<description><![CDATA[I want to be like this in thirty years:

I believe it to be a totally awesome and worthwhile goal.
]]></description>
			<content:encoded><![CDATA[<p>I want to be like this in thirty years:</p>
<p><a href="http://en.wikipedia.org/wiki/Fu_Manchu"><img class="alignnone" title="Pure Badass" src="http://yangman.ca/fumanchu5.jpg" alt="" width="503" height="396" /></a></p>
<p>I believe it to be a totally awesome and worthwhile goal.</p>
]]></content:encoded>
			<wfw:commentRss>http://yangman.ca/blog/2010/02/04/in-thirty-years-time/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Internet Archaeology</title>
		<link>http://yangman.ca/blog/2010/01/23/internet-archaeology/</link>
		<comments>http://yangman.ca/blog/2010/01/23/internet-archaeology/#comments</comments>
		<pubDate>Sun, 24 Jan 2010 06:53:11 +0000</pubDate>
		<dc:creator>yangman</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[autobiography]]></category>
		<category><![CDATA[Sharune]]></category>
		<category><![CDATA[zMUD]]></category>

		<guid isPermaLink="false">http://yangman.ca/blog/?p=375</guid>
		<description><![CDATA[While job hunting last year, the need to constantly write about my programming background prompted me to start writing an autobiography specifically about my coding history.  It&#8217;s a project I&#8217;ve been working on sporadically for the past several months, and has helped me remember some fairly obscure details of my past that, frankly, would have [...]]]></description>
			<content:encoded><![CDATA[<p>While job hunting last year, the need to constantly write about my programming background prompted me to start writing an autobiography specifically about my coding history.  It&#8217;s a project I&#8217;ve been working on sporadically for the past several months, and has helped me remember some fairly obscure details of my past that, frankly, would have been useful during some interviews.</p>
<p>One of the most prominent parts of my software development history is my involvement with <a href="http://www.sharune.com/">Sharune</a>.  Today, while attempting—and so far failing—to locate some old Delphi code written for this little MUD, I decided to do a search for the thing that I had built to see if it had become yet another artifact of the web.</p>
<p>No such luck.</p>
<p>What I did find, however, was this <a href="http://forums.zuggsoft.com/forums/viewtopic.php?p=23523">old forum thread</a> of me seeking help with what was the precursor to that project.</p>
<p>This, essentially, is the moment I stopped being just a video game nerd and started becoming a &#8220;fucking prolific&#8221; hacker.</p>
]]></content:encoded>
			<wfw:commentRss>http://yangman.ca/blog/2010/01/23/internet-archaeology/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Fishy Tale</title>
		<link>http://yangman.ca/blog/2009/12/15/a-fishy-tale/</link>
		<comments>http://yangman.ca/blog/2009/12/15/a-fishy-tale/#comments</comments>
		<pubDate>Wed, 16 Dec 2009 06:22:54 +0000</pubDate>
		<dc:creator>yangman</dc:creator>
				<category><![CDATA[Random]]></category>
		<category><![CDATA[fish]]></category>

		<guid isPermaLink="false">http://yangman.ca/blog/?p=370</guid>
		<description><![CDATA[My family keeps a tiny aquarium of three goldfish.  Two are stubby, have tiny fins, and move about more by waddling than swimming.  The third resembles a tiny golden carp with the behind of a Fantail, and is larger than the others combined.
It&#8217;s also a huge asshat.
The three fish are housed in a pathetically (but [...]]]></description>
			<content:encoded><![CDATA[<p>My family keeps a tiny aquarium of three goldfish.  Two are stubby, have tiny fins, and move about more by waddling than swimming.  The third resembles a tiny golden carp with the behind of a <a href="http://en.wikipedia.org/wiki/Fantail_%28goldfish%29">Fantail</a>, and is larger than the others combined.</p>
<p>It&#8217;s also a huge asshat.</p>
<p>The three fish are housed in a pathetically (but not quite unethically) small aquarium, and have only each other for amusement.  Now, I don&#8217;t know what goldfish or carps usually do for amusement when not being fed, but I&#8217;ve often noticed the largest of the three using the others to play what I&#8217;ve dubbed Upside-Down Fish.  The rules are simple: pick a fishmate, chase it into a corner, use the aquarium wall to flip your mate over and push it to the surface, then see how long you can keep it upside-down.</p>
<p>Remember those old-timey cartoons where sometimes a bully would pick up a smaller guy, roll him into a ball, then use him to play hoops or knock down some pins?  It&#8217;s exactly like that.  Except it&#8217;s only slightly funny, and mostly just mean.</p>
<p>In the words of the wise animal sanctuary warden:</p>
<blockquote><p>Well, animals are not like people, Mrs. Simpson.  Some of them act badly because they&#8217;ve had a hard life, or have been mistreated&#8230;but, like people, some of them are just jerks.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://yangman.ca/blog/2009/12/15/a-fishy-tale/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Beverly Hills Battlebot</title>
		<link>http://yangman.ca/blog/2009/12/06/beverly-hills-battlebot/</link>
		<comments>http://yangman.ca/blog/2009/12/06/beverly-hills-battlebot/#comments</comments>
		<pubDate>Sun, 06 Dec 2009 20:27:29 +0000</pubDate>
		<dc:creator>yangman</dc:creator>
				<category><![CDATA[Random]]></category>
		<category><![CDATA[Beverly Hills Cop]]></category>
		<category><![CDATA[China]]></category>

		<guid isPermaLink="false">http://yangman.ca/blog/?p=367</guid>
		<description><![CDATA[When I was growing up in China, there was a weekly SciFi radio show that was along the lines of Power Rangers. I listened to it religiously, and it featured the Beverly Hills Cop theme music as the opening score.
To this day, whenever I hear that tune, I think giant battle robots.
]]></description>
			<content:encoded><![CDATA[<p><span>When I was growing up in China, there was a weekly SciFi radio show that was along the lines of Power Rangers. I listened to it religiously, and it featured the <a href="http://www.boingboing.net/2009/11/11/worlds-most-awesome.html">Beverly Hills Cop</a> theme music as the opening score.</p>
<p>To this day, whenever I hear that tune, I think giant battle robots.</span></p>
]]></content:encoded>
			<wfw:commentRss>http://yangman.ca/blog/2009/12/06/beverly-hills-battlebot/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>This isn&#8217;t a Blind Date</title>
		<link>http://yangman.ca/blog/2009/12/02/this-isnt-a-blind-date/</link>
		<comments>http://yangman.ca/blog/2009/12/02/this-isnt-a-blind-date/#comments</comments>
		<pubDate>Thu, 03 Dec 2009 04:37:26 +0000</pubDate>
		<dc:creator>yangman</dc:creator>
				<category><![CDATA[Thoughts]]></category>
		<category><![CDATA[job hunting]]></category>

		<guid isPermaLink="false">http://yangman.ca/blog/?p=364</guid>
		<description><![CDATA[I have been job hunting for the better part of six months now.  Taking the overall health of the job market into account, this doesn&#8217;t seem like a big deal.  However, as a new graduate who qualified for but managed to miss the opportunity to receive employment insurance benefits, the whole thing is an ongoing [...]]]></description>
			<content:encoded><![CDATA[<p>I have been job hunting for the better part of six months now.  Taking the overall health of the job market into account, this doesn&#8217;t seem like a big deal.  However, as a new graduate who qualified for but managed to miss the opportunity to receive employment insurance benefits, the whole thing is an ongoing ordeal that has been crippling, exhausting, demoralizing, and confusing.</p>
<p>It&#8217;s this last point that I would like to elaborate on: why is there such an asymmetry of expectations for job seekers when compared to those in positions to hire?</p>
<p>(Of course, there is a clear difference in the volume of applications an employer may receive and how many simultaneous application processes an employee-hopeful is going through at the moment.  Let&#8217;s assume that the in-person interview has happened, and there is no expectation of a follow-up interview.)</p>
<p>Through the various career preparation courses and workshops I have had to endure, there was a consistent message that I, as a job seeker, should do my best to research and learn more about the potential employer and the position in question before sitting down at the interview.  However, in most cases, the true nature of a position is not revealed until the interview is happening, and, all things considered, this is reasonable.  What isn&#8217;t reasonable is the fact that employers are not held up to the same expectations.</p>
<p>Truth be told, half the time, I am unconvinced my interviewer has even read my relatively short, 1.2 page resumé beyond scanning the headers.  I am, however, fairly convinced that none have taken the time actually investigate my open source work.  Some don&#8217;t even seem to understand that I had just finished school, and unlikely to have years of professional experience.</p>
<p>However, this is a minor annoyance compared to the lack of communication following an interview.  Despite the promises of &#8220;get back to you next week&#8221; and &#8220;staying in touch&#8221;, only some ever do.   I am not expecting feedback on my interview performance or tips on how to do better next time; a courtesy one-liner will suffice. Paradoxically, but not surprisingly, the probability of being notified of a rejection seem to be inversely proportional to the size of the company in question.  Empirically, I have had exactly zero rejection messages from companies big enough to have dedicated HR staff.  Most of the smaller programming shops have been good in this respect, but the score is not quite perfect.</p>
<p>Granted, I have not requested for a response when none were received in the assured time frame.  And, frankly, why should I?  If I were responsible for making the final decision on a business transaction of such a scale, I will have the common courtesy to notify the other parties affected regardless of outcome.  However, as a job seeker, the expectation of such a reciprocation is apparently foolish.</p>
<p>The mind boggles.</p>
<p>I will end with this list of wishes and advice for employers:</p>
<ul>
<li>If you are collecting resumes over a month or more, and plan to have phone screenings, don&#8217;t leave it all until after the deadline.  We might not remember having applied with you at all.</li>
<li>If you have brought in candidates in for face-to-face interviews with the expectation that the outcome is Hire or No Hire, do let them know regardless of the outcome.  You wouldn&#8217;t leave a business partner hanging like that, would you?</li>
<li>Don&#8217;t take weeks making the final decision after the interviews are held.  In the odd chance there is a good reason, let people know.</li>
<li>Research us.  If we have impressive stuff to show, we would, and it&#8217;s not always the case that it should belong on a resumé.</li>
<li>Treat this with the same professionalism as you would any other business relationship.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://yangman.ca/blog/2009/12/02/this-isnt-a-blind-date/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Weiss explains DRI and DRM</title>
		<link>http://yangman.ca/blog/2009/11/20/weiss-explains-dri-and-drm/</link>
		<comments>http://yangman.ca/blog/2009/11/20/weiss-explains-dri-and-drm/#comments</comments>
		<pubDate>Fri, 20 Nov 2009 22:29:24 +0000</pubDate>
		<dc:creator>yangman</dc:creator>
				<category><![CDATA[Random]]></category>
		<category><![CDATA[dri]]></category>
		<category><![CDATA[drm]]></category>
		<category><![CDATA[graphics]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://yangman.ca/blog/?p=361</guid>
		<description><![CDATA[One more for the Linux graphics-related series of articles: How DRI and DRM Work.
]]></description>
			<content:encoded><![CDATA[<p>One more for the Linux graphics-related series of articles: <a href="http://www.bitwiz.org.uk/s/how-dri-and-drm-work.html">How DRI and DRM Work</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://yangman.ca/blog/2009/11/20/weiss-explains-dri-and-drm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Peter Hutterer Explains X11 Releases</title>
		<link>http://yangman.ca/blog/2009/10/27/peter-hutterer-explains-x11-releases/</link>
		<comments>http://yangman.ca/blog/2009/10/27/peter-hutterer-explains-x11-releases/#comments</comments>
		<pubDate>Wed, 28 Oct 2009 02:37:29 +0000</pubDate>
		<dc:creator>yangman</dc:creator>
				<category><![CDATA[Random]]></category>

		<guid isPermaLink="false">http://yangman.ca/blog/?p=356</guid>
		<description><![CDATA[Since we&#8217;re on the topic of Linux graphics systems, here&#8217;s is a recent article by Peter Hutterer explaining how X.org releases work:
X11R7.5 released &#8211; but what is it?
]]></description>
			<content:encoded><![CDATA[<p>Since we&#8217;re on the topic of <a href="http://yangman.ca/blog/2009/10/15/linux-graphics-driver-stack-explained/">Linux graphics systems</a>, here&#8217;s is a recent article by Peter Hutterer explaining how X.org releases work:</p>
<p><a href="http://who-t.blogspot.com/2009/10/x11r75-released-but-what-is-it.html">X11R7.5 released &#8211; but what is it?</a></p>
]]></content:encoded>
			<wfw:commentRss>http://yangman.ca/blog/2009/10/27/peter-hutterer-explains-x11-releases/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux “Graphics Driver Stack” Explained</title>
		<link>http://yangman.ca/blog/2009/10/15/linux-graphics-driver-stack-explained/</link>
		<comments>http://yangman.ca/blog/2009/10/15/linux-graphics-driver-stack-explained/#comments</comments>
		<pubDate>Thu, 15 Oct 2009 17:01:38 +0000</pubDate>
		<dc:creator>yangman</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mesa]]></category>
		<category><![CDATA[OpenGL]]></category>
		<category><![CDATA[x11]]></category>
		<category><![CDATA[xorg]]></category>

		<guid isPermaLink="false">http://yangman.ca/blog/?p=318</guid>
		<description><![CDATA[We get this question a lot about radeonhd: “When is 3D going to be supported?”
The short answer: never; 3D acceleration is the domain of Mesa.
But, of course, it’s not as simple as that.  For the long answer, read on…
More than Meets the Eye

Your Linux “video card driver” is not a single blob of code.  As [...]]]></description>
			<content:encoded><![CDATA[<p>We get this question a lot about <a href="http://www.x.org/wiki/radeonhd">radeonhd</a>: “When is 3D going to be supported?”</p>
<p>The short answer: never; 3D acceleration is the domain of <a href="http://www.mesa3d.org/">Mesa</a>.</p>
<p>But, of course, it’s not as simple as that.  For the long answer, read on…</p>
<h3>More than Meets the Eye</h3>
<p><a href="http://xkcd.com/619/"><img class="alignright" src="http://imgs.xkcd.com/comics/supported_features.png" alt="" width="324" height="326" /></a></p>
<p>Your Linux “video card driver” is not a single blob of code.  As with any sufficiently large piece of software, things need to be broken up into discrete components for both technical and maintainability reasons.  And, there is no doubt a complete graphics stack is large: the AMD Catalyst driver is a 93MB download.  That&#8217;s <em>over one hundred Mega bytes</em> of executable code and supporting data.  In that humongous pile of bytes are roughly half a dozen different components working together to deliver your polygonal needs, without counting the configuration tools.  This, unfortunately, is not common knowledge.</p>
<p>In the open source world, our drivers are much more svelte, partly because less features are supported, and also because application-specific optimizations are omitted.  Unlike the proprietary drivers, however, the boundaries of separation are clearly visible.  In respect to “driver” code that is specific to a particular hardware, there are, more or less, three separate components involved:</p>
<ul>
<li>X display driver</li>
<li>Mesa DRI driver</li>
<li>Kernel DRM driver</li>
</ul>
<p>Indeed, in true UNIX fashion, all of these are actually worked on as completely separate projects, albeit with significant overlap in the personnels involved. (Proprietary drivers from AMD and nVidia provide equivalents to all three in a single package.)</p>
<h3>DDX: People’s Favourite Barking Tree</h3>
<p>When the words “Linux video card driver” are invoked, the DDX is what people typically think of.  And, for good reason: historically, when configuring X11, the DDX was one of the few things that had to be configured by the user, and could be selected. This is your <tt>radeonhd</tt>, <tt>radeon</tt>, <tt>nv</tt>, and <tt>intel</tt>.</p>
<p>The main function of these drivers is to provide mode setting: that is, selecting the screen resolution, colour depth, turning outputs on and off, etc. The X server uses the DDX to perform basic, essential hardware manipulation so that you can have a graphical display at all.  Each DDX is hardware-specific: indeed, it stands for Device Dependent X (but this trivia is not very important.)</p>
<p>That’s not all.</p>
<p>A DDX also provides hooks that allow the X server to offload certain drawing operations to the GPU so that they can be accelerated.  XAA, EXA, and UXA all fall under the DDX&#8217;s domain, in addition to Xv.  The former group is responsible for things like moving windows around your desktop, scrolling a website in your favourite browser, and compositing desktop effects.  The latter handles video rendering.</p>
<p>To summarize, everything 2D is the domain of the DDX.  And, in simple terms, it is its only domain.  If you are looking for 3D acceleration, this is not the tree to be barking up at.</p>
<h3>Mesa DRI Driver: The Invisible Hero</h3>
<p>OpenGL is the method with which applications achieve 3D rendering under Linux.  Unfortunately, but for good reasons, it is not possible to go from an OpenGL function call to manipulating hardware states in a single step.  Multiple translations must be done under the hood to convert those calls into something that the GPU can understand.</p>
<p>Mesa is largely divided into two parts: an OpenGL compatible library stack that applications can call into, and DRI drivers that translate Mesa-internal instructions into forms that the video hardware can understand and execute.</p>
<p>After a call is made to the Mesa library and it has been translated into a GPU-specific language, the resulting operations need to be sent to the hardware for execution.  Mesa, however, cannot do this without help as it lives in user space:  only kernel space code is allowed to touch hardware directly.  Note that DDX is one of very few exceptions to this rule: it is technically user space code but allowed direct hardware access, for better or worse.</p>
<p>Unfortunately, sending these instructions through the DDX, and hence X, is not fast enough.  This point finally brings us to…</p>
<h3>DRM: Bridge to the Hardware</h3>
<p>The final piece of the driver stack is the Direct Rendering Manager.  Oversimplified, it exposes certain features of the hardware with an abstraction layer to user space such that applications like Mesa can make use of a GPU more efficiently.</p>
<p>It is also the job of the DRM layer to provide measures that ensure multiple applications that require working closely with the hardware to not step on each other&#8217;s toes.</p>
<p>DRM drivers are Linux kernel modules, which are accessed by user space through libdrm.</p>
<h3>All Together Now</h3>
<p>So, say you have a shiny new RadeonHD 4870.  What driver features would it take to have it “working under Linux”?</p>
<p>First of all, you need a DDX that can properly mode set the GPU. radeonhd and radeon have both been capable of this for some time.</p>
<p>For fast 2D, again, support needs to be added to the appropriate DDX.  Mostly done, as above.</p>
<p>In terms of accelerated 3D, support from both Mesa and the kernel are required.  As of this writing, work on both are progressing nicely but remain in experimental states.  And, in this particular case, changes were required to libdrm as well.</p>
<p>It should now be clear that, for newer video hardware, there is rarely a trivial answer to the question “Does it work in Linux?”  In fact, it can be downright confusing.</p>
<h3>Now, Lets Make It Complicated</h3>
<p>Video hardware rarely change completely from generation to generation.  This means that the same code is often times used to operate GPUs from multiple generations.  Understanding which version of which component you need can occasionally become a messy affair.</p>
<p>To draw an example from the Radeon world, R3xx (Radeon 9xxx) and R5xx (Radeon X1xxx) GPUs share a similar 3D engine, but the mode setting engines are drastically different.  Therefore, while you can use the same Mesa DRI driver on both (r300_dri.so), radeonhd will not work on the former.  As for DRM, radeon (note that there is a kernel module <em>and</em> a DDX bearing this name) takes care of everything. (There are, of course, oddities from those generations that do not fit in to this generalization.)</p>
<p>Furthermore, there is currently a push in Linux to move video mode setting into the kernel (Intel is already there).  Kernel Mode Setting, more commonly referred to as KMS, brings the user- and kernel-space separation back to X, relieving the responsibility of hardware manipulation from the DDXes and putting it solely in the DRM drivers.  The details of this topic will—perhaps—be explored another time.</p>
<h3>So, Now You Know</h3>
<p>Armed with this knowledge, your task is to now educate your fellow Linux users regarding the mistaken concept of “The Linux Graphics Driver”.  Your efforts will, hopefully, help reduce the need for developers to repeat this explanation, again and again.</p>
]]></content:encoded>
			<wfw:commentRss>http://yangman.ca/blog/2009/10/15/linux-graphics-driver-stack-explained/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
