display:qualcomm-drm-kms

23 篇文章 43 订阅

1.架构图 

1.App或者GUI tool发起绘画请求,最终经过libdrm到kernel驱动GPU进行渲染操作;或者pixel-man经过CPU渲染,或者overlay这种;

2.GPU将渲染结果通过memory最终传给上层[与其他类型的图层也在一并交给compositor]。

3.渲染的一张张结果[多张不同图层]经过kms:displayconntroller合成一张图装换成合适的数据格式最终输出到屏幕上。 

 

 a.高通方面的源码路径如下

kernel/driver/gpu/drm/xxxx

kernel/driver/gpu/drm/msm/xxxx

kernel/driver/gpu/drm/msm/sde/xxxx
sde和以前的mdp是同一个模块

2.概念

Direct rendering manager (DRM), is introduced to deal with graphic cards embedding GPUs
Kernel mode setting (KMS) is a subpart of the DRM API, sets mode on the given display
Rendering and mode setting are split into two different APIs and are accessible through /dev/dri/renderX and /dev/dri/controlDX 
KMS provides a way to configure the display pipeline of a graphic card (or an embedded system)
KMS is an alternative to frame buffer dev (FBDEV)

a. libdrm

libdrm是包装大多数Drm IOCTL的库。包括vblank事件处理,内存管理,输出管理,帧缓冲管理等。是用户空间与内核交互的重要方式。api分两套,legacy和atomic

b. drm& c. kms& d. gem& framebuffer 

Linux

DRM层包含用于支持复杂图形设备需求的代码,通常包含非常适合3D图形加速的可编程管道。内核中的图形驱动程序可以利用DRM函数来简化内存管理,中断处理和DMA等任务,并为应用程序提供统一的接口。

KMS 负责modeset,负责将图像合成,变成电信号,最终送到显示设备上。

这两个合起来负责渲染以及送显。也就是整个图像的生成以及显示到硬件上的整个过程。

GEM是负责管理framebuffer的模块。也是drm重点的一部分。

e. plane

Display Controller的数据源通道,每个crtc至少要有一个plane;切记这是硬件设备

f. crtc

1.DPMS (Display Power Manage System) 电源状态管理 (crtc_funcs->dpms)
2.将 Framebuffer 转换成标准的 LCDC Timing ,其实就是一帧图像刷新的过程(crtc_funs->mode_set)
3.帧切换,即在 VBlank 消影期间,切换 Framebuffer(crtc_funcs->page_flip)
4.Gamma 校正值调整(crtc_funcs->gamma_set)

g. encoder

1.DPMS (Display Power Manage System) 电源状态管理 (encoder_funcs->dpms)

2.将 VOP 输出的 lcdc Timing 打包转化为对应接口时序 HDMI TMDS / … (encoder_funcs->mode_set)

h. bridge

1.转换作用,将一种信号转换或者加解串成另一种信号

比如mipi -> hdmi

i.connector

1.获取上报热拔插Hotplug状态

2.读取并解析屏(Panel)的EDID信息

高通自身在msm里面有个sde文件夹,里面有自己重新封装的connector。文件为sde_connector.c以及sde_connector.h文件。

注:

顺序buffer -> plane -> crtc -> encoder -> (bridge) -> connector -> hw panel;

Frame buffers (struct drm_framebuffer)
 Frame buffers are abstract memory objects that provide a source of pixels to scan out to a CRTC. Implementation depends on the memory manager
used and the IOMMU capabilities
Planes (struct drm_pane)
 A plane represents an image source that can be blended with or overlaid on top of a CRTC during the scan out process.
 Planes are associated with a frame buffer to crop a portion of the image memory (source) and optionally scale it to a destination size. The result is
then blended with or overlaid on top of a CRTC.
CRTC (struct drm_crtc)
 CRT controller (CRTC) is not related only to CRT displays. It configures the appropriate display settings such as display timings, resolution, scans out
frame buffer content to one or more displays, and so on.
Encoder (struct drm_encoder)
 Takes pixel data from CRTC and converts it to the format suitable for any attached connectors.
Connectors (struct drm_connector)
 Represents display interface (HDMI, DisplayPort, DSI, VGA), transmits signal to display, detects display, exposes mode, and so on.
Bridge
 Associated with an encoder, participates in mode set, device power management, connection detection, and so on. 

plane-crtc-encoder对应的实体,都是包含在mdp/dpu/mdss内部;

j.Makefile

1类drm-xxx,drm基础模块

2类drm-xxx-helper-xxx,drm的helper模块。

3类xxx/文件夹,第三方厂商对drm,对自己硬件的实现与封装。

 

 

 

 

  • 5
    点赞
  • 38
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值