VirtualBox

Changeset 45348 in vbox for trunk/src/VBox/GuestHost


Ignore:
Timestamp:
Apr 4, 2013 7:46:29 PM (12 years ago)
Author:
vboxsync
Message:

crOpenGL: improved GPU data acwuisition mechanism for VRDP (disabled still)

Location:
trunk/src/VBox/GuestHost/OpenGL/include
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/GuestHost/OpenGL/include/cr_blitter.h

    r45201 r45348  
    116116}
    117117
     118DECLINLINE(GLint) CrBltGetVisBits(PCR_BLITTER pBlitter)
     119{
     120    return pBlitter->CtxInfo.Base.visualBits;
     121}
     122
     123
    118124DECLINLINE(GLboolean) CrBltIsEverEntered(PCR_BLITTER pBlitter)
    119125{
  • trunk/src/VBox/GuestHost/OpenGL/include/cr_server.h

    r45248 r45348  
    2222#include <iprt/err.h>
    2323#include <iprt/string.h>
     24#include <iprt/list.h>
     25#include <iprt/thread.h>
     26#include <iprt/critsect.h>
     27#include <iprt/semaphore.h>
    2428
    2529#include <VBox/vmm/ssm.h>
     
    8791} CRCreateInfo_t;
    8892
     93
     94/* VRAM->RAM worker thread */
     95
     96typedef enum
     97{
     98    CR_SERVER_RPW_STATE_UNINITIALIZED = 0,
     99    CR_SERVER_RPW_STATE_INITIALIZING,
     100    CR_SERVER_RPW_STATE_INITIALIZED,
     101    CR_SERVER_RPW_STATE_UNINITIALIZING,
     102} CR_SERVER_RPW_STATE;
     103
     104/* worker control command */
     105typedef enum
     106{
     107    CR_SERVER_RPW_CTL_TYPE_UNDEFINED = 0,
     108    CR_SERVER_RPW_CTL_TYPE_WAIT_COMPLETE,
     109    CR_SERVER_RPW_CTL_TYPE_TERM
     110} CR_SERVER_RPW_CTL_TYPE;
     111
     112struct CR_SERVER_RPW_ENTRY;
     113
     114typedef struct CR_SERVER_RPW_CTL {
     115    CR_SERVER_RPW_CTL_TYPE enmType;
     116    int rc;
     117    RTSEMEVENT hCompleteEvent;
     118    /* valid for *_WAIT_COMPLETE and *_CANCEL */
     119    struct CR_SERVER_RPW_ENTRY *pEntry;
     120} CR_SERVER_RPW_CTL;
     121
     122
     123struct CR_SERVER_RPW_ENTRY;
     124
     125typedef DECLCALLBACKPTR(void, PFNCR_SERVER_RPW_DATA) (const struct CR_SERVER_RPW_ENTRY* pEntry, void *pvEntryTexData);
     126
     127typedef struct CR_SERVER_RPW_ENTRY
     128{
     129    RTRECTSIZE Size;
     130    /*  We have to use 4 textures here.
     131     *
     132     *  1. iDrawTex - the texture clients can draw to and then submit it for contents acquisition via crServerRpwEntrySubmit
     133     *  2. iSubmittedTex - the texture submitted to the worker for processing and, whose processing has not start yet,
     134     *     i.e. it is being in the queue and can be safely removed/replaced [from] there
     135     *  3. iWorkerTex - the texture being prepared & passed by the worker to the GPU (stage 1 of a worker contents acquisition process)
     136     *  4. iGpuTex - the texture passed/processed to/by the GPU, whose data is then acquired by the server (stage 2 of a worker contents acquisition process)
     137     *
     138     *  - There can be valid distinct iGpuTex, iWorkerTex, iSubmittedTex and iDrawTex present simultaneously.
     139     *  - Either or both of iSubmittedTex and iFreeTex are always valid
     140     *
     141     *  Detail:
     142     *
     143     *  - iSubmittedTex and iFreeTex modifications are performed under CR_SERVER_RPW::CritSect lock.
     144     *
     145     *  - iDrawTex can only be changed by client side (i.e. the crServerRpwEntrySubmit caller), this is why client thread can access it w/o a lock
     146     *  - iSubmittedTex and iFreeTex can be modified by both client and worker, so lock is always required
     147     *
     148     *  - iDrawTex can be accessed by client code only
     149     *  - iWorkerTex and iGpuTex can be accessed by worker code only
     150     *  - iSubmittedTex and iFreeTex can be accessed under CR_SERVER_RPW::CritSect lock only
     151     *  - either or both of iSubmittedTex and iFreeTex are always valid (see below for more explanation),
     152     *    this is why client can easily determine the new iDrawTex value on Submit, i.e. :
     153     *
     154     *          (if initial iSubmittedTex was valid)
     155     *                ---------------
     156     *                |              ^
     157     *                >              |
     158     *   Submit-> iDrawTex -> iSubmittedTex
     159     *                ^
     160     *                | (if initial iSubmittedTex was NOT valid)
     161     *              iFreeTex
     162     *
     163     *  - The worker can invalidate the iSubmittedTex (i.e. do iSubmittedTex -> iWorkerTex) only after it is done
     164     *    with the last iWorkerTex -> iGpuTex transformation freeing the previously used iGpuTex to iFreeTex.
     165     *
     166     *  - A simplified worker iXxxTex transformation logic is:
     167     *    1. iFreeTex is initially valid
     168     *    2. iSubmittedTex -> iWorkerTex;
     169     *    3. submit iWorkerTex acquire request to the GPU
     170     *    4. complete current iGpuTex
     171     *    5. iGpuTex -> iFreeTex
     172     *    6. iWorkerTex -> iGpuTex
     173     *    7. goto 1
     174     *
     175     *  */
     176    int8_t iTexDraw;
     177    int8_t iTexSubmitted;
     178    int8_t iTexWorker;
     179    int8_t iTexGpu;
     180    int8_t iCurPBO;
     181    GLuint aidWorkerTexs[4];
     182    GLuint aidPBOs[2];
     183    RTLISTNODE WorkEntry;
     184    RTLISTNODE WorkerWorkEntry;
     185    RTLISTNODE GpuSubmittedEntry;
     186    PFNCR_SERVER_RPW_DATA pfnData;
     187} CR_SERVER_RPW_ENTRY;
     188
     189typedef struct CR_SERVER_RPW {
     190    RTLISTNODE WorkList;
     191    RTCRITSECT CritSect;
     192    RTSEMEVENT hSubmitEvent;
     193    /* only one outstanding command is supported,
     194     * and ctl requests must be cynchronized, hold it right here */
     195    CR_SERVER_RPW_CTL Ctl;
     196    int ctxId;
     197    GLint ctxVisBits;
     198    RTTHREAD hThread;
     199} CR_SERVER_RPW;
     200/* */
     201
     202
    89203/**
    90204 * Mural info
     
    142256    VBOXVR_SCR_COMPOSITOR_ENTRY RootVrCEntry;
    143257    VBOXVR_SCR_COMPOSITOR RootVrCompositor;
     258
     259    CR_SERVER_RPW_ENTRY RpwEntry;
    144260
    145261    /* bitfield representing contexts the mural has been ever current with
     
    269385
    270386/* */
     387
    271388/* BFB (BlitFramebuffer Blitter) flags
    272389 * so far only CR_SERVER_BFB_ON_ALWAIS is supported and is alwais used if any flag is set */
     
    336453    uint32_t fBlitterMode;
    337454    CR_BLITTER Blitter;
     455
     456    CR_SERVER_RPW RpwWorker;
    338457
    339458    /** configuration options */
     
    395514                                                     *using callback above to update vbox framebuffers*/
    396515    GLuint                fPresentModeDefault; /*can be set with CR_SERVER_DEFAULT_RENDER_TYPE*/
     516    GLuint                fVramPresentModeDefault;
    397517    GLboolean             bUsePBOForReadback;       /*Use PBO's for data readback*/
    398518
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