VirtualBox

Changeset 27458 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Mar 17, 2010 4:46:14 PM (15 years ago)
Author:
vboxsync
Message:

wddm: some um display driver prototyping to make logon more happy

Location:
trunk/src/VBox/Additions/WINNT/Graphics
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispD3D.cpp

    r26928 r27458  
    11/** @file
    22 *
    3  * VBoxVideo D3D
     3 * VBoxVideo Display D3D User mode dll
    44 *
    55 * Copyright (C) 2010 Sun Microsystems, Inc.
     
    2323#include <iprt/initterm.h>
    2424#include <iprt/log.h>
     25#include <iprt/mem.h>
     26
    2527#include <VBox/Log.h>
    2628
    2729#include <VBox/VBoxGuestLib.h>
     30
     31#include "VBoxDispD3D.h"
     32
     33#ifdef VBOXWDDMDISP_DEBUG
     34# include <stdio.h>
     35#endif
    2836
    2937/**
     
    3846        case DLL_PROCESS_ATTACH:
    3947        {
    40             RTR3Init();
    41             VbglR3Init();
    42 
    43             AssertBreakpoint();
    44             LogRel(("VBoxDispD3D: DLL loaded.\n"));
    45 
    46 //            DisableThreadLibraryCalls(hInstance);
    47 //            hDllInstance = hInstance;
     48            /* there __try __except are just to ensure the library does not assertion fail in case VBoxGuest is not present
     49             * and VbglR3Init / VbglR3Term assertion fail */
     50            __try
     51            {
     52//                LogRel(("VBoxDispD3D: DLL loaded.\n"));
     53                RTR3Init();
     54//                VbglR3Init();
     55            }
     56            __except (EXCEPTION_CONTINUE_EXECUTION)
     57            {
     58            }
     59
    4860            break;
    4961        }
     
    5163        case DLL_PROCESS_DETACH:
    5264        {
    53             LogRel(("VBoxDispD3D: DLL unloaded.\n"));
    54             VbglR3Term();
     65            /* there __try __except are just to ensure the library does not assertion fail in case VBoxGuest is not present
     66             * and VbglR3Init / VbglR3Term assertion fail */
     67//            __try
     68//            {
     69//                LogRel(("VBoxDispD3D: DLL unloaded.\n"));
     70//                VbglR3Term();
     71//            }
     72//            __except (EXCEPTION_CONTINUE_EXECUTION)
     73//            {
     74//            }
    5575            /// @todo RTR3Term();
    5676            break;
     
    6383}
    6484
    65 __checkReturn HRESULT APIENTRY OpenAdapter(__inout D3DDDIARG_OPENADAPTER*  pOpenData)
    66 {
    67     AssertBreakpoint();
     85static HRESULT APIENTRY vboxWddmDispGetCaps (HANDLE hAdapter, CONST D3DDDIARG_GETCAPS* pData)
     86{
     87    vboxVDbgPrint(("==>"__FUNCTION__", hAdapter(0x%p), caps type(%d)\n", hAdapter, pData->Type));
     88    AssertBreakpoint();
     89
     90    switch (pData->Type)
     91    {
     92        case D3DDDICAPS_DDRAW:
     93        case D3DDDICAPS_DDRAW_MODE_SPECIFIC:
     94        case D3DDDICAPS_GETFORMATCOUNT:
     95        case D3DDDICAPS_GETFORMATDATA:
     96        case D3DDDICAPS_GETMULTISAMPLEQUALITYLEVELS:
     97        case D3DDDICAPS_GETD3DQUERYCOUNT:
     98        case D3DDDICAPS_GETD3DQUERYDATA:
     99        case D3DDDICAPS_GETD3D3CAPS:
     100        case D3DDDICAPS_GETD3D5CAPS:
     101        case D3DDDICAPS_GETD3D6CAPS:
     102        case D3DDDICAPS_GETD3D7CAPS:
     103        case D3DDDICAPS_GETD3D8CAPS:
     104        case D3DDDICAPS_GETD3D9CAPS:
     105        case D3DDDICAPS_GETDECODEGUIDCOUNT:
     106        case D3DDDICAPS_GETDECODEGUIDS:
     107        case D3DDDICAPS_GETDECODERTFORMATCOUNT:
     108        case D3DDDICAPS_GETDECODERTFORMATS:
     109        case D3DDDICAPS_GETDECODECOMPRESSEDBUFFERINFOCOUNT:
     110        case D3DDDICAPS_GETDECODECOMPRESSEDBUFFERINFO:
     111        case D3DDDICAPS_GETDECODECONFIGURATIONCOUNT:
     112        case D3DDDICAPS_GETDECODECONFIGURATIONS:
     113        case D3DDDICAPS_GETVIDEOPROCESSORDEVICEGUIDCOUNT:
     114        case D3DDDICAPS_GETVIDEOPROCESSORDEVICEGUIDS:
     115        case D3DDDICAPS_GETVIDEOPROCESSORRTFORMATCOUNT:
     116        case D3DDDICAPS_GETVIDEOPROCESSORRTFORMATS:
     117        case D3DDDICAPS_GETVIDEOPROCESSORRTSUBSTREAMFORMATCOUNT:
     118        case D3DDDICAPS_GETVIDEOPROCESSORRTSUBSTREAMFORMATS:
     119        case D3DDDICAPS_GETVIDEOPROCESSORCAPS:
     120        case D3DDDICAPS_GETPROCAMPRANGE:
     121        case D3DDDICAPS_FILTERPROPERTYRANGE:
     122        case D3DDDICAPS_GETEXTENSIONGUIDCOUNT:
     123        case D3DDDICAPS_GETEXTENSIONGUIDS:
     124        case D3DDDICAPS_GETEXTENSIONCAPS:
     125        case D3DDDICAPS_GETGAMMARAMPCAPS:
     126            break;
     127        default:
     128            AssertBreakpoint();
     129    }
     130
     131    vboxVDbgPrint(("<=="__FUNCTION__", hAdapter(0x%p), caps type(%d)\n", hAdapter, pData->Type));
     132
    68133    return S_OK;
    69134}
     135
     136static HRESULT APIENTRY vboxWddmDispCreateDevice (IN HANDLE hAdapter, IN D3DDDIARG_CREATEDEVICE* pCreateData)
     137{
     138    vboxVDbgPrint(("==>"__FUNCTION__", hAdapter(0x%p)\n", hAdapter));
     139
     140    AssertBreakpoint();
     141
     142    vboxVDbgPrint(("<=="__FUNCTION__", hAdapter(0x%p)\n", hAdapter));
     143
     144    return E_FAIL;
     145}
     146
     147static HRESULT APIENTRY vboxWddmDispCloseAdapter (IN HANDLE hAdapter)
     148{
     149    vboxVDbgPrint(("==>"__FUNCTION__", hAdapter(0x%p)\n", hAdapter));
     150
     151    AssertBreakpoint();
     152
     153    RTMemFree(hAdapter);
     154
     155    vboxVDbgPrint(("<=="__FUNCTION__", hAdapter(0x%p)\n", hAdapter));
     156
     157    return S_OK;
     158}
     159
     160HRESULT APIENTRY OpenAdapter (__inout D3DDDIARG_OPENADAPTER*  pOpenData)
     161{
     162    vboxVDbgPrint(("==>"__FUNCTION__"\n"));
     163
     164    AssertBreakpoint();
     165
     166    PVBOXWDDMDISP_ADAPTER pAdapter = (PVBOXWDDMDISP_ADAPTER)RTMemAllocZ(sizeof (VBOXWDDMDISP_ADAPTER));
     167    Assert(pAdapter);
     168    if (!pAdapter)
     169    {
     170        vboxVDbgPrintR((__FUNCTION__": RTMemAllocZ returned NULL\n"));
     171        return E_OUTOFMEMORY;
     172    }
     173
     174    pAdapter->hAdapter = pOpenData->hAdapter;
     175    pAdapter->uIfVersion = pOpenData->Interface;
     176    pAdapter->uRtVersion= pOpenData->Version;
     177    pAdapter->RtCallbacks = *pOpenData->pAdapterCallbacks;
     178
     179    pOpenData->hAdapter = pAdapter;
     180    pOpenData->pAdapterFuncs->pfnGetCaps = vboxWddmDispGetCaps;
     181    pOpenData->pAdapterFuncs->pfnCreateDevice = vboxWddmDispCreateDevice;
     182    pOpenData->pAdapterFuncs->pfnCloseAdapter = vboxWddmDispCloseAdapter;
     183    pOpenData->DriverVersion = D3D_UMD_INTERFACE_VERSION;
     184
     185    vboxVDbgPrint(("<=="__FUNCTION__", pAdapter(0x%p)\n", pAdapter));
     186
     187    return S_OK;
     188}
     189
     190#ifdef VBOXWDDMDISP_DEBUG
     191VOID vboxVDbgDoPrint(LPCSTR szString, ...)
     192{
     193    char szBuffer[1024] = {0};
     194    va_list pArgList;
     195    va_start(pArgList, szString);
     196    _vsnprintf(szBuffer, sizeof(szBuffer) / sizeof(szBuffer[0]), szString, pArgList);
     197    va_end(pArgList);
     198
     199    OutputDebugStringA(szBuffer);
     200}
     201#endif
  • trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoWddm.cpp

    r27433 r27458  
    770770    )
    771771{
    772     dfprintf(("==> "__FUNCTION__ ", context(0x%p), msg(0x%x)\n", MiniportDeviceContext, MessageNumber));
     772//    dfprintf(("==> "__FUNCTION__ ", context(0x%p), msg(0x%x)\n", MiniportDeviceContext, MessageNumber));
    773773
    774774    vboxVDbgBreakFv();
     
    865865    }
    866866
    867     dfprintf(("<== "__FUNCTION__ ", context(0x%p), bOur(0x%x)\n", MiniportDeviceContext, (ULONG)bOur));
     867//    dfprintf(("<== "__FUNCTION__ ", context(0x%p), bOur(0x%x)\n", MiniportDeviceContext, (ULONG)bOur));
    868868
    869869    return bOur;
     
    899899    )
    900900{
    901     dfprintf(("==> "__FUNCTION__ ", context(0x%p)\n", MiniportDeviceContext));
     901//    dfprintf(("==> "__FUNCTION__ ", context(0x%p)\n", MiniportDeviceContext));
    902902
    903903    vboxVDbgBreakFv();
     
    934934        pDevExt->u.primary.DxgkInterface.DxgkCbNotifyDpc(pDevExt->u.primary.DxgkInterface.DeviceHandle);
    935935
    936     dfprintf(("<== "__FUNCTION__ ", context(0x%p)\n", MiniportDeviceContext));
     936//    dfprintf(("<== "__FUNCTION__ ", context(0x%p)\n", MiniportDeviceContext));
    937937}
    938938
     
    16951695    NTSTATUS Status = STATUS_SUCCESS;
    16961696
    1697     dfprintf(("==> "__FUNCTION__ ", context(0x%x)\n", hAdapter));
     1697//    dfprintf(("==> "__FUNCTION__ ", context(0x%x)\n", hAdapter));
    16981698
    16991699    vboxVDbgBreakFv();
     
    17371737    vboxVdmaCBufDrSubmit (pDevExt, &pDevExt->u.primary.Vdma, pDr);
    17381738
    1739     dfprintf(("<== "__FUNCTION__ ", context(0x%x)\n", hAdapter));
     1739//    dfprintf(("<== "__FUNCTION__ ", context(0x%x)\n", hAdapter));
    17401740
    17411741    return Status;
     
    17911791        case DXGK_OPERATION_DISCARD_CONTENT:
    17921792        {
    1793             AssertBreakpoint();
     1793//            AssertBreakpoint();
    17941794            break;
    17951795        }
     
    18331833    dfprintf(("==> "__FUNCTION__ ", hAdapter(0x%x)\n", hAdapter));
    18341834
    1835     AssertBreakpoint();
     1835    vboxVDbgBreakFv();
    18361836    /* @todo: fixme: implement */
    18371837
     
    18471847    CONST DXGKARG_SETPOINTERSHAPE*  pSetPointerShape)
    18481848{
    1849     dfprintf(("==> "__FUNCTION__ ", hAdapter(0x%x)\n", hAdapter));
    1850 
    1851     AssertBreakpoint();
     1849//    dfprintf(("==> "__FUNCTION__ ", hAdapter(0x%x)\n", hAdapter));
     1850
     1851    vboxVDbgBreakFv();
    18521852    /* @todo: fixme: implement */
    18531853
    1854     dfprintf(("<== "__FUNCTION__ ", hAdapter(0x%x)\n", hAdapter));
     1854//    dfprintf(("<== "__FUNCTION__ ", hAdapter(0x%x)\n", hAdapter));
    18551855
    18561856    return STATUS_NOT_SUPPORTED;
     
    26652665    PAGED_CODE();
    26662666
    2667     dfprintf(("==> "__FUNCTION__ ", hContext(0x%x)\n", hContext));
     2667//    dfprintf(("==> "__FUNCTION__ ", hContext(0x%x)\n", hContext));
    26682668
    26692669    vboxVDbgBreakFv();
     
    27832783    }
    27842784
    2785     dfprintf(("<== "__FUNCTION__ ", hContext(0x%x), Status(0x%x)\n", hContext, Status));
     2785//    dfprintf(("<== "__FUNCTION__ ", hContext(0x%x), Status(0x%x)\n", hContext, Status));
    27862786
    27872787    return Status;
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