Skip to content

Instantly share code, notes, and snippets.

@lucmann
lucmann / vsc-windows.csv
Last active November 5, 2024 07:55
Visual Studio Code
F2 Rename Symbol
Ctrl-F4 Close Editing File
Ctrl-R Recently Opened
Ctrl-Shift-F Global Search
Ctrl-Shift-J Toggle Search Details box (files to include/exclude)
@lucmann
lucmann / gpu-driver.md
Created October 17, 2024 03:01
notes about gpu drivers
  • Describing on which device the buffer has been allocated on is not enough: on some setups the buffer may have been allocated on one device but may still be directly accessible without any move on another device. For instance, on a split render/display system, a buffer allocated on the display device can be directly rendered to from the render device.
@lucmann
lucmann / bit-field.mk
Created October 9, 2024 09:06
Convert json to svg by a tool named bit-field
SRCS := $(wildcard *.json)
OBJS := $(patsubst %.json,%.svg, $(SRCS))
all: $(OBJS)
$(OBJS): %.svg: %.json
npx bit-field --hspace 1800 --lanes $(shell echo $< | grep -o -E '[0-9]*') --vflip --hflip -i $< > $@
clean:
rm -f $(OBJS)
@lucmann
lucmann / ol.sh
Created September 26, 2024 07:26
one-liner script
fails=(); for i in `seq 1 8`; do fails+=("$i"); done; echo "${fails[@]}"
@lucmann
lucmann / strace.md
Created September 14, 2024 02:46
strace 注意事项
  • 默认输出是 stderr, 而不是 stdout
  • -o 1.log -ff 每个进程生成单独的文件,后缀是 $PID
@lucmann
lucmann / v4l2.md
Last active September 13, 2024 04:30
similarities between media and DRM subsystems
  • Interact Methods (open/close, ioctls, mmap)
  • DMABUF (V4L2 Streaming I/O)
  • Image Formats
    • v4l2_pix_format vs drm_format (V4L2_PIX_FMT_ in videodev2.h vs DRM_FORMAT_ in drm_fourcc.h)
    • FourCC (Four Character Codes)
    • ColorSpaces
    • Depth Format (V4L2_PIX_FMT_Z16 vs DRM 没有 Depth Format)
    • Popular Data Formats
      • RGB565
  • Platform-specific Device Support
@lucmann
lucmann / drm_info.txt
Created August 5, 2024 08:08
drm_info output on WSL2
Node: /dev/dri/card0
├───Driver: vkms (Virtual Kernel Mode Setting) version 1.0.0 (20180514)
│ ├───DRM_CLIENT_CAP_STEREO_3D supported
│ ├───DRM_CLIENT_CAP_UNIVERSAL_PLANES supported
│ ├───DRM_CLIENT_CAP_ATOMIC supported
│ ├───DRM_CLIENT_CAP_ASPECT_RATIO supported
│ ├───DRM_CLIENT_CAP_WRITEBACK_CONNECTORS supported
│ ├───DRM_CLIENT_CAP_CURSOR_PLANE_HOTSPOT not supported
│ ├───DRM_CAP_DUMB_BUFFER = 1
│ ├───DRM_CAP_VBLANK_HIGH_CRTC = 1
@lucmann
lucmann / dri3.c
Last active August 1, 2024 06:34
libxcb building
/*
* This file generated automatically from dri3.xml by c_client.py.
* Edit at your peril.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <string.h>
@lucmann
lucmann / create-file.sh
Created July 30, 2024 07:38
create a file
dd if=/dev/zero of=/tmp/sock-ghost bs=1K seek=1 count=0
dd if=/dev/zero of=/tmp/sock-solid bs=1K count=1