diff options
author | Maarten Maathuis <madman2003@gmail.com> | 2008-11-29 14:30:55 +0100 |
---|---|---|
committer | Maarten Maathuis <madman2003@gmail.com> | 2008-11-29 14:30:55 +0100 |
commit | ffb484f7ef84099019b196ef97bfb2355eb6d52a (patch) | |
tree | 420da6447a7b1d311b6a77306821bc4d06fe08dc | |
parent | 01eaebdc98f30fdf543af6337cdf012d3ff16f09 (diff) |
randr: Avoid needlessly creating a shadow framebuffer.
- pScreen->width and height were zero, so it didn't "fit" the screen.
-rw-r--r-- | hw/xfree86/modes/xf86Crtc.c | 13 | ||||
-rw-r--r-- | hw/xfree86/modes/xf86Rotate.c | 2 |
2 files changed, 12 insertions, 3 deletions
diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c index e9652e1cb..6a3731c7c 100644 --- a/hw/xfree86/modes/xf86Crtc.c +++ b/hw/xfree86/modes/xf86Crtc.c | |||
@@ -112,6 +112,8 @@ xf86CrtcCreate (ScrnInfoPtr scrn, | |||
112 | crtc->filter_width = 0; | 112 | crtc->filter_width = 0; |
113 | crtc->filter_height = 0; | 113 | crtc->filter_height = 0; |
114 | crtc->transform_in_use = FALSE; | 114 | crtc->transform_in_use = FALSE; |
115 | crtc->transformPresent = FALSE; | ||
116 | crtc->desiredTransformPresent = FALSE; | ||
115 | memset (&crtc->bounds, '\0', sizeof (crtc->bounds)); | 117 | memset (&crtc->bounds, '\0', sizeof (crtc->bounds)); |
116 | 118 | ||
117 | if (xf86_config->crtc) | 119 | if (xf86_config->crtc) |
@@ -241,6 +243,8 @@ xf86CrtcSetModeTransform (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotati | |||
241 | RRTransformPtr transform, int x, int y) | 243 | RRTransformPtr transform, int x, int y) |
242 | { | 244 | { |
243 | ScrnInfoPtr scrn = crtc->scrn; | 245 | ScrnInfoPtr scrn = crtc->scrn; |
246 | /* During ScreenInit() scrn->pScreen is still NULL */ | ||
247 | ScreenPtr pScreen = screenInfo.screens[scrn->scrnIndex]; | ||
244 | xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); | 248 | xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); |
245 | int i; | 249 | int i; |
246 | Bool ret = FALSE; | 250 | Bool ret = FALSE; |
@@ -254,9 +258,9 @@ xf86CrtcSetModeTransform (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotati | |||
254 | 258 | ||
255 | if (crtc->funcs->set_mode_major) | 259 | if (crtc->funcs->set_mode_major) |
256 | return crtc->funcs->set_mode_major(crtc, mode, rotation, x, y); | 260 | return crtc->funcs->set_mode_major(crtc, mode, rotation, x, y); |
257 | 261 | ||
258 | crtc->enabled = xf86CrtcInUse (crtc); | 262 | crtc->enabled = xf86CrtcInUse (crtc); |
259 | 263 | ||
260 | if (!crtc->enabled) | 264 | if (!crtc->enabled) |
261 | { | 265 | { |
262 | /* XXX disable crtc? */ | 266 | /* XXX disable crtc? */ |
@@ -290,6 +294,11 @@ xf86CrtcSetModeTransform (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotati | |||
290 | } else | 294 | } else |
291 | crtc->transformPresent = FALSE; | 295 | crtc->transformPresent = FALSE; |
292 | 296 | ||
297 | /* xf86CrtcFitsScreen() relies on these values being correct. */ | ||
298 | /* This should ensure the values are always set at modeset time. */ | ||
299 | pScreen->width = scrn->virtualX; | ||
300 | pScreen->height = scrn->virtualY; | ||
301 | |||
293 | /* Shift offsets that move us out of virtual size */ | 302 | /* Shift offsets that move us out of virtual size */ |
294 | if (x + mode->HDisplay > xf86_config->maxWidth || | 303 | if (x + mode->HDisplay > xf86_config->maxWidth || |
295 | y + mode->VDisplay > xf86_config->maxHeight) | 304 | y + mode->VDisplay > xf86_config->maxHeight) |
diff --git a/hw/xfree86/modes/xf86Rotate.c b/hw/xfree86/modes/xf86Rotate.c index 07189a5ba..d7f7b3b78 100644 --- a/hw/xfree86/modes/xf86Rotate.c +++ b/hw/xfree86/modes/xf86Rotate.c | |||
@@ -464,7 +464,7 @@ xf86CrtcRotate (xf86CrtcPtr crtc) | |||
464 | /* mark shadowed area as damaged so it will be repainted */ | 464 | /* mark shadowed area as damaged so it will be repainted */ |
465 | xf86CrtcDamageShadow (crtc); | 465 | xf86CrtcDamageShadow (crtc); |
466 | } | 466 | } |
467 | 467 | ||
468 | if (!xf86_config->rotation_damage) | 468 | if (!xf86_config->rotation_damage) |
469 | { | 469 | { |
470 | /* Create damage structure */ | 470 | /* Create damage structure */ |