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
20414797
Commit
20414797
authored
Jul 07, 2022
by
Rémi Bernon
Committed by
Alexandre Julliard
Jul 27, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
win32u: Introduce new add_mode device manager callback.
And use it to enumerate display modes in winex11 and wineandroid.
parent
237778d7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
187 additions
and
23 deletions
+187
-23
sysparams.c
dlls/win32u/sysparams.c
+82
-22
init.c
dlls/wineandroid.drv/init.c
+6
-0
display.c
dlls/winemac.drv/display.c
+82
-1
display.c
dlls/winex11.drv/display.c
+16
-0
gdi_driver.h
include/wine/gdi_driver.h
+1
-0
No files found.
dlls/win32u/sysparams.c
View file @
20414797
This diff is collapsed.
Click to expand it.
dlls/wineandroid.drv/init.c
View file @
20414797
...
...
@@ -288,9 +288,15 @@ BOOL ANDROID_UpdateDisplayDevices( const struct gdi_device_manager *device_manag
.
rc_work
=
monitor_rc_work
,
.
state_flags
=
DISPLAY_DEVICE_ACTIVE
|
DISPLAY_DEVICE_ATTACHED
,
};
const
DEVMODEW
mode
=
{
.
dmFields
=
DM_PELSWIDTH
|
DM_PELSHEIGHT
|
DM_BITSPERPEL
|
DM_DISPLAYFLAGS
|
DM_DISPLAYFREQUENCY
,
.
dmBitsPerPel
=
screen_bpp
,
.
dmPelsWidth
=
screen_width
,
.
dmPelsHeight
=
screen_height
,
.
dmDisplayFrequency
=
60
,
};
device_manager
->
add_gpu
(
&
gpu
,
param
);
device_manager
->
add_adapter
(
&
adapter
,
param
);
device_manager
->
add_monitor
(
&
gdi_monitor
,
param
);
device_manager
->
add_mode
(
&
mode
,
param
);
force_display_devices_refresh
=
FALSE
;
}
...
...
dlls/winemac.drv/display.c
View file @
20414797
...
...
@@ -918,6 +918,73 @@ better:
return
ret
;
}
static
DEVMODEW
*
display_get_modes
(
CGDirectDisplayID
display_id
,
int
*
modes_count
)
{
int
default_bpp
=
get_default_bpp
(),
synth_count
=
0
,
count
,
i
;
BOOL
modes_has_8bpp
=
FALSE
,
modes_has_16bpp
=
FALSE
;
struct
display_mode_descriptor
*
desc
;
DEVMODEW
*
devmodes
;
CFArrayRef
modes
;
modes
=
copy_display_modes
(
display_id
,
TRUE
);
if
(
!
modes
)
return
NULL
;
count
=
CFArrayGetCount
(
modes
);
for
(
i
=
0
;
i
<
count
&&
!
(
modes_has_8bpp
&&
modes_has_16bpp
);
i
++
)
{
CGDisplayModeRef
mode
=
(
CGDisplayModeRef
)
CFArrayGetValueAtIndex
(
modes
,
i
);
int
bpp
=
display_mode_bits_per_pixel
(
mode
);
if
(
bpp
==
8
)
modes_has_8bpp
=
TRUE
;
else
if
(
bpp
==
16
)
modes_has_16bpp
=
TRUE
;
}
if
(
!
(
devmodes
=
calloc
(
count
*
3
,
sizeof
(
DEVMODEW
))))
{
CFRelease
(
modes
);
return
NULL
;
}
desc
=
create_original_display_mode_descriptor
(
display_id
);
for
(
i
=
0
;
i
<
count
;
i
++
)
{
CGDisplayModeRef
mode
=
(
CGDisplayModeRef
)
CFArrayGetValueAtIndex
(
modes
,
i
);
display_mode_to_devmode
(
display_id
,
mode
,
devmodes
+
i
);
if
(
retina_enabled
&&
display_mode_matches_descriptor
(
mode
,
desc
))
{
devmodes
[
i
].
dmPelsWidth
*=
2
;
devmodes
[
i
].
dmPelsHeight
*=
2
;
}
}
free_display_mode_descriptor
(
desc
);
for
(
i
=
0
;
!
modes_has_16bpp
&&
i
<
count
;
i
++
)
{
/* We only synthesize modes from those having the default bpp. */
if
(
devmodes
[
i
].
dmBitsPerPel
!=
default_bpp
)
continue
;
devmodes
[
count
+
synth_count
]
=
devmodes
[
i
];
devmodes
[
count
+
synth_count
].
dmBitsPerPel
=
16
;
synth_count
++
;
}
for
(
i
=
0
;
!
modes_has_8bpp
&&
i
<
count
;
i
++
)
{
/* We only synthesize modes from those having the default bpp. */
if
(
devmodes
[
i
].
dmBitsPerPel
!=
default_bpp
)
continue
;
devmodes
[
count
+
synth_count
]
=
devmodes
[
i
];
devmodes
[
count
+
synth_count
].
dmBitsPerPel
=
8
;
synth_count
++
;
}
CFRelease
(
modes
);
*
modes_count
=
count
+
synth_count
;
return
devmodes
;
}
/***********************************************************************
* EnumDisplaySettingsEx (MACDRV.@)
*
...
...
@@ -1301,7 +1368,8 @@ BOOL macdrv_UpdateDisplayDevices( const struct gdi_device_manager *device_manage
struct
macdrv_adapter
*
adapters
,
*
adapter
;
struct
macdrv_monitor
*
monitors
,
*
monitor
;
struct
macdrv_gpu
*
gpus
,
*
gpu
;
INT
gpu_count
,
adapter_count
,
monitor_count
;
INT
gpu_count
,
adapter_count
,
monitor_count
,
mode_count
;
DEVMODEW
*
mode
,
*
modes
;
DWORD
len
;
if
(
!
force
&&
!
force_display_devices_refresh
)
return
TRUE
;
...
...
@@ -1359,6 +1427,19 @@ BOOL macdrv_UpdateDisplayDevices( const struct gdi_device_manager *device_manage
device_manager
->
add_monitor
(
&
gdi_monitor
,
param
);
}
if
(
!
(
modes
=
display_get_modes
(
adapter
->
id
,
&
mode_count
)))
break
;
TRACE
(
"adapter: %#x, mode count: %d
\n
"
,
adapter
->
id
,
mode_count
);
/* Initialize modes */
for
(
mode
=
modes
;
mode
<
modes
+
mode_count
;
mode
++
)
{
TRACE
(
"mode: %dx%dx%dbpp @%d Hz, %sstretched %sinterlaced
\n
"
,
mode
->
dmPelsWidth
,
mode
->
dmPelsHeight
,
mode
->
dmBitsPerPel
,
mode
->
dmDisplayFrequency
,
mode
->
dmDisplayFixedOutput
==
DMDFO_STRETCH
?
""
:
"un"
,
mode
->
dmDisplayFlags
&
DM_INTERLACED
?
""
:
"non-"
);
device_manager
->
add_mode
(
mode
,
param
);
}
macdrv_free_monitors
(
monitors
);
}
...
...
dlls/winex11.drv/display.c
View file @
20414797
...
...
@@ -1026,6 +1026,8 @@ BOOL X11DRV_UpdateDisplayDevices( const struct gdi_device_manager *device_manage
struct
gdi_gpu
*
gpus
;
INT
gpu_count
,
adapter_count
,
monitor_count
;
INT
gpu
,
adapter
,
monitor
;
DEVMODEW
*
modes
,
*
mode
;
DWORD
mode_count
;
if
(
!
force
&&
!
force_display_devices_refresh
)
return
TRUE
;
force_display_devices_refresh
=
FALSE
;
...
...
@@ -1060,6 +1062,20 @@ BOOL X11DRV_UpdateDisplayDevices( const struct gdi_device_manager *device_manage
}
handler
->
free_monitors
(
monitors
,
monitor_count
);
if
(
!
settings_handler
.
get_modes
(
adapters
[
adapter
].
id
,
EDS_ROTATEDMODE
,
&
modes
,
&
mode_count
))
continue
;
qsort
(
modes
,
mode_count
,
sizeof
(
*
modes
)
+
modes
[
0
].
dmDriverExtra
,
mode_compare
);
for
(
mode
=
modes
;
mode_count
;
mode_count
--
)
{
TRACE
(
"mode: %p
\n
"
,
mode
);
device_manager
->
add_mode
(
mode
,
param
);
mode
=
(
DEVMODEW
*
)((
char
*
)
mode
+
sizeof
(
*
modes
)
+
modes
[
0
].
dmDriverExtra
);
}
settings_handler
.
free_modes
(
modes
);
}
handler
->
free_adapters
(
adapters
);
...
...
include/wine/gdi_driver.h
View file @
20414797
...
...
@@ -266,6 +266,7 @@ struct gdi_device_manager
void
(
*
add_gpu
)(
const
struct
gdi_gpu
*
gpu
,
void
*
param
);
void
(
*
add_adapter
)(
const
struct
gdi_adapter
*
adapter
,
void
*
param
);
void
(
*
add_monitor
)(
const
struct
gdi_monitor
*
monitor
,
void
*
param
);
void
(
*
add_mode
)(
const
DEVMODEW
*
mode
,
void
*
param
);
};
struct
tagUPDATELAYEREDWINDOWINFO
;
...
...
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