diff options
author | Keith Packard <keithp@keithp.com> | 2012-07-03 15:45:09 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2012-07-05 13:39:50 -0700 |
commit | 9d457f9c55f12106ba44c1c9db59d14f978f0ae8 (patch) | |
tree | 6b323ee38f55cdfd6d8b40b6e0ac40618c11430d /dix/window.c | |
parent | ed6daa15a7dcf8dba930f67401f4c1c8ca2e6fac (diff) |
Add screen-specific privates.
Screen-specific privates areas are only allocated for objects related
to the target screen; objects allocated for other screens will not
have the private space reserved. This saves memory in these objects
while also allowing hot-plug screens to have additional private
allocation space beyond what the core screens are using.
Drivers are encouraged to switch to this mechanism as it will reduce
memory usage in multi-GPU environments, but it is only required for
drivers which will be loaded after the server starts, like
modesetting.
Objects providing screen-specific privates *must* be managed by the
screen-specific private API when allocating or initializing privates
so that the per-screen area can be initialized properly.
The objects which support screen-specific privates are:
Windows
Pixmaps
GCs
Pictures
Extending this list to include Colormaps would be possible, but
require slightly more work as the default colormap is created before
all colormap privates are allocated during server startup, and hence
gets a bunch of special treatment.
Of particular note, glyphs are *not* capable of supporting
screen-specific privates as they are global objects, not allocated on
a screen-specific basis, and so each driver must be able to see their
privates within the glyph.
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'dix/window.c')
-rw-r--r-- | dix/window.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/dix/window.c b/dix/window.c index 5cc3a502d..b66080830 100644 --- a/dix/window.c +++ b/dix/window.c @@ -446,7 +446,7 @@ CreateRootWindow(ScreenPtr pScreen) BoxRec box; PixmapFormatRec *format; - pWin = dixAllocateObjectWithPrivates(WindowRec, PRIVATE_WINDOW); + pWin = dixAllocateScreenObjectWithPrivates(pScreen, WindowRec, PRIVATE_WINDOW); if (!pWin) return FALSE; @@ -710,7 +710,7 @@ CreateWindow(Window wid, WindowPtr pParent, int x, int y, unsigned w, return NullWindow; } - pWin = dixAllocateObjectWithPrivates(WindowRec, PRIVATE_WINDOW); + pWin = dixAllocateScreenObjectWithPrivates(pScreen, WindowRec, PRIVATE_WINDOW); if (!pWin) { *error = BadAlloc; return NullWindow; |