Linux DRM的component框架有什么作用

技术Linux DRM的component框架有什么作用这篇文章主要介绍“Linux DRM的component框架有什么作用”,在日常操作中,相信很多人在Linux DRM的component框架有什么作用问题上存在疑

这篇文章主要介绍“Linux数字版权管理的成分框架有什么作用",在日常操作中,相信很多人在Linux操作系统数字版权管理的成分框架有什么作用问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答“Linux数字版权管理的成分框架有什么作用"的疑惑有所帮助!接下来,请跟着小编一起来学习吧!

一、component介绍

Linux内核成分代码实现文件:驱动程序/基础/组件。

使用查看指定文件的提交历史组件命令,可以查看该文件的第一次提交记录。

commit 2 a 41 e 6070 DD 7 ef 539d 0 F3 b 1652 b 4839d 04378 e 11作者: russellkingrmk kernel @ arm。Linux。组织。ukdate : fri Jan 10233:372014 0000驱动器/底座:为组件提供了一个基础结构subsystemssusystaschassa,drmandstors至少需要一个儿童级设备但是,固件tendsto描述了单个设备以及它们之间的连接。因此,weneedawaytogathupthingindividualcomponentdevicegether,并指示我们拥有所有组件设备通过配置“超级设备”节点,它指定了这些组件,eg:imx-drm{compatible='fsl,DRM ';crtcs=ipu1连接器=HDMI };perdevice被集成到组件中

upport, along with the    subcomponents.  The superdevice receives callbacks to locate the    subcomponents, and identify when all components are present.  At this    point, we bind the superdevice, which causes the appropriate subsystem    to be initialised in the conventional way.    When any of the components or superdevice are removed from the system,    we unbind the superdevice, thereby taking the subsystem down.

Linux内核引入component框架的目的:

在DRM、ALSA等子系统中,通过超级设备(superdevice)管理多个组件(component)加载顺序,保证所有组件都可正常使用。

二、超级设备

1.超级设备定义

超级设备也可称为master,一般指某个子系统(如:display-subsystem)。定义文件:rk3399.dtsi,内容如下:

    display_subsystem: display-subsystem {        compatible = "rockchip,display-subsystem";        ports = <&vopl_out>, <&vopb_out>;        clocks = <&cru PLL_VPLL>, <&cru PLL_CPLL>;        clock-names = "hdmi-tmds-pll", "default-vop-pll";        devfreq = <&dmc>;        status = "disabled";    };

2.超级设备加载

超级设备通过component_master_add_with_match()函数进行match注册,实现文件:rockchip_drm_drv.c,内容如下:

static int rockchip_drm_platform_probe(struct platform_device *pdev){    ...    /*     * Bind the crtc ports first, so that     * drm_of_find_possible_crtcs called from encoder .bind callbacks     * works as expected.     */    for (i = 0;; i++) {        ...        port = of_parse_phandle(np, "ports", i);        ...        component_match_add(dev, &match, compare_of, port->parent);  ## 1. Bind CRTC        of_node_put(port);    }    ...    /*     * For each bound crtc, bind the encoders attached to its     * remote endpoint.     */    for (i = 0;; i++) {        port = of_parse_phandle(np, "ports", i);                ...                rockchip_add_endpoints(dev, &match, port);                 ## 2. add endpoints for each port        of_node_put(port);    }    ...    return component_master_add_with_match(dev, &rockchip_drm_ops, match);}
三、component设备

1.component设备定义

component设备用来表示vop和各显示接口(如:HDMI、MIPI等),定义文件:rk3399.dtsi,内容如下:

        vopl_out: port {            #address-cells = <1>;            #size-cells = <0>;            vopl_out_dsi: endpoint@0 {                reg = <0>;                remote-endpoint = <&dsi_in_vopl>;            };            ...            vopl_out_hdmi: endpoint@2 {                reg = <2>;                remote-endpoint = <&hdmi_in_vopl>;            };            ...        };                vopb_out: port {            #address-cells = <1>;            #size-cells = <0>;            ...            vopb_out_dsi: endpoint@1 {                reg = <1>;                remote-endpoint = <&dsi_in_vopb>;            };            vopb_out_hdmi: endpoint@2 {                reg = <2>;                remote-endpoint = <&hdmi_in_vopb>;            };            ...        };

2.component设备加载

component设备通过component_add()函数进行加载。

vop实现文件rockchip_vop_reg.c,代码如下:

static int vop_probe(struct platform_device *pdev){    ...    return component_add(dev, &vop_component_ops);}

HDMI接口实现文件dw_hdmi-rockchip.c,代码如下:

static int dw_hdmi_rockchip_probe(struct platform_device *pdev){    ...    return component_add(&pdev->dev, &dw_hdmi_rockchip_ops);}

其它接口暂不介绍。

PS:

VOP(Video Output Processor)是Rockchip系列SoC的显示控制器。RK3399显示特性如下:

1、Dual VOP: one supports 4096x2160 with AFBC supported;The other supports 2560x16002、Dual channel MIPI-DSI (4 lanes per channel)3、eDP 1.3 (4 lanes with 10.8Gbps) to support display, with PSR4、HDMI 2.0 for 4K 60Hz with HDCP 1.4/2.25、DisplayPort 1.2 (4 lanes, up to 4K 60Hz)6、Supports Rec.2020 and conversion to Rec.709

注:本文代码基于RockPI 4A Debian系统Linux 4.4内核。

到此,关于“Linux DRM的component框架有什么作用”的学习就结束了,希望能够解决大家的疑惑。理论与实践的搭配能更好的帮助大家学习,快去试试吧!若想继续学习更多相关知识,请继续关注网站,小编会继续努力为大家带来更多实用的文章!

内容来源网络,如有侵权,联系删除,本文地址:https://www.230890.com/zhan/113129.html

(0)

相关推荐

  • 动词的过去分词,英语常见的动词过去式和过去分词!

    技术动词的过去分词,英语常见的动词过去式和过去分词!常用动词过去式及过去分词 规则动词的过去式及过去分词:(1)直接加ed(e结尾单词直接加d)(2)双写最后一个字母加ed(3)辅音字母加y结尾的去y加ied(1)直接加

    生活 2021年10月20日
  • 拔苗助长告诉我们什么道理,揠苗助长告诉我们什么道理

    技术拔苗助长告诉我们什么道理,揠苗助长告诉我们什么道理揠苗助长的故事出自《孟子·公孙丑上》,揠,是拔起的意思。揠苗助长的意思就是把苗拔起,帮助其生长,比喻不管事物的发展规律,强求速成,反而把事情弄糟。天下不希望自己禾苗长

    生活 2021年10月26日
  • 微信免单,周末微信支付怎么怎么能够免单

    技术微信免单,周末微信支付怎么怎么能够免单微信支付在春节期间推出摇一摇赢免单活动,意思就是如果你用微信支付就有机会获得免单奖励的,比如你在网上用微信支付买了一个月的qq音乐会员8元,用微信支付后会出现一个摇一摇获得免单机

    生活 2021年10月20日
  • java中抽象类和接口的区别(java接口和抽象类有什么不同)

    技术java中抽象类和接口的相同和不同点是什么这篇文章将为大家详细讲解有关java中抽象类和接口的相同和不同点是什么,文章内容质量较高,因此小编分享给大家做个参考,希望大家阅读完这篇文章后对相关知识有一定的了解。前言下面

    攻略 2021年12月20日
  • git flow 的正确使用姿势(gitflow工作流程)

    技术如何浅析GitLab Flow的十一个规则本篇文章为大家展示了如何浅析GitLab Flow的十一个规则,内容简明扼要并且容易理解,绝对能使你眼前一亮,通过这篇文章的详细介绍希望你能有所收获。使用 Git 版本控制

    攻略 2021年12月18日
  • 拼多多可以用花呗吗,京东淘宝拼多多分别用什么付款

    技术拼多多可以用花呗吗,京东淘宝拼多多分别用什么付款京东是京东自己的白条或者网银还有微信拼多多可以用花呗吗,淘宝可以支付宝跟网银,
    拼多多可以微信或者支付宝还有网银。
    无论是淘宝还是京东,就目前来看,都属于两个做得非常大

    生活 2021年10月31日