# How to interface with the graphics card on freebsd.



## alex (Sep 13, 2022)

Hello,
I would like to know how to draw something without X.org on a modern graphics card under FreeBSD.

I have a 2560x1440 monitor and a Radeon RX 6800 TX. // As an example setup. I'm more interested in embedded systems, but it would be interesting to see if the process is the same for a dedicated graphics card.

I tried drawing pixels with svgalib and it worked.
It's obviously not suitable for high resolution monitors and HDMI signals.

I probably need something that can communicate with the graphics driver, like svgalib is supposed to communicate with the vga driver.
What would be the driver I need to communicate with (for a RX 6800 TX) and are libraries like sdl or opengl able to do this without the x.org server?
Thanks.


----------



## Alain De Vos (Sep 14, 2022)

Maybe drawing directly to the framebuffer device fbdev. Like the boot splash ?


----------



## zirias@ (Sep 14, 2022)

Yes, for just "drawing pixels", using the framebuffer is a simple way to go.

If you need "accelerated" drawing functions (2d and 3d), the DRM interface offered by the drivers in e.g. graphics/drm-kmod provide the standard interface that's also used by Xorg. SDL has `KMSDRM` enabled by default, this seems to be the correct backend to use DRM directly.


----------



## astyle (Sep 14, 2022)

alex said:


> Hello,
> I would like to know how to draw something without X.org on a modern graphics card under FreeBSD.
> 
> I have a 2560x1440 monitor and a Radeon RX 6800 TX. // As an example setup. I'm more interested in embedded systems, but it would be interesting to see if the process is the same for a dedicated graphics card.
> ...


In response to your post: Did you get xorg or Wayland working? what's your FreeBSD version? are you using ports or packages?


----------



## alex (Sep 14, 2022)

astyle said:


> In response to your post: Did you get xorg or Wayland working? what's your FreeBSD version? are you using ports or packages?


I have Xorg installed but dont use it for now. FreeBSD Version 15.0. I used the package. But why is that imported.


----------



## alex (Sep 14, 2022)

zirias@ said:


> Yes, for just "drawing pixels", using the framebuffer is a simple way to go.
> 
> If you need "accelerated" drawing functions (2d and 3d), the DRM interface offered by the drivers in e.g. graphics/drm-kmod provide the standard interface that's also used by Xorg. SDL has `KMSDRM` enabled by default, this seems to be the correct backend to use DRM directly.


Thank you, that was helpfull.


----------



## SirDice (Sep 14, 2022)

alex said:


> FreeBSD Version 15.0.


Are you from the future? FreeBSD 14.0 is scheduled for release some time in July 2023. I don't expect to see 15.0 until 2026?


----------



## astyle (Sep 14, 2022)

alex said:


> I have Xorg installed but dont use it for now. FreeBSD Version 15.0. I used the package. But why is that imported.


Ah, I was interested because I have a 6900 XT, and if someone got a 6800XT working, then 6900 XT is a possibility. But yeah, as SirDice pointed out, no such thing as FreeBSD 15.0 right now... My educated guess is that something *else* is at version 15.0...


----------



## alex (Sep 14, 2022)

Oh, sorry i meant to write 13.1. 
15.0 is my Slackware system.


----------



## alex (Sep 14, 2022)

SirDice said:


> Are you from the future? FreeBSD 14.0 is scheduled for release some time in July 2023. I don't expect to see 15.0 until 2026?


Yes, but I will not tell you any lucky numbers.


----------

