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
3ea8de26
Commit
3ea8de26
authored
Jul 03, 2012
by
Henri Verbeet
Committed by
Alexandre Julliard
Jul 03, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11: Use our own structure for mode information.
parent
3509c891
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
73 additions
and
80 deletions
+73
-80
desktop.c
dlls/winex11.drv/desktop.c
+8
-9
settings.c
dlls/winex11.drv/settings.c
+23
-29
x11drv.h
dlls/winex11.drv/x11drv.h
+13
-6
xrandr.c
dlls/winex11.drv/xrandr.c
+16
-17
xvidmode.c
dlls/winex11.drv/xvidmode.c
+13
-18
xvidmode.h
dlls/winex11.drv/xvidmode.h
+0
-1
No files found.
dlls/winex11.drv/desktop.c
View file @
3ea8de26
...
...
@@ -26,13 +26,12 @@
/* avoid conflict with field names in included win32 headers */
#undef Status
#include "ddrawi.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
x11drv
);
/* data for resolution changing */
static
LPDDHALMODEINFO
dd_modes
;
static
struct
x11drv_mode_info
*
dd_modes
;
static
unsigned
int
dd_mode_count
;
static
unsigned
int
max_width
;
...
...
@@ -76,9 +75,9 @@ static int X11DRV_desktop_GetCurrentMode(void)
DWORD
dwBpp
=
screen_bpp
;
for
(
i
=
0
;
i
<
dd_mode_count
;
i
++
)
{
if
(
(
screen_width
==
dd_modes
[
i
].
dwW
idth
)
&&
(
screen_height
==
dd_modes
[
i
].
dwHeight
)
&&
(
dwBpp
==
dd_modes
[
i
].
dwBPP
))
if
(
(
screen_width
==
dd_modes
[
i
].
w
idth
)
&&
(
screen_height
==
dd_modes
[
i
].
height
)
&&
(
dwBpp
==
dd_modes
[
i
].
bpp
))
return
i
;
}
ERR
(
"In unknown mode, returning default
\n
"
);
...
...
@@ -88,17 +87,17 @@ static int X11DRV_desktop_GetCurrentMode(void)
static
LONG
X11DRV_desktop_SetCurrentMode
(
int
mode
)
{
DWORD
dwBpp
=
screen_bpp
;
if
(
dwBpp
!=
dd_modes
[
mode
].
dwBPP
)
if
(
dwBpp
!=
dd_modes
[
mode
].
bpp
)
{
FIXME
(
"Cannot change screen BPP from %d to %d
\n
"
,
dwBpp
,
dd_modes
[
mode
].
dwBPP
);
FIXME
(
"Cannot change screen BPP from %d to %d
\n
"
,
dwBpp
,
dd_modes
[
mode
].
bpp
);
/* Ignore the depth mismatch
*
* Some (older) applications require a specific bit depth, this will allow them
* to run. X11drv performs a color depth conversion if needed.
*/
}
TRACE
(
"Resizing Wine desktop window to %dx%d
\n
"
,
dd_modes
[
mode
].
dwWidth
,
dd_modes
[
mode
].
dwH
eight
);
X11DRV_resize_desktop
(
dd_modes
[
mode
].
dwWidth
,
dd_modes
[
mode
].
dwH
eight
);
TRACE
(
"Resizing Wine desktop window to %dx%d
\n
"
,
dd_modes
[
mode
].
width
,
dd_modes
[
mode
].
h
eight
);
X11DRV_resize_desktop
(
dd_modes
[
mode
].
width
,
dd_modes
[
mode
].
h
eight
);
return
DISP_CHANGE_SUCCESSFUL
;
}
...
...
dlls/winex11.drv/settings.c
View file @
3ea8de26
...
...
@@ -40,7 +40,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(x11settings);
* This is done because the array of DDHALMODEINFO structures must be
* created for use by DirectDraw anyway.
*/
static
LPDDHALMODEINFO
dd_modes
=
NULL
;
static
struct
x11drv_mode_info
*
dd_modes
=
NULL
;
static
unsigned
int
dd_mode_count
=
0
;
static
unsigned
int
dd_max_modes
=
0
;
/* All Windows drivers seen so far either support 32 bit depths, or 24 bit depths, but never both. So if we have
...
...
@@ -58,11 +58,11 @@ static const char *handler_name;
* Set the handlers for resolution changing functions
* and initialize the master list of modes
*/
LPDDHALMODEINFO
X11DRV_Settings_SetHandlers
(
const
char
*
name
,
int
(
*
pNewGCM
)(
void
),
LONG
(
*
pNewSCM
)(
int
),
unsigned
int
nmodes
,
int
reserve_depths
)
struct
x11drv_mode_info
*
X11DRV_Settings_SetHandlers
(
const
char
*
name
,
int
(
*
pNewGCM
)(
void
),
LONG
(
*
pNewSCM
)(
int
),
unsigned
int
nmodes
,
int
reserve_depths
)
{
handler_name
=
name
;
pGetCurrentMode
=
pNewGCM
;
...
...
@@ -79,7 +79,7 @@ LPDDHALMODEINFO X11DRV_Settings_SetHandlers(const char *name,
TRACE
(
"Destroying old display modes array
\n
"
);
HeapFree
(
GetProcessHeap
(),
0
,
dd_modes
);
}
dd_modes
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
DDHALMODEINFO
)
*
dd_max_modes
);
dd_modes
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
dd_modes
)
*
dd_max_modes
);
dd_mode_count
=
0
;
TRACE
(
"Initialized new display modes array
\n
"
);
return
dd_modes
;
...
...
@@ -88,7 +88,7 @@ LPDDHALMODEINFO X11DRV_Settings_SetHandlers(const char *name,
/* Add one mode to the master list */
void
X11DRV_Settings_AddOneMode
(
unsigned
int
width
,
unsigned
int
height
,
unsigned
int
bpp
,
unsigned
int
freq
)
{
LPDDHALMODEINFO
info
=
&
(
dd_modes
[
dd_mode_count
])
;
struct
x11drv_mode_info
*
info
=
&
dd_modes
[
dd_mode_count
]
;
DWORD
dwBpp
=
screen_bpp
;
if
(
dd_mode_count
>=
dd_max_modes
)
{
...
...
@@ -96,16 +96,10 @@ void X11DRV_Settings_AddOneMode(unsigned int width, unsigned int height, unsigne
return
;
}
if
(
bpp
==
0
)
bpp
=
dwBpp
;
info
->
dwWidth
=
width
;
info
->
dwHeight
=
height
;
info
->
wRefreshRate
=
freq
;
info
->
lPitch
=
0
;
info
->
dwBPP
=
bpp
;
info
->
wFlags
=
0
;
info
->
dwRBitMask
=
0
;
info
->
dwGBitMask
=
0
;
info
->
dwBBitMask
=
0
;
info
->
dwAlphaBitMask
=
0
;
info
->
width
=
width
;
info
->
height
=
height
;
info
->
refresh_rate
=
freq
;
info
->
bpp
=
bpp
;
TRACE
(
"initialized mode %d: %dx%dx%d @%d Hz (%s)
\n
"
,
dd_mode_count
,
width
,
height
,
bpp
,
freq
,
handler_name
);
dd_mode_count
++
;
...
...
@@ -125,8 +119,8 @@ void X11DRV_Settings_AddDepthModes(void)
{
for
(
i
=
0
;
i
<
existing_modes
;
i
++
)
{
X11DRV_Settings_AddOneMode
(
dd_modes
[
i
].
dwWidth
,
dd_modes
[
i
].
dwHeight
,
depths
[
j
],
dd_modes
[
i
].
wRefreshR
ate
);
X11DRV_Settings_AddOneMode
(
dd_modes
[
i
].
width
,
dd_modes
[
i
].
height
,
depths
[
j
],
dd_modes
[
i
].
refresh_r
ate
);
}
}
}
...
...
@@ -295,10 +289,10 @@ BOOL CDECL X11DRV_EnumDisplaySettingsEx( LPCWSTR name, DWORD n, LPDEVMODEW devmo
}
if
(
n
<
dd_mode_count
)
{
devmode
->
dmPelsWidth
=
dd_modes
[
n
].
dwW
idth
;
devmode
->
dmPelsHeight
=
dd_modes
[
n
].
dwH
eight
;
devmode
->
dmBitsPerPel
=
dd_modes
[
n
].
dwBPP
;
devmode
->
dmDisplayFrequency
=
dd_modes
[
n
].
wRefreshR
ate
;
devmode
->
dmPelsWidth
=
dd_modes
[
n
].
w
idth
;
devmode
->
dmPelsHeight
=
dd_modes
[
n
].
h
eight
;
devmode
->
dmBitsPerPel
=
dd_modes
[
n
].
bpp
;
devmode
->
dmDisplayFrequency
=
dd_modes
[
n
].
refresh_r
ate
;
devmode
->
dmFields
=
DM_PELSWIDTH
|
DM_PELSHEIGHT
|
DM_BITSPERPEL
|
DM_DISPLAYFLAGS
;
if
(
devmode
->
dmDisplayFrequency
)
...
...
@@ -401,23 +395,23 @@ LONG CDECL X11DRV_ChangeDisplaySettingsEx( LPCWSTR devname, LPDEVMODEW devmode,
{
if
(
devmode
->
dmFields
&
DM_BITSPERPEL
)
{
if
(
dwBpp
!=
dd_modes
[
i
].
dwBPP
)
if
(
dwBpp
!=
dd_modes
[
i
].
bpp
)
continue
;
}
if
(
devmode
->
dmFields
&
DM_PELSWIDTH
)
{
if
(
devmode
->
dmPelsWidth
!=
dd_modes
[
i
].
dwW
idth
)
if
(
devmode
->
dmPelsWidth
!=
dd_modes
[
i
].
w
idth
)
continue
;
}
if
(
devmode
->
dmFields
&
DM_PELSHEIGHT
)
{
if
(
devmode
->
dmPelsHeight
!=
dd_modes
[
i
].
dwH
eight
)
if
(
devmode
->
dmPelsHeight
!=
dd_modes
[
i
].
h
eight
)
continue
;
}
if
((
devmode
->
dmFields
&
DM_DISPLAYFREQUENCY
)
&&
(
dd_modes
[
i
].
wRefreshR
ate
!=
0
)
&&
if
((
devmode
->
dmFields
&
DM_DISPLAYFREQUENCY
)
&&
(
dd_modes
[
i
].
refresh_r
ate
!=
0
)
&&
devmode
->
dmDisplayFrequency
!=
0
)
{
if
(
devmode
->
dmDisplayFrequency
!=
dd_modes
[
i
].
wRefreshR
ate
)
if
(
devmode
->
dmDisplayFrequency
!=
dd_modes
[
i
].
refresh_r
ate
)
continue
;
}
/* we have a valid mode */
...
...
dlls/winex11.drv/x11drv.h
View file @
3ea8de26
...
...
@@ -56,7 +56,6 @@ typedef int Status;
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "ddrawi.h"
#include "wine/gdi_driver.h"
#include "wine/list.h"
...
...
@@ -643,17 +642,25 @@ extern int X11DRV_check_error(void) DECLSPEC_HIDDEN;
extern
void
X11DRV_X_to_window_rect
(
struct
x11drv_win_data
*
data
,
RECT
*
rect
)
DECLSPEC_HIDDEN
;
extern
void
xinerama_init
(
unsigned
int
width
,
unsigned
int
height
)
DECLSPEC_HIDDEN
;
struct
x11drv_mode_info
{
unsigned
int
width
;
unsigned
int
height
;
unsigned
int
bpp
;
unsigned
int
refresh_rate
;
};
extern
void
X11DRV_init_desktop
(
Window
win
,
unsigned
int
width
,
unsigned
int
height
)
DECLSPEC_HIDDEN
;
extern
void
X11DRV_resize_desktop
(
unsigned
int
width
,
unsigned
int
height
)
DECLSPEC_HIDDEN
;
extern
void
X11DRV_Settings_AddDepthModes
(
void
)
DECLSPEC_HIDDEN
;
extern
void
X11DRV_Settings_AddOneMode
(
unsigned
int
width
,
unsigned
int
height
,
unsigned
int
bpp
,
unsigned
int
freq
)
DECLSPEC_HIDDEN
;
unsigned
int
X11DRV_Settings_GetModeCount
(
void
)
DECLSPEC_HIDDEN
;
void
X11DRV_Settings_Init
(
void
)
DECLSPEC_HIDDEN
;
LPDDHALMODEINFO
X11DRV_Settings_SetHandlers
(
const
char
*
name
,
int
(
*
pNewGCM
)(
void
),
LONG
(
*
pNewSCM
)(
int
),
unsigned
int
nmodes
,
int
reserve_depths
)
DECLSPEC_HIDDEN
;
struct
x11drv_mode_info
*
X11DRV_Settings_SetHandlers
(
const
char
*
name
,
int
(
*
pNewGCM
)(
void
),
LONG
(
*
pNewSCM
)(
int
),
unsigned
int
nmodes
,
int
reserve_depths
)
DECLSPEC_HIDDEN
;
/* XIM support */
extern
BOOL
X11DRV_InitXIM
(
const
char
*
input_style
)
DECLSPEC_HIDDEN
;
...
...
dlls/winex11.drv/xrandr.c
View file @
3ea8de26
...
...
@@ -34,7 +34,6 @@
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "ddrawi.h"
#include "wine/library.h"
#include "wine/debug.h"
...
...
@@ -59,7 +58,7 @@ extern int usexrandr;
static
int
xrandr_event
,
xrandr_error
,
xrandr_major
,
xrandr_minor
;
static
LPDDHALMODEINFO
dd_modes
;
static
struct
x11drv_mode_info
*
dd_modes
;
static
unsigned
int
dd_mode_count
;
static
XRRScreenSize
*
real_xrandr_sizes
;
static
short
**
real_xrandr_rates
;
...
...
@@ -150,9 +149,9 @@ static int X11DRV_XRandR_GetCurrentMode(void)
wine_tsx11_unlock
();
for
(
i
=
0
;
i
<
real_xrandr_modes_count
;
i
++
)
{
if
(
(
dd_modes
[
i
].
dwWidth
==
real_xrandr_sizes
[
size
].
width
)
&&
(
dd_modes
[
i
].
dwHeight
==
real_xrandr_sizes
[
size
].
height
)
&&
(
dd_modes
[
i
].
wRefreshR
ate
==
rate
)
)
if
(
(
dd_modes
[
i
].
width
==
real_xrandr_sizes
[
size
].
width
)
&&
(
dd_modes
[
i
].
height
==
real_xrandr_sizes
[
size
].
height
)
&&
(
dd_modes
[
i
].
refresh_r
ate
==
rate
)
)
{
res
=
i
;
break
;
...
...
@@ -183,26 +182,26 @@ static LONG X11DRV_XRandR_SetCurrentMode(int mode)
size
=
pXRRConfigCurrentConfiguration
(
sc
,
&
rot
);
mode
=
mode
%
real_xrandr_modes_count
;
TRACE
(
"Changing Resolution to %dx%d @%d Hz
\n
"
,
dd_modes
[
mode
].
dwWidth
,
dd_modes
[
mode
].
dwHeight
,
dd_modes
[
mode
].
wRefreshR
ate
);
TRACE
(
"Changing Resolution to %dx%d @%d Hz
\n
"
,
dd_modes
[
mode
].
width
,
dd_modes
[
mode
].
height
,
dd_modes
[
mode
].
refresh_r
ate
);
for
(
i
=
0
;
i
<
real_xrandr_sizes_count
;
i
++
)
{
if
(
(
dd_modes
[
mode
].
dwWidth
==
real_xrandr_sizes
[
i
].
width
)
&&
(
dd_modes
[
mode
].
dwH
eight
==
real_xrandr_sizes
[
i
].
height
)
)
if
(
(
dd_modes
[
mode
].
width
==
real_xrandr_sizes
[
i
].
width
)
&&
(
dd_modes
[
mode
].
h
eight
==
real_xrandr_sizes
[
i
].
height
)
)
{
size
=
i
;
if
(
real_xrandr_rates_count
[
i
])
{
for
(
j
=
0
;
j
<
real_xrandr_rates_count
[
i
];
j
++
)
{
if
(
dd_modes
[
mode
].
wRefreshR
ate
==
real_xrandr_rates
[
i
][
j
])
if
(
dd_modes
[
mode
].
refresh_r
ate
==
real_xrandr_rates
[
i
][
j
])
{
rate
=
real_xrandr_rates
[
i
][
j
];
TRACE
(
"Resizing X display to %dx%d @%d Hz
\n
"
,
dd_modes
[
mode
].
dwWidth
,
dd_modes
[
mode
].
dwH
eight
,
rate
);
TRACE
(
"Resizing X display to %dx%d @%d Hz
\n
"
,
dd_modes
[
mode
].
width
,
dd_modes
[
mode
].
h
eight
,
rate
);
stat
=
pXRRSetScreenConfigAndRate
(
gdi_display
,
sc
,
root
,
size
,
rot
,
rate
,
CurrentTime
);
break
;
...
...
@@ -211,8 +210,8 @@ static LONG X11DRV_XRandR_SetCurrentMode(int mode)
}
else
{
TRACE
(
"Resizing X display to %dx%d <default Hz>
\n
"
,
dd_modes
[
mode
].
dwWidth
,
dd_modes
[
mode
].
dwH
eight
);
TRACE
(
"Resizing X display to %dx%d <default Hz>
\n
"
,
dd_modes
[
mode
].
width
,
dd_modes
[
mode
].
h
eight
);
stat
=
pXRRSetScreenConfig
(
gdi_display
,
sc
,
root
,
size
,
rot
,
CurrentTime
);
}
break
;
...
...
@@ -222,7 +221,7 @@ static LONG X11DRV_XRandR_SetCurrentMode(int mode)
wine_tsx11_unlock
();
if
(
stat
==
RRSetConfigSuccess
)
{
X11DRV_resize_desktop
(
dd_modes
[
mode
].
dwWidth
,
dd_modes
[
mode
].
dwH
eight
);
X11DRV_resize_desktop
(
dd_modes
[
mode
].
width
,
dd_modes
[
mode
].
h
eight
);
return
DISP_CHANGE_SUCCESSFUL
;
}
...
...
dlls/winex11.drv/xvidmode.c
View file @
3ea8de26
...
...
@@ -55,7 +55,7 @@ static int xf86vm_gammaramp_size;
static
BOOL
xf86vm_use_gammaramp
;
#endif
/* X_XF86VidModeSetGammaRamp */
static
LPDDHALMODEINFO
dd_modes
;
static
struct
x11drv_mode_info
*
dd_modes
;
static
unsigned
int
dd_mode_count
;
static
XF86VidModeModeInfo
**
real_xf86vm_modes
;
static
unsigned
int
real_xf86vm_mode_count
;
...
...
@@ -90,23 +90,18 @@ static void convert_modeinfo( const XF86VidModeModeInfo *mode)
X11DRV_Settings_AddOneMode
(
mode
->
hdisplay
,
mode
->
vdisplay
,
0
,
rate
);
}
static
void
convert_modeline
(
int
dotclock
,
const
XF86VidModeModeLine
*
mode
,
LPDDHALMODEINFO
info
,
unsigned
int
bpp
)
static
void
convert_modeline
(
int
dotclock
,
const
XF86VidModeModeLine
*
mode
,
struct
x11drv_mode_info
*
info
,
unsigned
int
bpp
)
{
info
->
dwWidth
=
mode
->
hdisplay
;
info
->
dwHeight
=
mode
->
vdisplay
;
info
->
width
=
mode
->
hdisplay
;
info
->
height
=
mode
->
vdisplay
;
if
(
mode
->
htotal
!=
0
&&
mode
->
vtotal
!=
0
)
info
->
wRefreshR
ate
=
dotclock
*
1000
/
(
mode
->
htotal
*
mode
->
vtotal
);
info
->
refresh_r
ate
=
dotclock
*
1000
/
(
mode
->
htotal
*
mode
->
vtotal
);
else
info
->
wRefreshR
ate
=
0
;
info
->
refresh_r
ate
=
0
;
TRACE
(
" width=%d, height=%d, refresh=%d
\n
"
,
info
->
dwWidth
,
info
->
dwHeight
,
info
->
wRefreshRate
);
info
->
lPitch
=
0
;
info
->
dwBPP
=
bpp
;
info
->
wFlags
=
0
;
info
->
dwRBitMask
=
0
;
info
->
dwGBitMask
=
0
;
info
->
dwBBitMask
=
0
;
info
->
dwAlphaBitMask
=
0
;
info
->
width
,
info
->
height
,
info
->
refresh_rate
);
info
->
bpp
=
bpp
;
}
static
int
XVidModeErrorHandler
(
Display
*
dpy
,
XErrorEvent
*
event
,
void
*
arg
)
...
...
@@ -119,7 +114,7 @@ static int X11DRV_XF86VM_GetCurrentMode(void)
XF86VidModeModeLine
line
;
int
dotclock
;
unsigned
int
i
;
DDHALMODEINFO
cmode
;
struct
x11drv_mode_info
cmode
;
DWORD
dwBpp
=
screen_bpp
;
TRACE
(
"Querying XVidMode current mode
\n
"
);
...
...
@@ -140,9 +135,9 @@ static LONG X11DRV_XF86VM_SetCurrentMode(int mode)
{
DWORD
dwBpp
=
screen_bpp
;
/* only set modes from the original color depth */
if
(
dwBpp
!=
dd_modes
[
mode
].
dwBPP
)
if
(
dwBpp
!=
dd_modes
[
mode
].
bpp
)
{
FIXME
(
"Cannot change screen BPP from %d to %d
\n
"
,
dwBpp
,
dd_modes
[
mode
].
dwBPP
);
FIXME
(
"Cannot change screen BPP from %d to %d
\n
"
,
dwBpp
,
dd_modes
[
mode
].
bpp
);
}
mode
=
mode
%
real_xf86vm_mode_count
;
...
...
@@ -240,7 +235,7 @@ void X11DRV_XF86VM_Init(void)
X11DRV_XF86VM_SetCurrentMode
,
nmodes
,
1
);
/* convert modes to
DDHALMODEINFO
format */
/* convert modes to
x11drv_mode_info
format */
for
(
i
=
0
;
i
<
real_xf86vm_mode_count
;
i
++
)
{
convert_modeinfo
(
real_xf86vm_modes
[
i
]);
...
...
dlls/winex11.drv/xvidmode.h
View file @
3ea8de26
...
...
@@ -29,7 +29,6 @@
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "ddrawi.h"
void
X11DRV_XF86VM_Init
(
void
)
DECLSPEC_HIDDEN
;
void
X11DRV_XF86VM_Cleanup
(
void
)
DECLSPEC_HIDDEN
;
...
...
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