949
948
* Query the last display change request.
951
* @returns iprt status value
952
* @param xres where to store the horizontal pixel resolution requested
953
* (0 = do not change)
954
* @param yres where to store the vertical pixel resolution requested
955
* (0 = do not change)
956
* @param bpp where to store the bits per pixel requeste
957
* (0 = do not change)
958
* @param display Where to store the display number the request was for -
959
* 0 for the primary display, 1 for the first secondary, etc.
950
* @returns boolean success indicator.
951
* @param pScrn Pointer to the X screen info structure.
952
* @param pcx Where to store the horizontal pixel resolution (0 = do not change).
953
* @param pcy Where to store the vertical pixel resolution (0 = do not change).
954
* @param pcBits Where to store the bits per pixel (0 = do not change).
955
* @param fEventAck Flag that the request is an acknowlegement for the
956
* VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST.
959
* VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST - event acknowledged.
960
* @param iDisplay 0 for primary display, 1 for the first secondary, etc.
962
vboxGetDisplayChangeRequest(ScrnInfoPtr pScrn, uint32_t *px, uint32_t *py,
963
uint32_t *pbpp, uint32_t *display)
963
vboxGetDisplayChangeRequest(ScrnInfoPtr pScrn, uint32_t *pcx, uint32_t *pcy,
964
uint32_t *pcBits, uint32_t fEventAck, uint32_t iDisplay)
965
int rc, scrnIndex = pScrn->scrnIndex;
966
VBOXPtr pVBox = pScrn->driverPrivate;
968
VMMDevDisplayChangeRequest2 Req = { { 0 } };
969
vmmdevInitRequest(&Req.header, VMMDevReq_GetDisplayChangeRequest2);
970
rc = vbox_vmmcall(pScrn, pVBox, &Req.header);
976
*display = Req.display;
979
xf86DrvMsg(scrnIndex, X_ERROR,
980
"Failed to request the last resolution requested from the guest, rc=%d.\n",
966
VMMDevDisplayChangeRequest2 req;
970
req.eventAck = fEventAck;
971
req.display = iDisplay;
973
rc = vmmdevInitRequest ((VMMDevRequestHeader*)&req, VMMDevReq_GetDisplayChangeRequest2);
974
if (VBOX_FAILURE (rc))
977
/* open VBOXGUEST_DEVICE_NAME temporarily as we didn't call vbox_open yet when we enter
979
fd = open (VBOXGUEST_DEVICE_NAME, O_RDWR, 0);
982
if (ioctl(fd, VBOXGUEST_IOCTL_VMMREQUEST(sizeof(req)), (void*)&req) < 0)