![SiS315GraphicsEngine_第1頁](http://file4.renrendoc.com/view/b930eccd0eee26e7b8ae6991b5a1316e/b930eccd0eee26e7b8ae6991b5a1316e1.gif)
![SiS315GraphicsEngine_第2頁](http://file4.renrendoc.com/view/b930eccd0eee26e7b8ae6991b5a1316e/b930eccd0eee26e7b8ae6991b5a1316e2.gif)
![SiS315GraphicsEngine_第3頁](http://file4.renrendoc.com/view/b930eccd0eee26e7b8ae6991b5a1316e/b930eccd0eee26e7b8ae6991b5a1316e3.gif)
![SiS315GraphicsEngine_第4頁](http://file4.renrendoc.com/view/b930eccd0eee26e7b8ae6991b5a1316e/b930eccd0eee26e7b8ae6991b5a1316e4.gif)
![SiS315GraphicsEngine_第5頁](http://file4.renrendoc.com/view/b930eccd0eee26e7b8ae6991b5a1316e/b930eccd0eee26e7b8ae6991b5a1316e5.gif)
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)
文檔簡介
1、SiS 315 Graphics Engine Introduction to some capabilities of graphics accelerator hardware1SVGA incompatibilitiesSVGA manufacturers have different ways of implementing their accelerator featuresSiS provides 2D and 3D graphics enginesAccess is via memory-mapped i/o portsThis requires a new Linux devi
2、ce-driver, to allow mapping the io-ports into user-spaceA suitable driver is our engine2d.c It only works with SiS graphics hardware2SiS policySiS officials say it is not company policy to provide individuals with programming infoBut some programming info is available in unofficial sources (e.g., in
3、-line comments by programmers who wrote open source device-drivers for Linux XFree86 systems)Not everything is fully explained, thoughSo a lot of trial-and-error is necessary!3Where to look for infoThe source-code for drivers distributed with the Linux kernel can be found in:/usr/src/local/linux/dri
4、vers/video/sisRecent versions of the SVGALIB package have some SiS-specific code you can viewThere is also a website maintained by the author of the SiS driver for Linux (Thomas Winischhofer): 4Linux kernel modulesLinux permits installing new kernel code at runtime (i.e., without recompiling kernel)
5、A system administrator can install/remove kernel modules, and may grant users this same privilege (by adjusting permissions on the insmod and rmmod commands)Modules are written in the C language (not C+) and include special header-files that are distributed with the kernel source-code 5Module requir
6、ementsMust define _KERNEL_ and MODULE before any #include statementsMust have: #include Maybe others: e.g., #include Must have these two public functions:int init_module( void );void cleanup_module( void );Usually device-specific function(s), too6Driver-Module Structureinit_module()cleanup_module()M
7、ODULE_LICENSEstruct write()lseek()mmap()read()static data objects#define -#include -typedef -/ and module abstractThis is the device-driver coreThese are for module mgmt7Our engine2d.c moduleOur module only needs one extra function:int my_mmap( );Also needs a struct object:struct my_fops;The init_mo
8、dule() function will install that structure-object in kernel-space, together with executable code which it referencesThe cleanup_module() function removes that code and data after were finished8How it workskernel-spaceuser-spaceapplicationprogramruntimelibrarysyscallhandlerdevice-drivermoduleint $0
9、x80iretmmapretcallret9Pentiums TablesOur drivers mmap method calls a kernel procedure that knows how to setup some new entries in the CPUs directory and table data-structures which give the effect of mapping the GPUs i/o-ports into an applications virtual address-spaceThen the program can read or wr
10、ite these i/o-ports as if they were memory-locations10The PCI InterfaceThe graphics hardware connects with the CPU using the AGP bus, conforming to a standard PCI-bus programming interfaceLinux kernel functions can be called from our init_module() to query the GPU chipIdentify the chips make and mod
11、el Get physical address for its i/o-memoryDetermine the length of the i/o-memory 11Linux device-nodesLinux treats devices as if they were filesWe must create a device- our GPU Device-files normally go in /dev directoryWe invent a for our device-fileWe pick an unused device id-numberA system administ
12、rator creates the file:root# mknod /dev/sismmio c 101 0root# chmod a+rw /dev/sismmio12Our sisaccel.cpp demoWe have written a short demo-program It uses the SiS 315s 2D graphics engine It fills some rectangles with a solid colorIt also shows how to draw a line-segmentThese operations could be done, a
13、s we know, with software algorithms but its faster to let the hardware do it insteadYou are invited to experiment further!13#include “sisaccel.h”This header defines symbolic names for some of the 2D engines i/o addresses Accelerator commands involve writing the values for various parameters to these
14、 i/o port-addresses, concluding with a value that encodes a desired engine commandSome Extended Sequencer registers must be initialized beforehand, to enable engine14Truecolor GraphicsWe used VESA graphics mode 0 x413BScreen-resolution is 800 x600Pixels are 32-bits in size (Truecolor)Recall the Truecolor pixel-format:Alpha channelbyte0byte3byte2byte115MakefileIn order to compile the engine2d.c driver, we recommend using t
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025年交接器項目可行性研究報告
- 2025至2030年中國盤式電機數(shù)據(jù)監(jiān)測研究報告
- 2025至2030年中國氣動防爆氣扇數(shù)據(jù)監(jiān)測研究報告
- 2025至2030年中國冰箱專用冰磚數(shù)據(jù)監(jiān)測研究報告
- 2025至2030年中國丁胺黑藥數(shù)據(jù)監(jiān)測研究報告
- 2025年中國電腦彩繪指甲機市場調(diào)查研究報告
- 城市交通規(guī)劃與經(jīng)濟效應考核試卷
- 醫(yī)療設備租賃合同風險規(guī)避考核試卷
- 批發(fā)商品牌合作與代理協(xié)議考試考核試卷
- 2025-2030年復古風格皮質(zhì)沙發(fā)套企業(yè)制定與實施新質(zhì)生產(chǎn)力戰(zhàn)略研究報告
- 教育案例評選細則(3篇模板)
- 武強縣華浩數(shù)控設備科技有限公司年產(chǎn)9000把(只)提琴、吉他、薩克斯等樂器及80臺(套)數(shù)控雕刻設備項目環(huán)評報告
- 安全生產(chǎn)法律法規(guī)匯編(2024年4月)
- DB11∕T 882-2023 房屋建筑安全評估技術(shù)規(guī)程
- (2024年)剪映入門教程課件
- 快餐品牌全案推廣方案
- 華為員工股權(quán)激勵方案
- 衛(wèi)生院安全生產(chǎn)知識培訓課件
- 發(fā)生輸液反應時的應急預案及處理方法課件
- 中國旅游地理(高職)全套教學課件
- 門脈高壓性消化道出血的介入治療課件
評論
0/150
提交評論