【DM642学习笔记六】TI参考文档--DM642 Video Port Mini Driver
1 Overview
The DSP’sEDMA is used to transfer data between memory and the TMS320DM642Video Port.
Tomaximize code reuse and streamline the integration process, bothdrivers are designed of two distinctive parts:
the genericpart and the board specific part. The external devicecontrol interface (EDC) is defined to bind these two parts togetherin a plug-and-play manner.
The generic part of the drivers uses EDMAs totransfer data to and from the video ports.; The board-specific partmainly consists of code that in the case of the capture driver,initializes and configures the SAA7115
video decoder, and in thecase of the display driver, initializes and configures the SAA7105video encoder.These
EDC-compliant modules set up the video codecs towork together with the video ports to capture or display thedesired video data in a specific format. For example, the SAA7105can be configured
to output video data in composite NTSC format orcomponent High-Definition 1080i format or a wide range of othervideo formats, depending on application requirements. In the meantime, the associated video port must also be configuredaccordingly.
The board-specific part also requires the EVM andthe DM642 DSP to be initialized by calling the EVM642_init()function from the DM642 EVM Board Support Library (BSL),
whichcomes with the EVM. This will set up the EMIF, pin-muxconfigurations and the I2C controller. An application must link allthree libraries necessary in order to function correctly: one fromthe board-specific part, such as the SAA7115 or the SAA7105, onefrom
the generic VPORTCAP or VPORTDIS part, and one from the BSL.These three libraries are called
evm642_saa7115.l64, evm642_vportcap.l64, andevmdm642.l64, respectively for capture, and are calledevm642_saa7105.l64, evm642_vportdis.l64, and
evmdm642.l64, respectively fordisplay.
2 Usage
2.1 Configuration
To use the capture or display device driver, adevice entry must be added and configured in the DSP/BIOSconfiguration tool.
The following are the device configurationsettings required to use the
capture driver:
_
Init function:
N/A, not used by this driver
_
Function table ptr:
_VPORTCAP_Fxns
_
Function table type:
IOM_Fxns
_
Device id:
0 or 1 for DM642 EVM:, specify which video port touse
_
Device params ptr:
An optional pointer to an object of typeVPORT_PortParams as defined in the header file vport.h. Thispointer will point to a device parameter structure. Setting thispointer to NULL requires that
an additional FVID_control call madefrom the application to initialize the video port. The parameterstructure is described below. An example of this structure is the _EVM642_vCapParamsNTSCPort that is defined intheevm642_vcapParamsNTSC.c file for NTSC
format videocapture.
_
Device global data ptr:
N/A, not used by this driver
The following are the device configurationsettings required to use the
display driver:
_
Init function:
N/A, not used by this driver
_
Function table ptr:
_VPORTDIS_Fxns
_
Function table type:
IOM_Fxns
_
Device id:
2 for DM642 EVM: specify which video port is inuse
_
Device params ptr:
Same as for the capture driver
_
Device global data ptr:
N/A, not used by this
2.2 Device Parameters for Generic Part of theDriver
通用视频端口部分的设备参数
2.2.1 Port Parameters (vport.h)
typedef struct VPORT_PortParams{
IntversionId; //Version
number of the driver.
BooldualChanEnab; //Dual
channel mode enable (captureonly).
Unsvc1Polarity; //polarity of the vctrl1 pin, either
active high oractive low
Unsvc2Polarity; //polarity of the vctrl2 pin.
Unsvc3Polarity; //vctrl3 pin.
EDC_Fxns*edcTbl[2]; //array of up to two pointers of EDC functiontables, one
for each channel. EDC函数表的两个指针数组
}VPORT_PortParams;
2.2.2Capture Channel Parameters (vportcap.h)
typedefstruct {
Intcmode; //
capture mode,
IntfldOp; //
field and frame operation mode
Intscale; //
horizontal
½
scaling enable
Intresmpl; //
chroma horizontal 4:2:2 to 4:2:0 re-samplingenable
Int bpk10Bit; //10-bit packing mode,
InthCtRst; //horizontal counter reset mode.
IntvCtRst; //
vertical counter reset
IntfldDect; //
field detection enable, only used in external syncmode
IntextCtl; //
external sync mode enable.
IntfldInv; //
field inverse enable.
Uint16 fldXStrt1; //
starting
pixelnumber of field 1 ,≥0。
Uint16 fldYStrt1;
//starting
line number of field 1,≥1
Uint16fldXStrt2; //starting pixel number of field 2,≥0
Uint16fldYStrt2; //starting line number of field 2.≥1
Uint16 fldXStop1; //the last captured pixel of field one,≥
fldXStrt1
Uint16fldYStop1; //the last captured line of field one,≥
fldYStrt1
Uint16 fldXStop2;
Uint16 fldYStop2;
Uint16 thrld; //specifies number of double-words required togenerate DMA events
IntnumFrmBufs; //number of frame buffers to be allocated by driverto
store video data captured
Intalignment; //
memory alignment requirement for framebuffers
IntmergeFlds; //
indicate whether to merge field one and two or tokeep them separate in memory.
Int segId; //DSP/BIOS memory segment ID, used by driver forframe buffer
allocation
IntedmaPri; //
priority level of EDMA transfers
IntirqId; //
EDMA interrupt
ID
}VPORTCAP_Params
The definitions of the bit-fields in the aboveparameter are mapped to the
video port capture controlregister. The unnamed fields are there to represent thereserved bits in that register.
2.2.3Display Channel Parameters (vportdis.h)
typedef struct {
Intdmode; //display mode,
Int fldOp;
Intscale; //horizontal 2x scaling enable
Intresmpl;
Int defValEn; //default value output enable.
Int bpk10Bit;
Int vctl1Config; //VCTL1 pin output select.
Int vctl2Config;
Int vctl3Config;
IntextCtl; //external control enable
Uint16 frmHSize; //horizontal size of the video frame, including
theblanking period视频帧的水平尺寸,包括消隐期
Uint16frmVSize; //
垂直尺寸。包括消隐期
Int16 imgHOffsetFld1;//display image horizontal offset in
Field 1,relative to the end of horizontal blanking 显示图像在场1的水平偏移
Int16 imgVOffsetFld1; //在场1的垂直偏移
Uint16imgHSizeFld1; //显示图像在场1的像素宽度
Uint16imgVSizeFld1; //图像在场1的行高度
Int16 imgHOffsetFld2;
Int16 imgVOffsetFld2;
Uint16 imgHSizeFld2;
Uint16 imgVSizeFld2;
Uint16 hBlnkStart; //specifies the pixel number within
the line onwhich horizontal blanking starts/stop.
Uint16hBlnkStop;
Uint16 vBlnkXStartFld1;//specifies the pixel number on which
the verticalblanking starts for Field 1
Uint16 vBlnkYStartFld1;
Uint16 vBlnkXStopFld1;
Uint16 vBlnkYStopFld1;
Uint16 vBlnkXStartFld2;
Uint16 vBlnkYStartFld2;
Uint16 vBlnkXStopFld2;
Uint16 vBlnkYStopFld2;
Uint16 xStartFld1;
Uint16 yStartFld1;
Uint16 xStartFld2;
Uint16 yStartFld2;
Uint16 hSyncStart;
Uint16 hSyncStop;
Uint16 vSyncXStartFld1;
Uint16 vSyncYStartFld1;
Uint16 vSyncXStopFld1;
Uint16 vSyncYStopFld1;
Uint16 vSyncXStartFld2;
Uint16 vSyncYStartFld2;
Uint16 vSyncXStopFld2;
Uint16 vSyncYStopFld2;
Uint8 yClipLow;
Uint8 yClipHigh;
Uint8 cClipLow;
Uint8 cClipHigh;
Uint8 yDefVal;
Uint8 cbDefVal;
Uint8 crDefVal;
Int rgbX;
Int incPix;
Uint16 thrld;
Int numFrmBufs; //number
of frame buffers to be allocated by driverto store video data captured
Int alignment;
Int mergeFlds;
Int segId;
Int edmaPri;
Int irqId;
}VPORTDIS_Params;
2.2.4
Video Port Global Interrupt Processing
typedef struct VPORT_VIntCbParams{
Int cbArg;
VPORT_IntCallBack vIntCbFxn;
Uint16 vIntMask;
Uint16 vIntLine;
Int irqId;
Uns intrMask;
} VPORT_VIntCbParams;
2.2.5Commands
The following are implemented run-time commandsdefined in vport.h:
VPORT_CMD_RESET:
resets video port
VPORT_CMD_CONFIG_PORT:
configures video port
VPORT_CMD_CONFIG_CHAN:
configures a video channel
VPORT_CMD_START:
starts capture or display operation
VPORT_CMD_STOP:
stops capture or display operation
VPORT_CMD_SET_VINTCB:
setup video port global interruptcall-back
VPORT_CMD_DUND_RECOVER:
force video port to recover from displayunder-run
VPORT_CMD_COVR_RECOVER:
force video port to recover from captureover-run
2.3 Device Parameters for Board Specific Part ofthe Drivers
特定编解码芯片驱动的设备参数
2.3.1 TheExternal Device Control (EDC) Interface
As showed in Figure 2, thecapture and display mini-drivers consist of the following twoparts:
•The generic part, which is designed to work as is withdifferent external video codecs and board layouts. All of itsdependencies lies within the DM642 device. For example, thevportdis.c file in
the display mini-driver library, can be reusedwithout any code change with different video encoders on differentcustomer boards.
•The board specific part, whichonly works with specific video encoders or decoders on a specificboard. For example, the SAA7105.c file in the display mini-driverlibrary,
only works with the Phillips SAA7105 video encoder on theDM642 EVM. Source code changes may be needed even if the sameencoder is used on a different board. The EDC interface is defined toallow seamless integration of these
two parts in order to maximizecode reuse and minimize possible errors in the integration process.It defines a set of APIs that a board-specific part of themini-driver must implement in order to work with the genericpart.
#define EDC_CONFIG0x00000001
#define EDC_RESET0x00000002
#define EDC_START0x00000003
#define EDC_STOP0x00000004
#define EDC_GET_CONFIG0x00000005
#define EDC_GET_STATUS0x00000006
#define EDC_USER0x10000000
#define EDC_SUCCESS0
#define EDC_FAILED−1
typedef void*EDC_Handle;
typedef struct EDC_Fxns{
EDC_Handle(*open)(String name, Arg optArg);
Int (*close)(PtrdevHandle);
Int (*ctrl)(PtrdevHandle, Uns cmd, Arg arg);
} EDC_Fxns;
2.3.2 SAA7105Parameters
2.3.3 SAA7115Parameters
2.3.4 String NamingConvention in FVID_create()
3Architecture
3.1 BlockDiagram


3.2 Buffer Management
3.3 Cache Coherency
It is the application’s responsibility to ensurecache coherency, as the driver does nothing in this respect.This is because data istypically moved by EDMA between fast
on-chip SRAM and slow off-chipSD-RAM for faster CPU access. Furthermore, algorithmscan use ping-pong buffer schemes to parallel the EDMA transfer andthe CPU execution, thus hiding most or all overhead associated withthe data movement. If this
is the case, cache flush and cleanoperations can be avoided by aligning the frame buffers to cacheline boundaries.
However, if the application does access thesebuffers directly, the application must flush or clean the cache toensure cache coherency, the EDMA accesses external memory directlythrough the EMIF, while the CPU goes through the cache whenaccessing
the data.
4 Constraints
This device driver does not support the followingmodes:
• Raw data capture
• Dual-channel synchronized raw-data display
• Synchronized to another video port
• Capture of MPEG transport stream
【DM642学习笔记六】TI参考文档--DM642 Video Port Mini Driver的更多相关文章
- SpringBoot学习笔记:Swagger实现文档管理
SpringBoot学习笔记:Swagger实现文档管理 Swagger Swagger是一个规范且完整的框架,用于生成.描述.调用和可视化RESTful风格的Web服务.Swagger的目标是对RE ...
- JavaScript学习笔记7 之DOM文档对象模型
一.什么是DOMDocument Object Model 文档 -------对象 ----模型-------缩写DOM DOM是针对HTML和XML文档的一个API(应用程序编程接口).DOM描绘 ...
- AngularJS1.X学习笔记14-动画(解读文档)
最近在看算法分析,那个大O啊,小o啊,分治法啊(目前就看到这里),真是搞死了.这回呢休息一下,学学AngularJS动画,上一篇文章根据自由男人的书简单谈到了动画的话题,发现反响很大(好吧,我说慌了, ...
- MongoDB学习笔记四—增删改文档下
$slice 如果希望数组的最大长度是固定的,那么可以将 $slice 和 $push 组合在一起使用,就可以保证数组不会超出设定好的最大长度.$slice 的值必须是负整数. 假设$slice的值为 ...
- MongoDB学习笔记三—增删改文档上
插入insert 单条插入 > db.foo.insert({"bar":"baz"}) WriteResult({ }) 批量插入 > db.fo ...
- HTML&CSS基础学习笔记1.4-定义文档类型
Web 世界中存在许多不同的文档.只有了解文档的类型,浏览器才能正确地显示文档. HTML 也有多个不同的版本,只有完全明白页面中使用的确切 HTML 版本,浏览器才能完全正确地显示出 HTML 页面 ...
- 《DOM Scripting》学习笔记-——第八章 充实文档的内容
本章内容 一.一个为文档创建“缩略词语表”的函数 二.一个为文档创建“文献来源链接”的函数 三.一个为文档创建“快速访问键清单”的函数 利用DOM动态的收集和创建一些有用的辅助信息,并把它们呈现在网页 ...
- MongoDB快速入门学习笔记3 MongoDB的文档插入操作
1.文档的数据存储格式为BSON,类似于JSON.MongoDB插入数据时会检验数据中是否有“_id”,如果没有会自动生成.shell操作有insert和save两种方法.当插入一条数据有“_id”值 ...
- latex学习笔记----基本知识、文档排版
1.空格和制表符等空白字符视为相同的空白距离,多个连续的空白字符等同为一个字符. 2.# $ % ^ _ { } ~ 在这些字符前面加上反斜线,就可以在文本中得到它们. 反斜线\不 ...
随机推荐
- System.Drawing.Graphics.cs
ylbtech-System.Drawing.Graphics.cs 1.程序集 System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKey ...
- Android Support Library 学习入门
0. 文前闲话 作为一个由原生桌面应用程序开发者(VC.Delphi)转行的Android菜鸟,虐心的事真是数不胜数:安装个开发工具下载个SDK需要整整一夜:早晨一上班点开Android Studio ...
- 关于python3字符串中引号格式的看法,‘’,“”
关于字符串中引号格式的看法 在python3中,字符串统一使用: ' ' 或 " " 来表示,两者没有什么区别. 但是在使用的过程中,可以注意一下使用的方式,可以提高编程 ...
- windows 映射samba Linux服务器,输入正确的账号密码却提示“ 指定的网络密码不正确
重启Linux samba服务也没用,重启Linux和windows系统也没用,急!!! 最佳答案 linux中要添加对应的系统用户和samba用户useradd titiansmbpasswd -a ...
- SSH整合时执行hibernate查询报错:java.lang.ClassCastException: com.ch.hibernate.Depart
今天在整合ssh三个框架时,有一个功能,是查询所有员工信息,且员工表和部门表是多对一的映射关系,代码能正常运行到查询得到一个List集合,但在页面展示的时候,就报异常了, java.lang.Clas ...
- hive 总结二
本文参考:黑泽君相关博客 本文是我总结日常工作中遇到的坑,结合黑泽君相关博客,选取.补充了部分内容. 查询函数(Hive高级) NVL(cloumn,replace_with) 如果cloumn为NU ...
- node-webkit笔记
两个月前给一个运营站点做了个封皮,今天再做竟然忘了怎么搞了...为之文以志. 流程参考: http://www.cnblogs.com/2050/p/3543011.html 相关命令: copy / ...
- import time 进度条动态输出26个字母
# 2018-08-06 19:42:51 import time # 调用时间模块 num = 97 # 字母a while num <= 115: # print(chr(num), end ...
- 第二篇:怕碰到是因为没掌握,来吧,zTree!
一直以来看见web项目中的树就头疼.这次又给碰上了,什么也别说,这次自己整理一个版本出来实践一下.zTree v3.2的API界面非常清爽,但是在查看API之前,你需要自己先实践一下,知道基本的概念和 ...
- Print Article /// 斜率优化DP oj26302
题目大意: 经典题 数学分析 G(a,b)<sum[i]时 a优于b G(a,b)<G(b,c)<sum[i]时 b必不为最优 #include <bits/stdc++.h& ...
