Commit 53932b38 authored by Dave Airlie's avatar Dave Airlie Committed by Dave Airlie
Browse files

xf86: add helper functions to convert to from ScrnInfoPtr/ScreenPtr (v2)

These are just simple functions that we should start migrating drivers
to using.

The end goal is to remove xf86Screens and screenInfo from the ABI.

This includes a define XF86_HAS_SCRN_CONV that drivers can ifdef to provide
their own copies. I'll probably post a generic compat.h file for drivers later.

v2: add asserts.
Reviewed-by: Aaron Plattner's avatarAaron Plattner <>
Reviewed-by: Keith Packard's avatarKeith Packard <>
Signed-off-by: default avatarDave Airlie <>
parent 39f73e81
......@@ -449,6 +449,13 @@ xf86RandRSetNewVirtualAndDimensions(ScreenPtr pScreen,
extern _X_EXPORT Bool
VidModeExtensionInit(ScreenPtr pScreen);
/* convert ScreenPtr to ScrnInfoPtr */
extern _X_EXPORT ScrnInfoPtr xf86ScreenToScrn(ScreenPtr pScreen);
/* convert ScrnInfoPtr to ScreenPtr */
extern _X_EXPORT ScreenPtr xf86ScrnToScreen(ScrnInfoPtr pScrn);
#endif /* _NO_XF86_PROTOTYPES */
#define XF86_HAS_SCRN_CONV 1 /* define for drivers to use in api compat */
#endif /* _XF86_H */
......@@ -1834,3 +1834,17 @@ xf86MotionHistoryAllocate(InputInfoPtr pInfo)
xf86ScreenToScrn(ScreenPtr pScreen)
assert(pScreen->myNum < xf86NumScreens);
return xf86Screens[pScreen->myNum];
xf86ScrnToScreen(ScrnInfoPtr pScrn)
assert(pScrn->scrnIndex < screenInfo.numScreens);
return screenInfo.screens[pScrn->scrnIndex];
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment