Skip to content

Instantly share code, notes, and snippets.

Avatar
🗓️
Year of FreeBSD on the Desktop

myfreeweb

🗓️
Year of FreeBSD on the Desktop
View GitHub Profile
View tokio-wayland-loop.rs
use smithay_client_toolkit::reexports::client::{
EventQueue, Interface, Main, MessageGroup, Proxy, ProxyMap,
};
/// Tokio task for polling the Wayland socket, dispatching the callbacks.
/// This makes wayland_event_chan work.
pub async fn wayland_loop(event_queue: &mut EventQueue) -> Result<(), Box<dyn std::error::Error>> {
use std::task::Poll;
let fd = event_queue.display().get_connection_fd();
@myfreeweb
myfreeweb / dpcd-eve.patch
Created Apr 9, 2020
Patch forcing DPCD backlight on Pixelbook
View dpcd-eve.patch
diff --git i/drivers/gpu/drm/i915/intel_dp_aux_backlight.c w/drivers/gpu/drm/i915/intel_dp_aux_backlight.c
index 357136f17..7de91a4a5 100644
--- i/drivers/gpu/drm/i915/intel_dp_aux_backlight.c
+++ w/drivers/gpu/drm/i915/intel_dp_aux_backlight.c
@@ -252,8 +252,12 @@ intel_dp_aux_display_control_capable(struct intel_connector *connector)
* the panel can support backlight control over the aux channel
*/
if (intel_dp->edp_dpcd[1] & DP_EDP_TCON_BACKLIGHT_ADJUSTMENT_CAP &&
- (intel_dp->edp_dpcd[2] & DP_EDP_BACKLIGHT_BRIGHTNESS_AUX_SET_CAP) &&
- !(intel_dp->edp_dpcd[2] & DP_EDP_BACKLIGHT_BRIGHTNESS_PWM_PIN_CAP)) {
View wf-alias-optional.patch
diff --git i/include/wayfire/config/option-types.hpp w/include/wayfire/config/option-types.hpp
index ec49728..7e30648 100644
--- i/include/wayfire/config/option-types.hpp
+++ w/include/wayfire/config/option-types.hpp
@@ -1,12 +1,24 @@
#pragma once
+#if __has_include(<optional>)
+#include <optional>
+#else
View i915_gem_userptr_ioctl.trace
CPU FUNCTION
1 -> i915_gem_userptr_ioctl arg: fffffe00cd374000
1 | i915_gem_userptr_ioctl:entry
1 -> linux_access_ok
1 <- linux_access_ok
1 -> i915_gem_object_alloc
1 -> uma_zalloc_arg
1 -> memset
1 -> memset_erms
1 <- memset_erms
View haskell-style-existential.idr
module Main
data Printable : Type where
Pr : Show a => a -> Printable
Show Printable where
show (Pr p) = show p
hello : (f: Bool) -> Printable
hello False = Pr 10
@myfreeweb
myfreeweb / index.js
Created Jul 25, 2019
oxipng wasm wrapper
View index.js
(async function () {
await wasm_bindgen('oxipng_wasm_bg.wasm')
window.oxi = wasm_bindgen
oxi.init()
const resp = await fetch('y.png')
const arb = await resp.arrayBuffer()
const uarr = new Uint8Array(arb)
console.log(uarr)
const t0 = performance.now()
window.result = oxi.optimize_from_memory(uarr)
View input.h
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
/*
* Copyright (c) 1999-2002 Vojtech Pavlik
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as published by
* the Free Software Foundation.
*/
#ifndef _UAPI_INPUT_H
#define _UAPI_INPUT_H
@myfreeweb
myfreeweb / dmesg
Created Jun 20, 2018
asus-duma postmarketOS first boot dmesg
View dmesg
[ 0.000000] Booting Linux on physical CPU 0
[ 0.000000] Initializing cgroup subsys cpu
[ 0.000000] Linux version 3.4.113-ElementalX-ME302KL-7.02 (pmos@varch) (gcc version 6.4.0 (Alpine 6.4.0) ) #1-postmarketOS SMP PREEMPT Wed Jun 20 11:36:41 UTC 2018
[ 0.000000] CPU: ARMv7 Processor [511f06f0] revision 0 (ARMv7), cr=10c5387d
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, PIPT instruction cache
[ 0.000000] Machine: QCT APQ8064 DUMA
[ 0.000000] Truncating memory at 0x90000000 to fit in 32-bit physical address space
[ 0.000000] memory pool 3 (start fe9ff000 size 1600000) initialized
[ 0.000000] Hardboot page reserved at 0x88C00000
[ 0.000000] Initialized persistent memory from 88d00000-88dfffff
@myfreeweb
myfreeweb / left-pad.mlw
Last active Apr 26, 2018
Left-pad verified with Why3
View left-pad.mlw
module LeftPad
use import int.Int
use import int.MinMax
use import string.Char as C
use import map.Map as M
use import string.String as S
use import string.Buffer as B
(* string.Buffer.contents only does the length for some reason *)
val buf2str (b: B.t) : string
@myfreeweb
myfreeweb / Makefile
Created Mar 26, 2018
Linker removes struct :(
View Makefile
libstruct.o: libstruct.c libstruct.h
cc -c -o $@ libstruct.c
libinit.o: libinit.c libinit.h
cc -c -o $@ libinit.c
lib.a: libstruct.o libinit.o
ar rcs $@ libstruct.o libinit.o
app: app.c lib.a
You can’t perform that action at this time.