VirtualBox

Ignore:
Timestamp:
Jan 25, 2010 9:16:05 PM (15 years ago)
Author:
vboxsync
Message:

wddm: more impl

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoWddm.cpp

    r26009 r26036  
    323323    )
    324324{
    325     return STATUS_NOT_IMPLEMENTED;
     325    /* The DxgkDdiQueryDeviceDescriptor should be made pageable. */
     326    PAGED_CODE();
     327
     328    dfprintf(("==> "__FUNCTION__ ", context(0x%x)\n", MiniportDeviceContext));
     329
     330    /* we do not support EDID */
     331    DeviceDescriptor->DescriptorOffset = 0;
     332    DeviceDescriptor->DescriptorLength = 0;
     333    DeviceDescriptor->DescriptorBuffer = NULL;
     334
     335    dfprintf(("<== "__FUNCTION__ ", context(0x%x)\n", MiniportDeviceContext));
     336
     337    return STATUS_SUCCESS;
    326338}
    327339
     
    333345    )
    334346{
    335     return STATUS_NOT_IMPLEMENTED;
     347    /* The DxgkDdiSetPowerState function should be made pageable. */
     348    PAGED_CODE();
     349
     350    dfprintf(("==> "__FUNCTION__ ", context(0x%x)\n", MiniportDeviceContext));
     351
     352    /* @todo: */
     353
     354    dfprintf(("<== "__FUNCTION__ ", context(0x%x)\n", MiniportDeviceContext));
     355
     356    return STATUS_SUCCESS;
    336357}
    337358
     
    564585    )
    565586{
    566     return STATUS_NOT_IMPLEMENTED;
     587    /* The DxgkDdiRecommendFunctionalVidPn should be made pageable. */
     588    PAGED_CODE();
     589
     590    dfprintf(("==> "__FUNCTION__ ", context(0x%x)\n", hAdapter));
     591
     592    PDEVICE_EXTENSION pContext = (PDEVICE_EXTENSION)hAdapter;
     593    const DXGK_VIDPN_INTERFACE* pVidPnInterface = NULL;
     594    NTSTATUS Status = pContext->u.primary.DxgkInterface.DxgkCbQueryVidPnInterface(pRecommendFunctionalVidPnArg->hRecommendedFunctionalVidPn, DXGK_VIDPN_INTERFACE_VERSION_V1, &pVidPnInterface);
     595    if(Status == STATUS_SUCCESS)
     596    {
     597        D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology;
     598        const DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface;
     599        Status = pVidPnInterface->pfnGetTopology(pRecommendFunctionalVidPnArg->hRecommendedFunctionalVidPn, &hVidPnTopology, &pVidPnTopologyInterface);
     600        if(Status == STATUS_SUCCESS)
     601        {
     602            D3DKMDT_VIDPN_PRESENT_PATH *pNewVidPnPresentPathInfo;
     603            Status = pVidPnTopologyInterface->pfnCreateNewPathInfo(hVidPnTopology, &pNewVidPnPresentPathInfo);
     604            if(Status == STATUS_SUCCESS)
     605            {
     606                pNewVidPnPresentPathInfo->VidPnSourceId = 0;
     607                pNewVidPnPresentPathInfo->VidPnTargetId = 0;
     608                pNewVidPnPresentPathInfo->ImportanceOrdinal = D3DKMDT_VPPI_PRIMARY;
     609                pNewVidPnPresentPathInfo->ContentTransformation.Scaling = D3DKMDT_VPPS_IDENTITY;
     610                memset(&pNewVidPnPresentPathInfo->ContentTransformation.ScalingSupport,
     611                        0, sizeof(pNewVidPnPresentPathInfo->ContentTransformation.ScalingSupport));
     612                pNewVidPnPresentPathInfo->ContentTransformation.ScalingSupport.Identity = 1;
     613                pNewVidPnPresentPathInfo->ContentTransformation.ScalingSupport.Centered = 1;
     614                pNewVidPnPresentPathInfo->ContentTransformation.ScalingSupport.Stretched = 0;
     615                pNewVidPnPresentPathInfo->ContentTransformation.Rotation = D3DKMDT_VPPR_IDENTITY;
     616                pNewVidPnPresentPathInfo->ContentTransformation.RotationSupport.Identity = 1;
     617                pNewVidPnPresentPathInfo->ContentTransformation.RotationSupport.Rotate180 = 0;
     618                pNewVidPnPresentPathInfo->ContentTransformation.RotationSupport.Rotate270 = 0;
     619                pNewVidPnPresentPathInfo->ContentTransformation.RotationSupport.Rotate90 = 0;
     620                pNewVidPnPresentPathInfo->VisibleFromActiveTLOffset.cx = 0;
     621                pNewVidPnPresentPathInfo->VisibleFromActiveTLOffset.cy = 0;
     622                pNewVidPnPresentPathInfo->VisibleFromActiveBROffset.cx = 0;
     623                pNewVidPnPresentPathInfo->VisibleFromActiveBROffset.cy = 0;
     624                pNewVidPnPresentPathInfo->VidPnTargetColorBasis = D3DKMDT_CB_SRGB; /* @todo: how does it matters? */
     625                pNewVidPnPresentPathInfo->VidPnTargetColorCoeffDynamicRanges.FirstChannel =  8;
     626                pNewVidPnPresentPathInfo->VidPnTargetColorCoeffDynamicRanges.SecondChannel =  8;
     627                pNewVidPnPresentPathInfo->VidPnTargetColorCoeffDynamicRanges.ThirdChannel =  8;
     628                pNewVidPnPresentPathInfo->VidPnTargetColorCoeffDynamicRanges.FourthChannel =  0;
     629                pNewVidPnPresentPathInfo->Content = D3DKMDT_VPPC_GRAPHICS;
     630                pNewVidPnPresentPathInfo->CopyProtection.CopyProtectionType = D3DKMDT_VPPMT_NOPROTECTION;
     631                pNewVidPnPresentPathInfo->CopyProtection.APSTriggerBits = 0;
     632                memset(&pNewVidPnPresentPathInfo->CopyProtection.CopyProtectionSupport, 0, sizeof(pNewVidPnPresentPathInfo->CopyProtection.CopyProtectionSupport));
     633                pNewVidPnPresentPathInfo->CopyProtection.CopyProtectionSupport.NoProtection  = 1;
     634                pNewVidPnPresentPathInfo->GammaRamp.Type = D3DDDI_GAMMARAMP_DEFAULT;
     635                pNewVidPnPresentPathInfo->GammaRamp.DataSize = 0;
     636                Status = pVidPnTopologyInterface->pfnAddPath(hVidPnTopology, pNewVidPnPresentPathInfo);
     637                if(Status == STATUS_SUCCESS)
     638                {
     639                    D3DKMDT_HVIDPNSOURCEMODESET hNewVidPnSourceModeSet;
     640                    const DXGK_VIDPNSOURCEMODESET_INTERFACE *pVidPnSourceModeSetInterface;
     641                    Status = pVidPnInterface->pfnCreateNewSourceModeSet(pRecommendFunctionalVidPnArg->hRecommendedFunctionalVidPn,
     642                                    0, /*__in CONST D3DDDI_VIDEO_PRESENT_SOURCE_ID  VidPnSourceId */
     643                                    &hNewVidPnSourceModeSet,
     644                                    &pVidPnSourceModeSetInterface);
     645                    if(Status == STATUS_SUCCESS)
     646                    {
     647                        D3DKMDT_VIDPN_SOURCE_MODE *pNewVidPnSourceModeInfo;
     648                        Status = pVidPnSourceModeSetInterface->pfnCreateNewModeInfo(hNewVidPnSourceModeSet, &pNewVidPnSourceModeInfo);
     649                        if(Status == STATUS_SUCCESS)
     650                        {
     651                            D3DKMDT_VIDEO_PRESENT_SOURCE_MODE_ID modeId = pNewVidPnSourceModeInfo->Id;
     652                            pNewVidPnSourceModeInfo->Type = D3DKMDT_RMT_GRAPHICS;
     653                            /* @todo: should we obtain the default mode from the host? */
     654                            pNewVidPnSourceModeInfo->Format.Graphics.PrimSurfSize.cx = 1024;
     655                            pNewVidPnSourceModeInfo->Format.Graphics.PrimSurfSize.cx = 768;
     656                            pNewVidPnSourceModeInfo->Format.Graphics.VisibleRegionSize = pNewVidPnSourceModeInfo->Format.Graphics.PrimSurfSize;
     657                            pNewVidPnSourceModeInfo->Format.Graphics.Stride = pNewVidPnSourceModeInfo->Format.Graphics.PrimSurfSize.cx * 4;
     658                            pNewVidPnSourceModeInfo->Format.Graphics.PixelFormat = D3DDDIFMT_X8R8G8B8;
     659                            pNewVidPnSourceModeInfo->Format.Graphics.ColorBasis = D3DKMDT_CB_SRGB;
     660                            pNewVidPnSourceModeInfo->Format.Graphics.PixelValueAccessMode = D3DKMDT_PVAM_DIRECT;
     661                            Status = pVidPnSourceModeSetInterface->pfnAddMode(hNewVidPnSourceModeSet, pNewVidPnSourceModeInfo);
     662                            if(Status == STATUS_SUCCESS)
     663                            {
     664                                Status = pVidPnSourceModeSetInterface->pfnPinMode(hNewVidPnSourceModeSet, modeId);
     665                                if(Status == STATUS_SUCCESS)
     666                                {
     667
     668                                }
     669                                else
     670                                {
     671                                    drprintf(("VBoxVideoWddm: pfnPinMode failed Status(0x%x)\n"));
     672                                }
     673                            }
     674                            else
     675                            {
     676                                drprintf(("VBoxVideoWddm: pfnAddMode failed Status(0x%x)\n"));
     677                                pVidPnSourceModeSetInterface->pfnReleaseModeInfo(hNewVidPnSourceModeSet, pNewVidPnSourceModeInfo);
     678                                pNewVidPnSourceModeInfo = NULL;
     679                            }
     680                        }
     681                        else
     682                        {
     683                            drprintf(("VBoxVideoWddm: pfnCreateNewModeInfo failed Status(0x%x)\n"));
     684                        }
     685                    }
     686                    else
     687                    {
     688                        drprintf(("VBoxVideoWddm: pfnCreateNewSourceModeSet failed Status(0x%x)\n"));
     689                    }
     690                }
     691                else
     692                {
     693                    drprintf(("VBoxVideoWddm: pfnAddPath failed Status(0x%x)\n"));
     694                    pVidPnTopologyInterface->pfnReleasePathInfo(hVidPnTopology, pNewVidPnPresentPathInfo);
     695                    pNewVidPnPresentPathInfo = NULL;
     696                }
     697            }
     698            else
     699            {
     700                drprintf(("VBoxVideoWddm: pfnCreateNewPathInfo failed Status(0x%x)\n"));
     701            }
     702        }
     703        else
     704        {
     705            drprintf(("VBoxVideoWddm: pfnGetTopology failed Status(0x%x)\n"));
     706        }
     707    }
     708    else
     709    {
     710        drprintf(("VBoxVideoWddm: DxgkCbQueryVidPnInterface failed Status(0x%x)\n"));
     711    }
     712
     713    dfprintf(("<== "__FUNCTION__ ", status(0x%x), context(0x%x)\n", Status, hAdapter));
     714
     715    return Status;
    567716}
    568717
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