Bogus mode rewriting in xf86Crtc.c
Submitted by Søren Sandmann Pedersen
Assigned to Xorg Project Team
Description
In xf86CrtcSetMode() there is this passage:
/* Shift offsets that move us out of virtual size */
if (x + mode->HDisplay > xf86_config->maxWidth ||
y + mode->VDisplay > xf86_config->maxHeight)
{
if (x + mode->HDisplay > xf86_config->maxWidth)
crtc->x = xf86_config->maxWidth - mode->HDisplay;
if (y + mode->VDisplay > xf86_config->maxHeight)
crtc->y = xf86_config->maxHeight - mode->VDisplay;
if (crtc->x < 0 || crtc->y < 0)
{
xf86DrvMsg (scrn->scrnIndex, X_ERROR,
"Mode %dx%d does not fit virtual size %dx%d - "
"internal error\n", mode->HDisplay, mode->VDisplay,
xf86_config->maxWidth, xf86_config->maxHeight);
goto done;
}
xf86DrvMsg (scrn->scrnIndex, X_ERROR,
"Mode %dx%d+%d+%d does not fit virtual size %dx%d - "
"offset updated to +%d+%d\n",
mode->HDisplay, mode->VDisplay, x, y,
xf86_config->maxWidth, xf86_config->maxHeight,
crtc->x, crtc->y);
}
This is incorrect because it doesn't take rotation into account, but it's also bogus since if it can't set the right mode, it should just fail instead of silently changing it to something else.
I suggest deleting it altogether.