这个文档介绍了在DM642EVM板上视频采集和显示微驱动的使用和设计。用EDMA进行存储器和视频端口的数据传输。为了增强代码的复用性和简化设计过程,驱动分为通用视频端口层和特定编解码芯片微驱动层两个部分。外部设备控制(EDC)接口将这两个部分以即插即用的方式联系在一起。

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的更多相关文章

  1. SpringBoot学习笔记:Swagger实现文档管理

    SpringBoot学习笔记:Swagger实现文档管理 Swagger Swagger是一个规范且完整的框架,用于生成.描述.调用和可视化RESTful风格的Web服务.Swagger的目标是对RE ...

  2. JavaScript学习笔记7 之DOM文档对象模型

    一.什么是DOMDocument Object Model 文档 -------对象 ----模型-------缩写DOM DOM是针对HTML和XML文档的一个API(应用程序编程接口).DOM描绘 ...

  3. AngularJS1.X学习笔记14-动画(解读文档)

    最近在看算法分析,那个大O啊,小o啊,分治法啊(目前就看到这里),真是搞死了.这回呢休息一下,学学AngularJS动画,上一篇文章根据自由男人的书简单谈到了动画的话题,发现反响很大(好吧,我说慌了, ...

  4. MongoDB学习笔记四—增删改文档下

    $slice 如果希望数组的最大长度是固定的,那么可以将 $slice 和 $push 组合在一起使用,就可以保证数组不会超出设定好的最大长度.$slice 的值必须是负整数. 假设$slice的值为 ...

  5. MongoDB学习笔记三—增删改文档上

    插入insert 单条插入 > db.foo.insert({"bar":"baz"}) WriteResult({ }) 批量插入 > db.fo ...

  6. HTML&CSS基础学习笔记1.4-定义文档类型

    Web 世界中存在许多不同的文档.只有了解文档的类型,浏览器才能正确地显示文档. HTML 也有多个不同的版本,只有完全明白页面中使用的确切 HTML 版本,浏览器才能完全正确地显示出 HTML 页面 ...

  7. 《DOM Scripting》学习笔记-——第八章 充实文档的内容

    本章内容 一.一个为文档创建“缩略词语表”的函数 二.一个为文档创建“文献来源链接”的函数 三.一个为文档创建“快速访问键清单”的函数 利用DOM动态的收集和创建一些有用的辅助信息,并把它们呈现在网页 ...

  8. MongoDB快速入门学习笔记3 MongoDB的文档插入操作

    1.文档的数据存储格式为BSON,类似于JSON.MongoDB插入数据时会检验数据中是否有“_id”,如果没有会自动生成.shell操作有insert和save两种方法.当插入一条数据有“_id”值 ...

  9. latex学习笔记----基本知识、文档排版

    1.空格和制表符等空白字符视为相同的空白距离,多个连续的空白字符等同为一个字符. 2.#  $  %  ^  _    {   }  ~ 在这些字符前面加上反斜线,就可以在文本中得到它们. 反斜线\不 ...

随机推荐

  1. 精度试验结果报告Sleep, GetTickCount, timeGetTime, QueryPerformanceCounter

    一段简单的代码来实现精度试验 int main() {       // 初始化代码       ......       int i = 0;       while(i++ < 1000) ...

  2. tomcat JAVA_OPTS设置

    原文地址:https://blog.csdn.net/bamboo_cqh/article/details/72820700 AVA_OPTS ,顾名思义,是用来设置JVM相关运行参数的变量. JVM ...

  3. 分享18道Java基础面试笔试题(面试实拍)

    上图来自Java技术栈微信群里的群友分享,看起来比较基础,但不一定人人都答得上来. 图片比较模糊,小编把题目进行了文字化. 1.你最常上的两个技术站和最常使用的两个app分別进什么?主要解决你什么需求 ...

  4. <jquery>滚动例子

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  5. godaddy账号以及域名被盗找回经历以及网络信息安全的思考

    本案涉及到公司的一些机密信息,因此涉及到机密信息,我都将会用一些其他的代号进行替代.不影响读者理解本案.我会按照时间顺序讲述本案经过,是如何一步步找回godaddy账号的. 我供职的公司是一家网络科技 ...

  6. 【笔记篇】C#笔记1

    返回目录:目录请戳这里~ 以后的C#笔记如果不出意外的话都是Win10 Professional + VS2015 Professional出的,(当然还有直接在编译框敲的所以能不能过编译我也不知道┑ ...

  7. Android开发 从代码里设置Drawable图片不显示的问题

    问题描述 我们从代码里获得Drawable在设置给View时会发现,图片不显示的问题.比如如下代码: Drawable drawable = getResources().getDrawable(R. ...

  8. 关于安装了sqlite对于vs的组件,重启vs后,在外面可以连接sqlite数据库,但是在建立实体模型时没有sqlite数据源的问题

    出自:http://bbs.csdn.net/topics/390917337 兄弟,刚刚在stackoverflow上找到了解决方法了http://stackoverflow.com/questio ...

  9. 廖雪峰Java13网络编程-2Email编程-1发送email

    1.邮件发送 1.1传统邮件发送: 传统的邮件是通过邮局投递,从一个邮局到另一个邮局,最终到达用户的邮箱. 1.2电子邮件发送: 与传统邮件类似,它是从用户电脑的邮件软件(如outlook)发送到邮件 ...

  10. sshfs实践记录

    sshfs是一款利器,可以将远程linux服务器的路径通过ssh协议挂载到本地指定路径.本地的文件一改动,就自动同步到远程服务器中. 本次的实验在centos 6.9中进行. 1.下载.安装所有的依赖 ...