Skip to content

Commit

Permalink
Separate GPD Win 2 as a discrete device. Close #30
Browse files Browse the repository at this point in the history
Add mem_sleep_default=s2idle to kernel options to fix not waking from suspend.
  • Loading branch information
flexiondotorg committed Jan 21, 2022
1 parent e743e82 commit c25b8ed
Show file tree
Hide file tree
Showing 8 changed files with 68 additions and 28 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ xinput
| GPD Pocket | DSI-1 / DSI1 | 1200x1920 | Right | SINO WEALTH Gaming Keyboard | Goodix Capacitive TouchScreen | >= 4.18 | >= 18.04.2 | gpd-pocket |
| GPD Pocket 2 | eDP-1 / eDP1 | 1200x1920 | Right | HAILUCK CO.,LTD USB KEYBOARD Mouse | Goodix Capacitive TouchScreen | >= 4.18 | >= 18.04.2 | gpd-pocket2 |
| GPD Pocket 3 | DSI-1 / DSI1 | 1200x1920 | Right | HAILUCK CO.,LTD USB KEYBOARD Mouse | GXTP7380:00 27C6:0113 | >= 5.13 | >= 21.10 | gpd-pocket3 |
| GPD WIN 2 | eDP-1 / eDP1 | 720x1280 | Right | HK-ZYYK-US-A1-02-00 USB Keyboard Mouse | Goodix Capacitive TouchScreen | >= 4.18 | >= 19.04 | gpd-pocket2 |
| GPD WIN 2 | eDP-1 / eDP1 | 720x1280 | Right | HK-ZYYK-US-A1-02-00 USB Keyboard Mouse | Goodix Capacitive TouchScreen | >= 4.18 | >= 19.04 | gpd-win2 |
| GPD MicroPC | DSI-1 / DSI1 | 720x1280 | Right | AMR-4630-XXX-0- 0-1023 USB KEYBOARD Mouse | n/a | >= 5.2 | >= 19.10 | gpd-micropc |
| GPD P2 Max | eDP-1 / eDP1 | 2560x1600 | n/a | HAILUCK CO.,LTD USB KEYBOARD Mouse | Goodix Capacitive TouchScreen | ? | > | gpd-p2-max |
| GPD WIN Max | eDP-1 / eDP1 | 800x1280 | Right | HTIX5288:00 093A:0255 Mouse | Goodix Capacitive TouchScreen | >= 5.4 | >= 20.04.1 | gpd-win-max |
Expand Down
7 changes: 7 additions & 0 deletions data/20-gpd-win2-intel.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Section "Device"
Identifier "Device0"
Driver "intel"
Option "AccelMethod" "sna"
Option "TearFree" "true"
Option "DRI" "3"
EndSection
11 changes: 11 additions & 0 deletions data/40-gpd-win2-monitor.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# GPD WIN 2 (modesetting)
Section "Monitor"
Identifier "eDP-1"
Option "Rotate" "right"
EndSection

# GPD WIN 2 (xorg-video-intel)
Section "Monitor"
Identifier "eDP1"
Option "Rotate" "right"
EndSection
1 change: 1 addition & 0 deletions data/99-gpd-win2-touch.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ACTION=="add|change", KERNEL=="event[0-9]*", ATTRS{name}=="Goodix Capacitive TouchScreen", ENV{LIBINPUT_CALIBRATION_MATRIX}="0 1 0 -1 0 1"
27 changes: 27 additions & 0 deletions data/gpd-win2-monitors.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<monitors version="2">
<configuration>
<logicalmonitor>
<x>0</x>
<y>0</y>
<scale>2</scale>
<primary>yes</primary>
<transform>
<rotation>right</rotation>
<flipped>no</flipped>
</transform>
<monitor>
<monitorspec>
<connector>eDP-1</connector>
<vendor>unknown</vendor>
<product>unknown</product>
<serial>unknown</serial>
</monitorspec>
<mode>
<width>720</width>
<height>1280</height>
<rate>60.021636962890625</rate>
</mode>
</monitor>
</logicalmonitor>
</configuration>
</monitors>
2 changes: 2 additions & 0 deletions data/gpd-win2.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
GRUB_CMDLINE_LINUX="${GRUB_CMDLINE_LINUX} fbcon=rotate:1 mem_sleep_default=s2idle"
GRUB_GFXMODE=720x1280x32
23 changes: 7 additions & 16 deletions umpc-ubuntu-respin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function usage() {
echo
echo "OPTIONS"
echo " -d"
echo " device modifications to apply to the iso image, can be 'gpd-pocket', 'gpd-pocket2', 'gpd-pocket3', 'gpd-micropc', 'gpd-p2-max', 'gpd-win-max' or 'topjoy-falcon'"
echo " device modifications to apply to the iso image, can be 'gpd-pocket', 'gpd-pocket2', 'gpd-pocket3', 'gpd-micropc', 'gpd-p2-max', 'gpd-win2', 'gpd-win-max' or 'topjoy-falcon'"
echo
echo " -h"
echo " display this help and exit"
Expand Down Expand Up @@ -76,11 +76,14 @@ ISO_IN="${1}"
if [ -z "${UMPC}" ]; then
echo "ERROR! You must supply the name of the device you want to apply modifications for."
usage
elif [ "${UMPC}" != "gpd-pocket" ] && [ "${UMPC}" != "gpd-pocket2" ] && [ "${UMPC}" != "gpd-pocket3" ] && [ "${UMPC}" != "gpd-micropc" ] && [ "${UMPC}" != "gpd-p2-max" ] && [ "${UMPC}" != "gpd-win-max" ] && [ "${UMPC}" != "topjoy-falcon" ]; then
echo "ERROR! Unknown device name given."
usage
fi

case "${UMPC}" in
gpd-pocket|gpd-pocket2|gpd-pocket3|gpd-micropc|gpd-p2-max|gpd-win2|gpd-win-max|topjoy-falcon) true;;
*) echo "ERROR! Unknown device name given."
usage;;
esac

if [ -z "${ISO_IN}" ]; then
echo "ERROR! You must provide the filename of an Ubuntu iso image."
usage
Expand Down Expand Up @@ -246,18 +249,6 @@ esac
#cat "${GRUB_LOOPBACK_CONF}"
#echo

# Increase console font size and add the display scaler
case ${UMPC} in
gpd-win-max|gpd-micropc) true;;
*) sed -i 's/FONTSIZE="8x16"/FONTSIZE="16x32"/' "${CONSOLE_CONF}"
inject_data "${SQUASH_OUT}/usr/bin/umpc-display-scaler"
inject_data "${SQUASH_OUT}/etc/xdg/autostart/umpc-display-scaler.desktop"
inject_data "${SQUASH_OUT}/usr/share/applications/umpc-display-scaler.desktop"
#inject_data "${SQUASH_OUT}/lib/systemd/system/umpc-display-scaler.service"
#ln -sf /lib/systemd/system/umpc-display-scaler.service "${SQUASH_OUT}/etc/systemd/system/oem-config.service.wants/"
;;
esac

# Update filesystem size
du -sx --block-size=1 "${SQUASH_OUT}" | cut -f1 > "${MNT_OUT}/casper/filesystem.size"

Expand Down
23 changes: 12 additions & 11 deletions umpc-ubuntu.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

# Set to either "gpd-pocket", "gpd-pocket2", "gpd-pocket3", "gpd-micropc", "gpd-p2-max", "gpd-win-max" or "topjoy-falcon"
# Set to either "gpd-pocket", "gpd-pocket2", "gpd-pocket3", "gpd-p2-max", "gpd-micropc", "gpd-win2", "gpd-win-max" or "topjoy-falcon"
UMPC="gpd-pocket3"
XORG_CONF_PATH="/usr/share/X11/xorg.conf.d"
INTEL_CONF="${XORG_CONF_PATH}/20-${UMPC}-intel.conf"
Expand Down Expand Up @@ -94,16 +94,6 @@ function enable_umpc_config() {

update-grub

# Increase console font size and add the display scaler
case ${UMPC} in
gpd-win-max|gpd-micropc) true;;
*) sed -i 's/FONTSIZE="8x16"/FONTSIZE="16x32"/' "${CONSOLE_CONF}"
inject_data "${SQUASH_OUT}/usr/bin/umpc-display-scaler"
inject_data "${SQUASH_OUT}/etc/xdg/autostart/umpc-display-scaler.desktop"
inject_data "${SQUASH_OUT}/usr/share/applications/umpc-display-scaler.desktop"
;;
esac

echo "UMPC hardware configuration is applied. Please reboot to complete the setup."
}

Expand Down Expand Up @@ -166,6 +156,17 @@ else
MODE=$(echo "${1}" | tr '[:upper:]' '[:lower:]')
fi

if [ -z "${UMPC}" ]; then
echo "ERROR! You must supply the name of the device you want to apply modifications for."
usage
fi

case "${UMPC}" in
gpd-pocket|gpd-pocket2|gpd-pocket3|gpd-micropc|gpd-p2-max|gpd-win2|gpd-win-max|topjoy-falcon) true;;
*) echo "ERROR! Unknown device name given."
usage;;
esac

case "${MODE}" in
-d|--disable|disable)
disable_umpc_config;;
Expand Down

0 comments on commit c25b8ed

Please sign in to comment.