mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-01-19 19:00:50 +01:00
vidmode: Let the driver resize the framebuffer when switching modes
Resize the framebuffer when switching modes with VidMode. This allows better interaction with randr, which may have shrunk the framebuffer when changing to a smaller mode.
This commit is contained in:
parent
709c656297
commit
ea21759cec
1 changed files with 6 additions and 0 deletions
|
|
@ -42,6 +42,7 @@
|
|||
#include "os.h"
|
||||
#include "xf86.h"
|
||||
#include "xf86Priv.h"
|
||||
#include "xf86Crtc.h"
|
||||
#include "extinit.h"
|
||||
|
||||
#ifdef XF86VIDMODE
|
||||
|
|
@ -247,11 +248,16 @@ xf86VidModeSwitchMode(ScreenPtr pScreen, DisplayModePtr mode)
|
|||
{
|
||||
ScrnInfoPtr pScrn;
|
||||
DisplayModePtr pTmpMode;
|
||||
xf86CrtcConfigPtr config;
|
||||
Bool retval;
|
||||
|
||||
pScrn = xf86ScreenToScrn(pScreen);
|
||||
/* save in case we fail */
|
||||
pTmpMode = pScrn->currentMode;
|
||||
/* let the driver resize the framebuffer */
|
||||
config = XF86_CRTC_CONFIG_PTR(pScrn);
|
||||
if (!(*config->funcs->resize) (pScrn, mode->HDisplay, mode->VDisplay))
|
||||
return FALSE;
|
||||
/* Force a mode switch */
|
||||
pScrn->currentMode = NULL;
|
||||
retval = xf86SwitchMode(pScrn->pScreen, mode);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue