diff options
author | Aaron Plattner <aplattner@nvidia.com> | 2006-07-10 18:58:09 -0700 |
---|---|---|
committer | Aaron Plattner <aplattner@nvidia.com> | 2006-07-26 15:48:51 -0700 |
commit | a4005c15fbb48231cb958c32b2c791a2d23a135a (patch) | |
tree | 247ce0d86b1f62e69f188ff352cd424bd032284b /fb/fbscreen.c | |
parent | 319efac445cebda5a2ac1db67efebe54bc47ba9d (diff) |
Add framebuffer access wrapper infrastructure.
Create fbPrepareAccess macros to call into the driver to set up the
wfbReadMemory and wfbWriteWemory pointers. Call these from fbGetDrawable and
fbGetStipDrawable.
Add the READ and WRITE macros, which expand to simple memory accesses for fb,
and calls through the function pointers for wfb.
Add fbFinishAccess macro to give the driver an opportunity to clean up. Add
calls to this in the appropriate places.
Diffstat (limited to 'fb/fbscreen.c')
-rw-r--r-- | fb/fbscreen.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/fb/fbscreen.c b/fb/fbscreen.c index b88375810..045ca8fd2 100644 --- a/fb/fbscreen.c +++ b/fb/fbscreen.c @@ -155,6 +155,19 @@ fbSetupScreen(ScreenPtr pScreen, return TRUE; } +#ifdef FB_ACCESS_WRAPPER +Bool +wfbFinishScreenInit(ScreenPtr pScreen, + pointer pbits, + int xsize, + int ysize, + int dpix, + int dpiy, + int width, + int bpp, + SetupWrapProcPtr setupWrap, + FinishWrapProcPtr finishWrap) +#else Bool fbFinishScreenInit(ScreenPtr pScreen, pointer pbits, @@ -164,6 +177,7 @@ fbFinishScreenInit(ScreenPtr pScreen, int dpiy, int width, int bpp) +#endif { VisualPtr visuals; DepthPtr depths; @@ -222,6 +236,10 @@ fbFinishScreenInit(ScreenPtr pScreen, fbGetScreenPrivate(pScreen)->win32bpp = 32; fbGetScreenPrivate(pScreen)->pix32bpp = 32; } +#ifdef FB_ACCESS_WRAPPER + fbGetScreenPrivate(pScreen)->setupWrap = setupWrap; + fbGetScreenPrivate(pScreen)->finishWrap = finishWrap; +#endif #endif rootdepth = 0; if (!fbInitVisuals (&visuals, &depths, &nvisuals, &ndepths, &rootdepth, @@ -256,6 +274,27 @@ fbFinishScreenInit(ScreenPtr pScreen, } /* dts * (inch/dot) * (25.4 mm / inch) = mm */ +#ifdef FB_ACCESS_WRAPPER +Bool +wfbScreenInit(ScreenPtr pScreen, + pointer pbits, + int xsize, + int ysize, + int dpix, + int dpiy, + int width, + int bpp, + SetupWrapProcPtr setupWrap, + FinishWrapProcPtr finishWrap) +{ + if (!fbSetupScreen(pScreen, pbits, xsize, ysize, dpix, dpiy, width, bpp)) + return FALSE; + if (!wfbFinishScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, + width, bpp, setupWrap, finishWrap)) + return FALSE; + return TRUE; +} +#else Bool fbScreenInit(ScreenPtr pScreen, pointer pbits, @@ -273,6 +312,7 @@ fbScreenInit(ScreenPtr pScreen, return FALSE; return TRUE; } +#endif #ifdef FB_OLD_SCREEN |