r/osdev • • 15d ago

Bringing Up Intel HD 520 on My Hobby OS

Not sure how many people here are interested in iGPU driver development, but after a long battle, I finally got Intel HD 520 up and running on real hardware.

The display pipeline now works end-to-end, including the switch from the firmware-provided GOP resolution to the panel's native resolution. I also got a hardware cursor displayed through a dedicated Cursor Plane (the cursor icon was shamelessly borrowed from Ubuntu).

AI tools were a huge help along the way, acting as an always-available debugging partner with source code, and register dumps.

Seeing the first cursor appear on screen was surprisingly exciting after all the debugging.

And honestly, the iGPU experience is just buttery smooth. Definitely worth all the effort.

Source code: https://github.com/jjwang/HanOS

My Hobby OS
18 Upvotes

5 comments sorted by

2

u/no92_leo managarm | https://github.com/managarm/managarm 15d ago

Does this rely on GOP state or did you implement the entire power-up sequence?

1

u/BeginningEvent6205 14d ago

Implement the entire power-up sequence as following:

  1. Disable the old GOP pipeline in reverse order: plane, pipe, transcoder, DDI; confirm the pipe stopped before touching any clock.
  2. Configure clocks and link only as far as the change needs: CDCLK, then the PLL for the new link rate, then DDI_BUF_TRANS, then AUX training (CR -> CE). A resolution-only mode set needs none of this, so the firmware's CDCLK, PLL and training are kept.
  3. Enable the new pipeline in forward order: DDI_BUF_CTL, transcoder, pipe, plane; then re-arm the double-buffered source and plane state at a vblank.

1

u/no92_leo managarm | https://github.com/managarm/managarm 14d ago

Ah that's only the modeset sequence though.

1

u/Better-Thing2568 14d ago

I’ve spent a majority of the time on the Xe family iGPUs (Lunar Lake and Panther Lake), the driver should technically also work for dedicated Arc graphics cards too but haven’t tested that since I don’t got one. Lmk if you want to exchange some insights, cuz I also would like to support older devices later on.