当前位置: 首页 > news >正文

DRM全解析 —— plane详解(1)

本文参考以下博文:

Linux内核4.14版本——drm框架分析(5)——plane分析

特此致谢!

1. 简介

一个plane代表一个image layer(硬件图层),最终的image由一个或者多个plane(s)组成。plane和 Framebuffer 一样是内存地址。plane主要包括以下3种类型:

  • DRM_PLANE_TYPE_PRIMARY:主要图层,通常用于仅支持RGB格式的简单图层
  • DRM_PLANE_TYPE_OVERLAY:叠加图层,通常用于YUV格式的视频图层
  • DRM_PLANE_TYPE_CURSOR:光标图层,一般用于pc系统,用于显示鼠标

2. 核心结构

在Linux内核的DRM中,plane对应的核心结构体为:struct drm_plane。该结构体在include/drm/drm_plane.h中定义,代码如下(Linux内核版本:6.1):

/*** struct drm_plane - central DRM plane control structure** Planes represent the scanout hardware of a display block. They receive their* input data from a &drm_framebuffer and feed it to a &drm_crtc. Planes control* the color conversion, see `Plane Composition Properties`_ for more details,* and are also involved in the color conversion of input pixels, see `Color* Management Properties`_ for details on that.*/
struct drm_plane {/** @dev: DRM device this plane belongs to */struct drm_device *dev;/*** @head:** List of all planes on @dev, linked from &drm_mode_config.plane_list.* Invariant over the lifetime of @dev and therefore does not need* locking.*/struct list_head head;/** @name: human readable name, can be overwritten by the driver */char *name;/*** @mutex:** Protects modeset plane state, together with the &drm_crtc.mutex of* CRTC this plane is linked to (when active, getting activated or* getting disabled).** For atomic drivers specifically this protects @state.*/struct drm_modeset_lock mutex;/** @base: base mode object */struct drm_mode_object base;/*** @possible_crtcs: pipes this plane can be bound to constructed from* drm_crtc_mask()*/uint32_t possible_crtcs;/** @format_types: array of formats supported by this plane */uint32_t *format_types;/** @format_count: Size of the array pointed at by @format_types. */unsigned int format_count;/*** @format_default: driver hasn't supplied supported formats for the* plane. Used by the non-atomic driver compatibility wrapper only.*/bool format_default;/** @modifiers: array of modifiers supported by this plane */uint64_t *modifiers;/** @modifier_count: Size of the array pointed at by @modifier_count. */unsigned int modifier_count;/*** @crtc:** Currently bound CRTC, only meaningful for non-atomic drivers. For* atomic drivers this is forced to be NULL, atomic drivers should* instead check &drm_plane_state.crtc.*/struct drm_crtc *crtc;/*** @fb:** Currently bound framebuffer, only meaningful for non-atomic drivers.* For atomic drivers this is forced to be NULL, atomic drivers should* instead check &drm_plane_state.fb.*/struct drm_framebuffer *fb;/*** @old_fb:** Temporary tracking of the old fb while a modeset is ongoing. Only* used by non-atomic drivers, forced to be NULL for atomic drivers.*/struct drm_framebuffer *old_fb;/** @funcs: plane control functions */const struct drm_plane_funcs *funcs;/** @properties: property tracking for this plane */struct drm_object_properties properties;/** @type: Type of plane, see &enum drm_plane_type for details. */enum drm_plane_type type;/*** @index: Position inside the mode_config.list, can be used as an array* index. It is invariant over the lifetime of the plane.*/unsigned index;/** @helper_private: mid-layer private data */const struct drm_plane_helper_funcs *helper_private;/*** @state:** Current atomic state for this plane.** This is protected by @mutex. Note that nonblocking atomic commits* access the current plane state without taking locks. Either by going* through the &struct drm_atomic_state pointers, see* for_each_oldnew_plane_in_state(), for_each_old_plane_in_state() and* for_each_new_plane_in_state(). Or through careful ordering of atomic* commit operations as implemented in the atomic helpers, see* &struct drm_crtc_commit.*/struct drm_plane_state *state;/*** @alpha_property:* Optional alpha property for this plane. See* drm_plane_create_alpha_property().*/struct drm_property *alpha_property;/*** @zpos_property:* Optional zpos property for this plane. See* drm_plane_create_zpos_property().*/struct drm_property *zpos_property;/*** @rotation_property:* Optional rotation property for this plane. See* drm_plane_create_rotation_property().*/struct drm_property *rotation_property;/*** @blend_mode_property:* Optional "pixel blend mode" enum property for this plane.* Blend mode property represents the alpha blending equation selection,* describing how the pixels from the current plane are composited with* the background.*/struct drm_property *blend_mode_property;/*** @color_encoding_property:** Optional "COLOR_ENCODING" enum property for specifying* color encoding for non RGB formats.* See drm_plane_create_color_properties().*/struct drm_property *color_encoding_property;/*** @color_range_property:** Optional "COLOR_RANGE" enum property for specifying* color range for non RGB formats.* See drm_plane_create_color_properties().*/struct drm_property *color_range_property;/*** @scaling_filter_property: property to apply a particular filter while* scaling.*/struct drm_property *scaling_filter_property;
};

3. drm_plane结构释义

(0)总述

DRM全解析 —— plane详解(1)

struct drm_plane —— 核心的DRM plane控制结构。

planes表示显示块的扫描输出硬件。它们从drm_framebuffer中接收输入数据,并将其提供给drm_crtc。planes控制颜色转换(有关详细信息,请参见“平面合成属性”),并且还参与输入像素的颜色转换(请参见“颜色管理属性”以了解详细信息)。

作用如下图示:

(1)struct drm_device *dev

    /** @dev: DRM device this plane belongs to */struct drm_device *dev;

此plane所属的DRM设备。

(2)struct list_head head

    /*** @head:** List of all planes on @dev, linked from &drm_mode_config.plane_list.* Invariant over the lifetime of @dev and therefore does not need* locking.*/struct list_head head;

@dev上所有平面的列表,链接自&drm_mode_config.plane_List。在@dev的生命周期内保持不变,因此不需要锁定。

(3)char *name

    /** @name: human readable name, can be overwritten by the driver */char *name;

人类可读的名称(名字),可以被驱动程序覆盖。

下一篇文章继续深入释义drm_plane结构中其余成员。

相关文章:

DRM全解析 —— plane详解(1)

本文参考以下博文: Linux内核4.14版本——drm框架分析(5)——plane分析 特此致谢! 1. 简介 一个plane代表一个image layer(硬件图层),最终的image由一个或者多个plane(s)组成。plane和 Framebuffer 一样是内存地址。…...

数据结构总结

数据结构 相关博文 单链表数组模拟单链表-CSDN博客双链表数组模拟双链表-CSDN博客栈及单调栈数组模拟栈以及单调栈-CSDN博客队列及单调队列数组模拟队列以及单调队列-CSDN博客KMPKMP详细算法思路-CSDN博客TrieTire树的理解-CSDN博客并查集并查集(面试常考&#xff…...

在SOLIDWORKS搭建一个简易的履带式机器人

文章目录 前言一、构建模型基本单元二、搭建车体模块三.插入轮子4.构建履带 前言 趁着十一假期,在solidworks中搭建了一个履带式机器人小车,计划将其应用在gazebo中完成多机器人编队的仿真。 一、构建模型基本单元 构建底板(a面&#xff09…...

C# 为什么要限制静态方法的使用

前言 在工作了一年多之后,我发现静态方法的耦合问题实在是头疼。如果可以尽量不要使用静态方法存储数据,如果要存储全局数据就把数据放在最顶层的主函数里面。 静态方法问题 耦合问题,不要用静态方法存储数据 我这里有两个静态方法&#…...

【已解决】Pyecharts折线图,只有坐标轴没有折线数据

【已解决】Pyecharts折线图,只有坐标轴没有折线数据 1、问题复现2、原因3、问题解决 1、问题复现 在做简单的数据通过 Pyecharts 生成折现图的时候,一直只有坐标轴没有折线数据,但是代码一直看不出问题,代码如下: im…...

win10搭建Selenium环境+java+IDEA(3)

这里主要对前面的maven和selenium做补充说明,以及更新一些pom文件下载依赖的问题。 IDEA里面,如果你创建的工程是maven工程文件,那么就会有一个pom.xml文件,可以在这个网站:https://mvnrepository.com/搜索依赖&#…...

String 、Stringbuffer、StringBuilder区别

上代码 public class Test {public static void main(String[] args) {//String 连接10000次消耗1127ms//StringBuffer 连接10000次消耗5ms//StringBuilder 连接10000次消耗3msStringTest(10000);StringBufferTest(10000);StringBuilderTest(10000);}public static void Strin…...

如何提升爬虫IP使用效率?精打细算的方法分享

在进行爬虫数据采集时,爬虫IP是不可或缺的工具。然而,爬虫IP的费用可能是一个爬虫项目的重要开支之一。为了帮助您节省爬虫IP经费,本文将分享一些经济高效的方法,让您在使用爬虫IP时更加节约成本,提高经济效益。 一、优…...

(高阶) Redis 7 第19讲 缓存过期淘汰策略 大厂篇

🌹 以下分享 Redis 缓存淘汰策略,如有问题请指教。🌹🌹 如你对技术也感兴趣,欢迎交流。🌹🌹🌹 如有对阁下帮助,请👍点赞💖收藏🐱‍🏍分享😀 面试题 1. 生产上,redis内存设置的多少 2. 如何配置、修改Redis 内存大小 3. 如果内存满了,如何处理 4. …...

【四旋翼飞行器】模拟四旋翼飞行器的平移和旋转动力学(Simulink仿真实现)

💥💥💞💞欢迎来到本博客❤️❤️💥💥 🏆博主优势:🌞🌞🌞博客内容尽量做到思维缜密,逻辑清晰,为了方便读者。 ⛳️座右铭&a…...

Kaggle - LLM Science Exam(一):赛事概述、数据收集、BERT Baseline

文章目录 一、赛事概述1.1 OpenBookQA Dataset1.2 比赛背景1.3 评估方法和代码要求1.4 比赛数据集1.5 优秀notebook 二、BERT Baseline2.1 数据预处理2.2 定义data_collator2.3 加载模型,配置trainer并训练2.4 预测结果并提交2.5 deberta-v3-large 1k Wiki&#xff…...

mmap底层驱动实现(remap_pfn_range函数)

mmap底层驱动实现 myfb.c&#xff08;申请了128K空间&#xff09; #include <linux/init.h> #include <linux/tty.h> #include <linux/device.h> #include <linux/export.h> #include <linux/types.h> #include <linux/module.h> #inclu…...

品牌如何查窜货

当渠道中的产品出现不按规定区域销售时&#xff0c;这种行为就叫做窜货&#xff0c;窜货不仅会扰乱渠道的健康发展&#xff0c;损害经销商的利益&#xff0c;同时会滋生低价、假货的发生&#xff0c;有效的管控窜货&#xff0c;需要品牌先将窜货链店铺找出来&#xff0c;才能进…...

Java基于SpringBoot的车辆充电桩

博主介绍&#xff1a;✌程序员徐师兄、7年大厂程序员经历。全网粉丝30W,Csdn博客专家、掘金/华为云/阿里云/InfoQ等平台优质作者、专注于Java技术领域和毕业项目实战✌ 文章目录 1、效果演示效果图 技术栈2、 前言介绍&#xff08;完整源码请私聊&#xff09;3、主要技术3.4.1…...

【ARM】(1)架构简介

前言 ARM既可以认为是一个公司的名字&#xff0c;也可以认为是对一类微处理器的通称&#xff0c;还可以认为是一种技术的名字。 ARM公司是专门从事基于RISC技术芯片设计开发的公司&#xff0c;作为知识产权&#xff08;IP&#xff09;供应商&#xff0c;本身不直接从事芯片生产…...

企业完善质量、环境、健康安全三体系认证的作用及其意义!

一、ISO三体系标准作用 ISO9001&#xff1a;质量管理体系&#xff0c;专门针对企业的质量管理&#xff0c;投标首选&#xff0c;很多大客户要求企业必备这项。 ISO14001&#xff1a;环境管理体系&#xff0c;针对企业的生产环境&#xff0c;排污&#xff0c;节能环保&#xf…...

<HarmonyOS第一课>运行Hello World——闯关习题及答案

判断题 1.DevEco Studio是开发HarmonyOS应用的一站式集成开发环境。&#xff08; 对 &#xff09; 2.main_pages.json存放页面page路径配置信息。&#xff08; 对 &#xff09; 单选题 1.在stage模型中&#xff0c;下列配置文件属于AppScope文件夹的是&#xff1f;&#xff…...

NLP 02 RNN

一、RNN RNN(Recurrent Neural Network),中文称作循环神经网络它一般以序列数据为输入通过网络内部的结构设计有效捕捉序列之间的关系特征,一般也是以序列形式进行输出。 传统神经网络(包括CNN)&#xff0c;输入和输出都是互相独立的。但有些任务&#xff0c;后续的输出和之前…...

@PostConstruct注解

PostConstruct注解 PostConstruct注解是javax.annotation包下的一个注解&#xff0c;用于标记一个方法&#xff0c;在构造函数执行之后&#xff0c;依赖注入(如Autowired&#xff0c;意味着在方法内部可以安全地使用依赖注入的成员变量&#xff0c;而不会出现空指针异常&#…...

拓世AI|中秋节营销攻略,创意文案和海报一键生成

秋风意境多诗情&#xff0c;中秋月圆思最浓。又是一年中秋节&#xff0c;作为中国传统的重要节日之一&#xff0c;中秋节的意义早已不再仅仅是一家团圆的节日&#xff0c;更是一场商业盛宴。品牌方们纷纷加入其中&#xff0c;希望能够借助这一节日为自己的产品赢得更多的关注和…...

8k长序列建模,蛋白质语言模型Prot42仅利用目标蛋白序列即可生成高亲和力结合剂

蛋白质结合剂&#xff08;如抗体、抑制肽&#xff09;在疾病诊断、成像分析及靶向药物递送等关键场景中发挥着不可替代的作用。传统上&#xff0c;高特异性蛋白质结合剂的开发高度依赖噬菌体展示、定向进化等实验技术&#xff0c;但这类方法普遍面临资源消耗巨大、研发周期冗长…...

什么是库存周转?如何用进销存系统提高库存周转率?

你可能听说过这样一句话&#xff1a; “利润不是赚出来的&#xff0c;是管出来的。” 尤其是在制造业、批发零售、电商这类“货堆成山”的行业&#xff0c;很多企业看着销售不错&#xff0c;账上却没钱、利润也不见了&#xff0c;一翻库存才发现&#xff1a; 一堆卖不动的旧货…...

多模态大语言模型arxiv论文略读(108)

CROME: Cross-Modal Adapters for Efficient Multimodal LLM ➡️ 论文标题&#xff1a;CROME: Cross-Modal Adapters for Efficient Multimodal LLM ➡️ 论文作者&#xff1a;Sayna Ebrahimi, Sercan O. Arik, Tejas Nama, Tomas Pfister ➡️ 研究机构: Google Cloud AI Re…...

GC1808高性能24位立体声音频ADC芯片解析

1. 芯片概述 GC1808是一款24位立体声音频模数转换器&#xff08;ADC&#xff09;&#xff0c;支持8kHz~96kHz采样率&#xff0c;集成Δ-Σ调制器、数字抗混叠滤波器和高通滤波器&#xff0c;适用于高保真音频采集场景。 2. 核心特性 高精度&#xff1a;24位分辨率&#xff0c…...

有限自动机到正规文法转换器v1.0

1 项目简介 这是一个功能强大的有限自动机&#xff08;Finite Automaton, FA&#xff09;到正规文法&#xff08;Regular Grammar&#xff09;转换器&#xff0c;它配备了一个直观且完整的图形用户界面&#xff0c;使用户能够轻松地进行操作和观察。该程序基于编译原理中的经典…...

蓝桥杯 冶炼金属

原题目链接 &#x1f527; 冶炼金属转换率推测题解 &#x1f4dc; 原题描述 小蓝有一个神奇的炉子用于将普通金属 O O O 冶炼成为一种特殊金属 X X X。这个炉子有一个属性叫转换率 V V V&#xff0c;是一个正整数&#xff0c;表示每 V V V 个普通金属 O O O 可以冶炼出 …...

SQL慢可能是触发了ring buffer

简介 最近在进行 postgresql 性能排查的时候,发现 PG 在某一个时间并行执行的 SQL 变得特别慢。最后通过监控监观察到并行发起得时间 buffers_alloc 就急速上升,且低水位伴随在整个慢 SQL,一直是 buferIO 的等待事件,此时也没有其他会话的争抢。SQL 虽然不是高效 SQL ,但…...

在 Spring Boot 项目里,MYSQL中json类型字段使用

前言&#xff1a; 因为程序特殊需求导致&#xff0c;需要mysql数据库存储json类型数据&#xff0c;因此记录一下使用流程 1.java实体中新增字段 private List<User> users 2.增加mybatis-plus注解 TableField(typeHandler FastjsonTypeHandler.class) private Lis…...

Linux安全加固:从攻防视角构建系统免疫

Linux安全加固:从攻防视角构建系统免疫 构建坚不可摧的数字堡垒 引言:攻防对抗的新纪元 在日益复杂的网络威胁环境中,Linux系统安全已从被动防御转向主动免疫。2023年全球网络安全报告显示,高级持续性威胁(APT)攻击同比增长65%,平均入侵停留时间缩短至48小时。本章将从…...

基于江科大stm32屏幕驱动,实现OLED多级菜单(动画效果),结构体链表实现(独创源码)

引言 在嵌入式系统中&#xff0c;用户界面的设计往往直接影响到用户体验。本文将以STM32微控制器和OLED显示屏为例&#xff0c;介绍如何实现一个多级菜单系统。该系统支持用户通过按键导航菜单&#xff0c;执行相应操作&#xff0c;并提供平滑的滚动动画效果。 本文设计了一个…...