2018-04-01 15:22:59 -07:00
|
|
|
From 2c0e38e44cb592d67eee581cd78428d784a24f40 Mon Sep 17 00:00:00 2001
|
2015-02-21 19:08:15 -08:00
|
|
|
From: Sebastian Lackner <sebastian@fds-team.de>
|
|
|
|
Date: Sat, 21 Feb 2015 23:37:26 +0100
|
|
|
|
Subject: winecfg: Add checkbox to enable/disable vaapi GPU decoder.
|
|
|
|
|
|
|
|
---
|
|
|
|
programs/winecfg/resource.h | 1 +
|
2015-04-05 00:56:31 -07:00
|
|
|
programs/winecfg/staging.c | 30 ++++++++++++++++++++++++++++++
|
2015-02-21 19:08:15 -08:00
|
|
|
programs/winecfg/winecfg.rc | 1 +
|
2015-04-05 00:56:31 -07:00
|
|
|
3 files changed, 32 insertions(+)
|
2015-02-21 19:08:15 -08:00
|
|
|
|
|
|
|
diff --git a/programs/winecfg/resource.h b/programs/winecfg/resource.h
|
2018-04-01 15:22:59 -07:00
|
|
|
index 54c67c2..7b6ac54 100644
|
2015-02-21 19:08:15 -08:00
|
|
|
--- a/programs/winecfg/resource.h
|
|
|
|
+++ b/programs/winecfg/resource.h
|
2018-04-01 15:22:59 -07:00
|
|
|
@@ -214,6 +214,7 @@
|
2015-02-21 19:08:15 -08:00
|
|
|
|
|
|
|
/* Staging tab */
|
|
|
|
#define IDC_ENABLE_CSMT 9001
|
|
|
|
+#define IDC_ENABLE_VAAPI 9002
|
|
|
|
|
|
|
|
/* About tab */
|
|
|
|
#define IDC_ABT_OWNER 8432
|
|
|
|
diff --git a/programs/winecfg/staging.c b/programs/winecfg/staging.c
|
2018-04-01 15:22:59 -07:00
|
|
|
index efba152..a2b6dce 100644
|
2015-02-21 19:08:15 -08:00
|
|
|
--- a/programs/winecfg/staging.c
|
|
|
|
+++ b/programs/winecfg/staging.c
|
2018-04-01 15:22:59 -07:00
|
|
|
@@ -45,10 +45,36 @@ static void csmt_set(BOOL status)
|
|
|
|
set_reg_key_dword(config_key, "Direct3D", "csmt", status);
|
2015-02-21 19:08:15 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
+/*
|
|
|
|
+ * DXVA2
|
|
|
|
+ */
|
|
|
|
+static BOOL vaapi_get(void)
|
|
|
|
+{
|
2015-04-05 00:56:31 -07:00
|
|
|
+#ifdef HAVE_VAAPI
|
2015-02-21 19:08:15 -08:00
|
|
|
+ BOOL ret;
|
|
|
|
+ char *value = get_reg_key(config_key, keypath("DXVA2"), "backend", NULL);
|
|
|
|
+ ret = (value && !strcmp(value, "va"));
|
|
|
|
+ HeapFree(GetProcessHeap(), 0, value);
|
|
|
|
+ return ret;
|
2015-04-05 00:56:31 -07:00
|
|
|
+#else
|
|
|
|
+ return FALSE;
|
|
|
|
+#endif
|
2015-02-21 19:08:15 -08:00
|
|
|
+}
|
|
|
|
+static void vaapi_set(BOOL status)
|
|
|
|
+{
|
2015-04-05 00:56:31 -07:00
|
|
|
+#ifdef HAVE_VAAPI
|
2015-02-21 19:08:15 -08:00
|
|
|
+ set_reg_key(config_key, keypath("DXVA2"), "backend", status ? "va" : NULL);
|
2015-04-05 00:56:31 -07:00
|
|
|
+#endif
|
2015-02-21 19:08:15 -08:00
|
|
|
+}
|
|
|
|
|
|
|
|
static void load_staging_settings(HWND dialog)
|
|
|
|
{
|
|
|
|
CheckDlgButton(dialog, IDC_ENABLE_CSMT, csmt_get() ? BST_CHECKED : BST_UNCHECKED);
|
|
|
|
+ CheckDlgButton(dialog, IDC_ENABLE_VAAPI, vaapi_get() ? BST_CHECKED : BST_UNCHECKED);
|
2015-04-05 00:56:31 -07:00
|
|
|
+
|
|
|
|
+#ifndef HAVE_VAAPI
|
|
|
|
+ disable(IDC_ENABLE_VAAPI);
|
|
|
|
+#endif
|
2015-02-21 19:08:15 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
INT_PTR CALLBACK StagingDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
2018-04-01 15:22:59 -07:00
|
|
|
@@ -78,6 +104,10 @@ INT_PTR CALLBACK StagingDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
|
2015-02-21 19:08:15 -08:00
|
|
|
csmt_set(IsDlgButtonChecked(hDlg, IDC_ENABLE_CSMT) == BST_CHECKED);
|
|
|
|
SendMessageW(GetParent(hDlg), PSM_CHANGED, 0, 0);
|
|
|
|
return TRUE;
|
|
|
|
+ case IDC_ENABLE_VAAPI:
|
|
|
|
+ vaapi_set(IsDlgButtonChecked(hDlg, IDC_ENABLE_VAAPI) == BST_CHECKED);
|
|
|
|
+ SendMessageW(GetParent(hDlg), PSM_CHANGED, 0, 0);
|
|
|
|
+ return TRUE;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
diff --git a/programs/winecfg/winecfg.rc b/programs/winecfg/winecfg.rc
|
2018-04-01 15:22:59 -07:00
|
|
|
index 420f127..59fb0a9 100644
|
2015-02-21 19:08:15 -08:00
|
|
|
--- a/programs/winecfg/winecfg.rc
|
|
|
|
+++ b/programs/winecfg/winecfg.rc
|
2018-04-01 15:22:59 -07:00
|
|
|
@@ -316,6 +316,7 @@ BEGIN
|
2015-02-21 19:08:15 -08:00
|
|
|
GROUPBOX "Staging settings",IDC_STATIC,8,4,244,210
|
|
|
|
LTEXT "The following settings are experimental and may break stuff!\nMake sure to reset them again in case of a problem.",IDC_STATIC,16,16,230,16
|
2018-04-01 15:22:59 -07:00
|
|
|
CONTROL "Enable &CSMT for better graphic performance (deprecated)",IDC_ENABLE_CSMT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,40,230,8
|
2015-02-21 19:08:15 -08:00
|
|
|
+ CONTROL "Enable &VAAPI as backend for DXVA2 GPU decoding",IDC_ENABLE_VAAPI,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,55,230,8
|
|
|
|
END
|
|
|
|
|
|
|
|
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
|
|
|
|
--
|
2018-04-01 15:22:59 -07:00
|
|
|
2.7.4
|
2015-02-21 19:08:15 -08:00
|
|
|
|