Skip to content

Instantly share code, notes, and snippets.

@Miouyouyou
Miouyouyou / GForms.html
Created July 30, 2017 18:18
Quick and dirty Hugo Shortcode for Google Forms
<iframe src="https://docs.google.com/forms/d/e/{{ .Get "src" }}/viewform?embedded=true" width="{{ .Get "width" }}" height="{{ .Get "height" }}" frameborder="0" marginheight="0" marginwidth="0">Chargement en cours…</iframe>
@Miouyouyou
Miouyouyou / beta.txt
Created August 7, 2017 23:15 — forked from K-atc/beta.txt
キチガイ辞書(UTF-8)(Google IMEで使えます。Shift JISにエンコードすればMS IMEでも使えます。)
あげあげ (☝◞‸◟)☝ 顔文字
あげあげ ( ☝՞ਊ ՞)☝ 顔文字
あっあっ (◞‸◟;) 顔文字
あつい (。>﹏<) 顔文字
あわてる ヽ( ̄д ̄;)ノ=3=3=3 顔文字
いう ( ^o^)< 名詞
いしはらよしずみ 三( ◠‿◠ )そんな時にタウンページが便利なんですよ 顔文字
うーにゃー (」・ω・)」うー!(/・ω・)/にゃー 名詞
うーん :;(∩´﹏`∩);: 顔文字
うっとり ・:*:・(*´∀`*)・:*:・ 顔文字
ּ_בּ
בּ_בּ
טּ_טּ
כּ‗כּ
לּ_לּ
מּ_מּ
סּ_סּ
תּ_תּ
٩(×̯×)۶
٩(̾●̮̮̃̾•̃̾)۶
@Miouyouyou
Miouyouyou / Makefile
Last active December 24, 2023 10:14
Sample Makefile for cross-compiled ARM Linux kernel module
# Set this variable with the path to your kernel.
# Don't use /usr/src/linux if you're cross-compiling...
MYY_KERNEL_DIR ?= ../linux
# If you're compiling for ARM64, this will be arm64
ARCH ?= arm
# This is the prefix attached to your cross-compiling gcc/ld/... tools
# In my case, gcc is armv7a-hardfloat-linux-gnueabi-gcc
# If you've installed cross-compiling tools and don't know your
@Miouyouyou
Miouyouyou / drm-prime-mmap.c
Last active August 25, 2017 04:14
Works only if your DRM driver implements gem_prime_mmap and you have the right privileges
#include <stdio.h>
#include <libdrm/drm.h>
#include <stdint.h>
#include <sys/mman.h>
#include <string.h>
#include <sys/types.h>
@Miouyouyou
Miouyouyou / drm-prime-dumb-kms.c
Last active October 25, 2024 06:17
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>
@Miouyouyou
Miouyouyou / crash-dummy.c
Last active August 31, 2017 00:01
Freeze when accessing pdev->resources . This is due to a misuse of %pa . *%pa ARGUMENTS MUST BE PASSED BY REFERENCE*
#ifdef DUMBY_THE_EDITOR /* Used for Kdevelop */
#include <generated/autoconf.h>
#endif
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/of.h>
#include <linux/of_platform.h>
/* Crashes when trying to access pdev->resources[0].
@Miouyouyou
Miouyouyou / dmesg
Created September 10, 2017 01:22
crash notes...
[ 82.116562] [init_iova_domain]
iovad : ebca1c04
iovad->rb_root = (null)
iovad->cached32_node = (null)
iovad->granule = 4096
iovad->start_pfn = 65536
iovad->dma_32bit_pfn = 589823
[ 82.146988] [init_iova_domain]
iovad : ebca1c04
iovad->rb_root = (null)
@Miouyouyou
Miouyouyou / 0001-Slight-butchering-to-test-the-VPU-driver.patch
Created September 10, 2017 18:41
Linux 4.13 patch to test the VPU driver
From 981b3c1b139daafff1317de9a6d61e1b32a10280 Mon Sep 17 00:00:00 2001
From: Myy <[email protected]>
Date: Sun, 10 Sep 2017 20:31:39 +0000
Subject: [PATCH] Slight butchering to test the VPU driver
This patch must NOT be applied if you're not testing the VPU driver.
This enable the IOMMU_DMA_API for Rockchip boards and redefine some
functions in that API, in order to use them in the VPU code.
Turns out that iommu_get_domain_for(dev) fails miserably every time
@Miouyouyou
Miouyouyou / rockchip-iommu.c
Last active September 16, 2017 21:33
This freezes the machine pure and simple !
/* Code */
/* ... */
void rk_iommu_flush_tlb(struct device *dev) {
struct rk_iommu *iommu = rk_iommu_from_dev(dev);
int i;
if (!iommu)
dev_err(dev, "Can't flush nothing !\n");
else {