Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0572e3e680
|
||
|
|
49eadbf3c2
|
||
|
|
9bef5a8ac1
|
||
|
|
cfe339f3b2
|
||
|
|
ace6a59026
|
No files matched your search
@@ -8,6 +8,7 @@ on:
|
||||
- scripts
|
||||
paths:
|
||||
- 'build-aux/src/vk_gpu_info.c'
|
||||
- 'build-aux/src/wine_gpu_names.h'
|
||||
- '.gitea/workflows/build-vk-gpu-info-debian.yml'
|
||||
|
||||
jobs:
|
||||
|
||||
@@ -30,8 +30,6 @@ jobs:
|
||||
run: python dev-scripts/get_id.py
|
||||
env:
|
||||
STEAM_KEY: ${{ secrets.STEAM_KEY }}
|
||||
LINUX_GAMING_API_KEY: ${{ secrets.LINUX_GAMING_API_KEY }}
|
||||
LINUX_GAMING_API_USERNAME: ${{ secrets.LINUX_GAMING_API_USERNAME }}
|
||||
|
||||
- name: Commit and push changes
|
||||
env:
|
||||
|
||||
@@ -40,6 +40,6 @@ jobs:
|
||||
env:
|
||||
RENOVATE_CONFIG_FILE: "/tmp/renovate-config/config.js"
|
||||
RENOVATE_BINARY_SOURCE: "global"
|
||||
GITHUB_COM_TOKEN: ${{ secrets.GITHUB_COM_TOKEN }}
|
||||
GITHUB_COM_TOKEN: ${{ secrets.GHP_COM_TOKEN }}
|
||||
LOG_LEVEL: "debug"
|
||||
RENOVATE_TOKEN: ${{ secrets.RENOVATE_TOKEN }}
|
||||
@@ -0,0 +1,49 @@
|
||||
name: Update Wine GPU names
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: '0 4 * * 1'
|
||||
|
||||
concurrency:
|
||||
group: update-wine-gpu-names
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
update:
|
||||
if: gitea.repository == 'Linux-Gaming/PortProtonQt'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: https://git.linux-gaming.ru/actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
|
||||
with:
|
||||
ref: main
|
||||
token: ${{ secrets.GITEA_TOKEN }}
|
||||
|
||||
- name: Set up Python
|
||||
uses: https://git.linux-gaming.ru/actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7
|
||||
with:
|
||||
python-version-file: pyproject.toml
|
||||
|
||||
- name: Update Wine GPU names
|
||||
id: update
|
||||
run: |
|
||||
python dev-scripts/update_wine_gpu_names.py
|
||||
if git diff --quiet -- build-aux/src/wine_gpu_names.h; then
|
||||
echo "changed=false" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
echo "changed=true" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
|
||||
- name: Commit and push table changes
|
||||
if: steps.update.outputs.changed == 'true'
|
||||
run: |
|
||||
git add -- build-aux/src/wine_gpu_names.h
|
||||
if git diff --cached --quiet; then
|
||||
echo "Wine GPU names are unchanged."
|
||||
exit 0
|
||||
fi
|
||||
git config --local user.name 'Gitea Actions'
|
||||
git config --local user.email 'gitea-actions@users.noreply.gitea.com'
|
||||
git commit -m 'chore: sync Wine GPU names'
|
||||
git push origin HEAD:main
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
### Added
|
||||
|
||||
- В Run After / Wrapper добавлена поддержка `%command%` для передачи команды игры обёртке, например `mako-launch %command%`, без повторного запуска игры
|
||||
- Добавлено отслеживание запуска Steam-игр на странице игры
|
||||
- Добавлен CLI для получения локальных данных библиотеки
|
||||
- Для Run After / Wrapper добавлен раскрываемый список с отдельным полем для каждой записи, удалением записей и кнопкой полной очистки
|
||||
@@ -43,6 +44,7 @@
|
||||
|
||||
### Fixed
|
||||
|
||||
- Исправлена фильтрация видеокарт DXVK и VKD3D при расхождении нативного имени GPU с именем Wine
|
||||
- Запросы установки других игр GOG и EGS во время получения списка DLC добавляются в очередь вместо ошибки «Другая загрузка уже выполняется»
|
||||
- Виртуальная мышь создаётся только при включении эмуляции геймпадом и удаляется при её выключении
|
||||
- При ошибке загрузки каталога WINE/Proton отображаются локально установленные версии
|
||||
|
||||
Binary file not shown.
@@ -1572,6 +1572,7 @@ pw_kill_autostart () {
|
||||
export -f pw_kill_autostart
|
||||
|
||||
stop_portproton () {
|
||||
pw_remove_session_env
|
||||
[[ "$int_xneur" == "1" ]] && xneur &
|
||||
|
||||
if [[ "$PW_USE_US_LAYOUT" == "1" ]] \
|
||||
@@ -2008,6 +2009,37 @@ pw_init_db () {
|
||||
return 0
|
||||
}
|
||||
|
||||
pw_select_gpu () {
|
||||
[[ -n "${PW_GPU_USE}" && "${PW_GPU_USE}" != "disabled" ]] || return 0
|
||||
local vk_gpu_info_cmd vk_info_output line current_device_name="" filter_name="${PW_GPU_USE}"
|
||||
vk_gpu_info_cmd="$(dirname "${BASH_SOURCE[0]}")/../../../bin/vk_gpu_info"
|
||||
if [[ ! -x "${vk_gpu_info_cmd}" ]] ; then
|
||||
vk_gpu_info_cmd="$(command -v vk_gpu_info 2>/dev/null || true)"
|
||||
fi
|
||||
if [[ -n "${vk_gpu_info_cmd}" ]] ; then
|
||||
if vk_info_output="$("${vk_gpu_info_cmd}" 2>/dev/null)" ; then
|
||||
while IFS= read -r line ; do
|
||||
case "$line" in
|
||||
"GPU #"*) current_device_name="" ;;
|
||||
"device_name: "*) current_device_name="${line#device_name: }" ;;
|
||||
"wine_device_name: "*)
|
||||
if [[ "${current_device_name}" == "${PW_GPU_USE}" && -n "${line#wine_device_name: }" ]] ; then
|
||||
filter_name="${line#wine_device_name: }"
|
||||
break
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
done <<< "${vk_info_output}"
|
||||
else
|
||||
print_warning "vk_gpu_info failed; using the native GPU name for device filters."
|
||||
fi
|
||||
fi
|
||||
[[ -v DXVK_FILTER_DEVICE_NAME ]] || export DXVK_FILTER_DEVICE_NAME="${filter_name}"
|
||||
[[ -v VKD3D_FILTER_DEVICE_NAME ]] || export VKD3D_FILTER_DEVICE_NAME="${filter_name}"
|
||||
export MESA_VK_DEVICE_SELECT_FORCE_DEFAULT_DEVICE="1"
|
||||
export MESA_VK_DEVICE_SELECT="$PW_vendorID:$PW_deviceID"
|
||||
}
|
||||
|
||||
pw_check_vulkan_extensions () {
|
||||
local ext_name="$1"
|
||||
local ext_key
|
||||
@@ -3012,12 +3044,7 @@ start_portproton () {
|
||||
|
||||
[[ "${PW_VKBASALT_USER_CONF}" == 1 ]] && pw_select_vkbasalt_user_conf
|
||||
|
||||
if [[ $PW_GPU_USE != "disabled" ]] ; then
|
||||
export DXVK_FILTER_DEVICE_NAME="$PW_GPU_USE"
|
||||
export VKD3D_FILTER_DEVICE_NAME="$PW_GPU_USE"
|
||||
export MESA_VK_DEVICE_SELECT_FORCE_DEFAULT_DEVICE="1"
|
||||
export MESA_VK_DEVICE_SELECT="$PW_vendorID:$PW_deviceID"
|
||||
fi
|
||||
pw_select_gpu
|
||||
|
||||
if [[ -f "$PATH_TO_GAME/dxvk.conf" ]] ; then
|
||||
export DXVK_CONFIG_FILE="$PATH_TO_GAME/dxvk.conf"
|
||||
@@ -3845,6 +3872,7 @@ start_portproton () {
|
||||
pw_mangohud_check
|
||||
pw_vkbasalt_check
|
||||
pw_lsfg_vk_check
|
||||
pw_save_session_env || print_warning "Could not save Wine session environment"
|
||||
}
|
||||
|
||||
pw_run () {
|
||||
@@ -3996,6 +4024,80 @@ pw_run () {
|
||||
}
|
||||
export -f pw_run
|
||||
|
||||
pw_save_session_env () {
|
||||
local session_dir="${PORT_DATA_PATH}/data/tmp/wine-session-$(id -u)"
|
||||
local session_tmp
|
||||
|
||||
( umask 077; mkdir -p "$session_dir" ) || return 1
|
||||
[[ ! -L "$session_dir" && -O "$session_dir" ]] || return 1
|
||||
[[ "$(stat -c %a "$session_dir")" == 700 ]] || return 1
|
||||
|
||||
session_tmp="$(mktemp "$session_dir/env.XXXXXX")" || return 1
|
||||
if ( export PW_TERM; export -p > "$session_tmp" ) \
|
||||
&& mv -fT "$session_tmp" "$session_dir/session.env" ; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
rm -f "$session_tmp"
|
||||
return 1
|
||||
}
|
||||
|
||||
pw_remove_session_env () {
|
||||
local session_dir="${PORT_DATA_PATH}/data/tmp/wine-session-$(id -u)"
|
||||
[[ ! -L "$session_dir" && -O "$session_dir" ]] || return 0
|
||||
local session_env="$session_dir/session.env"
|
||||
[[ ! -L "$session_env" && -O "$session_env" ]] || return 0
|
||||
if grep -qsx "declare -x PW_START_PID=\"${PW_START_PID}\"" "$session_env" ; then
|
||||
rm -f "$session_env"
|
||||
fi
|
||||
}
|
||||
|
||||
pw_session_tool () {
|
||||
local tool="$1" session_pid session_env
|
||||
local session_dir="${PORT_DATA_PATH}/data/tmp/wine-session-$(id -u)"
|
||||
local session_wait_seconds="${2:-30}" wait_left
|
||||
wait_left="$session_wait_seconds"
|
||||
|
||||
case "$tool" in
|
||||
winefile|taskmgr|winecfg|regedit|cmd|uninstaller) ;;
|
||||
*) print_error "Unsupported Wine tool: $tool" ; return 1 ;;
|
||||
esac
|
||||
|
||||
session_env="$session_dir/session.env"
|
||||
while (( wait_left > 0 )) ; do
|
||||
if [[ ! -L "$session_dir" && -O "$session_dir" ]] \
|
||||
&& [[ "$(stat -c %a "$session_dir")" == 700 ]] \
|
||||
&& [[ ! -L "$session_env" && -O "$session_env" ]] \
|
||||
&& [[ "$(stat -c %a "$session_env")" == 600 ]] \
|
||||
&& session_pid="$(sed -n 's/^declare -x PW_START_PID="\([0-9]*\)"$/\1/p' "$session_env")" \
|
||||
&& [[ -n "$session_pid" ]] \
|
||||
&& kill -0 "$session_pid" 2>/dev/null ; then
|
||||
break
|
||||
fi
|
||||
|
||||
sleep 1
|
||||
(( --wait_left ))
|
||||
done
|
||||
|
||||
if (( wait_left == 0 )) ; then
|
||||
print_error "Wine session unavailable after ${session_wait_seconds} seconds"
|
||||
return 2
|
||||
fi
|
||||
|
||||
source "$session_env" || return 1
|
||||
PATH_TO_GAME="${WINEPREFIX}/drive_c"
|
||||
[[ -d "$PATH_TO_GAME" ]] || return 1
|
||||
|
||||
unset LAUNCH_PARAMETERS PW_RUN_AFTER_EXE PW_RUN_GAMESCOPE PW_USE_TERMINAL
|
||||
PW_TMPFS_PATH="$(mktemp -d "$session_dir/tool.XXXXXX")" || return 1
|
||||
export PW_TMPFS_PATH
|
||||
export PW_LOG_FILE="$PW_TMPFS_PATH/wine.log"
|
||||
|
||||
[[ "$tool" == cmd ]] && PW_USE_TERMINAL=1
|
||||
[[ "$tool" == winecfg || "$tool" == regedit ]] && export GST_PLUGIN_SYSTEM_PATH_1_0=""
|
||||
pw_run "$tool" || return 1
|
||||
}
|
||||
|
||||
pw_launch_wrapper () {
|
||||
if [[ -z "${PW_RUN_AFTER_EXE:-}" ]] ; then
|
||||
"$@"
|
||||
@@ -4038,6 +4140,22 @@ pw_launch_wrapper () {
|
||||
return
|
||||
fi
|
||||
|
||||
local wrapper_arg
|
||||
local -a launch_cmd=()
|
||||
local wrapper_command_seen=0
|
||||
for wrapper_arg in "${wrapper_cmd[@]}" ; do
|
||||
if [[ "$wrapper_arg" == '%command%' ]] ; then
|
||||
launch_cmd+=("$@")
|
||||
wrapper_command_seen=1
|
||||
else
|
||||
launch_cmd+=("$wrapper_arg")
|
||||
fi
|
||||
done
|
||||
if [[ "$wrapper_command_seen" == 1 ]] ; then
|
||||
"${launch_cmd[@]}"
|
||||
return
|
||||
fi
|
||||
|
||||
if [[ "${wrapper_cmd[0]##*/}" == "systemd-run" ]] ; then
|
||||
"${wrapper_cmd[@]}" -- "$@"
|
||||
return
|
||||
|
||||
@@ -67,6 +67,21 @@ export PW_LOG_FILE="${PORT_DATA_PATH}/PortProton.log"
|
||||
# shellcheck source=/dev/null
|
||||
source "$PORT_SCRIPTS_PATH/functions_helper"
|
||||
|
||||
if [[ "${1:-}" == "cli" && "${2:-}" == "--wine-session-tool" ]] ; then
|
||||
session_unavailable_status=2
|
||||
session_wait_seconds=30
|
||||
[[ -n "${4:-}" && -n "${5:-}" ]] && session_wait_seconds=1
|
||||
if pw_session_tool "${3:-}" "$session_wait_seconds" ; then
|
||||
exit 0
|
||||
else
|
||||
session_tool_status=$?
|
||||
fi
|
||||
if [[ "$session_tool_status" != "$session_unavailable_status" || -z "${4:-}" || -z "${5:-}" ]] ; then
|
||||
python_module dbus_tools notify -i error "Wine" "Failed to start Wine tool: ${3:-}" &>/dev/null
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
export PORT_WINE_TMP_PATH="${PORT_DATA_PATH}/data/tmp"
|
||||
create_new_dir "$PORT_WINE_TMP_PATH"
|
||||
rm -f "$PORT_WINE_TMP_PATH"/*.{exe,msi,tar}*
|
||||
@@ -280,11 +295,7 @@ case "$1" in
|
||||
--show-ppdb Show the content of .ppdb file for specified .exe file
|
||||
--backup-prefix Backup specified prefix to a file
|
||||
--restore-prefix Restore prefix from backup file
|
||||
--winefile Open wine file explorer, requires WINE version and prefix name
|
||||
--winecfg Open wine configuration, requires WINE version and prefix name
|
||||
--winecmd Open wine command prompt, requires WINE version and prefix name
|
||||
--winereg Open wine registry editor, requires WINE version and prefix name
|
||||
--wine_uninstaller Open wine uninstaller, requires WINE version and prefix name
|
||||
--wine-session-tool Open a Wine tool in the current session, or use optional WINE and prefix
|
||||
--winetricks-list-all List winetricks DLLs, fonts, and settings
|
||||
--winetricks-install Install winetricks items, requires WINE version and prefix name
|
||||
--clear_pfx Clear specified prefix, requires WINE version and prefix name
|
||||
@@ -300,7 +311,7 @@ Usage examples:
|
||||
portproton cli --del-user-conf PW_MANGOHUD
|
||||
portproton cli --backup-prefix DEFAULT /path/to/backup/directory
|
||||
portproton cli --restore-prefix /path/to/backup/file.ppack
|
||||
portproton cli --winecfg WINE_LG DEFAULT
|
||||
portproton cli --wine-session-tool winecfg WINE_LG DEFAULT
|
||||
portproton cli --winetricks-list-all WINE_LG DEFAULT
|
||||
portproton cli --winetricks-install WINE_LG DEFAULT --no-force corefonts
|
||||
portproton cli --mangohud-preview \"fps,frametime,cpu_temp,gpu_temp\"
|
||||
@@ -462,37 +473,21 @@ Usage examples:
|
||||
pw_unpack_prefix "$2"
|
||||
exit $?
|
||||
;;
|
||||
--winefile)
|
||||
get_wine_and_pfx "$2" "$3"
|
||||
--wine-session-tool)
|
||||
tool="$2"
|
||||
case "$tool" in
|
||||
winefile|taskmgr|winecfg|regedit|cmd|uninstaller) ;;
|
||||
*) print_error "Unsupported Wine tool: $tool" ; exit 1 ;;
|
||||
esac
|
||||
get_wine_and_pfx "$3" "$4"
|
||||
start_portproton
|
||||
pw_run winefile
|
||||
stop_portproton
|
||||
;;
|
||||
--winecfg)
|
||||
get_wine_and_pfx "$2" "$3"
|
||||
start_portproton
|
||||
export GST_PLUGIN_SYSTEM_PATH_1_0=""
|
||||
pw_run winecfg
|
||||
stop_portproton
|
||||
;;
|
||||
--winecmd)
|
||||
get_wine_and_pfx "$2" "$3"
|
||||
start_portproton
|
||||
cd "${PORT_DATA_PATH}/data/prefixes/${PW_PREFIX_NAME}/drive_c" || fatal "Prefix drive_c directory not found"
|
||||
PW_USE_TERMINAL=1 pw_run cmd
|
||||
stop_portproton
|
||||
;;
|
||||
--winereg)
|
||||
get_wine_and_pfx "$2" "$3"
|
||||
start_portproton
|
||||
export GST_PLUGIN_SYSTEM_PATH_1_0=""
|
||||
pw_run regedit
|
||||
stop_portproton
|
||||
;;
|
||||
--wine_uninstaller)
|
||||
get_wine_and_pfx "$2" "$3"
|
||||
start_portproton
|
||||
pw_run uninstaller
|
||||
[[ "$tool" == winecfg || "$tool" == regedit ]] && export GST_PLUGIN_SYSTEM_PATH_1_0=""
|
||||
if [[ "$tool" == cmd ]] ; then
|
||||
cd "${PORT_DATA_PATH}/data/prefixes/${PW_PREFIX_NAME}/drive_c" || fatal "Prefix drive_c directory not found"
|
||||
PW_USE_TERMINAL=1 pw_run "$tool"
|
||||
else
|
||||
pw_run "$tool"
|
||||
fi
|
||||
stop_portproton
|
||||
;;
|
||||
--winetricks-list-all)
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <vulkan/vulkan.h>
|
||||
#include "wine_gpu_names.h"
|
||||
|
||||
typedef struct {
|
||||
uint32_t vendor_id;
|
||||
@@ -275,6 +276,7 @@ int main() {
|
||||
printf("vendor_id: 0x%04x\n", props.vendorID);
|
||||
printf("device_id: 0x%04x\n", props.deviceID);
|
||||
printf("device_name: %s\n", device_name);
|
||||
printf("wine_device_name: %s\n", wine_device_name(props.vendorID, props.deviceID, device_name));
|
||||
printf("driver_name: %s\n", driver_name);
|
||||
printf("driver_info: %s\n", driver_info);
|
||||
printf("api_version: %u.%u.%u\n",
|
||||
|
||||
@@ -0,0 +1,371 @@
|
||||
/*
|
||||
* GPU names derived from Wine gpu_device_name()
|
||||
*
|
||||
* Copyright 1994 Alexandre Julliard
|
||||
* Copyright 2019 Zhiyi Zhang for CodeWeavers
|
||||
* Copyright 2021 Jacek Caban for CodeWeavers
|
||||
*
|
||||
* Adapted from LGPL-2.1-or-later Wine code under section 3 of LGPL-2.1.
|
||||
* This adaptation is licensed under GPL-3.0.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
// Source: wine-mirror/wine, dlls/win32u/sysparams.c
|
||||
// Revision: 9f8c4ae4d35c7ff4153267aba9618c026f5f5583
|
||||
#ifndef WINE_GPU_NAMES_H
|
||||
#define WINE_GPU_NAMES_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
static const struct {
|
||||
uint32_t vendor_id;
|
||||
uint32_t device_id;
|
||||
const char *name;
|
||||
} wine_gpu_names[] = {
|
||||
{0x10de, 0x0018, "NVIDIA RIVA 128"},
|
||||
{0x10de, 0x0020, "NVIDIA RIVA TNT"},
|
||||
{0x10de, 0x0028, "NVIDIA RIVA TNT2/TNT2 Pro"},
|
||||
{0x10de, 0x0100, "NVIDIA GeForce 256"},
|
||||
{0x10de, 0x0150, "NVIDIA GeForce2 GTS/GeForce2 Pro"},
|
||||
{0x10de, 0x0110, "NVIDIA GeForce2 MX/MX 400"},
|
||||
{0x10de, 0x0200, "NVIDIA GeForce3"},
|
||||
{0x10de, 0x0170, "NVIDIA GeForce4 MX 460"},
|
||||
{0x10de, 0x0253, "NVIDIA GeForce4 Ti 4200"},
|
||||
{0x10de, 0x0320, "NVIDIA GeForce FX 5200"},
|
||||
{0x10de, 0x0312, "NVIDIA GeForce FX 5600"},
|
||||
{0x10de, 0x0302, "NVIDIA GeForce FX 5800"},
|
||||
{0x10de, 0x014f, "NVIDIA GeForce 6200"},
|
||||
{0x10de, 0x0140, "NVIDIA GeForce 6600 GT"},
|
||||
{0x10de, 0x0041, "NVIDIA GeForce 6800"},
|
||||
{0x10de, 0x01d7, "NVIDIA GeForce Go 7300"},
|
||||
{0x10de, 0x01d8, "NVIDIA GeForce Go 7400"},
|
||||
{0x10de, 0x0391, "NVIDIA GeForce 7600 GT"},
|
||||
{0x10de, 0x0092, "NVIDIA GeForce 7800 GT"},
|
||||
{0x10de, 0x0849, "NVIDIA GeForce 8200"},
|
||||
{0x10de, 0x084b, "NVIDIA GeForce 8200"},
|
||||
{0x10de, 0x0423, "NVIDIA GeForce 8300 GS"},
|
||||
{0x10de, 0x0404, "NVIDIA GeForce 8400 GS"},
|
||||
{0x10de, 0x0421, "NVIDIA GeForce 8500 GT"},
|
||||
{0x10de, 0x0402, "NVIDIA GeForce 8600 GT"},
|
||||
{0x10de, 0x0407, "NVIDIA GeForce 8600M GT"},
|
||||
{0x10de, 0x0193, "NVIDIA GeForce 8800 GTS"},
|
||||
{0x10de, 0x0191, "NVIDIA GeForce 8800 GTX"},
|
||||
{0x10de, 0x086d, "NVIDIA GeForce 9200"},
|
||||
{0x10de, 0x086c, "NVIDIA GeForce 9300"},
|
||||
{0x10de, 0x0863, "NVIDIA GeForce 9400M"},
|
||||
{0x10de, 0x042c, "NVIDIA GeForce 9400 GT"},
|
||||
{0x10de, 0x0640, "NVIDIA GeForce 9500 GT"},
|
||||
{0x10de, 0x0622, "NVIDIA GeForce 9600 GT"},
|
||||
{0x10de, 0x064a, "NVIDIA GeForce 9700M GT"},
|
||||
{0x10de, 0x0614, "NVIDIA GeForce 9800 GT"},
|
||||
{0x10de, 0x0a23, "NVIDIA GeForce 210"},
|
||||
{0x10de, 0x0a20, "NVIDIA GeForce GT 220"},
|
||||
{0x10de, 0x0ca3, "NVIDIA GeForce GT 240"},
|
||||
{0x10de, 0x0615, "NVIDIA GeForce GTS 250"},
|
||||
{0x10de, 0x05e2, "NVIDIA GeForce GTX 260"},
|
||||
{0x10de, 0x05e6, "NVIDIA GeForce GTX 275"},
|
||||
{0x10de, 0x05e1, "NVIDIA GeForce GTX 280"},
|
||||
{0x10de, 0x0a7a, "NVIDIA GeForce 315M"},
|
||||
{0x10de, 0x08a3, "NVIDIA GeForce 320M"},
|
||||
{0x10de, 0x0a2d, "NVIDIA GeForce GT 320M"},
|
||||
{0x10de, 0x0a35, "NVIDIA GeForce GT 325M"},
|
||||
{0x10de, 0x0ca0, "NVIDIA GeForce GT 330"},
|
||||
{0x10de, 0x0cb0, "NVIDIA GeForce GTS 350M"},
|
||||
{0x10de, 0x1055, "NVIDIA GeForce 410M"},
|
||||
{0x10de, 0x0de2, "NVIDIA GeForce GT 420"},
|
||||
{0x10de, 0x0df0, "NVIDIA GeForce GT 425M"},
|
||||
{0x10de, 0x0de1, "NVIDIA GeForce GT 430"},
|
||||
{0x10de, 0x0de0, "NVIDIA GeForce GT 440"},
|
||||
{0x10de, 0x0dc4, "NVIDIA GeForce GTS 450"},
|
||||
{0x10de, 0x0e22, "NVIDIA GeForce GTX 460"},
|
||||
{0x10de, 0x0dd1, "NVIDIA GeForce GTX 460M"},
|
||||
{0x10de, 0x06c4, "NVIDIA GeForce GTX 465"},
|
||||
{0x10de, 0x06cd, "NVIDIA GeForce GTX 470"},
|
||||
{0x10de, 0x06c0, "NVIDIA GeForce GTX 480"},
|
||||
{0x10de, 0x1040, "NVIDIA GeForce GT 520"},
|
||||
{0x10de, 0x0dec, "NVIDIA GeForce GT 525M"},
|
||||
{0x10de, 0x0df4, "NVIDIA GeForce GT 540M"},
|
||||
{0x10de, 0x1244, "NVIDIA GeForce GTX 550 Ti"},
|
||||
{0x10de, 0x04b8, "NVIDIA GeForce GT 555M"},
|
||||
{0x10de, 0x1200, "NVIDIA GeForce GTX 560 Ti"},
|
||||
{0x10de, 0x1251, "NVIDIA GeForce GTX 560M"},
|
||||
{0x10de, 0x1201, "NVIDIA GeForce GTX 560"},
|
||||
{0x10de, 0x1081, "NVIDIA GeForce GTX 570"},
|
||||
{0x10de, 0x1080, "NVIDIA GeForce GTX 580"},
|
||||
{0x10de, 0x104a, "NVIDIA GeForce GT 610"},
|
||||
{0x10de, 0x0f00, "NVIDIA GeForce GT 630"},
|
||||
{0x10de, 0x0de9, "NVIDIA GeForce GT 630M"},
|
||||
{0x10de, 0x0fc1, "NVIDIA GeForce GT 640"},
|
||||
{0x10de, 0x0fd2, "NVIDIA GeForce GT 640M"},
|
||||
{0x10de, 0x0fd1, "NVIDIA GeForce GT 650M"},
|
||||
{0x10de, 0x0fc6, "NVIDIA GeForce GTX 650"},
|
||||
{0x10de, 0x11c6, "NVIDIA GeForce GTX 650 Ti"},
|
||||
{0x10de, 0x11c0, "NVIDIA GeForce GTX 660"},
|
||||
{0x10de, 0x0fd4, "NVIDIA GeForce GTX 660M"},
|
||||
{0x10de, 0x1183, "NVIDIA GeForce GTX 660 Ti"},
|
||||
{0x10de, 0x1189, "NVIDIA GeForce GTX 670"},
|
||||
{0x10de, 0x11a1, "NVIDIA GeForce GTX 670MX"},
|
||||
{0x10de, 0x11a7, "NVIDIA GeForce GTX 675MX"},
|
||||
{0x10de, 0x11a2, "NVIDIA GeForce GTX 675MX"},
|
||||
{0x10de, 0x1180, "NVIDIA GeForce GTX 680"},
|
||||
{0x10de, 0x1188, "NVIDIA GeForce GTX 690"},
|
||||
{0x10de, 0x128b, "NVIDIA GeForce GT 720"},
|
||||
{0x10de, 0x1287, "NVIDIA GeForce GT 730"},
|
||||
{0x10de, 0x0fe1, "NVIDIA GeForce GT 730M"},
|
||||
{0x10de, 0x1292, "NVIDIA GeForce GT 740M"},
|
||||
{0x10de, 0x0fe9, "NVIDIA GeForce GT 750M"},
|
||||
{0x10de, 0x0fcd, "NVIDIA GeForce GT 755M"},
|
||||
{0x10de, 0x1381, "NVIDIA GeForce GTX 750"},
|
||||
{0x10de, 0x1380, "NVIDIA GeForce GTX 750 Ti"},
|
||||
{0x10de, 0x1187, "NVIDIA GeForce GTX 760"},
|
||||
{0x10de, 0x1193, "NVIDIA GeForce GTX 760 Ti"},
|
||||
{0x10de, 0x11e2, "NVIDIA GeForce GTX 765M"},
|
||||
{0x10de, 0x11e0, "NVIDIA GeForce GTX 770M"},
|
||||
{0x10de, 0x1184, "NVIDIA GeForce GTX 770"},
|
||||
{0x10de, 0x119d, "NVIDIA GeForce GTX 775M"},
|
||||
{0x10de, 0x1004, "NVIDIA GeForce GTX 780"},
|
||||
{0x10de, 0x119e, "NVIDIA GeForce GTX 780M"},
|
||||
{0x10de, 0x100a, "NVIDIA GeForce GTX 780 Ti"},
|
||||
{0x10de, 0x1005, "NVIDIA GeForce GTX TITAN"},
|
||||
{0x10de, 0x100c, "NVIDIA GeForce GTX TITAN Black"},
|
||||
{0x10de, 0x17c2, "NVIDIA GeForce GTX TITAN X"},
|
||||
{0x10de, 0x1001, "NVIDIA GeForce GTX TITAN Z"},
|
||||
{0x10de, 0x0fed, "NVIDIA GeForce 820M"},
|
||||
{0x10de, 0x1340, "NVIDIA GeForce 830M"},
|
||||
{0x10de, 0x1341, "NVIDIA GeForce 840M"},
|
||||
{0x10de, 0x1344, "NVIDIA GeForce 845M"},
|
||||
{0x10de, 0x1391, "NVIDIA GeForce GTX 850M"},
|
||||
{0x10de, 0x1392, "NVIDIA GeForce GTX 860M"},
|
||||
{0x10de, 0x119a, "NVIDIA GeForce GTX 860M"},
|
||||
{0x10de, 0x1199, "NVIDIA GeForce GTX 870M"},
|
||||
{0x10de, 0x1198, "NVIDIA GeForce GTX 880M"},
|
||||
{0x10de, 0x1347, "NVIDIA GeForce 940M"},
|
||||
{0x10de, 0x1402, "NVIDIA GeForce GTX 950"},
|
||||
{0x10de, 0x139a, "NVIDIA GeForce GTX 950M"},
|
||||
{0x10de, 0x1401, "NVIDIA GeForce GTX 960"},
|
||||
{0x10de, 0x139b, "NVIDIA GeForce GTX 960M"},
|
||||
{0x10de, 0x13c2, "NVIDIA GeForce GTX 970"},
|
||||
{0x10de, 0x13d8, "NVIDIA GeForce GTX 970M"},
|
||||
{0x10de, 0x13c0, "NVIDIA GeForce GTX 980"},
|
||||
{0x10de, 0x17c8, "NVIDIA GeForce GTX 980 Ti"},
|
||||
{0x10de, 0x1d01, "NVIDIA GeForce GT 1030"},
|
||||
{0x10de, 0x1c81, "NVIDIA GeForce GTX 1050"},
|
||||
{0x10de, 0x1c82, "NVIDIA GeForce GTX 1050 Ti"},
|
||||
{0x10de, 0x1c02, "NVIDIA GeForce GTX 1060 3GB"},
|
||||
{0x10de, 0x1c03, "NVIDIA GeForce GTX 1060"},
|
||||
{0x10de, 0x1c20, "NVIDIA GeForce GTX 1060M"},
|
||||
{0x10de, 0x1b81, "NVIDIA GeForce GTX 1070"},
|
||||
{0x10de, 0x1be1, "NVIDIA GeForce GTX 1070M"},
|
||||
{0x10de, 0x1b80, "NVIDIA GeForce GTX 1080"},
|
||||
{0x10de, 0x1be0, "NVIDIA GeForce GTX 1080M"},
|
||||
{0x10de, 0x1b06, "NVIDIA GeForce GTX 1080 Ti"},
|
||||
{0x10de, 0x1b00, "NVIDIA TITAN X (Pascal)"},
|
||||
{0x10de, 0x1d81, "NVIDIA TITAN V"},
|
||||
{0x10de, 0x1f82, "NVIDIA GeForce GTX 1650"},
|
||||
{0x10de, 0x2187, "NVIDIA GeForce GTX 1650 SUPER"},
|
||||
{0x10de, 0x21c4, "NVIDIA GeForce GTX 1660 SUPER"},
|
||||
{0x10de, 0x2182, "NVIDIA GeForce GTX 1660 Ti"},
|
||||
{0x10de, 0x1f08, "NVIDIA GeForce RTX 2060"},
|
||||
{0x10de, 0x1f07, "NVIDIA GeForce RTX 2070"},
|
||||
{0x10de, 0x1e87, "NVIDIA GeForce RTX 2080"},
|
||||
{0x10de, 0x1e07, "NVIDIA GeForce RTX 2080 Ti"},
|
||||
{0x10de, 0x2507, "NVIDIA GeForce RTX 3050"},
|
||||
{0x10de, 0x2544, "NVIDIA GeForce RTX 3060"},
|
||||
{0x10de, 0x2504, "NVIDIA GeForce RTX 3060 (Low Hash Rate)"},
|
||||
{0x10de, 0x2414, "NVIDIA GeForce RTX 3060 Ti (GA103)"},
|
||||
{0x10de, 0x2486, "NVIDIA GeForce RTX 3060 Ti (GA104)"},
|
||||
{0x10de, 0x2489, "NVIDIA GeForce RTX 3060 Ti (GA104, Low Hash Rate)"},
|
||||
{0x10de, 0x2484, "NVIDIA GeForce RTX 3070"},
|
||||
{0x10de, 0x2488, "NVIDIA GeForce RTX 3070 (Low Hash Rate)"},
|
||||
{0x10de, 0x249d, "NVIDIA GeForce RTX 3070 (mobile)"},
|
||||
{0x10de, 0x2482, "NVIDIA GeForce RTX 3070 Ti"},
|
||||
{0x10de, 0x2206, "NVIDIA GeForce RTX 3080 10GB"},
|
||||
{0x10de, 0x2216, "NVIDIA GeForce RTX 3080 10GB (Low Hash Rate)"},
|
||||
{0x10de, 0x220a, "NVIDIA GeForce RTX 3080 12GB"},
|
||||
{0x10de, 0x2208, "NVIDIA GeForce RTX 3080 Ti"},
|
||||
{0x10de, 0x2204, "NVIDIA GeForce RTX 3090"},
|
||||
{0x10de, 0x2203, "NVIDIA GeForce RTX 3090 Ti"},
|
||||
{0x10de, 0x1eb8, "NVIDIA Tesla T4"},
|
||||
{0x10de, 0x2236, "NVIDIA Ampere A10"},
|
||||
{0x10de, 0x2882, "NVIDIA GeForce RTX 4060"},
|
||||
{0x10de, 0x28a0, "NVIDIA GeForce RTX 4060M"},
|
||||
{0x10de, 0x2803, "NVIDIA GeForce RTX 4060 Ti 8GB"},
|
||||
{0x10de, 0x2805, "NVIDIA GeForce RTX 4060 Ti 16GB"},
|
||||
{0x10de, 0x2786, "NVIDIA GeForce RTX 4070"},
|
||||
{0x10de, 0x2783, "NVIDIA GeForce RTX 4070 SUPER"},
|
||||
{0x10de, 0x2782, "NVIDIA GeForce RTX 4070 Ti"},
|
||||
{0x10de, 0x2705, "NVIDIA GeForce RTX 4070 Ti SUPER"},
|
||||
{0x10de, 0x2704, "NVIDIA GeForce RTX 4080"},
|
||||
{0x10de, 0x2702, "NVIDIA GeForce RTX 4080 SUPER"},
|
||||
{0x10de, 0x2684, "NVIDIA GeForce RTX 4090"},
|
||||
{0x1002, 0x5246, "ATI Rage Fury"},
|
||||
{0x1002, 0x5144, "ATI RADEON 7200 SERIES"},
|
||||
{0x1002, 0x514c, "ATI RADEON 8500 SERIES"},
|
||||
{0x1002, 0x4144, "ATI Radeon 9500"},
|
||||
{0x1002, 0x5955, "ATI RADEON XPRESS 200M Series"},
|
||||
{0x1002, 0x5e4c, "ATI Radeon X700 SE"},
|
||||
{0x1002, 0x71c2, "ATI Radeon X1600 Series"},
|
||||
{0x1002, 0x94c7, "ATI Mobility Radeon HD 2350"},
|
||||
{0x1002, 0x9581, "ATI Mobility Radeon HD 2600"},
|
||||
{0x1002, 0x9400, "ATI Radeon HD 2900 XT"},
|
||||
{0x1002, 0x9620, "ATI Radeon HD 3200 Graphics"},
|
||||
{0x1002, 0x9515, "ATI Radeon HD 3850 AGP"},
|
||||
{0x1002, 0x9712, "ATI Mobility Radeon HD 4200"},
|
||||
{0x1002, 0x954f, "ATI Radeon HD 4350"},
|
||||
{0x1002, 0x9495, "ATI Radeon HD 4600 Series"},
|
||||
{0x1002, 0x944e, "ATI Radeon HD 4700 Series"},
|
||||
{0x1002, 0x944c, "ATI Radeon HD 4800 Series"},
|
||||
{0x1002, 0x68f9, "ATI Radeon HD 5400 Series"},
|
||||
{0x1002, 0x68d8, "ATI Radeon HD 5600 Series"},
|
||||
{0x1002, 0x68be, "ATI Radeon HD 5700 Series"},
|
||||
{0x1002, 0x6898, "ATI Radeon HD 5800 Series"},
|
||||
{0x1002, 0x689c, "ATI Radeon HD 5900 Series"},
|
||||
{0x1002, 0x9803, "AMD Radeon HD 6300 series Graphics"},
|
||||
{0x1002, 0x6770, "AMD Radeon HD 6400 Series"},
|
||||
{0x1002, 0x9644, "AMD Radeon HD 6410D"},
|
||||
{0x1002, 0x9648, "AMD Radeon HD 6480G"},
|
||||
{0x1002, 0x6760, "AMD Radeon HD 6490M"},
|
||||
{0x1002, 0x9640, "AMD Radeon HD 6550D"},
|
||||
{0x1002, 0x6758, "AMD Radeon HD 6600 Series"},
|
||||
{0x1002, 0x6741, "AMD Radeon HD 6600M Series"},
|
||||
{0x1002, 0x68ba, "AMD Radeon HD 6700 Series"},
|
||||
{0x1002, 0x6739, "AMD Radeon HD 6800 Series"},
|
||||
{0x1002, 0x6719, "AMD Radeon HD 6900 Series"},
|
||||
{0x1002, 0x9901, "AMD Radeon HD 7660D"},
|
||||
{0x1002, 0x683d, "AMD Radeon HD 7700 Series"},
|
||||
{0x1002, 0x6819, "AMD Radeon HD 7800 Series"},
|
||||
{0x1002, 0x6818, "AMD Radeon HD 7870 Series"},
|
||||
{0x1002, 0x679a, "AMD Radeon HD 7900 Series"},
|
||||
{0x1002, 0x6660, "AMD Radeon HD 8600M Series"},
|
||||
{0x1002, 0x6610, "AMD Radeon HD 8670"},
|
||||
{0x1002, 0x665c, "AMD Radeon HD 8770"},
|
||||
{0x1002, 0x9830, "AMD Radeon HD 8400 / R3 Series"},
|
||||
{0x1002, 0x130f, "AMD Radeon(TM) R7 Graphics"},
|
||||
{0x1002, 0x6939, "AMD Radeon R9 285"},
|
||||
{0x1002, 0x67b1, "AMD Radeon R9 290"},
|
||||
{0x1002, 0x67b0, "AMD Radeon R9 290X"},
|
||||
{0x1002, 0x7300, "AMD Radeon (TM) R9 Fury Series"},
|
||||
{0x1002, 0x6821, "AMD Radeon R9 M370X"},
|
||||
{0x1002, 0x6647, "AMD Radeon R9 M380"},
|
||||
{0x1002, 0x6920, "AMD Radeon R9 M395X"},
|
||||
{0x1002, 0x67ef, "Radeon(TM) RX 460 Graphics"},
|
||||
{0x1002, 0x67df, "Radeon (TM) RX 480 Graphics"},
|
||||
{0x1002, 0x73df, "AMD Radeon RX 6700 XT"},
|
||||
{0x1002, 0x687f, "Radeon RX Vega"},
|
||||
{0x1002, 0x69af, "Radeon Pro Vega 20"},
|
||||
{0x1002, 0x15dd, "AMD Radeon(TM) Vega 10 Mobile Graphics"},
|
||||
{0x1002, 0x66af, "Radeon RX Vega 20"},
|
||||
{0x1002, 0x731f, "Radeon RX 5700 / 5700 XT"},
|
||||
{0x1002, 0x7340, "Radeon RX 5500M"},
|
||||
{0x1002, 0x73bf, "Radeon RX 6800/6800 XT / 6900 XT"},
|
||||
{0x1002, 0x7480, "AMD Radeon RX 7600 XT"},
|
||||
{0x1002, 0x7590, "AMD Radeon RX 9060 XT"},
|
||||
{0x1002, 0x73a1, "Radeon Pro V620"},
|
||||
{0x1002, 0x73ae, "Radeon Pro V620 VF"},
|
||||
{0x1002, 0x163f, "AMD VANGOGH"},
|
||||
{0x1002, 0x164e, "AMD Radeon(TM) Graphics"},
|
||||
{0x8086, 0x3577, "Intel(R) 82830M Graphics Controller"},
|
||||
{0x8086, 0x3582, "Intel(R) 82852/82855 GM/GME Graphics Controller"},
|
||||
{0x8086, 0x2562, "Intel(R) 845G"},
|
||||
{0x8086, 0x2572, "Intel(R) 82865G Graphics Controller"},
|
||||
{0x8086, 0x2582, "Intel(R) 82915G/GV/910GL Express Chipset Family"},
|
||||
{0x8086, 0x258a, "Intel(R) E7221G"},
|
||||
{0x8086, 0x2592, "Mobile Intel(R) 915GM/GMS,910GML Express Chipset Family"},
|
||||
{0x8086, 0x2772, "Intel(R) 945G"},
|
||||
{0x8086, 0x27a2, "Mobile Intel(R) 945GM Express Chipset Family"},
|
||||
{0x8086, 0x27ae, "Intel(R) 945GME"},
|
||||
{0x8086, 0x29b2, "Intel(R) Q35"},
|
||||
{0x8086, 0x29c2, "Intel(R) G33"},
|
||||
{0x8086, 0x29d2, "Intel(R) Q33"},
|
||||
{0x8086, 0xa001, "Intel(R) IGD"},
|
||||
{0x8086, 0xa011, "Intel(R) IGD"},
|
||||
{0x8086, 0x2992, "Intel(R) 965Q"},
|
||||
{0x8086, 0x2982, "Intel(R) 965G"},
|
||||
{0x8086, 0x2972, "Intel(R) 946GZ"},
|
||||
{0x8086, 0x2a02, "Mobile Intel(R) 965 Express Chipset Family"},
|
||||
{0x8086, 0x2a12, "Intel(R) 965GME"},
|
||||
{0x8086, 0x2a42, "Mobile Intel(R) GM45 Express Chipset Family"},
|
||||
{0x8086, 0x2e02, "Intel(R) Integrated Graphics Device"},
|
||||
{0x8086, 0x2e22, "Intel(R) G45/G43"},
|
||||
{0x8086, 0x2e12, "Intel(R) Q45/Q43"},
|
||||
{0x8086, 0x2e32, "Intel(R) G41"},
|
||||
{0x8086, 0x2e92, "Intel(R) B43"},
|
||||
{0x8086, 0x0042, "Intel(R) HD Graphics"},
|
||||
{0x8086, 0x0046, "Intel(R) HD Graphics"},
|
||||
{0x8086, 0x0122, "Intel(R) HD Graphics 3000"},
|
||||
{0x8086, 0x0126, "Intel(R) HD Graphics 3000"},
|
||||
{0x8086, 0x010a, "Intel(R) HD Graphics Family"},
|
||||
{0x8086, 0x0162, "Intel(R) HD Graphics 4000"},
|
||||
{0x8086, 0x0166, "Intel(R) HD Graphics 4000"},
|
||||
{0x8086, 0x015a, "Intel(R) HD Graphics Family"},
|
||||
{0x8086, 0x0412, "Intel(R) HD Graphics 4600"},
|
||||
{0x8086, 0x0416, "Intel(R) HD Graphics 4600"},
|
||||
{0x8086, 0x0a26, "Intel(R) HD Graphics 5000"},
|
||||
{0x8086, 0x0422, "Intel(R) HD Graphics 5000"},
|
||||
{0x8086, 0x0a22, "Intel(R) Iris(TM) Graphics 5100"},
|
||||
{0x8086, 0x0a2a, "Intel(R) Iris(TM) Graphics 5100"},
|
||||
{0x8086, 0x0a2b, "Intel(R) Iris(TM) Graphics 5100"},
|
||||
{0x8086, 0x0a2e, "Intel(R) Iris(TM) Graphics 5100"},
|
||||
{0x8086, 0x0d22, "Intel(R) Iris(TM) Pro Graphics 5200"},
|
||||
{0x8086, 0x0d26, "Intel(R) Iris(TM) Pro Graphics 5200"},
|
||||
{0x8086, 0x0d2a, "Intel(R) Iris(TM) Pro Graphics 5200"},
|
||||
{0x8086, 0x0d2b, "Intel(R) Iris(TM) Pro Graphics 5200"},
|
||||
{0x8086, 0x0d2e, "Intel(R) Iris(TM) Pro Graphics 5200"},
|
||||
{0x8086, 0x0c22, "Intel(R) Iris(TM) Pro Graphics 5200"},
|
||||
{0x8086, 0x161e, "Intel(R) HD Graphics 5300"},
|
||||
{0x8086, 0x1616, "Intel(R) HD Graphics 5500"},
|
||||
{0x8086, 0x1612, "Intel(R) HD Graphics 5600"},
|
||||
{0x8086, 0x1626, "Intel(R) HD Graphics 6000"},
|
||||
{0x8086, 0x162b, "Intel(R) Iris(TM) Graphics 6100"},
|
||||
{0x8086, 0x1622, "Intel(R) Iris(TM) Pro Graphics 6200"},
|
||||
{0x8086, 0x162a, "Intel(R) Iris(TM) Pro Graphics P6300"},
|
||||
{0x8086, 0x1902, "Intel(R) HD Graphics 510"},
|
||||
{0x8086, 0x1906, "Intel(R) HD Graphics 510"},
|
||||
{0x8086, 0x190b, "Intel(R) HD Graphics 510"},
|
||||
{0x8086, 0x191e, "Intel(R) HD Graphics 515"},
|
||||
{0x8086, 0x1916, "Intel(R) HD Graphics 520"},
|
||||
{0x8086, 0x1921, "Intel(R) HD Graphics 520"},
|
||||
{0x8086, 0x1912, "Intel(R) HD Graphics 530"},
|
||||
{0x8086, 0x191b, "Intel(R) HD Graphics 530"},
|
||||
{0x8086, 0x191d, "Intel(R) HD Graphics P530"},
|
||||
{0x8086, 0x1926, "Intel(R) Iris(TM) Graphics 540"},
|
||||
{0x8086, 0x1927, "Intel(R) Iris(TM) Graphics 550"},
|
||||
{0x8086, 0x192b, "Intel(R) Iris(TM) Graphics 555"},
|
||||
{0x8086, 0x192d, "Intel(R) Iris(TM) Graphics P555"},
|
||||
{0x8086, 0x1932, "Intel(R) Iris(TM) Pro Graphics 580"},
|
||||
{0x8086, 0x193b, "Intel(R) Iris(TM) Pro Graphics 580"},
|
||||
{0x8086, 0x193a, "Intel(R) Iris(TM) Pro Graphics P580"},
|
||||
{0x8086, 0x193d, "Intel(R) Iris(TM) Pro Graphics P580"},
|
||||
{0x8086, 0x87c0, "Intel(R) UHD Graphics 617"},
|
||||
{0x8086, 0x3ea0, "Intel(R) UHD Graphics 620"},
|
||||
{0x8086, 0x5917, "Intel(R) UHD Graphics 620"},
|
||||
{0x8086, 0x591e, "Intel(R) HD Graphics 615"},
|
||||
{0x8086, 0x5916, "Intel(R) HD Graphics 620"},
|
||||
{0x8086, 0x5912, "Intel(R) HD Graphics 630"},
|
||||
{0x8086, 0x591b, "Intel(R) HD Graphics 630"},
|
||||
{0x8086, 0x3e9b, "Intel(R) UHD Graphics 630"},
|
||||
{0x8086, 0x3e91, "Intel(R) UHD Graphics 630"},
|
||||
};
|
||||
|
||||
static inline const char *wine_device_name(uint32_t vendor_id, uint32_t device_id, const char *native_name) {
|
||||
for (size_t i = 0; i < sizeof(wine_gpu_names) / sizeof(wine_gpu_names[0]); i++) {
|
||||
if (wine_gpu_names[i].vendor_id == vendor_id && wine_gpu_names[i].device_id == device_id) {
|
||||
return wine_gpu_names[i].name;
|
||||
}
|
||||
}
|
||||
return native_name;
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,6 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
# Generate shell completion files for bash, zsh, and fish
|
||||
|
||||
set -e
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Synchronize GPU names with Wine without rewriting the surrounding header."""
|
||||
import os
|
||||
from pathlib import Path
|
||||
import re
|
||||
import subprocess
|
||||
import tempfile
|
||||
from urllib.request import urlopen
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
HEADER = ROOT / "build-aux/src/wine_gpu_names.h"
|
||||
WINE_REPOSITORY = "https://github.com/wine-mirror/wine.git"
|
||||
WINE_SOURCE = "dlls/win32u/sysparams.c"
|
||||
NETWORK_TIMEOUT = 30
|
||||
MAX_SOURCE_BYTES = 2 * 1024 * 1024
|
||||
C_STRING = r'"(?:[^"\\\r\n]|\\[^\r\n])*"'
|
||||
WINE_ROW = re.compile(
|
||||
r'case\s+MAKELONG\(\s*(0x[0-9a-fA-F]+)\s*,\s*(0x[0-9a-fA-F]+)\s*\)'
|
||||
r'\s*:\s*return\s+(' + C_STRING + r')\s*;'
|
||||
)
|
||||
HEADER_ROW = re.compile(
|
||||
r'^ \{(0x[0-9a-fA-F]+), (0x[0-9a-fA-F]+), (' + C_STRING + r')\},$', re.M,
|
||||
)
|
||||
TABLE = re.compile(r'(\} wine_gpu_names\[\] = \{\n)(.*?)(\n\};)', re.S)
|
||||
|
||||
|
||||
def parse_wine_names(source):
|
||||
function = re.search(
|
||||
r'\bconst char\s*\*gpu_device_name\([^)]*\)\s*\{(.*?)\n\};', source, re.S,
|
||||
)
|
||||
if function is None:
|
||||
raise ValueError("Wine gpu_device_name() was not found")
|
||||
body = function.group(1)
|
||||
rows = WINE_ROW.findall(body)
|
||||
if not rows or len(rows) != len(re.findall(r'\bcase\b', body)):
|
||||
raise ValueError("Wine GPU table is empty or contains unsupported cases")
|
||||
result = []
|
||||
seen = set()
|
||||
for vendor, device, name in rows:
|
||||
identity = (int(vendor, 16), int(device, 16))
|
||||
if identity in seen or any(value > 0xffff for value in identity) or name == '""':
|
||||
raise ValueError(f"Invalid or duplicate Wine GPU entry: {vendor}:{device}")
|
||||
seen.add(identity)
|
||||
result.append((f"0x{identity[0]:04x}", f"0x{identity[1]:04x}", name))
|
||||
return result
|
||||
|
||||
|
||||
def update_header(header, source, revision):
|
||||
if not re.fullmatch(r'[0-9a-f]{40}', revision):
|
||||
raise ValueError("Invalid Wine source revision")
|
||||
rows = parse_wine_names(source)
|
||||
tables = list(TABLE.finditer(header))
|
||||
if len(tables) != 1:
|
||||
raise ValueError("Expected exactly one wine_gpu_names array in the header")
|
||||
table = tables[0]
|
||||
existing = HEADER_ROW.findall(table.group(2))
|
||||
if not existing or len(existing) != len(table.group(2).strip().splitlines()):
|
||||
raise ValueError("Unsupported existing header table format")
|
||||
if rows == existing:
|
||||
return header
|
||||
replacement = "\n".join(f" {{{vendor}, {device}, {name}}}," for vendor, device, name in rows)
|
||||
updated = header[:table.start(2)] + replacement + header[table.end(2):]
|
||||
updated, count = re.subn(r'^// Revision: [0-9a-f]{40}$', f"// Revision: {revision}", updated, flags=re.M)
|
||||
if count != 1:
|
||||
raise ValueError("Expected exactly one Wine revision comment")
|
||||
return updated
|
||||
|
||||
|
||||
def main():
|
||||
print("Resolving Wine master revision...", flush=True)
|
||||
refs = subprocess.run(
|
||||
["git", "ls-remote", WINE_REPOSITORY, "refs/heads/master"],
|
||||
capture_output=True, text=True, check=True, timeout=NETWORK_TIMEOUT,
|
||||
).stdout.split()
|
||||
if len(refs) != 2 or not re.fullmatch(r'[0-9a-f]{40}', refs[0]):
|
||||
raise ValueError("Could not resolve Wine master revision")
|
||||
revision = refs[0]
|
||||
url = f"https://raw.githubusercontent.com/wine-mirror/wine/{revision}/{WINE_SOURCE}"
|
||||
print(f"Fetching Wine GPU names at {revision}...", flush=True)
|
||||
with urlopen(url, timeout=NETWORK_TIMEOUT) as response:
|
||||
source = response.read(MAX_SOURCE_BYTES + 1)
|
||||
if len(source) > MAX_SOURCE_BYTES:
|
||||
raise ValueError("Wine source exceeds the download size limit")
|
||||
header = HEADER.read_text(encoding="utf-8")
|
||||
updated = update_header(header, source.decode("utf-8"), revision)
|
||||
if updated == header:
|
||||
print("Wine GPU names are unchanged.")
|
||||
return
|
||||
temporary = None
|
||||
try:
|
||||
with tempfile.NamedTemporaryFile(mode="w", encoding="utf-8", dir=HEADER.parent, delete=False) as output:
|
||||
temporary = Path(output.name)
|
||||
output.write(updated)
|
||||
temporary.chmod(HEADER.stat().st_mode & 0o777)
|
||||
os.replace(temporary, HEADER)
|
||||
finally:
|
||||
if temporary is not None:
|
||||
temporary.unlink(missing_ok=True)
|
||||
print(f"Updated {len(parse_wine_names(source.decode('utf-8')))} Wine GPU names.")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -316,7 +316,7 @@ def get_advanced_settings(disabled_text, logical_core_options=None, locale_optio
|
||||
advanced_settings.append({
|
||||
'key': 'PW_RUN_AFTER_EXE',
|
||||
'name': _("Run After / Wrapper"),
|
||||
'description': _("Path to a second .exe, script, or wrapper command. Example: systemd-run --user --scope --slice=app.slice"),
|
||||
'description': _("Path to a second .exe, script, or wrapper command. Use %command% for the game command: /home/user/.local/bin/mako-launch %command%. Example: systemd-run --user --scope --slice=app.slice"),
|
||||
'type': 'text',
|
||||
'default': ''
|
||||
})
|
||||
|
||||
@@ -160,11 +160,12 @@ class MainWindowWineTabMixin(_MainWindowTypingBase):
|
||||
tools_grid.setSpacing(6)
|
||||
|
||||
tools = [
|
||||
("--winecfg", _("Wine Configuration")),
|
||||
("--winereg", _("Registry Editor")),
|
||||
("--winefile", _("File Explorer")),
|
||||
("--winecmd", _("Command Prompt")),
|
||||
("--wine_uninstaller", _("Uninstaller")),
|
||||
("winecfg", _("Wine Configuration")),
|
||||
("regedit", _("Registry Editor")),
|
||||
("winefile", _("File Explorer")),
|
||||
("cmd", _("Command Prompt")),
|
||||
("uninstaller", _("Uninstaller")),
|
||||
("taskmgr", _("Task Manager")),
|
||||
]
|
||||
|
||||
for i, (tool_cmd, tool_name) in enumerate(tools):
|
||||
@@ -237,7 +238,7 @@ class MainWindowWineTabMixin(_MainWindowTypingBase):
|
||||
env_vars = os.environ.copy()
|
||||
self._check_missing_prefix_by_name_before_launch(prefix, env_vars)
|
||||
start_sh = self.start_sh
|
||||
cmd = start_sh + ["cli", cli_arg, wine, prefix]
|
||||
cmd = start_sh + ["cli", "--wine-session-tool", cli_arg, wine, prefix]
|
||||
|
||||
# Show progress bar before launch
|
||||
self.wine_progress_bar.setVisible(True)
|
||||
@@ -269,16 +270,7 @@ class MainWindowWineTabMixin(_MainWindowTypingBase):
|
||||
|
||||
def _check_wine_process(self, cli_arg):
|
||||
"""Check if target .exe process started."""
|
||||
exe_map = {
|
||||
"--winecfg": "winecfg.exe",
|
||||
"--winereg": "regedit.exe",
|
||||
"--winefile": "winefile.exe",
|
||||
"--winecmd": "cmd.exe",
|
||||
"--wine_uninstaller": "uninstaller.exe",
|
||||
}
|
||||
target_exe = exe_map.get(cli_arg, "")
|
||||
if not target_exe:
|
||||
return
|
||||
target_exe = f"{cli_arg}.exe"
|
||||
|
||||
# Check processes via psutil
|
||||
for proc in psutil.process_iter(attrs=["name"]):
|
||||
|
||||
@@ -3,6 +3,7 @@ import subprocess
|
||||
import signal
|
||||
import psutil
|
||||
import os
|
||||
from PySide6.QtCore import QProcess
|
||||
from PySide6.QtWidgets import QSystemTrayIcon, QMenu, QApplication, QMessageBox
|
||||
from PySide6.QtGui import QIcon, QAction
|
||||
from portprotonqt.logger import get_logger
|
||||
@@ -45,6 +46,39 @@ def _restart_args(args: list[str]) -> list[str]:
|
||||
return restart_args
|
||||
|
||||
|
||||
def create_wine_tools_menu(parent: QMenu, start_sh: list[str]) -> QMenu:
|
||||
"""Create tools that join the running game's Wine session."""
|
||||
menu = QMenu("Wine", parent)
|
||||
tools = (
|
||||
("winefile", _("File Explorer")),
|
||||
("taskmgr", _("Task Manager")),
|
||||
("winecfg", _("Wine Configuration")),
|
||||
("regedit", _("Registry Editor")),
|
||||
("cmd", _("Command Prompt")),
|
||||
("uninstaller", _("Uninstaller")),
|
||||
)
|
||||
for tool, title in tools:
|
||||
action = menu.addAction(title)
|
||||
action.triggered.connect(
|
||||
lambda checked=False, name=tool: launch_session_wine_tool(start_sh, name)
|
||||
)
|
||||
return menu
|
||||
|
||||
|
||||
def launch_session_wine_tool(start_sh: list[str], tool: str) -> None:
|
||||
"""Start a Wine tool without running the game's startup or cleanup."""
|
||||
if not start_sh:
|
||||
logger.error("Cannot launch Wine tool: PortProton command is missing")
|
||||
QMessageBox.warning(None, _("Error"), _("Failed to start process."))
|
||||
return
|
||||
started, _pid = QProcess.startDetached(
|
||||
start_sh[0], start_sh[1:] + ["cli", "--wine-session-tool", tool]
|
||||
)
|
||||
if not started:
|
||||
logger.error("Failed to start Wine tool %s", tool)
|
||||
QMessageBox.warning(None, _("Error"), _("Failed to start process."))
|
||||
|
||||
|
||||
class TrayManager:
|
||||
"""Tray management module for PortProtonQt.
|
||||
|
||||
@@ -83,8 +117,12 @@ class TrayManager:
|
||||
self.pause_game_action.setEnabled(False)
|
||||
self.pause_game_action.triggered.connect(self.toggle_game_pause)
|
||||
|
||||
self.wine_tools_menu = create_wine_tools_menu(self.tray_menu, self.main_window.start_sh)
|
||||
self.wine_tools_menu.setEnabled(False)
|
||||
|
||||
self.tray_menu.addAction(self.pause_game_action)
|
||||
self.tray_menu.addAction(self.stop_game_action)
|
||||
self.tray_menu.addMenu(self.wine_tools_menu)
|
||||
self.tray_menu.addSeparator()
|
||||
self.tray_menu.addSeparator()
|
||||
|
||||
@@ -103,6 +141,7 @@ class TrayManager:
|
||||
|
||||
self.tray_menu.addAction(self.pause_game_action)
|
||||
self.tray_menu.addAction(self.stop_game_action)
|
||||
self.tray_menu.addMenu(self.wine_tools_menu)
|
||||
self.update_game_actions()
|
||||
if self.minimal_mode:
|
||||
return
|
||||
@@ -151,6 +190,7 @@ class TrayManager:
|
||||
target_exe = getattr(self.main_window, "target_exe", None)
|
||||
has_running_game = bool(game_processes or target_exe)
|
||||
self.stop_game_action.setEnabled(has_running_game)
|
||||
self.wine_tools_menu.setEnabled(has_running_game)
|
||||
self.pause_game_action.setEnabled(bool(processes))
|
||||
paused = self._are_processes_paused(processes)
|
||||
self.pause_game_action.setText(_("Resume Game") if paused else _("Pause Game"))
|
||||
|
||||
+101
-4
@@ -42,7 +42,7 @@ from portprotonqt.game_library_manager import FullLibraryTile, GameLibraryManage
|
||||
from portprotonqt.input_manager import InputManager
|
||||
from portprotonqt.main_window import MainWindow
|
||||
from portprotonqt.search_utils import SearchOptimizer, search_index
|
||||
from portprotonqt.tray_manager import TrayManager
|
||||
from portprotonqt.tray_manager import TrayManager, create_wine_tools_menu, launch_session_wine_tool
|
||||
from portprotonqt.themes.standart.styles.constants import GAME_CARD_ANIMATION
|
||||
from portprotonqt.portproton_api import remove_empty_custom_data_dirs
|
||||
import portprotonqt.tabs.autoinstall_tab as autoinstall_tab_module
|
||||
@@ -374,18 +374,71 @@ def test_minimal_tray_contains_game_actions() -> None:
|
||||
_application = QApplication.instance() or QApplication([])
|
||||
manager = TrayManager.__new__(TrayManager)
|
||||
manager.tray_menu = QMenu()
|
||||
manager.pause_game_action = QAction("Pause Game", manager.tray_menu)
|
||||
manager.stop_game_action = QAction("Stop Game", manager.tray_menu)
|
||||
owner = QWidget()
|
||||
manager.pause_game_action = QAction("Pause Game", owner)
|
||||
manager.stop_game_action = QAction("Stop Game", owner)
|
||||
manager.wine_tools_menu = create_wine_tools_menu(manager.tray_menu, ["portproton"])
|
||||
manager.minimal_mode = True
|
||||
manager.update_game_actions = MagicMock()
|
||||
|
||||
manager.refresh_tray_menu()
|
||||
manager.refresh_tray_menu()
|
||||
|
||||
assert manager.tray_menu.actions() == [
|
||||
manager.pause_game_action,
|
||||
manager.stop_game_action,
|
||||
manager.wine_tools_menu.menuAction(),
|
||||
]
|
||||
manager.update_game_actions.assert_called_once_with()
|
||||
assert manager.update_game_actions.call_count == 2
|
||||
|
||||
|
||||
@mark.parametrize("tool_index,tool", list(enumerate(
|
||||
("winefile", "taskmgr", "winecfg", "regedit", "cmd", "uninstaller")
|
||||
)))
|
||||
def test_wine_tools_menu_launches_session_tool(
|
||||
monkeypatch: MonkeyPatch, tool_index: int, tool: str,
|
||||
) -> None:
|
||||
_application = QApplication.instance() or QApplication([])
|
||||
parent = QMenu()
|
||||
start = MagicMock(return_value=(True, 123))
|
||||
monkeypatch.setattr("portprotonqt.tray_manager.QProcess.startDetached", start)
|
||||
menu = create_wine_tools_menu(parent, ["bash", "/path with spaces/start.sh"])
|
||||
|
||||
assert len(menu.actions()) == 6
|
||||
menu.actions()[tool_index].trigger()
|
||||
|
||||
start.assert_called_once_with(
|
||||
"bash", ["/path with spaces/start.sh", "cli", "--wine-session-tool", tool]
|
||||
)
|
||||
|
||||
|
||||
def test_wine_tool_start_failure_is_reported(monkeypatch: MonkeyPatch) -> None:
|
||||
_application = QApplication.instance() or QApplication([])
|
||||
warning = MagicMock()
|
||||
monkeypatch.setattr("portprotonqt.tray_manager.QMessageBox.warning", warning)
|
||||
monkeypatch.setattr(
|
||||
"portprotonqt.tray_manager.QProcess.startDetached", lambda *args: (False, 0)
|
||||
)
|
||||
|
||||
launch_session_wine_tool(["portproton"], "winefile")
|
||||
|
||||
warning.assert_called_once()
|
||||
|
||||
|
||||
@mark.parametrize("running", [False, True])
|
||||
def test_wine_tools_menu_requires_running_game(running: bool) -> None:
|
||||
_application = QApplication.instance() or QApplication([])
|
||||
manager = TrayManager.__new__(TrayManager)
|
||||
manager.main_window = SimpleNamespace(game_processes=[], target_exe="game.exe" if running else None)
|
||||
manager.stop_game_action = QAction()
|
||||
manager.pause_game_action = QAction()
|
||||
manager.wine_tools_menu = QMenu()
|
||||
manager._game_process_tree = MagicMock(return_value=[])
|
||||
|
||||
manager.update_game_actions()
|
||||
|
||||
assert manager.wine_tools_menu.isEnabled() is running
|
||||
|
||||
|
||||
def test_tray_pauses_game_process_tree(monkeypatch: MonkeyPatch) -> None:
|
||||
child = MagicMock(pid=12)
|
||||
@@ -3571,3 +3624,47 @@ def test_steam_watch_keeps_stop_during_preparation_gap(monkeypatch: MonkeyPatch)
|
||||
monkeypatch.setattr(main_window_module.time, "monotonic", lambda: 1004.0)
|
||||
MainWindow._steam_scan_finished(cast(Any, window), "620")
|
||||
assert watch["running"] is False
|
||||
|
||||
|
||||
@mark.parametrize("tool", ["winecfg", "regedit", "winefile", "cmd", "uninstaller", "taskmgr"])
|
||||
@mark.parametrize("running", [False, True])
|
||||
def test_wine_settings_tools_use_unified_command(
|
||||
monkeypatch: MonkeyPatch, tool: str, running: bool,
|
||||
) -> None:
|
||||
process = MagicMock()
|
||||
monkeypatch.setattr("portprotonqt.tabs.wine_tab.QProcess", MagicMock(return_value=process))
|
||||
window = MagicMock()
|
||||
window.game_processes = [MagicMock()] if running else []
|
||||
window.target_exe = "game.exe" if running else None
|
||||
window.start_sh = ["bash", "/path with spaces/start.sh"]
|
||||
window.wineCombo.currentText.return_value = "WINE_LG"
|
||||
window.prefixCombo.currentText.return_value = "my prefix"
|
||||
|
||||
WineMixin.launch_generic_tool(window, tool)
|
||||
|
||||
process.start.assert_called_once_with(
|
||||
"bash", ["/path with spaces/start.sh", "cli", "--wine-session-tool", tool, "WINE_LG", "MY_PREFIX"],
|
||||
)
|
||||
window._start_wine_process_monitor.assert_called_once_with(tool)
|
||||
|
||||
|
||||
|
||||
def test_silent_tray_includes_wine_tools_menu(monkeypatch: MonkeyPatch) -> None:
|
||||
_application = QApplication.instance() or QApplication([])
|
||||
manager = TrayManager.__new__(TrayManager)
|
||||
manager.tray_menu = QMenu()
|
||||
owner = QWidget()
|
||||
manager.pause_game_action = QAction("Pause Game", owner)
|
||||
manager.stop_game_action = QAction("Stop Game", owner)
|
||||
manager.wine_tools_menu = create_wine_tools_menu(manager.tray_menu, ["portproton"])
|
||||
manager.update_game_actions = MagicMock()
|
||||
start = MagicMock(return_value=(True, 123))
|
||||
monkeypatch.setattr("portprotonqt.tray_manager.QProcess.startDetached", start)
|
||||
|
||||
manager.set_minimal_mode()
|
||||
|
||||
tools = manager.tray_menu.actions()[2].menu()
|
||||
assert isinstance(tools, QMenu)
|
||||
assert len(tools.actions()) == 6
|
||||
tools.actions()[1].trigger()
|
||||
start.assert_called_once_with("portproton", ["cli", "--wine-session-tool", "taskmgr"])
|
||||
@@ -1,9 +1,10 @@
|
||||
"""Tests for the bundled PortProton shell scripts."""
|
||||
import os
|
||||
import shutil
|
||||
import subprocess
|
||||
from pathlib import Path
|
||||
|
||||
from pytest import mark
|
||||
from pytest import mark, skip
|
||||
|
||||
|
||||
@mark.parametrize("case", [
|
||||
@@ -326,3 +327,270 @@ def test_run_after_wrapper_preserves_command_with_comma(tmp_path: Path) -> None:
|
||||
capture_output=True, text=True, check=True,
|
||||
)
|
||||
assert result.stdout.splitlines() == ["first,second", "game"]
|
||||
|
||||
|
||||
def test_wine_gpu_name_lookup(tmp_path: Path) -> None:
|
||||
compiler = shutil.which("cc")
|
||||
if compiler is None:
|
||||
skip("C compiler is unavailable")
|
||||
source = tmp_path / "wine_names.c"
|
||||
source.write_text(
|
||||
'#include <stdio.h>\n#include "wine_gpu_names.h"\n'
|
||||
'int main(void) {\n'
|
||||
'puts(wine_device_name(0x1002, 0x163f, "AMD Custom GPU 0405 (RADV VANGOGH)"));\n'
|
||||
'puts(wine_device_name(0x10de, 0x249d, "NVIDIA GeForce RTX 3070 Laptop GPU"));\n'
|
||||
'puts(wine_device_name(0x8086, 0x5912, "Intel native name"));\n'
|
||||
'puts(wine_device_name(0xffff, 0x163f, "Unknown vendor"));\n'
|
||||
'puts(wine_device_name(0x1002, 0xffff, "Unknown device"));\n'
|
||||
'puts(wine_device_name(0x11002, 0x163f, "Non-PCI vendor"));\n'
|
||||
'return 0;\n}\n',
|
||||
)
|
||||
binary = tmp_path / "wine_names"
|
||||
subprocess.run(
|
||||
[compiler, "-std=c99", "-Wall", "-Wextra", "-Werror", "-I",
|
||||
str(Path("build-aux/src").resolve()), str(source), "-o", str(binary)],
|
||||
capture_output=True, text=True, check=True,
|
||||
)
|
||||
result = subprocess.run([str(binary)], capture_output=True, text=True, check=True)
|
||||
assert result.stdout.splitlines() == [
|
||||
"AMD VANGOGH", "NVIDIA GeForce RTX 3070 (mobile)", "Intel(R) HD Graphics 630",
|
||||
"Unknown vendor", "Unknown device", "Non-PCI vendor",
|
||||
]
|
||||
|
||||
|
||||
@mark.parametrize("names", [
|
||||
("AMD Custom GPU 0405 (RADV VANGOGH)", "AMD VANGOGH"),
|
||||
("NVIDIA GeForce RTX 3070 Laptop GPU", "NVIDIA GeForce RTX 3070 (mobile)"),
|
||||
("Unknown GPU", "Unknown GPU"),
|
||||
])
|
||||
@mark.parametrize("override", [
|
||||
{}, {"DXVK_FILTER_DEVICE_NAME": "custom-dxvk"},
|
||||
{"VKD3D_FILTER_DEVICE_NAME": "custom-vkd3d"},
|
||||
{"DXVK_FILTER_DEVICE_NAME": "", "VKD3D_FILTER_DEVICE_NAME": ""},
|
||||
])
|
||||
def test_gpu_selection_uses_wine_name_for_both_filters(
|
||||
tmp_path: Path, names: tuple[str, str], override: dict[str, str],
|
||||
) -> None:
|
||||
helper = Path("build-aux/share/portproton/scripts/functions_helper").read_text()
|
||||
function = "pw_select_gpu () {" + helper.split("pw_select_gpu () {", 1)[1].split(
|
||||
"\npw_check_vulkan_extensions () {", 1,
|
||||
)[0]
|
||||
binary = tmp_path / "vk_gpu_info"
|
||||
binary.write_text('#!/bin/bash\nprintf "%s" "$GPU_OUTPUT"\n')
|
||||
binary.chmod(0o755)
|
||||
native, wine = names
|
||||
output = (
|
||||
"GPU #0\ndevice_name: Other GPU\nwine_device_name: Other Wine GPU\n\n"
|
||||
f"GPU #1\ndevice_name: {native}\nwine_device_name: {wine}\n\n"
|
||||
"GPU #2\ndevice_name: Last GPU\nwine_device_name: Last Wine GPU\n"
|
||||
)
|
||||
result = subprocess.run(
|
||||
["bash", "-c", function + '\npw_select_gpu\n'
|
||||
'printf "%s\\n" "$DXVK_FILTER_DEVICE_NAME" "$VKD3D_FILTER_DEVICE_NAME" '
|
||||
'"$PW_GPU_USE" "$MESA_VK_DEVICE_SELECT" "$MESA_VK_DEVICE_SELECT_FORCE_DEFAULT_DEVICE"'],
|
||||
cwd=tmp_path, capture_output=True, text=True, check=True,
|
||||
env={"PATH": f"{tmp_path}:{os.defpath}", "GPU_OUTPUT": output, "PW_GPU_USE": native,
|
||||
"PW_vendorID": "0x1002", "PW_deviceID": "0x163f", **override},
|
||||
)
|
||||
assert result.stdout.splitlines() == [
|
||||
override.get("DXVK_FILTER_DEVICE_NAME", wine),
|
||||
override.get("VKD3D_FILTER_DEVICE_NAME", wine), native, "0x1002:0x163f", "1",
|
||||
]
|
||||
|
||||
|
||||
@mark.parametrize("case", [
|
||||
("GPU #0\ndevice_name: Selected GPU\n", 0),
|
||||
("GPU #0\ndevice_name: Selected GPU\nwine_device_name: \n", 0),
|
||||
("GPU #0\ndevice_name: Other GPU\nwine_device_name: Other Wine GPU\n", 0),
|
||||
("GPU #0\ndevice_name: Selected GPU\nwine_device_name: Wine GPU\n", 1),
|
||||
])
|
||||
@mark.parametrize("selected", ["Selected GPU", "disabled", ""])
|
||||
def test_gpu_selection_falls_back_to_native_name(
|
||||
tmp_path: Path, case: tuple[str, int], selected: str,
|
||||
) -> None:
|
||||
helper = Path("build-aux/share/portproton/scripts/functions_helper").read_text()
|
||||
function = "pw_select_gpu () {" + helper.split("pw_select_gpu () {", 1)[1].split(
|
||||
"\npw_check_vulkan_extensions () {", 1,
|
||||
)[0]
|
||||
output, status = case
|
||||
binary = tmp_path / "vk_gpu_info"
|
||||
binary.write_text(
|
||||
'#!/bin/bash\ntouch probe-ran\nprintf "%s" "$GPU_OUTPUT"\n'
|
||||
f'exit {status}\n',
|
||||
)
|
||||
binary.chmod(0o755)
|
||||
result = subprocess.run(
|
||||
["bash", "-c", function + '\nprint_warning () { echo "$*" >&2; }\npw_select_gpu\n'
|
||||
'printf "%s\\n" "${DXVK_FILTER_DEVICE_NAME-unset}" '
|
||||
'"${VKD3D_FILTER_DEVICE_NAME-unset}"'],
|
||||
cwd=tmp_path, capture_output=True, text=True, check=True,
|
||||
env={"PATH": f"{tmp_path}:{os.defpath}", "GPU_OUTPUT": output,
|
||||
"PW_GPU_USE": selected, "PW_vendorID": "0x1002", "PW_deviceID": "0x163f"},
|
||||
)
|
||||
expected = selected if selected == "Selected GPU" else "unset"
|
||||
assert result.stdout.splitlines() == [expected, expected]
|
||||
assert (tmp_path / "probe-ran").exists() == (selected == "Selected GPU")
|
||||
assert ("vk_gpu_info failed" in result.stderr) == (status != 0 and selected == "Selected GPU")
|
||||
|
||||
|
||||
@mark.parametrize("exit_code", [0, 37])
|
||||
def test_run_after_command_placeholder_preserves_arguments_and_status(
|
||||
tmp_path: Path, exit_code: int,
|
||||
) -> None:
|
||||
helper = Path("build-aux/share/portproton/scripts/functions_helper").read_text()
|
||||
wrapper = helper.split("pw_launch_wrapper () {", 1)[1].split(
|
||||
"export -f pw_launch_wrapper", 1,
|
||||
)[0]
|
||||
launcher = tmp_path / "Обёртка с пробелами"
|
||||
launcher.write_text(
|
||||
'#!/bin/bash\nexport WRAPPER_ACTIVE=yes\nexec "$@"\n',
|
||||
)
|
||||
launcher.chmod(0o755)
|
||||
result = subprocess.run(
|
||||
["bash", "-c", "pw_launch_wrapper () {" + wrapper
|
||||
+ '\npw_launch_wrapper bash -c \'printf "%s\\n" "$WRAPPER_ACTIVE" "$@"; '
|
||||
+ 'exit "$EXIT_CODE"\' game "аргумент с пробелами" \'$(false)\' ""'],
|
||||
env={"PATH": os.defpath, "PW_RUN_AFTER_EXE": f'"{launcher}" %command%',
|
||||
"EXIT_CODE": str(exit_code)},
|
||||
capture_output=True, text=True, check=False,
|
||||
)
|
||||
assert result.returncode == exit_code, result.stderr
|
||||
assert result.stdout == "yes\nаргумент с пробелами\n$(false)\n\n"
|
||||
|
||||
|
||||
def test_wine_session_missing_returns_distinct_status(tmp_path: Path) -> None:
|
||||
helper = Path("build-aux/share/portproton/scripts/functions_helper").read_text()
|
||||
definition = helper.split("pw_session_tool () {", 1)[1].split("pw_launch_wrapper () {", 1)[0]
|
||||
script = "pw_session_tool () {" + definition + '''
|
||||
print_error () { echo "$@" >&2; }
|
||||
sleep () { return 0; }
|
||||
pw_session_tool taskmgr 1
|
||||
'''
|
||||
result = subprocess.run(
|
||||
["bash", "-c", script], cwd=tmp_path, capture_output=True, text=True, check=False,
|
||||
env={"PATH": os.defpath, "PORT_DATA_PATH": str(tmp_path)},
|
||||
)
|
||||
|
||||
assert result.returncode == 2
|
||||
|
||||
|
||||
@mark.parametrize("tool", ["winecfg", "regedit", "winefile", "cmd", "uninstaller", "taskmgr"])
|
||||
def test_wine_session_tool_standalone_uses_selected_wine_and_prefix(tmp_path: Path, tool: str) -> None:
|
||||
start = Path("build-aux/share/portproton/scripts/start.sh").read_text()
|
||||
block = start.split(" --wine-session-tool)\n", 1)[1].split(" --winetricks-list-all)", 1)[0]
|
||||
script = '''
|
||||
get_wine_and_pfx () { printf '%s\\n' "$@"; }
|
||||
start_portproton () { mkdir -p "$PORT_DATA_PATH/data/prefixes/$PW_PREFIX_NAME/drive_c"; echo start; }
|
||||
pw_run () { printf '%s\\n' "$@"; }
|
||||
stop_portproton () { echo stop; }
|
||||
''' + 'case "$1" in --wine-session-tool)\n' + block + '\nesac\n'
|
||||
result = subprocess.run(
|
||||
["bash", "-c", script, "bash", "--wine-session-tool", tool, "WINE_LG", "MY_PREFIX"],
|
||||
cwd=tmp_path, capture_output=True, text=True, check=False,
|
||||
env={"PATH": os.defpath, "PORT_DATA_PATH": str(tmp_path), "PW_PREFIX_NAME": "MY_PREFIX"},
|
||||
)
|
||||
|
||||
assert result.returncode == 0, result.stderr
|
||||
assert result.stdout.splitlines() == ["WINE_LG", "MY_PREFIX", "start", tool, "stop"]
|
||||
|
||||
|
||||
@mark.parametrize("tool", ["winefile", "taskmgr", "winecfg", "regedit", "cmd", "uninstaller"])
|
||||
@mark.parametrize("tool_exit_code", [0, 2])
|
||||
def test_wine_session_tools_reuse_prefix_without_game_options(
|
||||
tmp_path: Path, tool: str, tool_exit_code: int,
|
||||
) -> None:
|
||||
helper = Path("build-aux/share/portproton/scripts/functions_helper").read_text()
|
||||
definitions = helper.split("pw_save_session_env () {", 1)[1].split("pw_launch_wrapper () {", 1)[0]
|
||||
script = "pw_save_session_env () {" + definitions + '''
|
||||
print_error () { echo "$@" >&2; }
|
||||
pw_run () {
|
||||
printf '%s\\n' "$1" "$WINEPREFIX" "${PW_USE_TERMINAL:-0}" "${LAUNCH_PARAMETERS:-}" \\
|
||||
"${PW_RUN_AFTER_EXE:-}" "${PW_RUN_GAMESCOPE:-}" "$PW_TMPFS_PATH"
|
||||
return "$TOOL_EXIT_CODE"
|
||||
}
|
||||
PW_TERM="test-terminal"
|
||||
export PW_START_PID="$$" WINEPREFIX="$PORT_DATA_PATH/prefix with spaces"
|
||||
export LAUNCH_PARAMETERS="--game-only" PW_RUN_AFTER_EXE=trainer.exe PW_RUN_GAMESCOPE=gamescope
|
||||
pw_save_session_env || exit 2
|
||||
pw_session_tool "$1"
|
||||
'''
|
||||
(tmp_path / "prefix with spaces/drive_c").mkdir(parents=True)
|
||||
result = subprocess.run(
|
||||
["bash", "-c", script, "bash", tool], capture_output=True, text=True,
|
||||
env={"PATH": os.defpath, "PORT_DATA_PATH": str(tmp_path),
|
||||
"TOOL_EXIT_CODE": str(tool_exit_code)}, check=False,
|
||||
)
|
||||
|
||||
assert result.returncode == int(tool_exit_code != 0), result.stderr
|
||||
lines = result.stdout.splitlines()
|
||||
assert lines[:6] == [tool, str(tmp_path / "prefix with spaces"), "1" if tool == "cmd" else "0", "", "", ""]
|
||||
assert Path(lines[6]).is_dir()
|
||||
assert Path(lines[6]).stat().st_mode & 0o777 == 0o700
|
||||
session = next((tmp_path / "data/tmp").glob("wine-session-*/session.env"))
|
||||
assert session.stat().st_mode & 0o777 == 0o600
|
||||
assert 'declare -x PW_TERM="test-terminal"' in session.read_text()
|
||||
|
||||
|
||||
@mark.parametrize("unsafe_directory", [False, True])
|
||||
def test_wine_session_save_does_not_follow_symlinks(tmp_path: Path, unsafe_directory: bool) -> None:
|
||||
helper = Path("build-aux/share/portproton/scripts/functions_helper").read_text()
|
||||
definition = helper.split("pw_save_session_env () {", 1)[1].split("pw_remove_session_env () {", 1)[0]
|
||||
session_dir = tmp_path / "data/tmp" / f"wine-session-{os.getuid()}"
|
||||
session_dir.parent.mkdir(parents=True)
|
||||
victim = tmp_path / "victim"
|
||||
victim.write_text("keep this")
|
||||
if unsafe_directory:
|
||||
target = tmp_path / "other-directory"
|
||||
target.mkdir(mode=0o700)
|
||||
session_dir.symlink_to(target, target_is_directory=True)
|
||||
else:
|
||||
session_dir.mkdir(mode=0o700)
|
||||
(session_dir / "session.env").symlink_to(victim)
|
||||
result = subprocess.run(
|
||||
["bash", "-c", "pw_save_session_env () {" + definition + "\npw_save_session_env"],
|
||||
capture_output=True, text=True,
|
||||
env={"PATH": os.defpath, "PORT_DATA_PATH": str(tmp_path)}, check=False,
|
||||
)
|
||||
|
||||
assert victim.read_text() == "keep this"
|
||||
assert result.returncode == (1 if unsafe_directory else 0), result.stderr
|
||||
if not unsafe_directory:
|
||||
assert not (session_dir / "session.env").is_symlink()
|
||||
|
||||
|
||||
def test_wine_session_tool_rejects_unknown_tool_before_reading_environment(tmp_path: Path) -> None:
|
||||
helper = Path("build-aux/share/portproton/scripts/functions_helper").read_text()
|
||||
definition = helper.split("pw_session_tool () {", 1)[1].split("pw_launch_wrapper () {", 1)[0]
|
||||
script = "pw_session_tool () {" + definition + '''
|
||||
print_error () { echo "$@" >&2; }
|
||||
sleep () { exit 99; }
|
||||
pw_session_tool '../../other-command'
|
||||
'''
|
||||
result = subprocess.run(
|
||||
["bash", "-c", script], capture_output=True, text=True,
|
||||
env={"PATH": os.defpath, "PORT_DATA_PATH": str(tmp_path)}, check=False,
|
||||
)
|
||||
|
||||
assert result.returncode == 1
|
||||
assert "Unsupported Wine tool" in result.stderr
|
||||
|
||||
|
||||
def test_wine_session_cleanup_preserves_newer_session(tmp_path: Path) -> None:
|
||||
helper = Path("build-aux/share/portproton/scripts/functions_helper").read_text()
|
||||
definitions = helper.split("pw_save_session_env () {", 1)[1].split("pw_session_tool () {", 1)[0]
|
||||
script = "pw_save_session_env () {" + definitions + '''
|
||||
export PW_START_PID="$$"
|
||||
pw_save_session_env || exit 2
|
||||
PW_START_PID=99999999
|
||||
pw_remove_session_env
|
||||
[[ -f "$PORT_DATA_PATH/data/tmp/wine-session-$(id -u)/session.env" ]] || exit 3
|
||||
PW_START_PID="$$"
|
||||
pw_remove_session_env
|
||||
[[ ! -e "$PORT_DATA_PATH/data/tmp/wine-session-$(id -u)/session.env" ]]
|
||||
'''
|
||||
result = subprocess.run(
|
||||
["bash", "-c", script], capture_output=True, text=True,
|
||||
env={"PATH": os.defpath, "PORT_DATA_PATH": str(tmp_path)}, check=False,
|
||||
)
|
||||
|
||||
assert result.returncode == 0, result.stderr
|
||||
Reference in new issue
Block a user