diff options
author | Søren Sandmann <ssp@redhat.com> | 2010-10-21 22:14:28 -0400 |
---|---|---|
committer | Søren Sandmann <ssp@redhat.com> | 2010-10-21 22:14:28 -0400 |
commit | ece8d39490ff8b8aa9d30a3bcf5ccbfe882c23c3 (patch) | |
tree | d0c181b67a8d76ea32cb567d63d5f6436b13bff3 | |
parent | b3ac7e6f6ad41a8140739e1a99cfd4e3c8a3353d (diff) |
Track the pixmap in the surface struct.
This is in preparation for making surfaces survives resets and mode
sets. To do that, we'll need to evacuate them out of video memory, and
then copy them back in. If some surface can't be reallocated, we'll
need to make sure it is removed from its corresponding surface.
-rw-r--r-- | src/qxl.h | 2 | ||||
-rw-r--r-- | src/qxl_driver.c | 2 | ||||
-rw-r--r-- | src/qxl_surface.c | 9 |
3 files changed, 13 insertions, 0 deletions
@@ -760,6 +760,8 @@ qxl_surface_t * qxl_surface_create (qxl_screen_t *qxl, int width, int height, int bpp); +void qxl_surface_set_pixmap (qxl_surface_t *surface, + PixmapPtr pixmap); /* Call this to ask the device to destroy the surface */ void qxl_surface_destroy (qxl_surface_t *surface); /* Call this when the notification comes back from the device diff --git a/src/qxl_driver.c b/src/qxl_driver.c index 3f3f99a..cb24921 100644 --- a/src/qxl_driver.c +++ b/src/qxl_driver.c @@ -668,6 +668,8 @@ qxl_create_pixmap (ScreenPtr screen, int w, int h, int depth, unsigned usage) NULL); set_surface (pixmap, surface); + + qxl_surface_set_pixmap (surface, pixmap); } else { diff --git a/src/qxl_surface.c b/src/qxl_surface.c index e02c17e..ade7ee3 100644 --- a/src/qxl_surface.c +++ b/src/qxl_surface.c @@ -19,6 +19,8 @@ struct qxl_surface_t int Bpp; int ref_count; + PixmapPtr pixmap; + union { qxl_surface_t *copy_src; @@ -90,6 +92,7 @@ surface_new (qxl_screen_t *qxl) result->next = NULL; result->in_use = TRUE; result->ref_count = 1; + result->pixmap = NULL; for (s = qxl->free_surfaces; s; s = s->next) { @@ -496,6 +499,12 @@ retry2: } void +qxl_surface_set_pixmap (qxl_surface_t *surface, PixmapPtr pixmap) +{ + surface->pixmap = pixmap; +} + +void qxl_surface_destroy (qxl_surface_t *surface) { qxl_screen_t *qxl = surface->qxl; |