Skip to content

Instantly share code, notes, and snippets.

Avatar

Tomáš Pružina tpruzina

View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am pruzinat on github.
  • I am pruzinat (https://keybase.io/pruzinat) on keybase.
  • I have a public key ASBWglH3AT7etM_uJoX3lNhGMO6d9y7tiL2vnsufqT0XGQo

To claim this, I am signing this object:

@tpruzina
tpruzina / 6464
Created Dec 10, 2018
Virtualbox-modules-6.0.0_beta2-Linux-4.20-rc5.patch
View 6464
diff -ru vbox2/vboxdrv/include/iprt/time.h vbox/vboxdrv/include/iprt/time.h
--- vbox2/vboxdrv/include/iprt/time.h 2018-09-07 21:01:57.000000000 +0200
+++ vbox/vboxdrv/include/iprt/time.h 2018-12-10 16:53:32.475735952 +0100
@@ -392,7 +392,7 @@
#endif /* various ways of detecting struct timeval */
-/* PORTME: Add struct timespec guard macro here. */
+/* PORTME: Add struct timespec64 guard macro here. */
#if defined(RTTIME_INCL_TIMESPEC) || defined(_STRUCT_TIMESPEC) || defined(_SYS__TIMESPEC_H_) || defined(TIMEVAL_TO_TIMESPEC) || defined(_TIMESPEC) \
@tpruzina
tpruzina / nvidia_linux_powersave_onset_benchmark.sh
Created Nov 28, 2018
Print a CSV formatted graph of nvidia perf stats just after the GPU was put under load ( nvidia pwr bug, https://i.imgur.com/I6QHcyp.png )
View nvidia_linux_powersave_onset_benchmark.sh
#!/bin/bash
BENCH=glxspheres64
SPIN_TIME=10
OUT_CSV=$(mktemp)
export __GL_SYNC_TO_VBLANK=0
${BENCH} &> /dev/null &
PID=$!
sleep $SPIN_TIME
@tpruzina
tpruzina / NVIDIA-415.18-20.0-rc3-next.patch
Last active Dec 10, 2018
NVIDIA-Linux-x86_64-415.18 20.0-rc3-next-20181123-CONFIG_DRM_NO.patch
View NVIDIA-415.18-20.0-rc3-next.patch
diff --git a/nvidia-uvm/uvm_linux.h b/nvidia-uvm/uvm_linux.h
index 8c42751..28fb0ef 100644
--- a/nvidia-uvm/uvm_linux.h
+++ b/nvidia-uvm/uvm_linux.h
@@ -254,7 +254,8 @@
#define nv_copy_from_user copy_from_user
#endif
-#if defined(NV_ATOMIC64_PRESENT)
+//#if defined(NV_ATOMIC64_PRESENT)
@tpruzina
tpruzina / e(xec).sh
Last active Oct 8, 2018
useful/convinient bash/zsh function snippets
View e(xec).sh
# for stuff that lacks shebang, use simple file extension based file open with the right application
# somewhat similar to xdg open
function e()
{
if [ -f $1 ]; then
case $1 in
*.exe) wine $@ ;;
*.jpg) gpicview $@ ;;
# ...
# *.sh) chmod +x $1 && ./$@ ;; #this is just lazy
@tpruzina
tpruzina / gist:0577d0d18c442ecc4c96c2bea82d3c45
Created Sep 17, 2018
NVIDIA-Linux-x86_64-396.54 linux-next-f8dcd02792146c5047419ff4c856651acd04f7c6.patch
View gist:0577d0d18c442ecc4c96c2bea82d3c45
diff -ur NVIDIA-Linux-x86_64-396.54/kernel/nvidia-drm/nvidia-drm-connector.c NVIDIA-Linux-x86_64-396.54.patched/kernel/nvidia-drm/nvidia-drm-connector.c
--- NVIDIA-Linux-x86_64-396.54/kernel/nvidia-drm/nvidia-drm-connector.c 2018-08-15 09:44:34.000000000 +0200
+++ NVIDIA-Linux-x86_64-396.54.patched/kernel/nvidia-drm/nvidia-drm-connector.c 2018-08-22 16:10:28.863761774 +0200
@@ -226,7 +226,7 @@
if (nv_connector->edid != NULL) {
- drm_mode_connector_update_edid_property(
+ drm_connector_update_edid_property(
connector, nv_connector->edid);
View build_wo_swap_fix.patch
diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c
index 156ed8154af8..9df07402d801 100644
--- a/arch/x86/mm/init.c
+++ b/arch/x86/mm/init.c
@@ -916,9 +916,11 @@ void update_cache_mode_entry(unsigned entry, enum page_cache_mode cache)
unsigned long max_swapfile_size(void)
{
- unsigned long pages;
+ unsigned long pages = 0UL;
@tpruzina
tpruzina / cpy.c
Last active Jun 5, 2018
You just can't beat the compiler
View cpy.c
#include <stdint.h>
#include <stddef.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
// play with these
#define EXPECT_SIZE 4096
//#define ALIGN
//#define FUNROLL
View frame_counter.c
#include <dlfcn.h>
#include <time.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "GL/glx.h"
// compile: "gcc frame_counter.c -ldl -D_GNU_SOURCE -shared -fPIC -o frame_counter.so"
// run: LD_PRELOAD=./frame_counter.so glxgears
@tpruzina
tpruzina / NVIDIA-Linux-x86_64-387.22.patch
Created Nov 17, 2017
NVIDIA-Linux-x86_64-387.22 patch for 4.15-staging-cf9b0772f2e410645fece13b749bd56505b998b8
View NVIDIA-Linux-x86_64-387.22.patch
diff -u -r NVIDIA-Linux-x86_64-387.22/kernel/Kbuild NVIDIA-Linux-x86_64-387.22.patched/kernel/Kbuild
--- NVIDIA-Linux-x86_64-387.22/kernel/Kbuild 2017-10-26 07:11:01.000000000 +0200
+++ NVIDIA-Linux-x86_64-387.22.patched/kernel/Kbuild 2017-10-31 19:20:41.430505370 +0100
@@ -61,6 +61,7 @@
EXTRA_CFLAGS += -Wall -MD $(DEFINES) $(INCLUDES) -Wsign-compare -Wno-cast-qual -Wno-error
EXTRA_CFLAGS += -D__KERNEL__ -DMODULE -DNVRM -DNV_VERSION_STRING=\"387.22\" -Wno-unused-function -Wuninitialized -fno-strict-aliasing -mno-red-zone -mcmodel=kernel -DNV_UVM_ENABLE -Wno-sign-compare -Wno-format-extra-args
EXTRA_CFLAGS += $(call cc-option,-Werror=undef,)
+EXTRA_CFLAGS += -mtune=native
#