Virtualbox WDDM之DxgkDdiQueryAdapterInfo
2015-10-27 11:31
1336 查看
/* The DxgkDdiQueryAdapterInfo function retrieves configuration information from the graphics adapter. 用户层驱动获取CAPS,DXGKQAITYPE_UMDRIVERPRIVATE DX驱动获取CAPS,<span style="white-space:pre"> </span> DXGKQAITYPE_DRIVERCAPS DX驱动获取内存段,<span style="white-space:pre"> </span> DXGKQAITYPE_QUERYSEGMENT
Memory segments, in the context of the display driver model for Windows Vista and later (WDDM), describe the graphics processing unit's (GPU) address space to the video memory manager. */ NTSTATUS APIENTRY DxgkDdiQueryAdapterInfo( CONST HANDLE hAdapter, CONST DXGKARG_QUERYADAPTERINFO* pQueryAdapterInfo) { /* The DxgkDdiQueryAdapterInfo should be made pageable. */ PAGED_CODE(); dfprintf(("==> "__FUNCTION__ ", context(0x%x)\n", hAdapter)); NTSTATUS Status = STATUS_SUCCESS; PDEVICE_EXTENSION pContext = (PDEVICE_EXTENSION)hAdapter; switch (pQueryAdapterInfo->Type) { case DXGKQAITYPE_DRIVERCAPS: { DXGK_DRIVERCAPS *pCaps = (DXGK_DRIVERCAPS*)pQueryAdapterInfo->pOutputData; pCaps->HighestAcceptableAddress.HighPart = 0xffffffffUL; pCaps->HighestAcceptableAddress.LowPart = 0xffffffffUL; pCaps->MaxAllocationListSlotId = 0xffffffffUL; pCaps->ApertureSegmentCommitLimit = 0; pCaps->MaxPointerWidth = 0xffffffffUL; pCaps->MaxPointerHeight = 0xffffffffUL; pCaps->PointerCaps.Value = 0x7; /* Monochrome , Color , MaskedColor */ pCaps->InterruptMessageNumber = 0; pCaps->NumberOfSwizzlingRanges = 0; /* @todo: need to adjust this for proper 2D Accel support */ pCaps->MaxOverlays = 0; pCaps->GammaRampCaps.Value = 0; pCaps->PresentationCaps.Value = 0; pCaps->PresentationCaps.NoScreenToScreenBlt = 1; pCaps->PresentationCaps.NoOverlapScreenBlt = 1; pCaps->MaxQueuedFlipOnVSync = 1; /* @todo: need more ?? */ pCaps->FlipCaps.Value = 0; pCaps->FlipCaps.FlipOnVSyncWithNoWait = 1; pCaps->FlipCaps.FlipOnVSyncMmIo = 1; /* @todo: ?? */ pCaps->SchedulingCaps.Value = 0; /* @todo: we might need it for Aero. * Setting this glag would mean we support DeviceContext, i.e. * DxgkDdiCreateContext and DxgkDdiDestroyContext * * pCaps->SchedulingCaps.MultiEngineAware = 1; */ pCaps->MemoryManagementCaps.Value = 0; /* @todo: this corelates with pCaps->SchedulingCaps.MultiEngineAware */ pCaps->MemoryManagementCaps.PagingNode = 0; /* @todo: this corelates with pCaps->SchedulingCaps.MultiEngineAware */ pCaps->GpuEngineTopology.NbAsymetricProcessingNodes = 0; break; } case DXGKQAITYPE_QUERYSEGMENT: { /* no need for DXGK_QUERYSEGMENTIN as it contains AGP aperture info, which (AGP aperture) we do not support * DXGK_QUERYSEGMENTIN *pQsIn = (DXGK_QUERYSEGMENTIN*)pQueryAdapterInfo->pInputData; */ DXGK_QUERYSEGMENTOUT *pQsOut = (DXGK_QUERYSEGMENTOUT*)pQueryAdapterInfo->pOutputData; if (!pQsOut->pSegmentDescriptor) { /* we are requested to provide the number of segments we support */ pQsOut->NbSegment = 1; } else if (pQsOut->NbSegment != 1) { AssertBreakpoint(); drprintf((__FUNCTION__ " NbSegment (%d) != 1\n", pQsOut->NbSegment)); Status = STATUS_INVALID_PARAMETER; } else { /* we are requested to provide segment information */ pQsOut->pSegmentDescriptor->BaseAddress.QuadPart = VBE_DISPI_LFB_PHYSICAL_ADDRESS; pQsOut->pSegmentDescriptor->CpuTranslatedAddress.QuadPart = VBE_DISPI_LFB_PHYSICAL_ADDRESS; /* make sure the size is page aligned */ pQsOut->pSegmentDescriptor->Size = (pContext->u.primary.cbVRAM - VBVA_ADAPTER_INFORMATION_SIZE - pContext->u.primary.cbMiniportHeap) & (~0xfffUL); pQsOut->pSegmentDescriptor->NbOfBanks = 0; pQsOut->pSegmentDescriptor->pBankRangeTable = 0; pQsOut->pSegmentDescriptor->CommitLimit = pQsOut->pSegmentDescriptor->Size; pQsOut->pSegmentDescriptor->Flags.Value = 0; pQsOut->pSegmentDescriptor->Flags.CpuVisible = 1; } pQsOut->PagingBufferSegmentId = 0; pQsOut->PagingBufferSize = 1024; /* @todo: ??*/ pQsOut->PagingBufferPrivateDataSize = 0; /* @todo: ??*/ break; } case DXGKQAITYPE_UMDRIVERPRIVATE: drprintf((__FUNCTION__ ": we do not support DXGKQAITYPE_UMDRIVERPRIVATE\n")); Status = STATUS_NOT_SUPPORTED; break; default: drprintf((__FUNCTION__ ": unsupported Type (%d)\n", pQueryAdapterInfo->Type)); Status = STATUS_NOT_SUPPORTED; break; } dfprintf(("<== "__FUNCTION__ ", context(0x%x), Status(0x%x)\n", hAdapter, Status)); return Status; }
相关文章推荐
- IOS--关于UIViewController添加UINavigationBar的详细实现方法
- UIScrollView常见属性
- 虚拟主机配置
- 深入浅出Cocoa多线程编程之block与dispatch quene
- Image Sampling and Nyquist Theorem (summary)
- UITextField+Category
- IOS UI Label的一些用法
- UIViewUILabel
- easyUI导出excel文件 提供下载功能
- Permutation Sequence
- UILabel
- UIVisualEffectView - initWithEffect
- UICollectionView的使用和布局方法
- UVA 11538-Chess Queen简单排列组合
- UITableView中用xib实现的cell中的View点击后View消失
- Android更新UI的两种方法——handler与runOnUiThread()
- UITableView中Lable自动换行,Cell自动适应高度
- 【HDOJ】【1005】Number Sequence
- UIBezierPath + bezierPathWithArcCenter
- 苹果在Xcode6中弃用segue的push和model