Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
5fbd4052
Commit
5fbd4052
authored
Jan 27, 2021
by
Brendan Shanks
Committed by
Alexandre Julliard
Jan 28, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winemac.drv: Handle non-PCI GPUs correctly.
Signed-off-by:
Brendan Shanks
<
bshanks@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
ae319caa
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
7 deletions
+15
-7
cocoa_display.m
dlls/winemac.drv/cocoa_display.m
+15
-7
No files found.
dlls/winemac.drv/cocoa_display.m
View file @
5fbd4052
...
...
@@ -183,7 +183,9 @@ done:
/***********************************************************************
* macdrv_get_gpu_info_from_entry
*
* Starting from entry, search upwards to find the PCI GPU. And get GPU information from the PCI GPU entry.
* Starting from entry (which must be the GPU or a child below the GPU),
* search upwards to find the IOPCIDevice and get information from it.
* In case the GPU is not a PCI device, get properties from 'entry'.
*
* Returns non-zero value on failure.
*/
...
...
@@ -193,18 +195,21 @@ static int macdrv_get_gpu_info_from_entry(struct macdrv_gpu* gpu, io_registry_en
io_registry_entry_t
gpu_entry
;
kern_return_t
result
;
int
ret
=
-
1
;
char
buffer
[
64
];
NSAutoreleasePool
*
pool
=
[[
NSAutoreleasePool
alloc
]
init
];
gpu_entry
=
entry
;
while
(
!
[
@"IOPCIDevice"
isEqualToString
:[(
NSString
*
)
IOObjectCopyClass
(
gpu_entry
)
autorelease
]]
||
get_entry_property_string
(
gpu_entry
,
CFSTR
(
"IOName"
),
buffer
,
sizeof
(
buffer
))
||
strcmp
(
buffer
,
"display"
))
while
(
!
[
@"IOPCIDevice"
isEqualToString
:[(
NSString
*
)
IOObjectCopyClass
(
gpu_entry
)
autorelease
]])
{
result
=
IORegistryEntryGetParentEntry
(
gpu_entry
,
kIOServicePlane
,
&
parent_entry
);
if
(
gpu_entry
!=
entry
)
IOObjectRelease
(
gpu_entry
);
if
(
result
!=
kIOReturnSuccess
)
if
(
result
==
kIOReturnNoDevice
)
{
/* If no IOPCIDevice node is found, get properties from the given entry. */
gpu_entry
=
entry
;
break
;
}
else
if
(
result
!=
kIOReturnSuccess
)
{
[
pool
release
];
return
ret
;
...
...
@@ -404,6 +409,7 @@ static int macdrv_get_gpus_from_iokit(struct macdrv_gpu** new_gpus, int* count)
int
integrated_index
=
-
1
;
int
primary_index
=
0
;
int
gpu_count
=
0
;
char
buffer
[
64
];
int
ret
=
-
1
;
int
i
;
...
...
@@ -417,7 +423,9 @@ static int macdrv_get_gpus_from_iokit(struct macdrv_gpu** new_gpus, int* count)
while
((
entry
=
IOIteratorNext
(
iterator
)))
{
if
(
!
macdrv_get_gpu_info_from_entry
(
&
gpus
[
gpu_count
],
entry
))
if
(
!
get_entry_property_string
(
entry
,
CFSTR
(
"IOName"
),
buffer
,
sizeof
(
buffer
))
&&
!
strcmp
(
buffer
,
"display"
)
&&
!
macdrv_get_gpu_info_from_entry
(
&
gpus
[
gpu_count
],
entry
))
{
gpu_count
++
;
assert
(
gpu_count
<
MAX_GPUS
);
...
...
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