Skip to content

Instantly share code, notes, and snippets.

View notro's full-sized avatar

Noralf Trønnes notro

View GitHub Profile
diff --git a/src/portable/raspberrypi/rp2040/dcd_rp2040.c b/src/portable/raspberrypi/rp2040/dcd_rp2040.c
index 80e5d3c4..1df94e63 100644
--- a/src/portable/raspberrypi/rp2040/dcd_rp2040.c
+++ b/src/portable/raspberrypi/rp2040/dcd_rp2040.c
@@ -72,8 +72,10 @@ static void _hw_endpoint_alloc(struct hw_endpoint *ep)
{
size = ep->wMaxPacketSize;
}
+ ep->hw_data_buf_len = size;

If you get this error:

$ sudo usbip attach -r gud-pi.local -b usbip-vudc.0
libusbip: error: udev_device_get_sysattr_value failed
usbip: error: open vhci_driver

and have a device with a name following lexicographically after vhci_hcd:

$ ls -l /sys/devices/platform/
@notro
notro / r1-rgb111.diff
Created March 9, 2021 18:05
gud: Fix R1 and RGB111
From 3e1ad239a4382f2da5bc7466cb3cfb28e235be0e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= <noralf@tronnes.org>
Date: Tue, 9 Mar 2021 15:14:18 +0100
Subject: [PATCH v8 11/11] gud: Fix R1 and RGB111
---
drivers/gpu/drm/gud/gud_drv.c | 2 +-
drivers/gpu/drm/gud/gud_pipe.c | 49 +++++++++++++++++++++-------------
2 files changed, 31 insertions(+), 20 deletions(-)
/*
* SPDX-License-Identifier: MIT
*/
#include <stdio.h>
#include <string.h>
#include "gud.h"
#define GUD_LOG1
/*
* SPDX-License-Identifier: MIT
*/
#ifndef __LINUX_GUD_PROTOCOL_H
#define __LINUX_GUD_PROTOCOL_H
#include <stddef.h>
#include <stdint.h>
@notro
notro / gist:a43a93a3aa0cc75d930890b7b254fc0a
Created February 26, 2021 12:01
gud: Don't pass length in request structs
diff --git a/include/drm/gud.h b/include/drm/gud.h
index 7056f599a8e4..30bf2e5f2123 100644
--- a/include/drm/gud.h
+++ b/include/drm/gud.h
@@ -32,9 +32,6 @@
* @max_width: Maximum width
* @min_height: Minimum height
* @max_height: Maximum height
- * @num_formats: Number of supported pixel formats
- * @num_properties: Number of properties that are not connector properties
@notro
notro / dev_lowlevel.diff
Created February 8, 2021 15:54
Add control loopback test
diff --git a/usb/device/dev_lowlevel/dev_lowlevel.c b/usb/device/dev_lowlevel/dev_lowlevel.c
index cf53170..6facc39 100644
--- a/usb/device/dev_lowlevel/dev_lowlevel.c
+++ b/usb/device/dev_lowlevel/dev_lowlevel.c
@@ -43,6 +43,8 @@ static volatile bool configured = false;
// Global data buffer for EP0
static uint8_t ep0_buf[64];
+// Loopback buffer for ep0
+static uint8_t ep0_test_buf[64];
if [ $# -eq 0 ] ; then
echo "Connector missing"
exit 1
fi
connector=$1
function modetest
{
pi@pi2835:~$ sudo sh -c "echo 0x7 > /sys/module/drm/parameters/debug "
pi@pi2835:~$ sudo dmesg -C && sudo modprobe mi0283qt
pi@pi2835:~$ con2fbmap 1 1
pi@pi2835:~$ ~/libdrm/tests/modetest/modetest -M mi0283qt -s 30:320x240@RG16
setting mode 320x240-0Hz@RG16 on connectors 30, crtc 33
^Z
[1]+ Stopped ~/libdrm/tests/modetest/modetest -M mi0283qt -s 30:320x240@RG16
pi@pi2835:~$ sudo sh -c "echo spi0.0 > /sys/bus/spi/drivers/mi0283qt/unbind "
pi@pi2835:~$ fg
diff --git a/samd/external_interrupts.c b/samd/external_interrupts.c
index 384ff99..42e315d 100644
--- a/samd/external_interrupts.c
+++ b/samd/external_interrupts.c
@@ -36,6 +36,7 @@
// has one user.
static void *channel_data[EIC_EXTINT_NUM];
static uint8_t channel_handler[EIC_EXTINT_NUM];
+static channel_handler_t *channel_handler_func[EIC_EXTINT_NUM];