summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-08-25 14:49:30 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2011-08-25 14:50:37 +0100
commitbd98001a49be061f0f2cb008b515f5505c8a63a4 (patch)
tree3d9c76939edaafef7d82694375d27ff08c7aba98
parent0865acb3ad03239ffdf8cbf3c9fc204b6c97121b (diff)
sna: Clear structures across server reset
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/kgem.c2
-rw-r--r--src/sna/sna_driver.c10
-rw-r--r--src/sna/sna_render.c2
3 files changed, 7 insertions, 7 deletions
diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index afd2a09f..061ca744 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -310,9 +310,7 @@ void kgem_init(struct kgem *kgem, int fd, struct pci_device *dev, int gen)
struct drm_i915_gem_get_aperture aperture;
int i;
- /* We presume we are partt of a zeroed structure
memset(kgem, 0, sizeof(*kgem));
- */
kgem->fd = fd;
kgem->gen = gen;
diff --git a/src/sna/sna_driver.c b/src/sna/sna_driver.c
index 6274a3fc..107659b8 100644
--- a/src/sna/sna_driver.c
+++ b/src/sna/sna_driver.c
@@ -745,11 +745,7 @@ static Bool sna_close_screen(int scrnIndex, ScreenPtr screen)
xf86_cursors_fini(screen);
/* XXX unhook devPrivate otherwise fbCloseScreen frees it! */
- if (sna->front) {
- screen->DestroyPixmap(sna->front);
- sna->front = NULL;
- screen->devPrivate = NULL;
- }
+ screen->devPrivate = NULL;
screen->CloseScreen = sna->CloseScreen;
(*screen->CloseScreen) (scrnIndex, screen);
@@ -760,6 +756,10 @@ static Bool sna_close_screen(int scrnIndex, ScreenPtr screen)
}
sna_mode_remove_fb(sna);
+ if (sna->front) {
+ screen->DestroyPixmap(sna->front);
+ sna->front = NULL;
+ }
xf86GARTCloseScreen(scrnIndex);
scrn->vtSema = FALSE;
diff --git a/src/sna/sna_render.c b/src/sna/sna_render.c
index 41e76941..4a38f390 100644
--- a/src/sna/sna_render.c
+++ b/src/sna/sna_render.c
@@ -200,6 +200,8 @@ void no_render_init(struct sna *sna)
{
struct sna_render *render = &sna->render;
+ memset (render,0, sizeof (*render));
+
render->composite = no_render_composite;
render->copy_boxes = no_render_copy_boxes;