第十七篇:曲径通幽处,禅房花木深--初探WDDM驱动学习笔记(四)

来源:互联网 发布:男子假扮美女网络招嫖 编辑:程序博客网 时间:2024/04/30 19:22

Multiple Monitors and Video Present Networks


这一篇写点VidPN的东西.
微软对SAMPLE CODE的解释/描述是越来越"吝啬"了. 至少,以前从WDK/DDK中拿一个SAMPLE出来,看一看,改一改,试一试,还能玩一玩, 从实际驱动跑起来去了解驱动的工作情况.
有了一个比较感性的认识后,再去深入细致地看代码, 或者有目地性地改代码, 就显得更加有的放失, 事半功倍.

为了评估显示驱动的工作量, 了解显示驱动的工作原理, 以及实现显示驱动的可行性, 从人力,时间上去做一个估算, 找到了WDK中的MIRROR驱动, 可能由于本人能力有限,加上对显卡驱动方面知识的缺乏, 愣是没从MIRROR这个SAMPLE中玩出点啥来.

无奈之下,又去找了一个基于WIN8的SAMPLE.
http://msdn.microsoft.com/en-us/library/ff554076(v=vs.85).aspx

Kernel mode display-only miniport driver (KMDOD) sample

相比较MIRROR, 这个驱动更加接近我的项目,以及评估的内容.

关于这个SAMPLE中的内容,将抽时间再写, 这里专对其中的VidPN的内容写一点东西.
VidPN管理器配合DISPLAY DRIVER与MINIPORT DRIVER, 共同管理ADAPTER与连接在ADAPTER上的设备.

简单来讲, VidPN是显卡驱动的逻辑上的表现形式, 它是由源, 目标, 连接源与目标的路径(具体的一条路径,代表了具体的转换功能,例如contrast/brightness gains, flicker filter, color transformation), 源的模式及模式集合, 目标的模式及模式集合, 路径构成的TOPOLOGY结构,  显示器的源模式集合, 等等.

VidPN manager主要负责的内容包括:
对显示器的PLUG, UNPLUG进行响应
对ADAPTER连接的显示器的模式集合进行管理以及更新
对源与目标进行相关性的管理
对显示设备与显示模式进行调整与管理(分别在open, close, dock, undock的情况下)

以下这段内容, 似乎更加明白地传达了VidPN的意思

The hardware on a display adapter that is responsible for scanning rendered content from video memory and presenting it on video outputs is called the display adapter's presentational subsystem. A video present network (VidPN) is a software model of a display adapter's presentational subsystem.

The key elements of a display adapter's presentational subsystem are the views (primary surface chains) and the video outputs. In the VidPN model, a view is called video present source, and a video output is called a video present target.

video present path is an association between a video present source and a video present target. A VidPN models the relationship between sources and targets by maintaining a set of video present paths. The set of paths is called aVidPN topology.

Note that video present targets are not the monitors (or other external display devices) connected to the display adapter. The video present targets are the video output connectors themselves.


需要强调的一点:
源与目标的模式是随着TOPOLOGY的改变而改变的, 而不是一个静态的概念.
miniport的作用是关联具体的codec, 这个关联的工作对于上层USER MODE是透明的.
一个codec可以连接一个SOURCE, 但可以连接多个TARGET, 这就显现在这样的做法:









0 0
原创粉丝点击