|
|
Log in / Subscribe / Register

The initial posting of the Apple AGX graphics driver

Asahi Lina has posted an initial version of a Rust-based driver for Apple AGX graphics processors; the posting includes a fair amount of Rust infrastructure for graphics drivers in general.

While developing the driver, I tried to make use of Rust's safety and lifetime features to provide not just CPU-side safety, but also partial firmware-ABI safety. Thanks to this, it has turned out to be a very stable driver even though GPU firmware crashes are fatal (no restart capability, need to reboot!) and the FW/driver interface is a huge mess of unsafe shared memory structures with complex pointer chains.


to post comments

The initial posting of the Apple AGX graphics driver

Posted Mar 9, 2023 4:31 UTC (Thu) by fredrik (subscriber, #232) [Link] (2 responses)

Only somewhat related, but I find casually following the discussions on the rust-for-linux mailing list both entertaining and informative. I can recommend that for those who are curious. As a bonus sofar it is low traffic as opposed to lkml. The tone is friendly in general.

There seems to be an ambition of the Rust for Linux kernel community to introduce Rust in general to developers coming from a C background. That is probably the reason the rust-for-linux mailing is such a treat. Many threads includes a slightly wider review on the difference between C and Rust, and how Rusts capabilities provides new ergonomics to development overall.

I'm still only a C programming novice, not a kernel developer, and I have only written slightly more than a Hello World in Rust so far. Still I can mostly follow along on rust-for-linux.

So, thanks to all involved in making this happen. You're awesome!

The initial posting of the Apple AGX graphics driver

Posted Mar 9, 2023 5:14 UTC (Thu) by Sho (guest, #8956) [Link]

Thank you for writing this comment and helpfully pointing out an interesting resource. I wish more people would be compelled to comment for positive reasons than negative ones on the internet (LWN does better than most communities in this regard, one of the reasons the site has been so delightful).

The initial posting of the Apple AGX graphics driver

Posted Mar 9, 2023 20:23 UTC (Thu) by ojeda (subscriber, #143370) [Link]

Thank you for the kind words! We are indeed trying to use the mailing list discussions (and sometimes patches and PRs too) to introduce Rust concepts when we can. I am glad to know it is helpful for you.

The initial posting of the Apple AGX graphics driver

Posted Mar 13, 2023 23:36 UTC (Mon) by riking (subscriber, #95706) [Link] (2 responses)

> Add can_run_job callback

If Christian König's first email said "Complete NAK, this is a terrible idea" instead of "Complete NAK, this is broken" then a lot of pain would have been avoided.

The initial posting of the Apple AGX graphics driver

Posted Mar 14, 2023 11:11 UTC (Tue) by farnz (subscriber, #17727) [Link] (1 responses)

For context, the first email in which Christian NAK'd the idea, followed by this mail in which Christian says it's broken, followed by that summarizes why this isn't a great idea, with a deep explation from Faith Ekstrand as to why it's not a good idea.

The issue boils down to "this is an easy thing to implement incorrectly, but really hard to implement correctly, and our experience is that things of this form induce people to submit buggy code". And Christian is trying to say "you may get this right, but lots of others, me included, will get it wrong".

The initial posting of the Apple AGX graphics driver

Posted Mar 14, 2023 11:15 UTC (Tue) by farnz (subscriber, #17727) [Link]

And there's also a nice subthread in which Karol Herbst and Christian discuss communication styles, and how Christian can get his point across in ways that establish a collaborative relationship, not an adversarial one.


Copyright © 2023, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds