Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
a7ec245f
Commit
a7ec245f
authored
Sep 16, 2021
by
Zhiyi Zhang
Committed by
Alexandre Julliard
Sep 16, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11.drv: Register GUID_DEVINTERFACE_DISPLAY_ADAPTER interface for GPUs.
Signed-off-by:
Zhiyi Zhang
<
zzhang@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
67ea78c8
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
60 additions
and
0 deletions
+60
-0
display.c
dlls/winex11.drv/display.c
+60
-0
No files found.
dlls/winex11.drv/display.c
View file @
a7ec245f
...
...
@@ -27,9 +27,11 @@
#include "winuser.h"
#include "rpc.h"
#include "winreg.h"
#include "cfgmgr32.h"
#include "initguid.h"
#include "devguid.h"
#include "devpkey.h"
#include "ntddvdeo.h"
#include "setupapi.h"
#define WIN32_NO_STATUS
#include "winternl.h"
...
...
@@ -405,6 +407,57 @@ void X11DRV_DisplayDevices_Update(BOOL send_display_change)
}
}
/* Set device interface link state to enabled. The link state should be set via
* IoSetDeviceInterfaceState(). However, IoSetDeviceInterfaceState() requires a PnP driver, which
* currently doesn't exist for display devices. */
static
BOOL
link_device
(
const
WCHAR
*
instance
,
const
GUID
*
guid
)
{
static
const
WCHAR
device_instanceW
[]
=
{
'D'
,
'e'
,
'v'
,
'i'
,
'c'
,
'e'
,
'I'
,
'n'
,
's'
,
't'
,
'a'
,
'n'
,
'c'
,
'e'
,
0
};
static
const
WCHAR
hash_controlW
[]
=
{
'#'
,
'\\'
,
'C'
,
'o'
,
'n'
,
't'
,
'r'
,
'o'
,
'l'
,
0
};
static
const
WCHAR
linkedW
[]
=
{
'L'
,
'i'
,
'n'
,
'k'
,
'e'
,
'd'
,
0
};
static
const
DWORD
enabled
=
1
;
WCHAR
device_key_name
[
MAX_PATH
],
device_instance
[
MAX_PATH
];
HKEY
iface_key
,
device_key
,
control_key
;
DWORD
length
,
index
=
0
;
BOOL
ret
=
FALSE
;
LSTATUS
lr
;
iface_key
=
SetupDiOpenClassRegKeyExW
(
guid
,
KEY_ALL_ACCESS
,
DIOCR_INTERFACE
,
NULL
,
NULL
);
while
(
1
)
{
length
=
ARRAY_SIZE
(
device_key_name
);
lr
=
RegEnumKeyExW
(
iface_key
,
index
++
,
device_key_name
,
&
length
,
NULL
,
NULL
,
NULL
,
NULL
);
if
(
lr
)
break
;
lr
=
RegOpenKeyExW
(
iface_key
,
device_key_name
,
0
,
KEY_ALL_ACCESS
,
&
device_key
);
if
(
lr
)
continue
;
length
=
ARRAY_SIZE
(
device_instance
);
lr
=
RegQueryValueExW
(
device_key
,
device_instanceW
,
NULL
,
NULL
,
(
BYTE
*
)
device_instance
,
&
length
);
if
(
lr
||
lstrcmpiW
(
device_instance
,
instance
))
{
RegCloseKey
(
device_key
);
continue
;
}
lr
=
RegCreateKeyExW
(
device_key
,
hash_controlW
,
0
,
NULL
,
REG_OPTION_VOLATILE
,
KEY_ALL_ACCESS
,
NULL
,
&
control_key
,
NULL
);
RegCloseKey
(
device_key
);
if
(
lr
)
break
;
lr
=
RegSetValueExW
(
control_key
,
linkedW
,
0
,
REG_DWORD
,
(
const
BYTE
*
)
&
enabled
,
sizeof
(
enabled
));
if
(
!
lr
)
ret
=
TRUE
;
RegCloseKey
(
control_key
);
break
;
}
RegCloseKey
(
iface_key
);
return
ret
;
}
/* Initialize a GPU instance.
* Return its GUID string in guid_string, driver value in driver parameter and LUID in gpu_luid */
static
BOOL
X11DRV_InitGpu
(
HDEVINFO
devinfo
,
const
struct
x11drv_gpu
*
gpu
,
INT
gpu_index
,
WCHAR
*
guid_string
,
...
...
@@ -434,6 +487,13 @@ static BOOL X11DRV_InitGpu(HDEVINFO devinfo, const struct x11drv_gpu *gpu, INT g
goto
done
;
}
/* Register GUID_DEVINTERFACE_DISPLAY_ADAPTER */
if
(
!
SetupDiCreateDeviceInterfaceW
(
devinfo
,
&
device_data
,
&
GUID_DEVINTERFACE_DISPLAY_ADAPTER
,
NULL
,
0
,
NULL
))
goto
done
;
if
(
!
link_device
(
instanceW
,
&
GUID_DEVINTERFACE_DISPLAY_ADAPTER
))
goto
done
;
/* Write HardwareID registry property, REG_MULTI_SZ */
written
=
sprintfW
(
bufferW
,
gpu_hardware_id_fmtW
,
gpu
->
vendor_id
,
gpu
->
device_id
);
bufferW
[
written
+
1
]
=
0
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment