VirtualBox

Changeset 51217 in vbox


Ignore:
Timestamp:
May 8, 2014 5:42:50 PM (10 years ago)
Author:
vboxsync
Message:

crOpenGL: pdm led, some fixes to follow

Location:
trunk
Files:
12 edited

Legend:

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

    r51121 r51217  
    2929#include <VBox/VBoxVideo.h>
    3030#include <VBox/hgcmsvc.h>
     31#include <VBox/vmm/pdmifs.h>
    3132
    3233/* screen update instance */
     
    9596    };
    9697    uint64_t cbVRam;
     98    PPDMLED pLed;
    9799    /* out */
    98100    struct VBOXCRCMD_SVRINFO CrCmdServerInfo;
  • trunk/include/VBox/vmm/pdmifs.h

    r51121 r51217  
    641641typedef struct VBVAINFOVIEW *PVBVAINFOVIEW;
    642642typedef struct VBVAHOSTFLAGS *PVBVAHOSTFLAGS;
    643 typedef struct VBOXVDMACMD_CHROMIUM_CMD *PVBOXVDMACMD_CHROMIUM_CMD; /* <- chromium [hgsmi] command */
    644 typedef struct VBOXVDMACMD_CHROMIUM_CTL *PVBOXVDMACMD_CHROMIUM_CTL; /* <- chromium [hgsmi] command */
     643struct VBOXVDMACMD_CHROMIUM_CMD; /* <- chromium [hgsmi] command */
     644struct VBOXVDMACMD_CHROMIUM_CTL; /* <- chromium [hgsmi] command */
    645645
    646646
     
    766766     * @thread  The emulation thread.
    767767     */
    768     DECLR3CALLBACKMEMBER(void, pfnCrHgsmiCommandProcess, (PPDMIDISPLAYCONNECTOR pInterface, PVBOXVDMACMD_CHROMIUM_CMD pCmd, uint32_t cbCmd));
     768    DECLR3CALLBACKMEMBER(void, pfnCrHgsmiCommandProcess, (PPDMIDISPLAYCONNECTOR pInterface, struct VBOXVDMACMD_CHROMIUM_CMD* pCmd, uint32_t cbCmd));
    769769
    770770    /**
     
    775775     * @thread  The emulation thread.
    776776     */
    777     DECLR3CALLBACKMEMBER(void, pfnCrHgsmiControlProcess, (PPDMIDISPLAYCONNECTOR pInterface, PVBOXVDMACMD_CHROMIUM_CTL pCtl, uint32_t cbCtl));
     777    DECLR3CALLBACKMEMBER(void, pfnCrHgsmiControlProcess, (PPDMIDISPLAYCONNECTOR pInterface, struct VBOXVDMACMD_CHROMIUM_CTL* pCtl, uint32_t cbCtl));
    778778
    779779    /**
     
    30903090
    30913091    DECLR3CALLBACKMEMBER(int, pfnCrHgsmiCommandCompleteAsync, (PPDMIDISPLAYVBVACALLBACKS pInterface,
    3092                                                                PVBOXVDMACMD_CHROMIUM_CMD pCmd, int rc));
     3092                                                               struct VBOXVDMACMD_CHROMIUM_CMD* pCmd, int rc));
    30933093
    30943094    DECLR3CALLBACKMEMBER(int, pfnCrHgsmiControlCompleteAsync, (PPDMIDISPLAYVBVACALLBACKS pInterface,
    3095                                                                PVBOXVDMACMD_CHROMIUM_CTL pCmd, int rc));
     3095                                                               struct VBOXVDMACMD_CHROMIUM_CTL* pCmd, int rc));
    30963096
    30973097    DECLR3CALLBACKMEMBER(int, pfnCrCtlSubmit, (PPDMIDISPLAYVBVACALLBACKS pInterface,
  • trunk/src/VBox/Devices/Graphics/DevVGA.cpp

    r51013 r51217  
    44614461    PDMIBASE_RETURN_INTERFACE(pszIID, PDMIDISPLAYVBVACALLBACKS, &pThis->IVBVACallbacks);
    44624462#endif
     4463    PDMIBASE_RETURN_INTERFACE(pszIID, PDMILEDPORTS, &pThis->ILeds);
    44634464    return NULL;
    44644465}
    44654466
     4467/* -=-=-=-=-=- Ring 3: ILeds -=-=-=-=-=- */
     4468#define ILEDPORTS_2_VGASTATE(pInterface) ( (PVGASTATE)((uintptr_t)pInterface - RT_OFFSETOF(VGASTATE, ILeds)) )
     4469
     4470/**
     4471 * Gets the pointer to the status LED of a unit.
     4472 *
     4473 * @returns VBox status code.
     4474 * @param   pInterface      Pointer to the interface structure containing the called function pointer.
     4475 * @param   iLUN            The unit which status LED we desire.
     4476 * @param   ppLed           Where to store the LED pointer.
     4477 */
     4478static DECLCALLBACK(int) vgaPortQueryStatusLed(PPDMILEDPORTS pInterface, unsigned iLUN, PPDMLED *ppLed)
     4479{
     4480    PVGASTATE pThis = ILEDPORTS_2_VGASTATE(pInterface);
     4481    switch (iLUN)
     4482    {
     4483        /* LUN #0: Display port. */
     4484        case 0:
     4485        {
     4486            *ppLed = &pThis->Led3D;
     4487            Assert((*ppLed)->u32Magic == PDMLED_MAGIC);
     4488            return VINF_SUCCESS;
     4489        }
     4490
     4491        default:
     4492            AssertMsgFailed(("Invalid LUN #%d\n", iLUN));
     4493            return VERR_PDM_NO_SUCH_LUN;
     4494    }
     4495
     4496    return VERR_PDM_LUN_NOT_FOUND;
     4497}
    44664498
    44674499/* -=-=-=-=-=- Ring 3: Dummy IDisplayConnector -=-=-=-=-=- */
     
    59936025# endif
    59946026#endif
     6027
     6028    pThis->ILeds.pfnQueryStatusLed = vgaPortQueryStatusLed;
     6029
     6030    RT_ZERO(pThis->Led3D);
     6031    pThis->Led3D.u32Magic = PDMLED_MAGIC;
     6032
    59956033    /*
    59966034     * We use our own critical section to avoid unncessary pointer indirections
     
    67536791    /* Init latched access mask. */
    67546792    pThis->uMaskLatchAccess = 0x3ff;
     6793
     6794    if (RT_SUCCESS(rc))
     6795    {
     6796        PPDMIBASE  pBase;
     6797        /*
     6798         * Attach status driver (optional).
     6799         */
     6800        rc = PDMDevHlpDriverAttach(pDevIns, PDM_STATUS_LUN, &pThis->IBase, &pBase, "Status Port");
     6801        AssertRC(rc);
     6802        if (RT_SUCCESS(rc))
     6803        {
     6804            pThis->pLedsConnector = PDMIBASE_QUERY_INTERFACE(pBase, PDMILEDCONNECTORS);
     6805            pThis->pMediaNotify = PDMIBASE_QUERY_INTERFACE(pBase, PDMIMEDIANOTIFY);
     6806        }
     6807        else if (rc != VERR_PDM_NO_ATTACHED_DRIVER)
     6808        {
     6809            AssertMsgFailed(("Failed to attach to status driver. rc=%Rrc\n", rc));
     6810            return PDMDEV_SET_ERROR(pDevIns, rc, N_("AHCI cannot attach to status driver"));
     6811        }
     6812    }
    67556813    return rc;
    67566814}
  • trunk/src/VBox/Devices/Graphics/DevVGA.h

    r51121 r51217  
    294294    PDMIDISPLAYVBVACALLBACKS    IVBVACallbacks;
    295295# endif
     296    /** Status LUN\#0: Leds interface. */
     297    PDMILEDPORTS                ILeds;
    296298    /** Pointer to base interface of the driver. */
    297299    R3PTRTYPE(PPDMIBASE)        pDrvBase;
    298300    /** Pointer to display connector interface of the driver. */
    299301    R3PTRTYPE(PPDMIDISPLAYCONNECTOR) pDrv;
     302
     303    /** Status LUN: Partner of ILeds. */
     304    R3PTRTYPE(PPDMILEDCONNECTORS)   pLedsConnector;
     305    /** Status LUN: Media Notifys. */
     306    R3PTRTYPE(PPDMIMEDIANOTIFY)     pMediaNotify;
    300307
    301308    /** Refresh timer handle - HC. */
     
    516523# endif /* VBOX_WITH_HGSMI */
    517524
     525    PDMLED Led3D;
     526
    518527    struct {
    519528        volatile uint32_t cPending;
  • trunk/src/VBox/Devices/Graphics/DevVGA_VDMA.cpp

    r51161 r51217  
    19441944        pCmd->pvVRamBase = pVGAState->vram_ptrR3;
    19451945        pCmd->cbVRam = pVGAState->vram_size;
     1946        pCmd->pLed = &pVGAState->Led3D;
    19461947        rc = vboxVDMACrCtlPost(pVGAState, &pCmd->Hdr, sizeof (*pCmd));
    19471948        if (RT_SUCCESS(rc))
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server.h

    r51141 r51217  
    2727extern uint8_t* g_pvVRamBase;
    2828extern uint32_t g_cbVRam;
     29extern PPDMLED g_pLed;
    2930extern HCRHGSMICMDCOMPLETION g_hCrHgsmiCompletion;
    3031extern PFNCRHGSMICMDCOMPLETION g_pfnCrHgsmiCompletion;
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_main.c

    r51141 r51217  
    3838uint8_t* g_pvVRamBase = NULL;
    3939uint32_t g_cbVRam = 0;
     40PPDMLED g_pLed = NULL;
     41
    4042HCRHGSMICMDCOMPLETION g_hCrHgsmiCompletion = NULL;
    4143PFNCRHGSMICMDCOMPLETION g_pfnCrHgsmiCompletion = NULL;
     
    42114213            g_pvVRamBase = (uint8_t*)pSetup->pvVRamBase;
    42124214            g_cbVRam = pSetup->cbVRam;
     4215
     4216            g_pLed = pSetup->pLed;
     4217
    42134218            pSetup->CrCmdServerInfo.hSvr = NULL;
    42144219            pSetup->CrCmdServerInfo.pfnEnable = crVBoxCrCmdEnable;
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_presenter.cpp

    r51157 r51217  
    24892489                mFlags.fForcePresentOnReenable = false;
    24902490                cr_server.head_spu->dispatch_table.VBoxPresentComposition(mSpuWindow, mpCompositor, NULL);
     2491                g_pLed->Asserted.s.fWriting = 1;
    24912492            }
    24922493
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r50996 r51217  
    11131113  <enum
    11141114    name="DeviceType"
    1115     uuid="6d9420f7-0b56-4636-99f9-7346f1b01e57"
     1115    uuid="cb977be1-d1fb-41f8-ad7e-951736c6cb3e"
    11161116    >
    11171117    <desc>
     
    11421142      <desc>Shared folder device.</desc>
    11431143    </const>
    1144   </enum>
     1144    <const name="Graphics"          value="7">
     1145      <desc>Graphics device.</desc>
     1146    </const>  </enum>
    11451147
    11461148  <enum
  • trunk/src/VBox/Main/include/ConsoleImpl.h

    r51026 r51217  
    893893    PPDMLED      mapSharedFolderLed;
    894894    PPDMLED      mapUSBLed[2];
     895    PPDMLED      mapCrOglLed;
    895896
    896897    MediumAttachmentMap mapMediumAttachments;
  • trunk/src/VBox/Main/src-client/ConsoleImpl.cpp

    r51096 r51217  
    433433    RT_ZERO(mapUSBLed);
    434434    RT_ZERO(mapSharedFolderLed);
     435    RT_ZERO(mapCrOglLed);
    435436
    436437    for (unsigned i = 0; i < RT_ELEMENTS(maStorageDevType); ++i)
     
    28772878        {
    28782879            SumLed.u32 |= readAndClearLed(mapSharedFolderLed);
     2880            break;
     2881        }
     2882
     2883        case DeviceType_Graphics:
     2884        {
     2885            SumLed.u32 |= readAndClearLed(mapCrOglLed);
    28792886            break;
    28802887        }
  • trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp

    r51092 r51217  
    33993399#endif
    34003400
     3401        attachStatusDriver(pInst, &mapCrOglLed, 0, 0, NULL, NULL, 0);
     3402
    34013403#ifdef VBOX_WITH_VMSVGA
    34023404        if (graphicsController == GraphicsControllerType_VMSVGA)
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