Planet (Former) Advogato

This is a complement to Advogato, it is an aggregation of blogs of those who used to post on Advogato, but for one reason or another moved their blog from Advogato. It is provided as a service to those who would like to read the "greater Advogato" community.

This site works only as a Planet, it aggregates the post only, to comment on a blog entry, click on the title or time to go to the blog entry on the original site, hopefully it will have a comment facility.

September 26, 2016

Eric Anholt [anholt]

This week in vc4 (2016-09-26): XDC 2016, glamor testing, glamor performance

Last week I spent at XDS 2016 with other graphics stack developers.

I gave a talk on X Server testing and our development model.  Since playing around in the Servo project (and a few other github-centric communities) recently, I've become increasingly convinced that github + CI + automatic merges is the right way to go about software development now.  I got a warmer reception from the other X Server developers than I expected, and I hope to keep working on building out this infrastructure.

I also spent a while with keithp and ajax (other core X developers) talking about how to fix our rendering performance.  We've got two big things hurting vc4 right now: Excessive flushing, and lack of bounds on rendering operations.

The excessive flushing one is pretty easy.  X currently does some of its drawing directly to the front buffer (I think this is bad and we should stop, but that *is* what we're doing today).  With glamor, we do our rendering with GL, so the driver accumulates a command stream over time.  In order for the drawing to the front buffer to show up on time, both for running animations, and for that last character you typed before rendering went idle, we have to periodically flush GL's command stream so that its rendering to the front buffer (if any) shows up.

Right now we just glFlush() every time we might block sending things back to a client, which is really frequent.  For a tiling architecture like vc4, each glFlush() is quite possibly a load and store of the entire screen (8MB).

The solution I started back in August is to rate-limit how often we flush.  When the server wakes up (possibly to render), I arm a timer.  When it fires, I flush and disarm it until the next wakeup.  I set the timer to 5ms as an arbitrary value that was clearly not pretending to be vsync.  The state machine was a little tricky and had a bug it seemed (or at least a bad interaction with x11perf -- it was unclear).  But ajax pointed out that I could easily do better: we have a function in glamor that gets called right before it does any GL operation, meaning that we could use that to arm the timer and not do the arming every time the server wakes up to process input.

Bounding our rendering operations is a bit trickier.  We started doing some of this with keithp's glamor rework: We glScissor() all of our rendering to the pCompositeClip (which is usually the bounds of the current window).  For front buffer rendering in X, this is a big win on vc4 because it means that when you update an uncomposited window I know that you're only loading and storing the area covered by the window, not the entire screen.  That's a big bandwidth savings.

However, the pCompositeClip isn't enough.  As I'm typing we should be bounding the GL rendering around each character (or span of them), so that I only load and store one or two tiles rather than the entire window.  It turns out, though, that you've probably already computed the bounds of the operation in the Damage extension, because you have a compositor running!  Wouldn't it be nice if we could just reuse that old damage computation and reference it?

Keith has started on making this possible: First with the idea of const-ifying all the op arguments so that we could reuse their pointers as a cheap cache key, and now with the idea of just passing along a possibly-initialized rectangle with the bounds of the operation.  If you do compute the bounds, then you pass it down to anything you end up calling.

Between these two, we should get much improved performance on general desktop apps on Raspberry Pi.

Other updates: Landed opt_peephole_sel improvement for glmark2 performance (and probably mupen64plus), added regression testing of glamor to the X Server, fixed a couple of glamor rendering bugs.

September 26, 2016 09:18 PM

September 24, 2016

Rachel Chalmers [rachel]

darwinian

I started listening to Siddhartha Mukherjee’s The Gene: An Intimate History (having finished up Drew Gilpin Faust’s This Republic of Suffering, which traces the American way of death back to the Civil War, and is excellent.) Mukherjee’s Emperor of Maladies made me cry buckets and also gave me an inkling of insight when it described “cancer pathways” – specific sequences of gene mutations that lead to specific conditions.

I couldn’t wait for The Gene to come out and so far it’s even better than Emperor. He talks about his paternal uncles, Rajesh and Jagu, who suffered from bipolar disorder and schizophrenia, and how the trauma of Partition exacerbated their illnesses. This immediately after I read Timothy Knatchbull’s From a Clear Blue Sky about the Mountbatten bomb. The consequences of British imperialism run through both families like another inherited trait.

Mukherjee made me laugh out loud when he described Darwin resolutely ignoring the theological consequences of his research as the idea of evolution dawned on him, calling this “the separation of church and state of mind.”

I first encountered Darwin as a teenager in my Dad’s Stephen Jay Gould and Dawkins books, which sounded every bit as self-satisfied as the religious books I was reading at the same time. Darwin came back around later, long after I’d lost my faith, when I read Janet Browne’s wonderful biographies of him. She described how seriously he took his reading, and in response, I started keeping my own log of the books I had read.

As a devout Christian and then as an angry atheist, a lot of Darwin was lost on me. If you refuse to engage with the central struggle of his life, between his faith in meaning and what his observations taught him, you miss so much. I see in Darwin now what I saw in La Sagrada Familia in Barcelona: that this world is more beautiful than it needs to be; that even when you understand its underlying principles, its glory can bring you to your knees.

“There is grandeur in this view of life, with its several powers, having been originally breathed into a few forms or into one; and that, whilst this planet has gone cycling on according to the fixed law of gravity, from so simple a beginning endless forms most beautiful and most wonderful have been, and are being, evolved.”

September 24, 2016 07:00 PM

September 23, 2016

Rachel Chalmers [rachel]

22 hours in new york

6pm: wheels down at JFK

6-8pm: stuck in UN traffic with an elderly bearded white taxi driver who plays country music and tells me the mileage on each vehicle he owns and exactly what happened last time he went to the DMV. When his credit card reader turns out to be offline, he locks all the doors and demands to know how I am going to pay. When I am released I go to an ATM, thrust the cash at him and flee.

8pm: I am an hour late for dinner but Leonard is still waiting for me, because he is delightful. We talk about technology for libraries and strategies for writing science fiction novels. I have the pork saltimbocca and a tiramisu of unusual size

10pm: stress about my talk

11pm-6am: wake every hour on the hour to make sure I haven’t overslept

7am: realize I have overslept

7:30am: rehearsal. Everyone is delightful. I am filled with terror

8am: in the speaker’s lounge. Too late to back out.

9:30-10am: I give my talk. I flub half the lines, but people say lovely things about it both to my face and on Twitter

11am: coffee with the lovely Fintan. We talk about containerization

12noon: lunch with the wonderful Francis and the amazing Gus. I have the moules marinieres and an excellent tarte tatin. We talk about word puzzles and technology for Doctors Without Borders and San Francisco high school choices and I have to tear myself away

1:30-2:30pm: taxi ride to JFK in which nothing goes wrong and I do not fear for my life. I leave an excessive tip

4pm: wheels up!

September 23, 2016 02:43 AM