I always loved devices that do things in a different way or prefer power saving and doing few things instead of consuming huge amounts of Watts. That’s why one day, surfing on amazon I found a pciexpress 1x video card which I never heard of: a Silicon Motion sm750.
That’s a 2D only video card, designed for embedded and industrial devices.
My first thought was: Haiku surely will use a framebuffer/vesa driver for it…
My second thought was: what if I write down a video card driver for it?..
My third thought was: I’ll need some specifications for it, surely it should be hard to find a datasheet for it… and then… I WAS WRONG.
I found a datasheet for this card! and my brain just got crazy… I couldn’t be helped, my desire was strong and even without noticing I triggered that button and then…
Look here! Something just appeared on my desk (ok this is my bed not my desk, forgive my narrative imagination):
I used 2 PCs to write down the driver. The main one was an old Via Nano x2 with 8 GB of ram (funny the idea of using and old pc to develop new drivers) and the second one a more recent (still not new) AMD holding the SM750 card, it helped a lot having an integrated serial port on both machines, available at boot time (not an usb adapter).
I plugged it in on a pci-express slot and removed a far newer card from my second PC. As you can see the card comes with 2 VGA connectors. Reading the datasheed I discovered that the Silicon Motion chip has 2 "paths:
- one that handles the crts (the one I got)
- the other that handles LCD panels, which integrates some other layers (video, ZV, Video alpha..)
both are merged at the end.
So with the help of an AI I started writing down. I preferred not using an AI agent and using instead the web browser chat because I wanted to learn the most and control all the errors AI spitted out.
Sometimes the AI suggested me wrong code or insisted me on adopting conceptual errors. But hey! it’s a tool, the developer is in charge of knowing what to do. Second, those errors taught me a lot of things.
Back to the driver:
Thanks the fact that the card is simple enough, I was able to handle it, except for:
- the integrated I2C, which later I learnt it was notoriously broken for that chip and nobody tries using it
- the integrated GPIO which seems locked. I was able to change the direction bits for some of them but not the ones I was interested in for the simulation of a i2c.
In the end with that card I was not able to detect the CRT supported resolutions and retrieve the EDID, after several attempts (quite a month) I gave up. Nor was possible to get the vesa edid. The only data I could get from the system was the framebuffer resolution at boot time.
That was used as the default resolution but, as I was able to make the pll work flawlessy, my heart was crying for not giving the possibility to change resolutions (and color depth)…
so I decide to give a table of some default vesa resolutions…
Ok my heart is not crying anymore ![]()
Interesting thing:
Hardware cursor
At some point I implemented part of the hardware cursor, everything worked except but I realized that the cursor was still drown by software functions. So I realized I was missing an Accelerant function: the set_cursor_bitmap
after writing down that function I saw a wonderful thing but a big problem:
- The cursor would not flick or create artifacts anymore when over Iceweasel (FANTASTIC!)
- The cursor would not change when drag’n’dropping files (OH NO! ANNOYING!)
The quality of the cursor is not on pair with the software rendered (shades of gray, antialiasing etc.), but with the 3 registers for the cursor colors available on my video card I was able to draw a nice cursor. Result? If you don’t know it’s not software rendered (with all those nice features), you’ll not notice that.
But the annoying part is that drag’n’drop is not working at all, showing me the normal cursor while dragging a file. I don’t know if it is intentional, but I thing is an haiku app_server missing behavior not giving a specific hardware cursor bitmap when dragging, or maybe it’s me missing something…
I managed to implement the haiku memory manager for the unused VRAM (the card has only 16MB, at least the one I own, but the specifics say there are some of 64 MB)
Now I’m trying to understand how to manage video/overlay layer, this will be a future implementation, maybe, who knows…
At this point I was super excited and I thought what if… I buy another small video card maybe a another one pcie 1x ?
looking here and there I found one on Amazon:
the vendor specified amd firepro blablabla port HDMI etc… My consciousness: “It should already work on haiku available drivers”, by my evil side said: “Naaaaah, buy it!”…
Well I’m prone to my evil side, and I bought it.
Some days passed and the card showed up on my desk (again, you know it’s my bed
)
I open the box and… SURPRISE!!!
The card was not an AMD at all!
this was the sister card of my sm750, using the PANEL/LCD path!
What a LUCKY situation. Being victim of a scam, but receiving a gift instead!
Even luckier that my code was written keeping in mind of this optional card and the driver worked without any further change!
MOREOVER I found out that the HDMI card retrieves the EDID from the boot, so now I can change through the supported resolutions of my monitor. Triple strike!
and then… what’s the most important test to run under Haiku?
The Teapot
I fixed an AI conceptual error in my driver and than run the most significant test:
Thanks for reading


