Changeset 50831 in vbox for trunk/src/VBox/HostServices
- Timestamp:
- Mar 20, 2014 5:40:50 PM (11 years ago)
- Location:
- trunk/src/VBox/HostServices/SharedOpenGL/crserverlib
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server.h
r50812 r50831 464 464 void CrFbTexDataInit(CR_TEXDATA* pFbTex, const VBOXVR_TEXTURE *pTex, PFNCRTEXDATA_RELEASED pfnTextureReleased); 465 465 466 int 32_t crVBoxServerCrCmdBltProcess(PVBOXCMDVBVA_HDRpCmd, uint32_t cbCmd);466 int8_t crVBoxServerCrCmdBltProcess(const VBOXCMDVBVA_HDR *pCmd, uint32_t cbCmd); 467 467 468 468 //#define VBOX_WITH_CRSERVER_DUMPER -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_main.c
r50827 r50831 60 60 int tearingdown = 0; /* can't be static */ 61 61 62 static DECLCALLBACK(int ) crVBoxCrCmdCmd(HVBOXCRCMDSVR hSvr, PVBOXCMDVBVA_HDRpCmd, uint32_t cbCmd);62 static DECLCALLBACK(int8_t) crVBoxCrCmdCmd(HVBOXCRCMDSVR hSvr, const VBOXCMDVBVA_HDR *pCmd, uint32_t cbCmd); 63 63 64 64 DECLINLINE(CRClient*) crVBoxServerClientById(uint32_t u32ClientID) … … 2989 2989 #ifdef VBOX_WITH_CRHGSMI 2990 2990 2991 static int32_t crVBoxServerCmdVbvaCrCmdProcess( struct VBOXCMDVBVA_CRCMD_CMD *pCmd, uint32_t cbCmd)2991 static int32_t crVBoxServerCmdVbvaCrCmdProcess(const struct VBOXCMDVBVA_CRCMD_CMD *pCmd, uint32_t cbCmd) 2992 2992 { 2993 2993 int32_t rc; … … 3047 3047 { 3048 3048 CRVBOXHGSMIWRITE* pFnCmd = (CRVBOXHGSMIWRITE*)pHdr; 3049 VBOXCMDVBVA_CRCMD_BUFFER *pBuf = &pCmd->aBuffers[1];3049 const VBOXCMDVBVA_CRCMD_BUFFER *pBuf = &pCmd->aBuffers[1]; 3050 3050 /* Fetch parameters. */ 3051 3051 uint32_t cbBuffer = pBuf->cbBuffer; … … 3103 3103 /* Fetch parameters. */ 3104 3104 uint32_t u32InjectClientID = pFnCmd->u32ClientID; 3105 VBOXCMDVBVA_CRCMD_BUFFER *pBuf = &pCmd->aBuffers[1];3105 const VBOXCMDVBVA_CRCMD_BUFFER *pBuf = &pCmd->aBuffers[1]; 3106 3106 uint32_t cbBuffer = pBuf->cbBuffer; 3107 3107 uint8_t *pBuffer = VBOXCRHGSMI_PTR_SAFE(pBuf->offBuffer, cbBuffer, uint8_t); … … 3153 3153 { 3154 3154 CRVBOXHGSMIREAD *pFnCmd = (CRVBOXHGSMIREAD*)pHdr; 3155 VBOXCMDVBVA_CRCMD_BUFFER *pBuf = &pCmd->aBuffers[1];3155 const VBOXCMDVBVA_CRCMD_BUFFER *pBuf = &pCmd->aBuffers[1]; 3156 3156 /* Fetch parameters. */ 3157 3157 uint32_t cbBuffer = pBuf->cbBuffer; … … 3207 3207 { 3208 3208 CRVBOXHGSMIWRITEREAD *pFnCmd = (CRVBOXHGSMIWRITEREAD*)pHdr; 3209 VBOXCMDVBVA_CRCMD_BUFFER *pBuf = &pCmd->aBuffers[1];3210 VBOXCMDVBVA_CRCMD_BUFFER *pWbBuf = &pCmd->aBuffers[2];3209 const VBOXCMDVBVA_CRCMD_BUFFER *pBuf = &pCmd->aBuffers[1]; 3210 const VBOXCMDVBVA_CRCMD_BUFFER *pWbBuf = &pCmd->aBuffers[2]; 3211 3211 3212 3212 /* Fetch parameters. */ … … 3452 3452 3453 3453 3454 static DECLCALLBACK(int ) crVBoxCrCmdCmd(HVBOXCRCMDSVR hSvr, PVBOXCMDVBVA_HDRpCmd, uint32_t cbCmd)3454 static DECLCALLBACK(int8_t) crVBoxCrCmdCmd(HVBOXCRCMDSVR hSvr, const VBOXCMDVBVA_HDR *pCmd, uint32_t cbCmd) 3455 3455 { 3456 3456 AssertFailed(); … … 3459 3459 case VBOXCMDVBVA_OPTYPE_CRCMD: 3460 3460 { 3461 VBOXCMDVBVA_CRCMD *pCrCmdDr;3462 VBOXCMDVBVA_CRCMD_CMD *pCrCmd;3461 const VBOXCMDVBVA_CRCMD *pCrCmdDr; 3462 const VBOXCMDVBVA_CRCMD_CMD *pCrCmd; 3463 3463 int rc; 3464 pCrCmdDr = ( VBOXCMDVBVA_CRCMD*)pCmd;3464 pCrCmdDr = (const VBOXCMDVBVA_CRCMD*)pCmd; 3465 3465 pCrCmd = &pCrCmdDr->Cmd; 3466 3466 if (cbCmd < sizeof (VBOXCMDVBVA_CRCMD)) 3467 3467 { 3468 3468 WARN(("invalid buffer size")); 3469 pCmd->u.i8Result = -1; 3470 break; 3469 return -1; 3471 3470 } 3472 3471 rc = crVBoxServerCmdVbvaCrCmdProcess(pCrCmd, cbCmd - RT_OFFSETOF(VBOXCMDVBVA_CRCMD, Cmd)); 3473 3472 if (RT_SUCCESS(rc)) 3474 3473 { 3475 /* success */3476 pCmd->u.i8Result =0;3474 /* success */ 3475 return 0; 3477 3476 } 3478 else 3479 { 3480 WARN(("crVBoxServerCmdVbvaCrCmdProcess failed, rc %d", rc)); 3481 pCmd->u.i8Result = -1; 3482 } 3483 break; 3477 3478 WARN(("crVBoxServerCmdVbvaCrCmdProcess failed, rc %d", rc)); 3479 return -1; 3484 3480 } 3485 3481 case VBOXCMDVBVA_OPTYPE_BLT_OFFPRIMSZFMT_OR_ID: 3486 3482 { 3487 crVBoxServerCrCmdBltProcess(pCmd, cbCmd); 3488 break; 3483 return crVBoxServerCrCmdBltProcess(pCmd, cbCmd); 3489 3484 } 3490 3485 default: 3491 3486 WARN(("unsupported command")); 3492 pCmd->u.i8Result = -1; 3493 } 3494 return VINF_SUCCESS; 3487 return -1; 3488 } 3489 3490 WARN(("internal error")); 3491 return -1; 3495 3492 } 3496 3493 -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_presenter.cpp
r50827 r50831 4629 4629 } 4630 4630 4631 int 32_t crVBoxServerCrCmdBltProcess(PVBOXCMDVBVA_HDRpCmd, uint32_t cbCmd)4631 int8_t crVBoxServerCrCmdBltProcess(const VBOXCMDVBVA_HDR *pCmd, uint32_t cbCmd) 4632 4632 { 4633 4633 uint8_t u8Flags = pCmd->u8Flags; … … 4640 4640 { 4641 4641 WARN(("request to present on disabled framebuffer, ignore")); 4642 pCmd->u.i8Result = -1; 4643 return VINF_SUCCESS; 4642 return -1; 4644 4643 } 4645 4644 … … 4658 4657 WARN(("RTMemAlloc failed!")); 4659 4658 g_CrPresenter.cbTmpBuf = 0; 4660 pCmd->u.i8Result = -1; 4661 return VINF_SUCCESS; 4659 return -1; 4662 4660 } 4663 4661 } … … 4690 4688 { 4691 4689 WARN(("invalid param")); 4692 pCmd->u.i8Result = -1; 4693 return VINF_SUCCESS; 4690 return -1; 4694 4691 } 4695 4692 … … 4702 4699 { 4703 4700 WARN(("CrFbBltPutContentsNe failed %d", rc)); 4704 return rc;4701 return -1; 4705 4702 } 4706 4703 … … 4766 4763 } 4767 4764 } 4768 return VINF_SUCCESS;4765 return 0; 4769 4766 } 4770 4767 else … … 4772 4769 /* blit from one primary to another primary, wow */ 4773 4770 WARN(("not implemented")); 4774 pCmd->u.i8Result = -1; 4775 return VINF_SUCCESS; 4771 return -1; 4776 4772 } 4777 4773 } … … 4784 4780 uint32_t texId = pBlt->alloc.u.id; 4785 4781 WARN(("not implemented")); 4786 pCmd->u.i8Result = -1; 4787 return VINF_SUCCESS; 4782 return -1; 4788 4783 } 4789 4784 else … … 4796 4791 { 4797 4792 WARN(("invalid param")); 4798 pCmd->u.i8Result = -1; 4799 return VINF_SUCCESS; 4793 return -1; 4800 4794 } 4801 4795 … … 4818 4812 { 4819 4813 WARN(("CrFbBltGetContents failed %d", rc)); 4820 pCmd->u.i8Result = -1; 4821 return VINF_SUCCESS; 4814 return -1; 4822 4815 } 4823 4816 } … … 4827 4820 { 4828 4821 WARN(("not implemented")); 4829 pCmd->u.i8Result = -1; 4830 return VINF_SUCCESS; 4831 } 4832 4833 pCmd->u.i8Result = 0; 4834 return VINF_SUCCESS; 4835 } 4822 return -1; 4823 } 4824 4825 return 0; 4826 }
Note:
See TracChangeset
for help on using the changeset viewer.