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
f74900ad
Commit
f74900ad
authored
Apr 11, 2024
by
Rémi Bernon
Committed by
Alexandre Julliard
May 07, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11: Only request display modes driver data when needed.
parent
6b4ab3be
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
28 deletions
+29
-28
display.c
dlls/winex11.drv/display.c
+3
-4
x11drv.h
dlls/winex11.drv/x11drv.h
+3
-1
xrandr.c
dlls/winex11.drv/xrandr.c
+16
-16
xvidmode.c
dlls/winex11.drv/xvidmode.c
+7
-7
No files found.
dlls/winex11.drv/display.c
View file @
f74900ad
...
@@ -71,7 +71,7 @@ static BOOL nores_get_id(const WCHAR *device_name, BOOL is_primary, x11drv_setti
...
@@ -71,7 +71,7 @@ static BOOL nores_get_id(const WCHAR *device_name, BOOL is_primary, x11drv_setti
return
TRUE
;
return
TRUE
;
}
}
static
BOOL
nores_get_modes
(
x11drv_settings_id
id
,
DWORD
flags
,
DEVMODEW
**
new_modes
,
UINT
*
mode_count
)
static
BOOL
nores_get_modes
(
x11drv_settings_id
id
,
DWORD
flags
,
DEVMODEW
**
new_modes
,
UINT
*
mode_count
,
BOOL
full
)
{
{
RECT
primary
=
get_host_primary_monitor_rect
();
RECT
primary
=
get_host_primary_monitor_rect
();
DEVMODEW
*
modes
;
DEVMODEW
*
modes
;
...
@@ -261,8 +261,7 @@ static DEVMODEW *get_full_mode(x11drv_settings_id id, DEVMODEW *dev_mode)
...
@@ -261,8 +261,7 @@ static DEVMODEW *get_full_mode(x11drv_settings_id id, DEVMODEW *dev_mode)
if
(
is_detached_mode
(
dev_mode
))
if
(
is_detached_mode
(
dev_mode
))
return
dev_mode
;
return
dev_mode
;
if
(
!
settings_handler
.
get_modes
(
id
,
EDS_ROTATEDMODE
,
&
modes
,
&
mode_count
))
if
(
!
settings_handler
.
get_modes
(
id
,
EDS_ROTATEDMODE
,
&
modes
,
&
mode_count
,
TRUE
))
return
NULL
;
return
NULL
;
for
(
mode_idx
=
0
;
mode_idx
<
mode_count
;
++
mode_idx
)
for
(
mode_idx
=
0
;
mode_idx
<
mode_count
;
++
mode_idx
)
{
{
...
@@ -547,7 +546,7 @@ BOOL X11DRV_UpdateDisplayDevices( const struct gdi_device_manager *device_manage
...
@@ -547,7 +546,7 @@ BOOL X11DRV_UpdateDisplayDevices( const struct gdi_device_manager *device_manage
if
(
!
settings_handler
.
get_id
(
devname
,
is_primary
,
&
settings_id
))
break
;
if
(
!
settings_handler
.
get_id
(
devname
,
is_primary
,
&
settings_id
))
break
;
settings_handler
.
get_current_mode
(
settings_id
,
&
current_mode
);
settings_handler
.
get_current_mode
(
settings_id
,
&
current_mode
);
if
(
settings_handler
.
get_modes
(
settings_id
,
EDS_ROTATEDMODE
,
&
modes
,
&
mode_count
))
if
(
settings_handler
.
get_modes
(
settings_id
,
EDS_ROTATEDMODE
,
&
modes
,
&
mode_count
,
FALSE
))
{
{
device_manager
->
add_modes
(
&
current_mode
,
mode_count
,
modes
,
param
);
device_manager
->
add_modes
(
&
current_mode
,
mode_count
,
modes
,
param
);
settings_handler
.
free_modes
(
modes
);
settings_handler
.
free_modes
(
modes
);
...
...
dlls/winex11.drv/x11drv.h
View file @
f74900ad
...
@@ -726,7 +726,7 @@ struct x11drv_settings_handler
...
@@ -726,7 +726,7 @@ struct x11drv_settings_handler
* dmDisplayFlags and dmDisplayFrequency
* dmDisplayFlags and dmDisplayFrequency
*
*
* Return FALSE on failure with parameters unchanged and error code set. Return TRUE on success */
* Return FALSE on failure with parameters unchanged and error code set. Return TRUE on success */
BOOL
(
*
get_modes
)(
x11drv_settings_id
id
,
DWORD
flags
,
DEVMODEW
**
modes
,
UINT
*
mode_count
);
BOOL
(
*
get_modes
)(
x11drv_settings_id
id
,
DWORD
flags
,
DEVMODEW
**
modes
,
UINT
*
mode_count
,
BOOL
full
);
/* free_modes() will be called to free the mode list returned from get_modes() */
/* free_modes() will be called to free the mode list returned from get_modes() */
void
(
*
free_modes
)(
DEVMODEW
*
modes
);
void
(
*
free_modes
)(
DEVMODEW
*
modes
);
...
@@ -747,6 +747,8 @@ struct x11drv_settings_handler
...
@@ -747,6 +747,8 @@ struct x11drv_settings_handler
LONG
(
*
set_current_mode
)(
x11drv_settings_id
id
,
const
DEVMODEW
*
mode
);
LONG
(
*
set_current_mode
)(
x11drv_settings_id
id
,
const
DEVMODEW
*
mode
);
};
};
#define NEXT_DEVMODEW(mode) ((DEVMODEW *)((char *)((mode) + 1) + (mode)->dmDriverExtra))
extern
void
X11DRV_Settings_SetHandler
(
const
struct
x11drv_settings_handler
*
handler
);
extern
void
X11DRV_Settings_SetHandler
(
const
struct
x11drv_settings_handler
*
handler
);
extern
void
X11DRV_init_desktop
(
Window
win
,
unsigned
int
width
,
unsigned
int
height
);
extern
void
X11DRV_init_desktop
(
Window
win
,
unsigned
int
width
,
unsigned
int
height
);
...
...
dlls/winex11.drv/xrandr.c
View file @
f74900ad
...
@@ -152,10 +152,10 @@ static BOOL xrandr10_get_id( const WCHAR *device_name, BOOL is_primary, x11drv_s
...
@@ -152,10 +152,10 @@ static BOOL xrandr10_get_id( const WCHAR *device_name, BOOL is_primary, x11drv_s
}
}
static
void
add_xrandr10_mode
(
DEVMODEW
*
mode
,
DWORD
depth
,
DWORD
width
,
DWORD
height
,
static
void
add_xrandr10_mode
(
DEVMODEW
*
mode
,
DWORD
depth
,
DWORD
width
,
DWORD
height
,
DWORD
frequency
,
SizeID
size_id
)
DWORD
frequency
,
SizeID
size_id
,
BOOL
full
)
{
{
mode
->
dmSize
=
sizeof
(
*
mode
);
mode
->
dmSize
=
sizeof
(
*
mode
);
mode
->
dmDriverExtra
=
sizeof
(
SizeID
)
;
mode
->
dmDriverExtra
=
full
?
sizeof
(
SizeID
)
:
0
;
mode
->
dmFields
=
DM_DISPLAYORIENTATION
|
DM_BITSPERPEL
|
DM_PELSWIDTH
|
mode
->
dmFields
=
DM_DISPLAYORIENTATION
|
DM_BITSPERPEL
|
DM_PELSWIDTH
|
DM_PELSHEIGHT
|
DM_DISPLAYFLAGS
;
DM_PELSHEIGHT
|
DM_DISPLAYFLAGS
;
if
(
frequency
)
if
(
frequency
)
...
@@ -168,10 +168,10 @@ static void add_xrandr10_mode( DEVMODEW *mode, DWORD depth, DWORD width, DWORD h
...
@@ -168,10 +168,10 @@ static void add_xrandr10_mode( DEVMODEW *mode, DWORD depth, DWORD width, DWORD h
mode
->
dmPelsWidth
=
width
;
mode
->
dmPelsWidth
=
width
;
mode
->
dmPelsHeight
=
height
;
mode
->
dmPelsHeight
=
height
;
mode
->
dmDisplayFlags
=
0
;
mode
->
dmDisplayFlags
=
0
;
memcpy
(
(
BYTE
*
)
mode
+
sizeof
(
*
mode
)
,
&
size_id
,
sizeof
(
size_id
)
);
if
(
full
)
memcpy
(
mode
+
1
,
&
size_id
,
sizeof
(
size_id
)
);
}
}
static
BOOL
xrandr10_get_modes
(
x11drv_settings_id
id
,
DWORD
flags
,
DEVMODEW
**
new_modes
,
UINT
*
new_mode_count
)
static
BOOL
xrandr10_get_modes
(
x11drv_settings_id
id
,
DWORD
flags
,
DEVMODEW
**
new_modes
,
UINT
*
new_mode_count
,
BOOL
full
)
{
{
INT
size_idx
,
depth_idx
,
rate_idx
,
mode_idx
=
0
;
INT
size_idx
,
depth_idx
,
rate_idx
,
mode_idx
=
0
;
INT
size_count
,
rate_count
,
mode_count
=
0
;
INT
size_count
,
rate_count
,
mode_count
=
0
;
...
@@ -201,24 +201,24 @@ static BOOL xrandr10_get_modes( x11drv_settings_id id, DWORD flags, DEVMODEW **n
...
@@ -201,24 +201,24 @@ static BOOL xrandr10_get_modes( x11drv_settings_id id, DWORD flags, DEVMODEW **n
return
FALSE
;
return
FALSE
;
}
}
for
(
size_idx
=
0
;
size_idx
<
size_count
;
++
size_idx
)
for
(
size_idx
=
0
,
mode
=
modes
;
size_idx
<
size_count
;
++
size_idx
)
{
{
for
(
depth_idx
=
0
;
depth_idx
<
DEPTH_COUNT
;
++
depth_idx
)
for
(
depth_idx
=
0
;
depth_idx
<
DEPTH_COUNT
;
++
depth_idx
)
{
{
rates
=
pXRRRates
(
gdi_display
,
DefaultScreen
(
gdi_display
),
size_idx
,
&
rate_count
);
rates
=
pXRRRates
(
gdi_display
,
DefaultScreen
(
gdi_display
),
size_idx
,
&
rate_count
);
if
(
!
rate_count
)
if
(
!
rate_count
)
{
{
mode
=
(
DEVMODEW
*
)((
BYTE
*
)
modes
+
(
sizeof
(
*
mode
)
+
sizeof
(
SizeID
))
*
mode_idx
++
);
add_xrandr10_mode
(
mode
,
depths
[
depth_idx
],
sizes
[
size_idx
].
width
,
add_xrandr10_mode
(
mode
,
depths
[
depth_idx
],
sizes
[
size_idx
].
width
,
sizes
[
size_idx
].
height
,
0
,
size_idx
);
sizes
[
size_idx
].
height
,
0
,
size_idx
,
full
);
mode
=
NEXT_DEVMODEW
(
mode
);
continue
;
continue
;
}
}
for
(
rate_idx
=
0
;
rate_idx
<
rate_count
;
++
rate_idx
)
for
(
rate_idx
=
0
;
rate_idx
<
rate_count
;
++
rate_idx
)
{
{
mode
=
(
DEVMODEW
*
)((
BYTE
*
)
modes
+
(
sizeof
(
*
mode
)
+
sizeof
(
SizeID
))
*
mode_idx
++
);
add_xrandr10_mode
(
mode
,
depths
[
depth_idx
],
sizes
[
size_idx
].
width
,
add_xrandr10_mode
(
mode
,
depths
[
depth_idx
],
sizes
[
size_idx
].
width
,
sizes
[
size_idx
].
height
,
rates
[
rate_idx
],
size_idx
);
sizes
[
size_idx
].
height
,
rates
[
rate_idx
],
size_idx
,
full
);
mode
=
NEXT_DEVMODEW
(
mode
);
}
}
}
}
}
}
...
@@ -1316,10 +1316,10 @@ static BOOL xrandr14_get_id( const WCHAR *device_name, BOOL is_primary, x11drv_s
...
@@ -1316,10 +1316,10 @@ static BOOL xrandr14_get_id( const WCHAR *device_name, BOOL is_primary, x11drv_s
}
}
static
void
add_xrandr14_mode
(
DEVMODEW
*
mode
,
XRRModeInfo
*
info
,
DWORD
depth
,
DWORD
frequency
,
static
void
add_xrandr14_mode
(
DEVMODEW
*
mode
,
XRRModeInfo
*
info
,
DWORD
depth
,
DWORD
frequency
,
DWORD
orientation
)
DWORD
orientation
,
BOOL
full
)
{
{
mode
->
dmSize
=
sizeof
(
*
mode
);
mode
->
dmSize
=
sizeof
(
*
mode
);
mode
->
dmDriverExtra
=
sizeof
(
RRMode
)
;
mode
->
dmDriverExtra
=
full
?
sizeof
(
RRMode
)
:
0
;
mode
->
dmFields
=
DM_DISPLAYORIENTATION
|
DM_BITSPERPEL
|
DM_PELSWIDTH
|
mode
->
dmFields
=
DM_DISPLAYORIENTATION
|
DM_BITSPERPEL
|
DM_PELSWIDTH
|
DM_PELSHEIGHT
|
DM_DISPLAYFLAGS
;
DM_PELSHEIGHT
|
DM_DISPLAYFLAGS
;
if
(
frequency
)
if
(
frequency
)
...
@@ -1340,10 +1340,10 @@ static void add_xrandr14_mode( DEVMODEW *mode, XRRModeInfo *info, DWORD depth, D
...
@@ -1340,10 +1340,10 @@ static void add_xrandr14_mode( DEVMODEW *mode, XRRModeInfo *info, DWORD depth, D
mode
->
dmDisplayOrientation
=
orientation
;
mode
->
dmDisplayOrientation
=
orientation
;
mode
->
dmBitsPerPel
=
depth
;
mode
->
dmBitsPerPel
=
depth
;
mode
->
dmDisplayFlags
=
0
;
mode
->
dmDisplayFlags
=
0
;
memcpy
(
(
BYTE
*
)
mode
+
sizeof
(
*
mode
)
,
&
info
->
id
,
sizeof
(
info
->
id
)
);
if
(
full
)
memcpy
(
mode
+
1
,
&
info
->
id
,
sizeof
(
info
->
id
)
);
}
}
static
BOOL
xrandr14_get_modes
(
x11drv_settings_id
id
,
DWORD
flags
,
DEVMODEW
**
new_modes
,
UINT
*
mode_count
)
static
BOOL
xrandr14_get_modes
(
x11drv_settings_id
id
,
DWORD
flags
,
DEVMODEW
**
new_modes
,
UINT
*
mode_count
,
BOOL
full
)
{
{
DWORD
frequency
,
orientation
,
orientation_count
;
DWORD
frequency
,
orientation
,
orientation_count
;
XRRScreenResources
*
screen_resources
;
XRRScreenResources
*
screen_resources
;
...
@@ -1415,7 +1415,7 @@ static BOOL xrandr14_get_modes( x11drv_settings_id id, DWORD flags, DEVMODEW **n
...
@@ -1415,7 +1415,7 @@ static BOOL xrandr14_get_modes( x11drv_settings_id id, DWORD flags, DEVMODEW **n
if
(
!
modes
)
if
(
!
modes
)
goto
done
;
goto
done
;
for
(
i
=
0
;
i
<
output_info
->
nmode
;
++
i
)
for
(
i
=
0
,
mode
=
modes
;
i
<
output_info
->
nmode
;
++
i
)
{
{
for
(
j
=
0
;
j
<
screen_resources
->
nmode
;
++
j
)
for
(
j
=
0
;
j
<
screen_resources
->
nmode
;
++
j
)
{
{
...
@@ -1432,8 +1432,8 @@ static BOOL xrandr14_get_modes( x11drv_settings_id id, DWORD flags, DEVMODEW **n
...
@@ -1432,8 +1432,8 @@ static BOOL xrandr14_get_modes( x11drv_settings_id id, DWORD flags, DEVMODEW **n
if
(
!
((
1
<<
orientation
)
&
rotations
))
if
(
!
((
1
<<
orientation
)
&
rotations
))
continue
;
continue
;
mode
=
(
DEVMODEW
*
)((
BYTE
*
)
modes
+
(
sizeof
(
*
modes
)
+
sizeof
(
RRMode
))
*
mode_idx
);
add_xrandr14_mode
(
mode
,
mode_info
,
depths
[
depth_idx
],
frequency
,
orientation
,
full
);
add_xrandr14_mode
(
mode
,
mode_info
,
depths
[
depth_idx
],
frequency
,
orientation
);
mode
=
NEXT_DEVMODEW
(
mode
);
++
mode_idx
;
++
mode_idx
;
}
}
}
}
...
...
dlls/winex11.drv/xvidmode.c
View file @
f74900ad
...
@@ -91,10 +91,10 @@ static BOOL xf86vm_get_id(const WCHAR *device_name, BOOL is_primary, x11drv_sett
...
@@ -91,10 +91,10 @@ static BOOL xf86vm_get_id(const WCHAR *device_name, BOOL is_primary, x11drv_sett
return
TRUE
;
return
TRUE
;
}
}
static
void
add_xf86vm_mode
(
DEVMODEW
*
mode
,
DWORD
depth
,
const
XF86VidModeModeInfo
*
mode_info
)
static
void
add_xf86vm_mode
(
DEVMODEW
*
mode
,
DWORD
depth
,
const
XF86VidModeModeInfo
*
mode_info
,
BOOL
full
)
{
{
mode
->
dmSize
=
sizeof
(
*
mode
);
mode
->
dmSize
=
sizeof
(
*
mode
);
mode
->
dmDriverExtra
=
sizeof
(
mode_info
)
;
mode
->
dmDriverExtra
=
full
?
sizeof
(
mode_info
)
:
0
;
mode
->
dmFields
=
DM_DISPLAYORIENTATION
|
DM_BITSPERPEL
|
DM_PELSWIDTH
|
DM_PELSHEIGHT
|
DM_DISPLAYFLAGS
;
mode
->
dmFields
=
DM_DISPLAYORIENTATION
|
DM_BITSPERPEL
|
DM_PELSWIDTH
|
DM_PELSHEIGHT
|
DM_DISPLAYFLAGS
;
if
(
mode_info
->
htotal
&&
mode_info
->
vtotal
)
if
(
mode_info
->
htotal
&&
mode_info
->
vtotal
)
{
{
...
@@ -106,10 +106,10 @@ static void add_xf86vm_mode(DEVMODEW *mode, DWORD depth, const XF86VidModeModeIn
...
@@ -106,10 +106,10 @@ static void add_xf86vm_mode(DEVMODEW *mode, DWORD depth, const XF86VidModeModeIn
mode
->
dmPelsWidth
=
mode_info
->
hdisplay
;
mode
->
dmPelsWidth
=
mode_info
->
hdisplay
;
mode
->
dmPelsHeight
=
mode_info
->
vdisplay
;
mode
->
dmPelsHeight
=
mode_info
->
vdisplay
;
mode
->
dmDisplayFlags
=
0
;
mode
->
dmDisplayFlags
=
0
;
memcpy
((
BYTE
*
)
mode
+
sizeof
(
*
mode
),
&
mode_info
,
sizeof
(
mode_info
)
);
if
(
full
)
memcpy
(
mode
+
1
,
&
mode_info
,
sizeof
(
mode_info
)
);
}
}
static
BOOL
xf86vm_get_modes
(
x11drv_settings_id
id
,
DWORD
flags
,
DEVMODEW
**
new_modes
,
UINT
*
mode_count
)
static
BOOL
xf86vm_get_modes
(
x11drv_settings_id
id
,
DWORD
flags
,
DEVMODEW
**
new_modes
,
UINT
*
mode_count
,
BOOL
full
)
{
{
INT
xf86vm_mode_idx
,
xf86vm_mode_count
;
INT
xf86vm_mode_idx
,
xf86vm_mode_count
;
XF86VidModeModeInfo
**
xf86vm_modes
;
XF86VidModeModeInfo
**
xf86vm_modes
;
...
@@ -139,12 +139,12 @@ static BOOL xf86vm_get_modes(x11drv_settings_id id, DWORD flags, DEVMODEW **new_
...
@@ -139,12 +139,12 @@ static BOOL xf86vm_get_modes(x11drv_settings_id id, DWORD flags, DEVMODEW **new_
memcpy
(
ptr
,
&
xf86vm_modes
,
sizeof
(
xf86vm_modes
));
memcpy
(
ptr
,
&
xf86vm_modes
,
sizeof
(
xf86vm_modes
));
modes
=
(
DEVMODEW
*
)(
ptr
+
sizeof
(
xf86vm_modes
));
modes
=
(
DEVMODEW
*
)(
ptr
+
sizeof
(
xf86vm_modes
));
for
(
depth_idx
=
0
;
depth_idx
<
DEPTH_COUNT
;
++
depth_idx
)
for
(
depth_idx
=
0
,
mode
=
modes
;
depth_idx
<
DEPTH_COUNT
;
++
depth_idx
)
{
{
for
(
xf86vm_mode_idx
=
0
;
xf86vm_mode_idx
<
xf86vm_mode_count
;
++
xf86vm_mode_idx
)
for
(
xf86vm_mode_idx
=
0
;
xf86vm_mode_idx
<
xf86vm_mode_count
;
++
xf86vm_mode_idx
)
{
{
mode
=
(
DEVMODEW
*
)((
BYTE
*
)
modes
+
(
sizeof
(
DEVMODEW
)
+
sizeof
(
XF86VidModeModeInfo
*
))
*
mode_idx
++
);
add_xf86vm_mode
(
mode
,
depths
[
depth_idx
],
xf86vm_modes
[
xf86vm_mode_idx
],
full
);
add_xf86vm_mode
(
mode
,
depths
[
depth_idx
],
xf86vm_modes
[
xf86vm_mode_idx
]
);
mode
=
NEXT_DEVMODEW
(
mode
);
}
}
}
}
...
...
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