Compare commits

..

2 Commits

Author SHA1 Message Date
960b808457 feat: added compatibility with ChimeraOS configuration and device-quirks
Signed-off-by: Boris Yumankulov <boria138@altlinux.org>
2025-07-09 21:25:14 +05:00
cf0b11ea3e fix: added workaround for work with nvk
Signed-off-by: Boris Yumankulov <boria138@altlinux.org>
2025-07-09 20:49:58 +05:00
2 changed files with 105 additions and 18 deletions

View File

@@ -1,13 +1,48 @@
# PortProtonQt session # PortProtonQt session
This project is not affiliated with Valve (wide inspiration was taken from This project is not affiliated with Valve (wide inspiration was taken from
their work on the SteamDeck). This configuration depends on [gamescope-session](https://raw.githubusercontent.com/ChimeraOS/gamescope-session) from the ChimeraOS project. and [portprotonqt](https://git.linux-gaming.ru/Boria138/PortProtonQt) their work on the SteamDeck)
## Basic manual setup ## Basic manual setup
Copy this repository file structure into the appropriate places and you'll be Copy this repository file structure into the appropriate places and you'll be
able to start the session on any Display Manager of your choice. able to start the session on any Display Manager of your choice.
# User Configuration
The session sources environment from `~/.config/environment.d/*.conf` files.
The easiest way to configure the session is to create `~/.config/environment.d/gamescope-session-plus.conf`
and set variables there:
```bash
# Size of the screen. If not set gamescope will detect native resolution from drm.
SCREEN_HEIGHT=2160
SCREEN_WIDTH=3840
# Internal render size of the screen. If not set, will be the same as SCREEN_HEIGHT and SCREEN_WIDTH.
INTERNAL_WIDTH=1280
INTERNAL_HEIGHT=800
# Orientation adjustment of panel, possible values: left, right
ORIENTATION=left
# Enable VRR
ADAPTIVE_SYNC=1
# Treat the internal panel as an external monitor
PANEL_TYPE=external
# Set priority of display connectors
OUTPUT_CONNECTOR='*,DSI-1'
# Set the specific values allowed for refresh rates
CUSTOM_REFRESH_RATES=40,50,60
# DRM mode generation algorithm (cvt, fixed)
# TODO: what is this ?
DRM_MODE=fixed
```
# License & Contributing # License & Contributing
The project is licensed under GPL v3 license. If you want to contribute, The project is licensed under GPL v3 license. If you want to contribute,

View File

@@ -1,5 +1,18 @@
#!/usr/bin/env bash #!/usr/bin/env bash
gamescope_has_option() {
if (gamescope --help 2>&1 | grep -e "$1" > /dev/null); then
return 0
fi
return 1
}
# Source device quirks if exists
if [ -f /usr/share/gamescope-session-plus/device-quirks ]; then
. /usr/share/gamescope-session-plus/device-quirks
fi
# Source user configuration from ~/.config/environment.d # Source user configuration from ~/.config/environment.d
set -a set -a
for i in "${HOME}"/.config/environment.d/*.conf; do for i in "${HOME}"/.config/environment.d/*.conf; do
@@ -7,23 +20,62 @@ for i in "${HOME}"/.config/environment.d/*.conf; do
done done
set +a set +a
# Fix intel color corruption # Gamescope parameters
# might come with some performance degradation but is better than a corrupted : "${OUTPUT_CONNECTOR:=*,eDP-1}"
# color image GAMESCOPE_PARAMS="--prefer-output $OUTPUT_CONNECTOR"
export INTEL_DEBUG=norbc
export mesa_glthread=true
# This should be used by default by gamescope. Cannot hurt to force it anyway. # Check if NVK driver is in use
# Reported better framelimiting with this enabled if vulkaninfo 2>/dev/null | grep -i "driverName" | grep -q "NVK"; then
export ENABLE_GAMESCOPE_WSI=1 # Workaround for https://gitlab.freedesktop.org/mesa/mesa/-/issues/13478
BACKEND="sdl"
# Some environment variables by default (taken from Deck session) GAMESCOPE_PARAMS+=" -f"
export SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS=0
# Add custom vulkan adapter if specified
if [ -n "$VULKAN_ADAPTER" ]; then
GAMESCOPECMD= " --prefer-vk-device $VULKAN_ADAPTER"
fi fi
# Start client application if [ -n "$SCREEN_WIDTH" ] && [ -n "$SCREEN_HEIGHT" ]; then
gamescope $GAMESCOPECMD -- portprotonqt --fullscreen GAMESCOPE_PARAMS+=" -W $SCREEN_WIDTH -H $SCREEN_HEIGHT"
fi
if [ -n "$INTERNAL_WIDTH" ] && [ -n "$INTERNAL_HEIGHT" ] ; then
GAMESCOPE_PARAMS+=" -w $INTERNAL_WIDTH -h $INTERNAL_HEIGHT"
fi
if [ -n "$DRM_MODE" ] ; then
GAMESCOPE_PARAMS+=" --generate-drm-mode $DRM_MODE"
fi
if [ -n "$ORIENTATION" ] ; then
GAMESCOPE_PARAMS+=" --force-orientation $ORIENTATION"
fi
if [ -n "$ADAPTIVE_SYNC" ]; then
GAMESCOPE_PARAMS+=" --adaptive-sync"
fi
if [ -n "$PANEL_TYPE" ] && gamescope_has_option "--force-panel-type"; then
GAMESCOPE_PARAMS+=" --force-panel-type $PANEL_TYPE"
fi
if [ -n "$CUSTOM_REFRESH_RATES" ] && gamescope_has_option "--custom-refresh-rates"; then
GAMESCOPE_PARAMS+=" --custom-refresh-rates $CUSTOM_REFRESH_RATES"
fi
if [ -n "$USE_ROTATION_SHADER" ] && gamescope_has_option "--use-rotation-shader"; then
GAMESCOPE_PARAMS+=" --use-rotation-shader $USE_ROTATION_SHADER"
fi
if [ -n "$BACKEND" ] && gamescope_has_option "--backend"; then
GAMESCOPE_PARAMS+=" --backend $BACKEND"
fi
if [ -f "$CURSOR_FILE" ]; then
# Use specified cursor if file exists
GAMESCOPE_PARAMS+=" --cursor ${CURSOR_FILE}"
fi
# Prefer a specific Vulkan adapter if defined
if [ -n "$VULKAN_ADAPTER" ]; then
GAMESCOPE_PARAMS+=" --prefer-vk-device $VULKAN_ADAPTER"
fi
# Start client application with Gamescope
gamescope $GAMESCOPE_PARAMS -- portprotonqt --fullscreen