Skip to content

Commit

Permalink
Add rockchip libdrm rendering backend
Browse files Browse the repository at this point in the history
  • Loading branch information
svpcom committed Dec 20, 2024
1 parent 3e86023 commit 5e737a9
Show file tree
Hide file tree
Showing 6 changed files with 1,146 additions and 11 deletions.
12 changes: 9 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,16 @@ ifeq ($(mode), gst)
CFLAGS += -Wall -pthread -std=gnu99 -D__GST_OPENGL__ -fPIC $(shell pkg-config --cflags glib-2.0) $(shell pkg-config --cflags gstreamer-1.0)
LDFLAGS += $(shell pkg-config --libs glib-2.0) $(shell pkg-config --libs gstreamer-1.0) $(shell pkg-config --libs gstreamer-video-1.0) -lgstapp-1.0 -lpthread -lrt -lm
OBJS = main.o osdrender.o osdmavlink.o graphengine.o UAVObj.o m2dlib.o math3d.o osdconfig.o osdvar.o fonts.o font_outlined8x14.o font_outlined8x8.o appsrc.o gst-compat.o
else
CFLAGS += -Wall -pthread -std=gnu99 -D__BCM_OPENVG__ -I$(SYSROOT)/opt/vc/include/ -I$(SYSROOT)/opt/vc/include/interface/vcos/pthreads -I$(SYSROOT)/opt/vc/include/interface/vmcs_host/linux
LDFLAGS += -L$(SYSROOT)/opt/vc/lib/ -lbrcmGLESv2 -lbrcmEGL -lopenmaxil -lbcm_host -lvcos -lvchiq_arm -lpthread -lrt -lm
else ifeq ($(mode), rockchip)
CFLAGS += -Wall -pthread -std=gnu99 -D__DRM_ROCKCHIP__ -fPIC $(shell pkg-config --cflags libdrm)
LDFLAGS += $(shell pkg-config --libs libdrm) -lpthread -lrt -lm
OBJS = main.o osdrender.o osdmavlink.o graphengine.o UAVObj.o m2dlib.o math3d.o osdconfig.o osdvar.o fonts.o font_outlined8x14.o font_outlined8x8.o drm_output.o
else ifeq ($(mode), rpi3)
CFLAGS += -Wall -pthread -std=gnu99 -D__BCM_OPENVG__ -I/opt/vc/include/ -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux
LDFLAGS += -L/opt/vc/lib/ -lbrcmGLESv2 -lbrcmEGL -lopenmaxil -lbcm_host -lvcos -lvchiq_arm -lpthread -lrt -lm
OBJS = main.o osdrender.o osdmavlink.o graphengine.o UAVObj.o m2dlib.o math3d.o osdconfig.o osdvar.o fonts.o font_outlined8x14.o font_outlined8x8.o oglinit.o
else
$(error Valid modes are: gst, rockchip or rpi3)
endif

all: osd
Expand Down
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ This project started from https://github.com/TobiasBales/PlayuavOSD.git
Supported platforms:
-------------------
* Raspberry Pi 0-3 -- use hardware overlay mode (OpenVG)
* Any other Linux with X11 or Wayland -- use GStreamer OpenGL mixer
* Radxa Zero 3W/3E -- use hardware overlay mode (libdrm)
* OrangePi 5 -- use hardware overlay mode (libdrm)
* Any other Linux with X11/Wayland and GPU -- use GStreamer OpenGL mixer

Supported autopilots:
---------------------
Expand All @@ -16,11 +18,15 @@ Building:
---------

1. Build for Linux (X11 or Wayland) (native build):
* `apt-get install gstreamer1.0-tools libgstreamer1.0-dev gstreamer1.0-plugins-base gstreamer1.0-plugins-bad gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly libgstreamer-plugins-base1.0-dev`
* `apt-get install gstreamer1.0-tools pkg-config libgstreamer1.0-dev gstreamer1.0-plugins-base gstreamer1.0-plugins-bad gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly libgstreamer-plugins-base1.0-dev`
* `make osd`

2. Build for Raspberry PI 0-3 (OpenVG) (native build):
* `make osd mode=rpi`
* `make osd mode=rpi3`

3. Build for Radxa or OrangePi (libdrm) (native build):
* `apt-get install libdrm-dev pkg-config`
* `make osd mode=rockchip`

Running:
--------
Expand Down
Loading

0 comments on commit 5e737a9

Please sign in to comment.