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
a92ab086
Commit
a92ab086
authored
May 17, 2021
by
Zhiyi Zhang
Committed by
Alexandre Julliard
May 17, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11.drv: Support reporting emulated display depth.
Signed-off-by:
Zhiyi Zhang
<
zzhang@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
cad10246
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
67 additions
and
6 deletions
+67
-6
d3drm.c
dlls/d3drm/tests/d3drm.c
+3
-3
monitor.c
dlls/user32/tests/monitor.c
+0
-3
settings.c
dlls/winex11.drv/settings.c
+64
-0
No files found.
dlls/d3drm/tests/d3drm.c
View file @
a92ab086
...
...
@@ -4061,7 +4061,7 @@ static void test_create_device_from_clipper1(void)
surface_desc
.
dwSize
=
sizeof
(
surface_desc
);
hr
=
IDirectDrawSurface_GetSurfaceDesc
(
surface
,
&
surface_desc
);
ok
(
hr
==
DD_OK
,
"Cannot get surface desc structure (hr = %x).
\n
"
,
hr
);
todo_wine
ok
(
surface_desc
.
ddpfPixelFormat
.
dwRGBBitCount
==
16
,
"Expected 16bpp, got %ubpp.
\n
"
,
ok
(
surface_desc
.
ddpfPixelFormat
.
dwRGBBitCount
==
16
,
"Expected 16bpp, got %ubpp.
\n
"
,
surface_desc
.
ddpfPixelFormat
.
dwRGBBitCount
);
hr
=
IDirectDraw2_RestoreDisplayMode
(
ddraw
);
...
...
@@ -4240,7 +4240,7 @@ static void test_create_device_from_clipper2(void)
surface_desc
.
dwSize
=
sizeof
(
surface_desc
);
hr
=
IDirectDrawSurface_GetSurfaceDesc
(
surface
,
&
surface_desc
);
ok
(
hr
==
DD_OK
,
"Cannot get surface desc structure (hr = %x).
\n
"
,
hr
);
todo_wine
ok
(
surface_desc
.
ddpfPixelFormat
.
dwRGBBitCount
==
16
,
"Expected 16bpp, got %ubpp.
\n
"
,
ok
(
surface_desc
.
ddpfPixelFormat
.
dwRGBBitCount
==
16
,
"Expected 16bpp, got %ubpp.
\n
"
,
surface_desc
.
ddpfPixelFormat
.
dwRGBBitCount
);
hr
=
IDirectDraw2_RestoreDisplayMode
(
ddraw
);
...
...
@@ -4418,7 +4418,7 @@ static void test_create_device_from_clipper3(void)
surface_desc
.
dwSize
=
sizeof
(
surface_desc
);
hr
=
IDirectDrawSurface_GetSurfaceDesc
(
surface
,
&
surface_desc
);
ok
(
hr
==
DD_OK
,
"Cannot get surface desc structure (hr = %x).
\n
"
,
hr
);
todo_wine
ok
(
surface_desc
.
ddpfPixelFormat
.
dwRGBBitCount
==
16
,
"Expected 16bpp, got %ubpp.
\n
"
,
ok
(
surface_desc
.
ddpfPixelFormat
.
dwRGBBitCount
==
16
,
"Expected 16bpp, got %ubpp.
\n
"
,
surface_desc
.
ddpfPixelFormat
.
dwRGBBitCount
);
hr
=
IDirectDraw2_RestoreDisplayMode
(
ddraw
);
...
...
dlls/user32/tests/monitor.c
View file @
a92ab086
...
...
@@ -297,8 +297,6 @@ static void _expect_dm(INT line, const DEVMODEA *expected, const CHAR *device, D
ok_
(
__FILE__
,
line
)((
dm
.
dmFields
&
expected
->
dmFields
)
==
expected
->
dmFields
,
"Device %s test %d expect dmFields to contain %#x, got %#x
\n
"
,
device
,
test
,
expected
->
dmFields
,
dm
.
dmFields
);
/* Wine doesn't support changing color depth yet */
todo_wine_if
(
expected
->
dmFields
&
DM_BITSPERPEL
&&
expected
->
dmBitsPerPel
!=
32
&&
expected
->
dmBitsPerPel
!=
24
)
ok_
(
__FILE__
,
line
)(
!
(
expected
->
dmFields
&
DM_BITSPERPEL
)
||
dm
.
dmBitsPerPel
==
expected
->
dmBitsPerPel
,
"Device %s test %d expect dmBitsPerPel %u, got %u
\n
"
,
device
,
test
,
expected
->
dmBitsPerPel
,
dm
.
dmBitsPerPel
);
ok_
(
__FILE__
,
line
)(
!
(
expected
->
dmFields
&
DM_PELSWIDTH
)
||
dm
.
dmPelsWidth
==
expected
->
dmPelsWidth
,
...
...
@@ -696,7 +694,6 @@ static void test_ChangeDisplaySettingsEx(void)
dm
.
dmSize
=
sizeof
(
dm
);
res
=
EnumDisplaySettingsA
(
devices
[
device
].
name
,
ENUM_CURRENT_SETTINGS
,
&
dm
);
ok
(
res
,
"Device %s EnumDisplaySettingsA failed, error %#x.
\n
"
,
devices
[
device
].
name
,
GetLastError
());
todo_wine_if
(
depths
[
test
]
!=
32
)
ok
(
dm
.
dmBitsPerPel
==
depths
[
test
],
"Device %s expect dmBitsPerPel %u, got %u.
\n
"
,
devices
[
device
].
name
,
depths
[
test
],
dm
.
dmBitsPerPel
);
/* 2008 resets to the resolution in the registry. Newer versions of Windows doesn't
...
...
dlls/winex11.drv/settings.c
View file @
a92ab086
...
...
@@ -45,6 +45,16 @@ struct x11drv_display_setting
DEVMODEW
desired_mode
;
};
struct
x11drv_display_depth
{
struct
list
entry
;
ULONG_PTR
display_id
;
DWORD
depth
;
};
/* Display device emulated depth list, protected by modes_section */
static
struct
list
x11drv_display_depth_list
=
LIST_INIT
(
x11drv_display_depth_list
);
/* All Windows drivers seen so far either support 32 bit depths, or 24 bit depths, but never both. So if we have
* a 32 bit framebuffer, report 32 bit bpps, otherwise 24 bit ones.
*/
...
...
@@ -405,6 +415,54 @@ static int mode_compare(const void *p1, const void *p2)
return
a
->
u1
.
s2
.
dmDisplayOrientation
-
b
->
u1
.
s2
.
dmDisplayOrientation
;
}
static
void
set_display_depth
(
ULONG_PTR
display_id
,
DWORD
depth
)
{
struct
x11drv_display_depth
*
display_depth
;
EnterCriticalSection
(
&
modes_section
);
LIST_FOR_EACH_ENTRY
(
display_depth
,
&
x11drv_display_depth_list
,
struct
x11drv_display_depth
,
entry
)
{
if
(
display_depth
->
display_id
==
display_id
)
{
display_depth
->
depth
=
depth
;
LeaveCriticalSection
(
&
modes_section
);
return
;
}
}
display_depth
=
heap_alloc
(
sizeof
(
*
display_depth
));
if
(
!
display_depth
)
{
ERR
(
"Failed to allocate memory.
\n
"
);
LeaveCriticalSection
(
&
modes_section
);
return
;
}
display_depth
->
display_id
=
display_id
;
display_depth
->
depth
=
depth
;
list_add_head
(
&
x11drv_display_depth_list
,
&
display_depth
->
entry
);
LeaveCriticalSection
(
&
modes_section
);
}
static
DWORD
get_display_depth
(
ULONG_PTR
display_id
)
{
struct
x11drv_display_depth
*
display_depth
;
DWORD
depth
;
EnterCriticalSection
(
&
modes_section
);
LIST_FOR_EACH_ENTRY
(
display_depth
,
&
x11drv_display_depth_list
,
struct
x11drv_display_depth
,
entry
)
{
if
(
display_depth
->
display_id
==
display_id
)
{
depth
=
display_depth
->
depth
;
LeaveCriticalSection
(
&
modes_section
);
return
depth
;
}
}
LeaveCriticalSection
(
&
modes_section
);
return
screen_bpp
;
}
/***********************************************************************
* EnumDisplaySettingsEx (X11DRV.@)
*
...
...
@@ -434,6 +492,10 @@ BOOL CDECL X11DRV_EnumDisplaySettingsEx( LPCWSTR name, DWORD n, LPDEVMODEW devmo
ERR
(
"Failed to get %s current display settings.
\n
"
,
wine_dbgstr_w
(
name
));
return
FALSE
;
}
if
(
!
is_detached_mode
(
devmode
))
devmode
->
dmBitsPerPel
=
get_display_depth
(
id
);
goto
done
;
}
...
...
@@ -842,6 +904,8 @@ static LONG apply_display_settings(struct x11drv_display_setting *displays, INT
full_mode
->
u1
.
s2
.
dmDisplayOrientation
);
ret
=
handler
.
set_current_mode
(
displays
[
display_idx
].
id
,
full_mode
);
if
(
attached_mode
&&
ret
==
DISP_CHANGE_SUCCESSFUL
)
set_display_depth
(
displays
[
display_idx
].
id
,
full_mode
->
dmBitsPerPel
);
free_full_mode
(
full_mode
);
if
(
ret
!=
DISP_CHANGE_SUCCESSFUL
)
return
ret
;
...
...
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