1
commit 3e28a0c0b43823d3104fe8fc50b5994b41fc0cc1
2
Author: Chris Wilson <chris@chris-wilson.co.uk>
3
Date: Thu Jan 20 15:07:26 2011 +0000
5
Create the UXA generational resources during screen create
7
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
9
diff --git a/src/intel.h b/src/intel.h
10
index e7c47db..4c755fc 100644
13
@@ -661,7 +661,7 @@ static inline Bool pixmap_is_scanout(PixmapPtr pixmap)
14
const OptionInfoRec *intel_uxa_available_options(int chipid, int busid);
16
Bool intel_uxa_init(ScreenPtr pScreen);
17
-void intel_uxa_create_screen_resources(ScreenPtr pScreen);
18
+Bool intel_uxa_create_screen_resources(ScreenPtr pScreen);
19
void intel_uxa_block_handler(intel_screen_private *intel);
20
Bool intel_get_aperture_space(ScrnInfoPtr scrn, drm_intel_bo ** bo_table,
22
diff --git a/src/intel_driver.c b/src/intel_driver.c
23
index 2cd5f1f..ebed258 100644
24
--- a/src/intel_driver.c
25
+++ b/src/intel_driver.c
26
@@ -234,9 +234,7 @@ static Bool i830CreateScreenResources(ScreenPtr screen)
27
if (!(*screen->CreateScreenResources) (screen))
30
- intel_uxa_create_screen_resources(screen);
33
+ return intel_uxa_create_screen_resources(screen);
36
static void PreInitCleanup(ScrnInfoPtr scrn)
37
@@ -1046,7 +1044,7 @@ I830ScreenInit(int scrnIndex, ScreenPtr screen, int argc, char **argv)
41
- return uxa_resources_init(screen);
45
static void i830AdjustFrame(int scrnIndex, int x, int y, int flags)
46
diff --git a/src/intel_uxa.c b/src/intel_uxa.c
47
index 8f58c29..9341b91 100644
50
@@ -1089,12 +1089,15 @@ static Bool intel_uxa_destroy_pixmap(PixmapPtr pixmap)
54
-void intel_uxa_create_screen_resources(ScreenPtr screen)
55
+Bool intel_uxa_create_screen_resources(ScreenPtr screen)
57
ScrnInfoPtr scrn = xf86Screens[screen->myNum];
58
intel_screen_private *intel = intel_get_screen_private(scrn);
59
dri_bo *bo = intel->front_buffer;
61
+ if (!uxa_resources_init(screen))
64
drm_intel_gem_bo_map_gtt(bo);
66
if (intel->use_shadow) {
67
@@ -1111,6 +1114,8 @@ void intel_uxa_create_screen_resources(ScreenPtr screen)
69
scrn->displayWidth = intel->front_pitch / intel->cpp;
77
From c6dc27562abbc8ca9e873ad502ca49ae010461d2 Mon Sep 17 00:00:00 2001
78
From: Chris Wilson <chris@chris-wilson.co.uk>
79
Date: Mon, 24 Jan 2011 20:25:27 +0000
80
Subject: uxa: Only recreate the glyph cache on *generational* updates
82
The screen resources are recreated when the screen is rotated as well,
83
without being finalized. In this case, we do not need to reconstuct the
84
cache (or if we did, we would need to tear it down first).
86
Reported-by: Till Matthiesen <entropy@everymail.net>
87
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=33412
88
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
90
diff --git a/uxa/uxa-glyphs.c b/uxa/uxa-glyphs.c
91
index 420e891..0f5ddda 100644
92
--- a/uxa/uxa-glyphs.c
93
+++ b/uxa/uxa-glyphs.c
94
@@ -111,6 +111,9 @@ static void uxa_unrealize_glyph_caches(ScreenPtr pScreen)
95
uxa_screen_t *uxa_screen = uxa_get_screen(pScreen);
98
+ if (!uxa_screen->glyph_cache_initialized)
101
for (i = 0; i < UXA_NUM_GLYPH_CACHE_FORMATS; i++) {
102
uxa_glyph_cache_t *cache = &uxa_screen->glyphCaches[i];
104
@@ -120,6 +123,7 @@ static void uxa_unrealize_glyph_caches(ScreenPtr pScreen)
108
+ uxa_screen->glyph_cache_initialized = FALSE;
111
void uxa_glyphs_fini(ScreenPtr pScreen)
112
@@ -145,6 +149,10 @@ static Bool uxa_realize_glyph_caches(ScreenPtr pScreen)
116
+ if (uxa_screen->glyph_cache_initialized)
119
+ uxa_screen->glyph_cache_initialized = TRUE;
120
memset(uxa_screen->glyphCaches, 0, sizeof(uxa_screen->glyphCaches));
122
for (i = 0; i < sizeof(formats)/sizeof(formats[0]); i++) {
123
@@ -214,17 +222,7 @@ Bool uxa_glyphs_init(ScreenPtr pScreen)
124
if (uxa_get_screen(pScreen)->force_fallback)
127
- /* We are trying to initialise per screen resources prior to the
128
- * complete initialisation of the screen. So ensure the components
129
- * that we depend upon are initialsed prior to our use.
131
- if (!CreateScratchPixmapsForScreen(pScreen->myNum))
134
- if (!uxa_realize_glyph_caches(pScreen))
138
+ return uxa_realize_glyph_caches(pScreen);
141
/* The most efficient thing to way to upload the glyph to the screen
142
diff --git a/uxa/uxa-priv.h b/uxa/uxa-priv.h
143
index 92536cc..ac206af 100644
146
@@ -139,6 +139,7 @@ typedef struct {
147
unsigned offScreenCounter;
149
uxa_glyph_cache_t glyphCaches[UXA_NUM_GLYPH_CACHE_FORMATS];
150
+ Bool glyph_cache_initialized;
152
PicturePtr solid_clear, solid_black, solid_white;
153
uxa_solid_cache_t solid_cache[UXA_NUM_SOLID_CACHE];