22 Aug 2018

In June, I announced in `#panfrost`

that I would be taking a break from Panfrost over the summer in order to focus on my summer classes, particularly during the hectic month of July. Luckily for my little graphics drivers, the summer has now elapsed, and my 3D voodoo has resumed. No command stream shall be left un`touch`

ed. Hehehehe.

My first class was “Writing about Social and Ethical Issues”, a class I take to heart as a free software advocate. A major course theme was the human mind’s resolution of ethical dilemmas. Our texts argued for *intuitionism* over *rationalism* – that is, we judge with our heart, and our brains merely provides confirmation bias – with two major implications. First, my acceptance of intuitionism led me into a downward spiral as I attempted to remember how I came to the free software movement in the first place, if not for reason. Second, once I reevaluated the place of proprietary software in society and came to similar conclusions, we learned about scientifically backed persuasive strategies. For instance, we discussed “moral reframing”, the idea that as rhetoricians, we need to appeal to the values of our audience rather than our own; these sets of values likely will not align, or otherwise our audience would already agree with us, and there would be no persuasion needed.

Moral reframing and its associated persuasive techniques provide an interesting opportunity for free software argumentation. So, for my final paper in this writing class, I wrote a persuasive piece criticising Digital Restrictions Management based on non-technical issues, rather than using free software rhetoric. Was I successful? Maybe. Maybe not. You can read the paper and decide for yourself. For some more background, you can also read the corresponding reflection.

Anyway, back to graphics. My other class, perhaps more in line with my Panfrostian interests, was “Linear Algebra and Differential Equations”. Yes, you read that correctly: my work on 3D graphics to date was conducted by a *tonta* with no formal education in Linear Algebra, better known as “3D math”. Finally, my fellow Panfrostite Connor Abbott need not wag his metaphorical head at me:

```
<cwabbott> i'd read through the GL spec first, to understand exactly what's going on
<cwabbott> it sounds like you've taken linear algebra, so the math won't be too hard to understand
<alyssa> cwabbott: just finished multivariate calculus, planning to take linear algebra over the summer
<cwabbott> alyssa: ok... actually, i'd recommend taking them in the opposite order
<alyssa> too late ;P
<cwabbott> oh well
```

So be it; I have now completed the course, so Connor need not “oh well” me any longer.

Oh well. OpenGL aside, Linear Algebra is a fascinating course in its own right. Also, everything is written vertically, so expect to purchase a *lot* of notebook paper. My compact note days of *Multivariable Calculus* are over. I think I should have invested in a CVS loyalty card with the *shear* number of dead trees involved in matrix algebra.

Although there were sadly no official programming assignments in the class, as part of my exam preparation, I implemented some animation demos with Linear Algebra in Tosh. I focused on the use of 3D mathematics, also known as “Chapter 2” or "geometric linear transformations in $\mathbb{R}^3$. The first, Parabolic Paranoia (source code), creates some psychadelic illusions by subjecting many symmetric copies of the graph of $y = x^2$ to numerous linear and the occasional affine transformations. The other, Run! (source code), animates a run cycle on a stick figure, drawn with 2D turtle graphics with lines and circles as the primitives, but modeling and animating the figure in a 3D world, implementing perspective projection to translate from the 3D description to 2D commands. I even threw in a simple cast shadow for the *shear* amount of puns. (Did I already make that joke last paragraph? $\sqrt{-1}$ caramba.)

Animations aside, my third and final (unofficial) project of the semester was perhaps the most interesting. In addition, it is *possibly* novel^{1}: reconstructing depth information from 2D images according to symmetry-based rules in order to transform the image in 3D space. The implementation is still incomplete and slow – I implemented it as an academic project in the Python scientific computing stack, ¿what do you expect! – but I do have a working prototype. The basic idea is to assign a depth value to each pixel based on the perpendicular distance between that pixel and a particular axis running through the object. That depth is tacked on to each pixel’s $\mathbb{R}^2$ coordinates to produce ordered triplets in $\mathbb{R}^3$. These coordinates can then be transformed in $\mathbb{R}^3$ using standard linear algebra, like affine transformations and rotations. Finally, the transformed coordinates are orthogonally projected back into $\mathbb{R}^2$, throwing away the transformed $z$-coordinate. Thus, the algorithm gives a (highly nonlinear) mapping from source image coordinates to destination image coordinates, which can then be rendered using standard forward mapping techniques. Once the implementation is fleshed out further, I’ll write up the algorithm more thoroughly. But for now, click for demos.

In other words…. Local Linear Algebra Student Discovers Weird Trick for Transforming 2D Images (3D Modelers Hate Her!)

These two classes ate up most of my academic time – but I did not stop there. As you know if you read my introductory blog post on the Free Software Foundation website and cross-posted here, I am one of the FSF’s summer interns, working with single-board computers, remote server administration, and liberating PayPal’s proprietary JavaScript. At the FSF, I have met a number of passionate, like-minded individuals – yes, that includes Richard Stallman who signed my GPG key! – and have grown my appreciation of the free software movement as I had hoped. My internship will continue remotely until the end of August.

Nevertheless, after my finals in my two classes, I returned home last weekend. (In)conveniently, just as my summer term finished, my fall classes have begun. The upshot is that I am now home with time to play with graphics.

For Panfrost, I have been focusing on supporting the T800 family of GPUs. Back in May, PINE64 generously offered to send me a ROCKPRO64 single-board computer, a development board for the Rockchip RK3399 used in the Samsung Chromebook Plus. The RK3399, succeeding the RK3288 (my prior focus), features a Mali T860 GPU, an upgrade over the RK3288’s Mali T760. Accordingly, the new board provides plenty of opportunities for improving Panfrost device support into the nebulous world of the T800.

Spoiler alert: the board is half-way between the preceding T700 and the succeeding Bifrost architecture. As you know if you hang out in `#panfrost`

and have the opportunity to listen to my GPU thought dumps via the neocortex-to-IRC pipeline, there is some exciting related news in the pipeline…

…but for now, you’ll have to enjoy the cliffhanger!

This page is licensed under the CC BY-SA 4.0. Spread free culture!

I couldn’t find anything similar to what I wanted on the web, but I also didn’t look too hard.↩