DRI DRM

2024-03-14 00:48
文章标签 dri

本文主要是介绍DRI DRM,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

http://www.linuxgraphics.cn/home/index.html

DRI 体系结构分析
作者: 刘鹏
日期: 2009-09-23
本文详细介绍了  DRI(Direct Rendering Infrastructure) 的体系结构,给出了模块图、数据流图和控制流图。

简介
Who develop it
  • Started by Jens Owen and Kevin E. Martin of Precision Insight.
  • First made widely available as part of XFree86 4.0 and is now part of the X.Org Server.
  • Currently maintained by Tungsten Graphics and others in the free software community.
What is it

An interface and a free software implementation used in the X Window System to securely allow user applications to access the video hardware without requiring data to be passed (slowly) through the X server.

Who use it

Its primary application is to provide hardware acceleration of the Mesa implementation of OpenGL. Mesa 的硬件加速就是通过 DRI 来实现的。

It has also been adapted to provide OpenGL acceleration on a framebuffer console without an X Server running.

详细的综述

Introduction to the Direct Rendering Infrastructure

Architecture
来自参考资料4
来自参考资料4

libGL:

  1. Present a OpenGL compatible API to the client application;
  2. Implement the GLX API (the glue between OpenGL and X);
  3. Find and load the appropriate 3D driver;
  4. Dispatch the received OpenGL API calls to the 3D driver, or fallback to the X server if no 3D driver was found;

3D driver:

  1. Implement the OpenGL API;
  2. Transform the received vertex and texture data into the hardware native format;
  3. Keep a backup of the graphics hardware state which is relevant to its drawing context;
  4. If DMA is supported by the hardware, fill in DMA buffers with the vertex and texture data and signal the DRM module to dispatch it to the hardware;
  5. Provide software fallbacks for all operations not supported in hardware.

DRI extension:

  1. Context/window setup;

2D Driver:

  1. Detect and initialize hardware;
  2. Reserve on-board memory for 3D operations;
  3. Synchronize 2D operations with 3D ones;
  4. Identify which 3D driver and DRM module to load;
  5. Communicate the current cliprect list;
  6. Authorize client access to the DRM module;

DRM core module

  1. Thin OS kernel abstraction layer for portability

DRM module:

  1. Graphical hardware lock;
  2. Allocate a pool of DMA buffers (in the AGP aperture if possible);
  3. Memory map the DMA buffers to client virtual address space;
  4. Dispatch the DMA buffers written by the clients;

SAREA:

  1. Store dirty hardware specific state;
  2. Store cliprects.

Details:

Direct Rendering Infrastructure: Architecture

Data Flow Diagram2
DRI Data Flow Diagram
DRI Data Flow Diagram

This overview diagram shows the different paths which the data takes from the program to the graphics hardware.

Starting at the left from the top.

Direct rendering program (3D):

Direct rendering (3D data) -> 3D data -> Graphics Hardware

Direct rendering program (2D):

X Protocol Encode -> Protocol Decode -> DIX -> XAA -> DDX Driver -> Graphics Hardware

3D and 2D commands share the same transport / protocol arrow / stream between the indirect rendering program (client) and the X Server. It's not until the protocol is decoded in the X Server that they diverge.

Indirect rendering program (2D):

X Protocol Encode -> Protocol Decode -> DIX -> XAA -> DDX Driver -> Graphics Hardware

Indirect rendering program (3D):

X Protocol Decode -> GLX -> Mesa (including SW rasterizer) -> DDX Driver -> Graphics Hardware

Control Flow Diagram2
DRI Control Flow Diagram
DRI Control Flow Diagram

3D and 2D commands share the same transport / protocol arrow / stream between the indirect rendering program (client) and the X Server. It's not until the protocol is decoded in the X Server that they diverge.

Indirect rendering program (3D):

X Protocol Decode -> GLX -> Mesa (including SW rasterizer) -> DDX Driver -> Graphics Hardware

Indirect rendering program (2D):

X Protocol Encode -> Protocol Decode -> DIX -> XAA -> DDX Driver -> Graphics Hardware

2D only program (2D):

X Protocol Encode -> Protocol Decode -> DIX -> XAA -> DDX Driver -> Graphics Hardware

RM and 2D commands share the same transport / protocol arrow / stream between the indirect rendering program (client) and the X Server. It's not until the protocol is decoded in the X Server that they diverge.

Direct rendering program (2D):

X Protocol Encode -> Protocol Decode -> DIX -> XAA -> DDX Driver -> Graphics Hardware

Direct rendering program (RM):

X Protocol Encode -> Protocol Decode -> DRI Module (-> DDX Driver) -> DRM Lib =>> SAREA & Kernel

Direct rendering program (3D):

Direct rendering (3D data) -> 3D data -> Graphics Hardware

Resource management:

SAREA & Kernel

3DDRP Internals:

Origins of 3D , RM , 2D & RM (x transport)

DRI Low-Level Design Documents2

Direct Rendering Infrastructure, Low Level Design Document

The Direct Rendering Manager, Kernel Support for the Direct Rendering Infrastructure

Hardware Locking for the Direct Rendering Infrastructure

A Security Analysis of the Direct Rendering Infrastructure

DRI Extensions for supporting the Direct Rendering Protocol Specification

The DRM Memory manager

TTMFencing - Information on fencing and flushes using TTM

DRI OpenGL Support

The DRI OpenGL support consists of several pieces:

  • DRM is a combination of at least two kernel modules, one of core DRM code and others providing APIs to userland to access different classes of video hardware.
  • The userland driver module contains an OpenGL driver that typically prepares buffers of commands to be sent to the hardware by the DRM and interacts with the windowing system for synchronization of access to the hardware.
  • Additional code provides access to the interface provided by the driver module. In X this is the libdri.so support module and a DRI-enabled DDX (2D driver). In the framebuffer implementation this is MiniGLX, which initializes the DRM and provides some X APIs to the userland driver despite the lack of an X Server.
新进展
  • Work on DRI2 started at the 2007 X Developers' Summit. The new rendering infrastructure improves several shortcomings of the old design, including removing internal locks and adding proper support for offscreen rendering, so that compositing and XVideo/OpenGL applications are properly managed.
SeeAlso
  1. http://en.wikipedia.org/wiki/Direct_Rendering_Infrastructure
  2. DRI Document

这篇关于DRI DRM的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/806760

相关文章

Linux Graphic DRI Wayland 显示子系统

1. 前言 上篇文章(Linux graphic subsytem(1)_概述)介绍了linux图形子系统基本的软件框架,以及GUI、Windowing system、3D渲染等基本概念。文中提到了linux DRI(Direct Render Infrastructure)框架,但限于篇幅,没有过多介绍。 蜗蜗觉得,DRI在当前(或者说将来)的linux图形子系统中,有着举足轻重的地位,甚至

Linux Graphic DRI 显示子系统 介绍1

1. 前言 图形子系统是linux系统中比较复杂的子系统之一:对下,它要管理形态各异的、性能各异的显示相关的器件;对上,它要向应用程序提供易用的、友好的、功能强大的图形用户界面(GUI)。因此,它是linux系统中少有的、和用户空间程序(甚至是用户)息息相关的一个子系统。 本文是图形子系统分析文章的第一篇,也是提纲挈领的一篇,将会从整体上,对linux显示子系统做一个简单的概述,进而罗列出显示

前端调用DRI后端API出现跨域资源共享(CORS)问题解决办法

目录 1. 引言2. 跨源资源共享和实现方法3. 在Django项目中配置django-cors-headers库Reference 1. 引言 在进行后端API开发时,有时会遇到“跨域资源共享 (CORS) 请求…被阻止“的错误,如图1所示。本文讲解如何在使用DRF(Django REST Framework)的后端API开发项目中解决这个问题。 A cross-ori