Skip to content

Instantly share code, notes, and snippets.

View johalun's full-sized avatar

Johannes Lundberg johalun

View GitHub Profile
johannes@jd:~ % sudo sysctl kern.msgbuf_clear=1
kern.msgbuf_clear: 0 -> 0
johannes@jd:~ % sudo kldunload i915kms
johannes@jd:~ % dmesg
[drm:drm_fb_helper_hotplug_event]
[drm:drm_setup_crtcs]
[drm:drm_helper_probe_single_connector_modes] [CONNECTOR:85:eDP-1]
[drm:intel_dp_detect] [CONNECTOR:85:eDP-1]
[drm:intel_power_well_enable] enabling DC off
[drm:gen9_set_dc_state] Setting DC state from 02 to 00
@johalun
johalun / iichid.diff
Created April 21, 2019 20:34
Implement evdev for iichid
diff --git a/sys/dev/iicbus/input/iichid.c b/sys/dev/iicbus/input/iichid.c
index 68b8b1e4d9b6..fe0e3fd96f4f 100644
--- a/sys/dev/iicbus/input/iichid.c
+++ b/sys/dev/iicbus/input/iichid.c
@@ -34,6 +34,12 @@
#include <dev/iicbus/iiconf.h>
#include "iicbus_if.h"
+#include "opt_evdev.h"
+
@johalun
johalun / gist:40627123057a8b1b29871c57916c18e2
Created May 11, 2019 00:01
xorg 1.20 with udev backend
root@amd:~ # cat /var/log/Xorg.0.log
[ 2078.396]
X.Org X Server 1.20.4
X Protocol Version 11, Revision 0
[ 2078.398] Build Operating System: FreeBSD 13.0-CURRENT amd64
[ 2078.398] Current Operating System: FreeBSD amd 13.0-CURRENT FreeBSD 13.0-CURRENT r347394+f389590a25dc(drm-v5.0) DRM amd64
[ 2078.399] Build Date: 10 May 2019 11:49:20PM
[ 2078.400]
[ 2078.400] Current version of pixman: 0.34.0
[ 2078.401] Before reporting problems, check http://wiki.x.org
@johalun
johalun / drm.diff
Created May 25, 2019 19:55
drm update
diff --git a/graphics/drm-current-kmod/Makefile b/graphics/drm-current-kmod/Makefile
index a026dfa03c86..e5f3f8103d22 100644
--- a/graphics/drm-current-kmod/Makefile
+++ b/graphics/drm-current-kmod/Makefile
@@ -19,6 +19,7 @@ RUN_DEPENDS= gpu-firmware-kmod>=g20180319:graphics/gpu-firmware-kmod
CONFLICTS_INSTALL= drm-devel-kmod \
drm-fbsd11.2-kmod \
drm-fbsd12.0-kmod \
+ drm-fbsd12.1-kmod \
drm-legacy-kmod
@johalun
johalun / iichid-suspend-resume.diff
Created June 23, 2019 19:13
iichid suspend resume
commit c86f6c434c203ab8325cd56fff2bc27f2ae0b142
Author: Johannes Lundberg <johalun0@gmail.com>
Date: Wed May 22 14:54:23 2019
Implement suspend resume for ig4 and i2c devices
diff --git a/sys/dev/ichiic/ig4_acpi.c b/sys/dev/ichiic/ig4_acpi.c
index f0b431fd1007..c3d8be6e0149 100644
--- a/sys/dev/ichiic/ig4_acpi.c
+++ b/sys/dev/ichiic/ig4_acpi.c
if ( ! $?XDG_RUNTIME_DIR ) then
setenv XDG_RUNTIME_DIR /tmp/${uid}-runtime-dir
if ( ! -d "$XDG_RUNTIME_DIR" ) then
mkdir "$XDG_RUNTIME_DIR"
chmod 0700 "$XDG_RUNTIME_DIR"
endif
endif
# XKB For Sway:
setenv XKB_DEFAULT_RULES evdev
$ (x=`pwd`; cd /usr/src ; make buildenv CROSS_TOOLCHAIN=powerpc64-gcc TARGET=powerpc TARGET_ARCH=powerpc64 BUILDENV_SHELL="cd ${x}; make -s -j8")
Entering world for powerpc64:powerpc
Explicit target required. Likely "buildworld" is wanted. See build(7).
--- _guard ---
*** [_guard] Error code 1
@johalun
johalun / crossbuild.sh
Last active August 30, 2019 21:41
Script to cross compile drm packages
#!/bin/sh
# Requires:
# pkg install devel/powerpc64-xtoolchain-gcc (gcc in base is too old)
# cd /usr/src; make kernel-toolchain TARGET_ARCH=aarch64
CLEAN=no
UPDATE=no
PWD=`pwd`
OBJDIRPREFIX=/tmp/kms-drm-
@johalun
johalun / gist:362e6b1584c6adff8a680a76dd722ea3
Created September 12, 2019 22:42
Build results stable/12
johannes@jm:~/dev/freebsd/kms-drm % git status
On branch drm-v5.0-fbsd12.1
Your branch is up to date with 'origin/drm-v5.0-fbsd12.1'.
nothing to commit, working tree clean
johannes@jm:~/dev/freebsd/kms-drm % ./scripts/crossbuild.sh sysdir=/usr/src-stable12/sys
Got sysdir=/usr/src-stable12/sys
Building amd64 SYSDIR=/usr/src-stable12/sys...
Entering world for amd64:amd64
===> linuxkpi (all)
@johalun
johalun / iichid.diff
Created September 27, 2019 16:32
iichid.diff
diff --git a/sys/conf/files b/sys/conf/files
index 7eaa38aa6f50..8077d6a80783 100644
--- a/sys/conf/files
+++ b/sys/conf/files
@@ -1787,6 +1787,7 @@ dev/iicbus/iicbb.c optional iicbb
dev/iicbus/iicbb_if.m optional iicbb
dev/iicbus/iicbus.c optional iicbus
dev/iicbus/iicbus_if.m optional iicbus
+dev/iicubs/iichid.c optional iichid acpi iicbus
dev/iicbus/iiconf.c optional iicbus