鸿蒙OpenHarmony【外设驱动使用之Display VDI 接入】 子系统

06-01 1495阅读

Display VDI 接入指南

概述

显示VDI(Vendor Device Interface)接口是为了方便芯片厂商接入OpenHarmony显示驱动框架模型而提供的接口。 显示VDI接口分为Composer和Buffer部分:

  • Composer:负责图层(Layer)合成和显示。
  • Buffer:负责申请和释放SurfaceBuffer。

Composer部分

图 1 Display Composer HDI架构

鸿蒙OpenHarmony【外设驱动使用之Display VDI 接入】 子系统

该框架模型内部分为三层,依次为框架层、HDI实现层、和Vendor驱动层。各层基本概念如下:

  • 框架层:对接HDI实现层的控制、图层的显示和合成,管理显示模块各个硬件设备等功能。
  • HDI实现层:实现OHOS(OpenHarmony Operation System)Composer HDI接口。
  • Vendor驱动层:屏蔽底层芯片和OS(Operation System)差异,支持多平台适配。

Buffer部分

图 2 Display Buffer HDI架构

鸿蒙OpenHarmony【外设驱动使用之Display VDI 接入】 子系统

该框架模型内部分为三层,依次为框架层、HDI实现层、和Vendor驱动层。各层基本概念如下:

  • 框架层:对接HDI实现层的控制、图形buffer的申请和释放。
  • HDI实现层:实现OHOS(OpenHarmony Operation System)Buffer HDI接口。
  • Vendor驱动层:屏蔽底层芯片和OS(Operation System)差异,支持多平台适配。

开发指导

Composer部分

接口说明

注:以下接口列举的为VDI接口,接口声明见文件/drivers/peripheral/display/composer/hdi_service/include/idisplay_composer_vdi.h,获取路径为:https://gitee.com/openharmony/drivers_peripheral/tree/master/display/composer。

  • idisplay_composer_vdi.h

    功能描述 接口名称
    注册热插拔事件回调 int32_t RegHotPlugCallback(HotPlugCallback cb, void* data)
    获取显示设备能力集 int32_t GetDisplayCapability(uint32_t devId, DisplayCapability& info)
    获取显示设备支持的显示模式信息 int32_t GetDisplaySupportedModes(uint32_t devId, std::vector& modes)
    获取显示设备当前的显示模式 int32_t GetDisplayMode(uint32_t devId, uint32_t& modeId)
    设置显示设备的显示模式 int32_t SetDisplayMode(uint32_t devId, uint32_t modeId)
    获取显示设备当前的电源状态 int32_t GetDisplayPowerStatus(uint32_t devId, DispPowerStatus& status)
    设置显示设备当前的电源状态 int32_t SetDisplayPowerStatus(uint32_t devId, DispPowerStatus status)
    获取显示设备当前的背光值 int32_t GetDisplayBacklight(uint32_t devId, uint32_t& level)
    设置显示设备当前的背光值 int32_t SetDisplayBacklight(uint32_t devId, uint32_t level)
    获取显示设备属性值 int32_t GetDisplayProperty(uint32_t devId, uint32_t id, uint64_t& value)
    获取显示设备合成类型有变化的layer int32_t GetDisplayCompChange(uint32_t devId, std::vector& layers, std::vector& types)
    设置显示设备的裁剪区域 int32_t SetDisplayClientCrop(uint32_t devId, const IRect& rect)
    设置显示设备的显示缓存 int32_t SetDisplayClientBuffer(uint32_t devId, const BufferHandle& buffer, int32_t fence)
    设置显示设备的显示脏区 int32_t SetDisplayClientDamage(uint32_t devId, std::vector& rects)
    使能垂直同步信号 int32_t SetDisplayVsyncEnabled(uint32_t devId, bool enabled)
    注册VBlank事件回调 int32_t RegDisplayVBlankC
免责声明:我们致力于保护作者版权,注重分享,被刊用文章因无法核实真实出处,未能及时与作者取得联系,或有版权异议的,请联系管理员,我们会立即处理! 部分文章是来自自研大数据AI进行生成,内容摘自(百度百科,百度知道,头条百科,中国民法典,刑法,牛津词典,新华词典,汉语词典,国家院校,科普平台)等数据,内容仅供学习参考,不准确地方联系删除处理! 图片声明:本站部分配图来自人工智能系统AI生成,觅知网授权图片,PxHere摄影无版权图库和百度,360,搜狗等多加搜索引擎自动关键词搜索配图,如有侵权的图片,请第一时间联系我们。

相关阅读

目录[+]

取消
微信二维码
微信二维码
支付宝二维码