--- wsfb_driver.c.orig Mon Feb 13 11:42:47 2006 +++ wsfb_driver.c Mon Feb 13 13:04:12 2006 @@ -596,24 +596,34 @@ mode->status = MODE_OK; mode->type = M_T_BUILTIN; mode->Clock = 0; - mode->HDisplay = fPtr->info.width; mode->HSyncStart = 0; mode->HSyncEnd = 0; mode->HTotal = 0; mode->HSkew = 0; - mode->VDisplay = fPtr->info.height; mode->VSyncStart = 0; mode->VSyncEnd = 0; mode->VTotal = 0; mode->VScan = 0; mode->Flags = 0; + + /* Handle display mode co-ordinate rotation here */ + if (fPtr->rotate == WSFB_ROTATE_CW || fPtr->rotate == WSFB_ROTATE_CCW) { + + /* Swap co-ordinates in original frame buffer structure so that references are consistent */ + mode->HDisplay = fPtr->info.height; + mode->VDisplay = fPtr->info.width; + } else { + mode->HDisplay = fPtr->info.width; + mode->VDisplay = fPtr->info.height; + } + if (pScrn->modes != NULL) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Ignoring mode specification from screen section\n"); } pScrn->currentMode = pScrn->modes = mode; - pScrn->virtualX = fPtr->info.width; - pScrn->virtualY = fPtr->info.height; + pScrn->virtualX = mode->HDisplay; + pScrn->virtualY = mode->VDisplay; pScrn->displayWidth = pScrn->virtualX; /* Set the display resolution */ @@ -739,14 +749,9 @@ if (!miSetPixmapDepths()) return FALSE; - if (fPtr->rotate == WSFB_ROTATE_CW - || fPtr->rotate == WSFB_ROTATE_CCW) { - height = pScrn->virtualX; - width = pScrn->displayWidth = pScrn->virtualY; - } else { - height = pScrn->virtualY; - width = pScrn->virtualX; - } + height = pScrn->virtualY; + width = pScrn->virtualX; + if (fPtr->rotate && !fPtr->PointerMoved) { fPtr->PointerMoved = pScrn->PointerMoved; pScrn->PointerMoved = WsfbPointerMoved;