Skip to content

Instantly share code, notes, and snippets.

View jnettlet's full-sized avatar

Jon Nettleton jnettlet

View GitHub Profile
@jnettlet
jnettlet / 0001-radeonsi-Temporary-patch-to-fix-corruption-with-pers.patch
Created July 14, 2020 14:39
Temp patch for mesa to fix Arm64 AmdGPU corruption
From c174f3201f58f57571f5676f07041eb50060d181 Mon Sep 17 00:00:00 2001
From: Jon Nettleton <[email protected]>
Date: Tue, 14 Jul 2020 15:01:42 +0200
Subject: [PATCH] radeonsi: Temporary patch to fix corruption with persitent
buffers
Until further debugging is done set kernel_flushes_hdp_before_ib to
false so persistent buffers are allocated from GTT memory. I have
an open issue for this in mesa that perhaps this should become a
runtime DRI option that can be enabled.
@jnettlet
jnettlet / amdgpu.conf
Created July 17, 2020 14:00
Put in /etc/dracut.conf.d for graphical boot
add_drivers+=" amdgpu "
install_items+=" /lib/firmware/amdgpu/polaris10_ce_2.bin "
install_items+=" /lib/firmware/amdgpu/polaris10_ce.bin "
install_items+=" /lib/firmware/amdgpu/polaris10_k2_smc.bin "
install_items+=" /lib/firmware/amdgpu/polaris10_k_mc.bin "
install_items+=" /lib/firmware/amdgpu/polaris10_k_smc.bin "
install_items+=" /lib/firmware/amdgpu/polaris10_mc.bin "
install_items+=" /lib/firmware/amdgpu/polaris10_me_2.bin "
install_items+=" /lib/firmware/amdgpu/polaris10_me.bin "
install_items+=" /lib/firmware/amdgpu/polaris10_mec2_2.bin "
@jnettlet
jnettlet / 0001-radeonsi-On-Aarch64-force-persistent-buffers-to-GTT.patch
Created August 14, 2020 11:41
Mesa corruption and performance fix for HoneyComb with Polaris graphics cards
From d72aa8ae74ffb7329003f9f23ffa05833af951ab Mon Sep 17 00:00:00 2001
From: Jon Nettleton <[email protected]>
Date: Fri, 14 Aug 2020 13:36:08 +0200
Subject: [PATCH] radeonsi: On Aarch64 force persistent buffers to GTT
This fixes a glamore corruption issue on the HoneyComb and by
internet reports should also fix problems seen on Huaweii
Kunpeng hardware.
The root cause of the corruption needs to be worked out, but
@jnettlet
jnettlet / Unvanquished_aarch64.diff
Created September 19, 2020 12:29
Unvanquished_aarch64.diff
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 08d3ceb8..27678144 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -428,10 +428,6 @@ if (NACL)
add_library(srclibs-nacl-module EXCLUDE_FROM_ALL ${NACLLIST_MODULE})
set_target_properties(srclibs-nacl-module PROPERTIES POSITION_INDEPENDENT_CODE 1 FOLDER "libs")
set(LIBS_BASE ${LIBS_BASE} srclibs-nacl-module)
-else()
- add_library(srclibs-nacl-native EXCLUDE_FROM_ALL ${NACLLIST_NATIVE})
@jnettlet
jnettlet / fb_test.c
Created September 25, 2021 09:19
Test for framebuffer memcpy bugs.
#include <signal.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include <stdio.h>
#include <fcntl.h>
#include <linux/fb.h>
#include <sys/mman.h>
#include <sys/ioctl.h>
From 6cf513dc8c5ab758072d894f10a58fbb4a146bd6 Mon Sep 17 00:00:00 2001
From: Jon Nettleton <[email protected]>
Date: Wed, 6 Oct 2021 09:16:35 -0400
Subject: [PATCH] Aarch64: Make memcpy more compatible with device memory
For normal non-cacheable memory ACE supports 4x128 bit r/w WRAP
transfers or 1x128 bit r/w INCR transfers. By re-ordering the
stp's in memcpy / memmove we can accomodate this better without
impacting the existing code.
@jnettlet
jnettlet / 99-asus-falchion.hwdb
Last active June 25, 2024 14:35
Stop Asus ROG Falchion mechanical keyboard from sending POWER and SLEEP key presses when the keyboard goes to sleep. Put in /etc/udev/hwdb.d and then run sudo systemd-hwdb update
evdev:input:b*v0B05p193Ee0111*
KEYBOARD_KEY_10081=reserved
KEYBOARD_KEY_10082=reserved
KEYBOARD_KEY_70070=reserved
KEYBOARD_KEY_70071=reserved
KEYBOARD_KEY_70072=reserved
KEYBOARD_KEY_70073=reserved
KEYBOARD_KEY_70074=reserved
KEYBOARD_KEY_70075=reserved
KEYBOARD_KEY_70076=reserved
@jnettlet
jnettlet / hc_setup.txt
Last active January 18, 2022 11:21
Setting up HoneyComb
installation
modprobe.blacklist=amdgpu
kernel commandline:
grubby --args="amdgpu.pcie_gen_cap=0x4 usbcore.autosuspend=-1 arm-smmu.disable_bypass=0 iommu.passthrough=1" --update-kernel=ALL
Early Boot dracut
/etc/dracut.conf.d/amdgpu.conf
add_drivers+=" amdgpu "
install_items+=" /lib/firmware/amdgpu/polaris*.bin.xz "
@jnettlet
jnettlet / ObjectDetection_on_mx8mp.py
Created March 14, 2022 13:03
Quick script to get full performance using the NN accelerator on the iMX8MP
import os
import argparse
import cv2
import numpy as np
import signal
import sys
import time
from threading import Thread
import importlib.util
@jnettlet
jnettlet / 01-honeycomb-x11.conf
Created April 6, 2022 08:33
Workaround X11 corruption with amdgpu on HoneyComb with mesa 22
<driconf>
<!-- Please always enable app-specific workarounds for all drivers and
screens. -->
<device>
<application name="XWayland" executable="Xwayland">
<option name="mesa_extension_override" value="-GL_ARB_buffer_storage" />
</application>
<application name="Xorg" executable="Xorg">
<option name="mesa_extension_override" value="-GL_ARB_buffer_storage" />
</application>