VirtualBox

Changeset 8366 in vbox


Ignore:
Timestamp:
Apr 24, 2008 3:02:20 PM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
30152
Message:

Additions/X11, Additions/common: report the maximum supported resolution in the X11 additions

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/VBoxGuest.h

    r8312 r8366  
    14701470VBGLR3DECL(bool)    VbglR3HostLikesVideoMode(uint32_t cx, uint32_t cy,
    14711471                                             uint32_t cBits);
     1472VBGLR3DECL(int)     VbglR3ReportMaxGuestResolution(uint32_t u32Width, uint32_t u32Height);
    14721473/** @}  */
    14731474
  • trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibVideo.cpp

    r8155 r8366  
    235235    return fRc;
    236236}
     237
     238
     239/**
     240 * Report the maximum resolution that we currently support to the host.
     241 *
     242 * @returns iprt status value
     243 * @param   u32Width   the maximum horizontal resolution
     244 * @param   u32Height  the maximum vertical resolution
     245 */
     246VBGLR3DECL(int) VbglR3ReportMaxGuestResolution(uint32_t u32Width, uint32_t u32Height)
     247{
     248    int rc = VERR_UNRESOLVED_ERROR;
     249    VMMDevReqGuestResolution req;
     250
     251    vmmdevInitRequest(&req.header, VMMDevReq_SetMaxGuestResolution);
     252    req.u32MaxWidth      = u32Width;
     253    req.u32MaxHeight     = u32Height;
     254    rc = vbglR3GRPerform(&req.header);
     255    if (!RT_SUCCESS(rc) || !RT_SUCCESS(req.header.rc))
     256        LogRelFunc(("error reporting maximum supported resolution to VMMDev. "
     257                    "rc = %Vrc, VMMDev rc = %Vrc\n", rc, req.header.rc));
     258    if (RT_SUCCESS(rc))
     259        rc = req.header.rc;
     260    return rc;
     261}
  • trunk/src/VBox/Additions/x11/xgraphics/vboxutils.c

    r8155 r8366  
    901901    return VbglR3HostLikesVideoMode(cx, cy, cBits);
    902902}
     903
     904
     905/**
     906 * Report the maximum resolution supported by the guest
     907 *
     908 * @returns true for success, false otherwise
     909 * @param   u32Width   maximum horizontal resolution supported
     910 * @param   u32Height  maximum vertical resolution supported
     911 */
     912Bool
     913vboxReportMaxGuestResolution(uint32_t u32Width, uint32_t u32Height)
     914{
     915    int irc = VbglR3ReportMaxGuestResolution(u32Width, u32Height);
     916    return RT_SUCCESS(irc);
     917}
  • trunk/src/VBox/Additions/x11/xgraphics/vboxvideo.h

    r8155 r8366  
    176176
    177177extern Bool vboxHostLikesVideoMode(uint32_t cx, uint32_t cy, uint32_t cBits);
     178extern Bool vboxReportMaxGuestResolution(uint32_t u32Width, uint32_t u32Height);
    178179
    179180#endif /* _VBOXVIDEO_H_ */
  • trunk/src/VBox/Additions/x11/xgraphics/vboxvideo_13.c

    r8155 r8366  
    748748
    749749    /* Set a sane minimum mode size and the maximum allowed by the available VRAM */
    750     /** @todo Make sure that the host resolution is supported if it fits into VRAM. */
    751750    {
    752751        unsigned maxSize, trySize = 512;
     
    934933                      "The VBox video extensions are now enabled.\n");
    935934        vboxEnableGraphicsCap(pVBox);
     935        /* Report the largest resolution that we support */
     936        vboxReportMaxGuestResolution(pScrn->display->virtualX,
     937                                     pScrn->display->virtualY);
    936938    }
    937939    return (TRUE);
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette