VirtualBox

Changeset 76181 in vbox


Ignore:
Timestamp:
Dec 12, 2018 3:16:19 PM (6 years ago)
Author:
vboxsync
Message:

DevVGA-SVGA: process the three GMRFB related commands when VBOX_WITH_VMSVGA3D is not defined.

Location:
trunk/src/VBox/Devices/Graphics
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Graphics/DevVGA-SVGA.cpp

    r76171 r76181  
    154154
    155155#include "DevVGA-SVGA.h"
    156 #include "vmsvga/svga_reg.h"
    157156#include "vmsvga/svga_escape.h"
    158157#include "vmsvga/svga_overlay.h"
    159 #include "vmsvga/svga3d_reg.h"
    160158#include "vmsvga/svga3d_caps.h"
    161159#ifdef VBOX_WITH_VMSVGA3D
     
    38473845                break;
    38483846            }
    3849 # ifdef VBOX_WITH_VMSVGA3D
     3847
    38503848            case SVGA_CMD_DEFINE_GMRFB:
    38513849            {
     
    40024000                break;
    40034001            }
    4004 # endif // VBOX_WITH_VMSVGA3D
     4002
    40054003            case SVGA_CMD_ANNOTATION_FILL:
    40064004            {
     
    47704768
    47714769    return VINF_SUCCESS;
     4770}
     4771
     4772
     4773/** Unsigned coordinates in pBox. Clip to [0; pSizeSrc), [0;pSizeDest).
     4774 *
     4775 * @param pSizeSrc  Source surface dimensions.
     4776 * @param pSizeDest Destination surface dimensions.
     4777 * @param pBox      Coordinates to be clipped.
     4778 */
     4779void vmsvgaClipCopyBox(const SVGA3dSize *pSizeSrc,
     4780                       const SVGA3dSize *pSizeDest,
     4781                       SVGA3dCopyBox *pBox)
     4782{
     4783    /* Src x, w */
     4784    if (pBox->srcx > pSizeSrc->width)
     4785        pBox->srcx = pSizeSrc->width;
     4786    if (pBox->w > pSizeSrc->width - pBox->srcx)
     4787        pBox->w = pSizeSrc->width - pBox->srcx;
     4788
     4789    /* Src y, h */
     4790    if (pBox->srcy > pSizeSrc->height)
     4791        pBox->srcy = pSizeSrc->height;
     4792    if (pBox->h > pSizeSrc->height - pBox->srcy)
     4793        pBox->h = pSizeSrc->height - pBox->srcy;
     4794
     4795    /* Src z, d */
     4796    if (pBox->srcz > pSizeSrc->depth)
     4797        pBox->srcz = pSizeSrc->depth;
     4798    if (pBox->d > pSizeSrc->depth - pBox->srcz)
     4799        pBox->d = pSizeSrc->depth - pBox->srcz;
     4800
     4801    /* Dest x, w */
     4802    if (pBox->x > pSizeDest->width)
     4803        pBox->x = pSizeDest->width;
     4804    if (pBox->w > pSizeDest->width - pBox->x)
     4805        pBox->w = pSizeDest->width - pBox->x;
     4806
     4807    /* Dest y, h */
     4808    if (pBox->y > pSizeDest->height)
     4809        pBox->y = pSizeDest->height;
     4810    if (pBox->h > pSizeDest->height - pBox->y)
     4811        pBox->h = pSizeDest->height - pBox->y;
     4812
     4813    /* Dest z, d */
     4814    if (pBox->z > pSizeDest->depth)
     4815        pBox->z = pSizeDest->depth;
     4816    if (pBox->d > pSizeDest->depth - pBox->z)
     4817        pBox->d = pSizeDest->depth - pBox->z;
     4818}
     4819
     4820/** Unsigned coordinates in pBox. Clip to [0; pSize).
     4821 *
     4822 * @param pSize     Source surface dimensions.
     4823 * @param pBox      Coordinates to be clipped.
     4824 */
     4825void vmsvgaClipBox(const SVGA3dSize *pSize,
     4826                   SVGA3dBox *pBox)
     4827{
     4828    /* x, w */
     4829    if (pBox->x > pSize->width)
     4830        pBox->x = pSize->width;
     4831    if (pBox->w > pSize->width - pBox->x)
     4832        pBox->w = pSize->width - pBox->x;
     4833
     4834    /* y, h */
     4835    if (pBox->y > pSize->height)
     4836        pBox->y = pSize->height;
     4837    if (pBox->h > pSize->height - pBox->y)
     4838        pBox->h = pSize->height - pBox->y;
     4839
     4840    /* z, d */
     4841    if (pBox->z > pSize->depth)
     4842        pBox->z = pSize->depth;
     4843    if (pBox->d > pSize->depth - pBox->z)
     4844        pBox->d = pSize->depth - pBox->z;
     4845}
     4846
     4847/** Clip.
     4848 *
     4849 * @param pBound    Bounding rectangle.
     4850 * @param pRect     Rectangle to be clipped.
     4851 */
     4852void vmsvgaClipRect(SVGASignedRect const *pBound,
     4853                    SVGASignedRect *pRect)
     4854{
     4855    int32_t left;
     4856    int32_t top;
     4857    int32_t right;
     4858    int32_t bottom;
     4859
     4860    /* Right order. */
     4861    Assert(pBound->left <= pBound->right && pBound->top <= pBound->bottom);
     4862    if (pRect->left < pRect->right)
     4863    {
     4864        left = pRect->left;
     4865        right = pRect->right;
     4866    }
     4867    else
     4868    {
     4869        left = pRect->right;
     4870        right = pRect->left;
     4871    }
     4872    if (pRect->top < pRect->bottom)
     4873    {
     4874        top = pRect->top;
     4875        bottom = pRect->bottom;
     4876    }
     4877    else
     4878    {
     4879        top = pRect->bottom;
     4880        bottom = pRect->top;
     4881    }
     4882
     4883    if (left < pBound->left)
     4884        left = pBound->left;
     4885    if (right < pBound->left)
     4886        right = pBound->left;
     4887
     4888    if (left > pBound->right)
     4889        left = pBound->right;
     4890    if (right > pBound->right)
     4891        right = pBound->right;
     4892
     4893    if (top < pBound->top)
     4894        top = pBound->top;
     4895    if (bottom < pBound->top)
     4896        bottom = pBound->top;
     4897
     4898    if (top > pBound->bottom)
     4899        top = pBound->bottom;
     4900    if (bottom > pBound->bottom)
     4901        bottom = pBound->bottom;
     4902
     4903    pRect->left = left;
     4904    pRect->right = right;
     4905    pRect->top = top;
     4906    pRect->bottom = bottom;
    47724907}
    47734908
  • trunk/src/VBox/Devices/Graphics/DevVGA-SVGA.h

    r75715 r76181  
    2424#include <VBox/vmm/pdmthread.h>
    2525
     26#include "vmsvga/svga3d_reg.h"
    2627
    2728/** Default FIFO size. */
     
    367368DECLCALLBACK(void) vmsvgaR3PowerOff(PPDMDEVINS pDevIns);
    368369
     370typedef struct VGAState *PVGASTATE;
     371
    369372#ifdef IN_RING3
    370 typedef struct VGAState *PVGASTATE;
    371373VMSVGASCREENOBJECT *vmsvgaGetScreenObject(PVGASTATE pThis, uint32_t idScreen);
    372374int vmsvgaUpdateScreen(PVGASTATE pThis, VMSVGASCREENOBJECT *pScreen, int x, int y, int w, int h);
    373375#endif
    374376
    375 #endif
    376 
     377void vmsvgaGMRFree(PVGASTATE pThis, uint32_t idGMR);
     378int vmsvgaGMRTransfer(PVGASTATE pThis, const SVGA3dTransferType enmTransferType,
     379                      uint8_t *pbHstBuf, uint32_t cbHstBuf, uint32_t offHst, int32_t cbHstPitch,
     380                      SVGAGuestPtr gstPtr, uint32_t offGst, int32_t cbGstPitch,
     381                      uint32_t cbWidth, uint32_t cHeight);
     382
     383void vmsvgaClipCopyBox(const SVGA3dSize *pSizeSrc,
     384                       const SVGA3dSize *pSizeDest,
     385                       SVGA3dCopyBox *pBox);
     386void vmsvgaClipBox(const SVGA3dSize *pSize,
     387                   SVGA3dBox *pBox);
     388void vmsvgaClipRect(SVGASignedRect const *pBound,
     389                    SVGASignedRect *pRect);
     390
     391#endif
     392
  • trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-internal.h

    r75811 r76181  
    11601160                               PVMSVGA3DSURFACE pSurface);
    11611161
    1162 void vmsvgaClipCopyBox(const SVGA3dSize *pSizeSrc,
    1163                        const SVGA3dSize *pSizeDest,
    1164                        SVGA3dCopyBox *pBox);
    1165 void vmsvgaClipBox(const SVGA3dSize *pSize,
    1166                    SVGA3dBox *pBox);
    1167 
    11681162DECLINLINE(int) vmsvga3dContextFromCid(PVMSVGA3DSTATE pState, uint32_t cid, PVMSVGA3DCONTEXT *ppContext)
    11691163{
  • trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-shared.cpp

    r75752 r76181  
    11001100
    11011101#endif /* LOG_ENABLED */
    1102 
    1103 /** Unsigned coordinates in pBox. Clip to [0; pSizeSrc), [0;pSizeDest).
    1104  *
    1105  * @param pSizeSrc  Source surface dimensions.
    1106  * @param pSizeDest Destination surface dimensions.
    1107  * @param pBox      Coordinates to be clipped.
    1108  */
    1109 void vmsvgaClipCopyBox(const SVGA3dSize *pSizeSrc,
    1110                        const SVGA3dSize *pSizeDest,
    1111                        SVGA3dCopyBox *pBox)
    1112 {
    1113     /* Src x, w */
    1114     if (pBox->srcx > pSizeSrc->width)
    1115         pBox->srcx = pSizeSrc->width;
    1116     if (pBox->w > pSizeSrc->width - pBox->srcx)
    1117         pBox->w = pSizeSrc->width - pBox->srcx;
    1118 
    1119     /* Src y, h */
    1120     if (pBox->srcy > pSizeSrc->height)
    1121         pBox->srcy = pSizeSrc->height;
    1122     if (pBox->h > pSizeSrc->height - pBox->srcy)
    1123         pBox->h = pSizeSrc->height - pBox->srcy;
    1124 
    1125     /* Src z, d */
    1126     if (pBox->srcz > pSizeSrc->depth)
    1127         pBox->srcz = pSizeSrc->depth;
    1128     if (pBox->d > pSizeSrc->depth - pBox->srcz)
    1129         pBox->d = pSizeSrc->depth - pBox->srcz;
    1130 
    1131     /* Dest x, w */
    1132     if (pBox->x > pSizeDest->width)
    1133         pBox->x = pSizeDest->width;
    1134     if (pBox->w > pSizeDest->width - pBox->x)
    1135         pBox->w = pSizeDest->width - pBox->x;
    1136 
    1137     /* Dest y, h */
    1138     if (pBox->y > pSizeDest->height)
    1139         pBox->y = pSizeDest->height;
    1140     if (pBox->h > pSizeDest->height - pBox->y)
    1141         pBox->h = pSizeDest->height - pBox->y;
    1142 
    1143     /* Dest z, d */
    1144     if (pBox->z > pSizeDest->depth)
    1145         pBox->z = pSizeDest->depth;
    1146     if (pBox->d > pSizeDest->depth - pBox->z)
    1147         pBox->d = pSizeDest->depth - pBox->z;
    1148 }
    1149 
    1150 /** Unsigned coordinates in pBox. Clip to [0; pSize).
    1151  *
    1152  * @param pSize     Source surface dimensions.
    1153  * @param pBox      Coordinates to be clipped.
    1154  */
    1155 void vmsvgaClipBox(const SVGA3dSize *pSize,
    1156                    SVGA3dBox *pBox)
    1157 {
    1158     /* x, w */
    1159     if (pBox->x > pSize->width)
    1160         pBox->x = pSize->width;
    1161     if (pBox->w > pSize->width - pBox->x)
    1162         pBox->w = pSize->width - pBox->x;
    1163 
    1164     /* y, h */
    1165     if (pBox->y > pSize->height)
    1166         pBox->y = pSize->height;
    1167     if (pBox->h > pSize->height - pBox->y)
    1168         pBox->h = pSize->height - pBox->y;
    1169 
    1170     /* z, d */
    1171     if (pBox->z > pSize->depth)
    1172         pBox->z = pSize->depth;
    1173     if (pBox->d > pSize->depth - pBox->z)
    1174         pBox->d = pSize->depth - pBox->z;
    1175 }
    1176 
    1177 /** Clip.
    1178  *
    1179  * @param pBound    Bounding rectangle.
    1180  * @param pRect     Rectangle to be clipped.
    1181  */
    1182 void vmsvgaClipRect(SVGASignedRect const *pBound,
    1183                     SVGASignedRect *pRect)
    1184 {
    1185     int32_t left;
    1186     int32_t top;
    1187     int32_t right;
    1188     int32_t bottom;
    1189 
    1190     /* Right order. */
    1191     Assert(pBound->left <= pBound->right && pBound->top <= pBound->bottom);
    1192     if (pRect->left < pRect->right)
    1193     {
    1194         left = pRect->left;
    1195         right = pRect->right;
    1196     }
    1197     else
    1198     {
    1199         left = pRect->right;
    1200         right = pRect->left;
    1201     }
    1202     if (pRect->top < pRect->bottom)
    1203     {
    1204         top = pRect->top;
    1205         bottom = pRect->bottom;
    1206     }
    1207     else
    1208     {
    1209         top = pRect->bottom;
    1210         bottom = pRect->top;
    1211     }
    1212 
    1213     if (left < pBound->left)
    1214         left = pBound->left;
    1215     if (right < pBound->left)
    1216         right = pBound->left;
    1217 
    1218     if (left > pBound->right)
    1219         left = pBound->right;
    1220     if (right > pBound->right)
    1221         right = pBound->right;
    1222 
    1223     if (top < pBound->top)
    1224         top = pBound->top;
    1225     if (bottom < pBound->top)
    1226         bottom = pBound->top;
    1227 
    1228     if (top > pBound->bottom)
    1229         top = pBound->bottom;
    1230     if (bottom > pBound->bottom)
    1231         bottom = pBound->bottom;
    1232 
    1233     pRect->left = left;
    1234     pRect->right = right;
    1235     pRect->top = top;
    1236     pRect->bottom = bottom;
    1237 }
  • trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d.h

    r74549 r76181  
    1919#define ___DEVVMWARE3D_H___
    2020
    21 #include "vmsvga/svga_reg.h"
    2221#include "vmsvga/svga3d_reg.h"
    2322#include "vmsvga/svga_escape.h"
     
    5049
    5150/* DevVGA-SVGA.cpp: */
    52 void vmsvgaGMRFree(PVGASTATE pThis, uint32_t idGMR);
    53 int vmsvgaGMRTransfer(PVGASTATE pThis, const SVGA3dTransferType enmTransferType,
    54                       uint8_t *pbHstBuf, uint32_t cbHstBuf, uint32_t offHst, int32_t cbHstPitch,
    55                       SVGAGuestPtr gstPtr, uint32_t offGst, int32_t cbGstPitch,
    56                       uint32_t cbWidth, uint32_t cHeight);
    5751void vmsvga3dSurfaceUpdateHeapBuffersOnFifoThread(PVGASTATE pThis, uint32_t sid);
    5852
     
    125119void vmsvga3dInfoSurfaceWorker(PVGASTATE pThis, PCDBGFINFOHLP pHlp, uint32_t sid, bool fVerbose, uint32_t cxAscii, bool fInvY, const char *pszBitmapPath);
    126120
    127 void vmsvgaClipRect(SVGASignedRect const *pBound,
    128                     SVGASignedRect *pRect);
    129 
    130121/* DevVGA-SVGA3d-shared.cpp: */
    131122
  • trunk/src/VBox/Devices/Graphics/DevVGA.cpp

    r75715 r76181  
    149149#ifdef VBOX_WITH_VMSVGA
    150150#include "DevVGA-SVGA.h"
    151 #include "vmsvga/svga_reg.h"
    152151#endif
    153152
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