< 返回版块

Cupnfish 发表于 2022-09-29 23:29

Asahi Lina开发的苹果M1显示驱动程序可以正常工作了

✨🎊🎉它可以工作!!!!🎉🎊✨ 🦀🐧🍎🔻🧊🇼👩🔥🦊⚙️

可以运行 GNOME!! Firefox 可以正常运行!! 能看 YouTube, 玩 Neverball, 运行 KDE 应用程序, 还有更多的东西可以使用!! 没有崩溃!!!🎉🎉

运行在 Apple M1 的本机 Linux GPU 驱动程序上!!🚀

在我最新的视频里展示了这些成果!!!

油管: https://www.youtube.com/watch?v=k0cnMUroMlQ

上面是推特的原文翻译,感兴趣的可以去看看视频。

对了,这个驱动是用Rust开发的,作者还写了一篇经验稿:

On the Rust side, have to say I'm super pleased experience writing a driver with my like this in Rust! I've had zero concurrency issues (and the driver uses fine-grained locking, there's no big driver lock) - once single processes worked, running multiple apps concurrently just worked. Also zero memory leaks, dangling CPU or GPU pointers, use-after / frees / free order mistakes, or anything like that! The only memory corruption issues I ran into were either fundamental mistakes in my unsafe DRM abstraction or core GPU memory management code, or happened from the GPU side (there's an issue with TLB invalidation, that's what the ugly workaround is for). I feel like Rust encourages good driver design and then the compiler goes a long way towards making the resulting code correct. All in all didn't really have that many bugs to fix, mostly just logic issues (both because I'm new to DRM and because the GPU interface is all reverse engineered and we're still working out the details).

The workaround for the GPU-side TLB inval issue has a large performance hit, but without that, kmscube does run at 1000+ FPS, and that's with a lot of suboptimal components that will be improved over time (e.g. my current allocator allocates/maps/unmaps/frees tons of little GPU structures per frame), sO I'm also very optimistic about the performance aspect! The only major Rust issue ran into is the lack of placement new, which I ended up working around with a very ugly place!() macro (it still has a soundness issue too, need to fix it to drop things if initialization fails halfway through). Without that, was quickly overflowing the kernel stacks (which is particularly ugly to debug without CONFIG_VMAP_STACK, which didn't have set at first...). With the macro though, the stack frames are under control enough that there's no issue, but I'd really love to see core language support for this. I think it's really necessary for kernel/embedded development.

关于Asahi linux: https://asahilinux.org/about/

源推: https://twitter.com/LinaAsahi/status/1575343067892051968

This Week in Rust 462

新一期的 Rust 周报速递发布,快来看看有哪些内容你曾经关注过 :)

This Week in Rust 462: https://this-week-in-rust.org/blog/2022/09/28/this-week-in-rust-462/ From 日报小组 Cupnfish

社区学习交流平台订阅:

评论区

写评论

还没有评论

1 共 0 条评论, 1 页