[PATCH] randr: prevent an unnecessary screen resize with multiple displays
Dave Airlie
airlied at gmail.com
Sun Jun 6 18:59:01 PDT 2010
On Mon, Jun 7, 2010 at 10:21 AM, Ben Skeggs <skeggsb at gmail.com> wrote:
> From: Ben Skeggs <bskeggs at redhat.com>
>
> crtc->{x,y} is always 0 when xf86DefaultScreenLimits() is called, so we
> calculate too small an area for the initial framebuffer and force a resize
> to happen.
>
> This commit fixes the code to use desired{X,Y} instead, which contains the
> initial output positions.
>
> Signed-off-by: Ben Skeggs <bskeggs at redhat.com>
I was always blaming something architectural and never tracked this
down properly, so this looks good and sane, and will help low VRAM
machines not fragment on startup.
Reviewed-by: Dave Airlie <airlied at redhat.com>
> ---
> hw/xfree86/modes/xf86Crtc.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
> index 304d503..cd978ae 100644
> --- a/hw/xfree86/modes/xf86Crtc.c
> +++ b/hw/xfree86/modes/xf86Crtc.c
> @@ -1038,8 +1038,8 @@ xf86DefaultScreenLimits (ScrnInfoPtr scrn, int *widthp, int *heightp,
>
> if (crtc->enabled)
> {
> - crtc_width = crtc->x + xf86ModeWidth (&crtc->desiredMode, crtc->desiredRotation);
> - crtc_height = crtc->y + xf86ModeHeight (&crtc->desiredMode, crtc->desiredRotation);
> + crtc_width = crtc->desiredX + xf86ModeWidth (&crtc->desiredMode, crtc->desiredRotation);
> + crtc_height = crtc->desiredY + xf86ModeHeight (&crtc->desiredMode, crtc->desiredRotation);
> }
> if (!canGrow) {
> for (o = 0; o < config->num_output; o++)
> --
> 1.7.0.1
>
> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: http://lists.x.org/mailman/listinfo/xorg-devel
>
More information about the xorg-devel
mailing list