Skip to content

Instantly share code, notes, and snippets.

View CmST0us's full-sized avatar

eki CmST0us

  • DJI
  • Shenzhen, China
View GitHub Profile
@CmST0us
CmST0us / drm-prime-dumb-kms.c
Created May 28, 2023 17:13 — forked from Miouyouyou/drm-prime-dumb-kms.c
Simple example showing how to use DRM to : allocate a Dumb buffer on the GPU, use it as a framebuffer, use this CRTC on the currently connected screen (expecting 1 connected screen), export the buffer, reimport it implicitly with mmap and write in it.
// This will works on Embedded GPU that implements .gem_prime_mmap like Rockchip ones.
// This will fail on most DRM drivers for GPU with dedicated memory as they tend to NOT implement .gem_prime_mmap.
#include <stdio.h>
#include <libdrm/drm.h>
#include <stdint.h>
#include <sys/mman.h>
#include <string.h>
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
# update pacman dbs
# sudo pacman -Syy
# install 950q driver if missing
# https://www.linuxtv.org/wiki/index.php/Hauppauge_WinTV-HVR-950Q
if [[ ! -f /lib/firware/dvb-fe-xc5000-1.6.114.fw ]]; then
wget http://www.kernellabs.com/firmware/xc5000/dvb-fe-xc5000-1.6.114.fw
mv dvb-fe-xc5000-1.6.114.fw /lib/firmware/
@CmST0us
CmST0us / send_fd.cpp
Created November 26, 2022 15:39 — forked from djarek/send_fd.cpp
send_fd.cpp
#include <boost/asio/coroutine.hpp>
#include <boost/asio/local/connect_pair.hpp>
#include <boost/asio/local/stream_protocol.hpp>
#include <iostream>
#include <sys/wait.h>
std::size_t
send_fd(boost::asio::local::stream_protocol::socket& socket,
int fd,
boost::system::error_code& ec)
@CmST0us
CmST0us / homebrew-permissions-issue.md
Created November 26, 2022 15:38 — forked from irazasyed/homebrew-permissions-issue.md
Homebrew: Permissions Denied Issue Fix (OS X / macOS)

Homebrew Permissions Denied Issues Solution

sudo chown -R $(whoami) $(brew --prefix)/*

@CmST0us
CmST0us / fix_libfdt.sh
Created November 3, 2021 15:52
Fix libfdt build break
find -name "libfdt*.h" -exec sed -i 's/ _LIBFDT_/ LIBFDT_/g' {} +
find -name "fdt.h" -exec sed -i 's/ _FDT_H/ FDT_H/g' {} +