DRM全解析 —— encoder详解(3)

接前一篇文章:DRM全解析 ------ encoder详解(2)

本文继续对DRM中encoder的核心结构struct drm_encoder的成员进行释义。

3. drm_encoder结构释义

(8)uint32_t possible_clones

cpp 复制代码
    /**
	 * @possible_clones: Bitmask of potential sibling encoders for cloning,
	 * using drm_encoder_index() as the index into the bitfield. The driver
	 * must set the bits for all &drm_encoder objects which can clone a
	 * &drm_crtc together with this encoder before calling
	 * drm_dev_register(). Drivers should set the bit representing the
	 * encoder itself, too. Cloning bits should be set such that when two
	 * encoders can be used in a cloned configuration, they both should have
	 * each another bits set.
	 *
	 * As an exception to the above rule if the driver doesn't implement
	 * any cloning it can leave @possible_clones set to 0. The core will
	 * automagically fix this up by setting the bit for the encoder itself.
	 *
	 * You will get a WARN if you get this wrong in the driver.
	 *
	 * Note that since encoder objects can't be hotplugged the assigned indices
	 * are stable and hence known before registering all objects.
	 */
	uint32_t possible_clones;

用于克隆的潜在兄弟encoder的位掩码,使用drm_encoder_index()作为位域的索引。在调用drm_dev_register()之前,驱动程序必须设置好所有&drm_encoder对象的位,这些对象可以与此编码器一起克隆&drm_crtc。驱动程序也应该设置表示编码器本身的位。克隆位应被设置,以便在克隆配置中可以使用两个编码器时,它们应能够互相设置对方的位。

作为上述规则的例外,如果驱动程序没有实现任何克隆,则可以将@possible_clones设置为0。

你将得到警告,如果在写驱动时犯了此错误。

注意,由于encoder对象不能热插拔,因此在注册所有对象之前,分配的索引是稳定的,因此是已知的。

(9)struct drm_crtc *crtc

cpp 复制代码
    /**
	 * @crtc: Currently bound CRTC, only really meaningful for non-atomic
	 * drivers.  Atomic drivers should instead check
	 * &drm_connector_state.crtc.
	 */
	struct drm_crtc *crtc;

当前绑定的CRTC,仅对非原子驱动程序真正有意义。而原子驱动程序应该检查&drm_connector_state.crtc。

(10)struct list_head bridge_chain

cpp 复制代码
    /**
	 * @bridge_chain: Bridges attached to this encoder. Drivers shall not
	 * access this field directly.
	 */
	struct list_head bridge_chain;

连接到此encoder的桥接器。驱动不应直接访问此字段。

(11)const struct drm_encoder_funcs *funcs

cpp 复制代码
    /** @funcs: control functions, can be NULL for simple managed encoders */
    const struct drm_encoder_funcs *funcs;

控制函数,对于简单的托管encoder可以(设置)为NULL。

(12)const struct drm_encoder_helper_funcs *helper_private

cpp 复制代码
    /** @helper_private: mid-layer private data */
    const struct drm_encoder_helper_funcs *helper_private;

中间层私有数据。

至此,DRM encoder的核心结构struct drm_encoder就释义完成了。后续会对此结构中涉及到的结构进行深入讲解。

相关推荐
DeeplyMind14 天前
AMD KFD的BO设计分析系列3-4:Linux DRM GEM mmap 与 drm_vma_offset_node 机制详解
linux·drm·opengl驱动·drm_gem_object
林政硕(Cohen0415)6 个月前
Linux驱动开发进阶(七)- DRM驱动程序设计
linux·驱动开发·drm
songze_lee8 个月前
openharmony系统移植之显示驱动框架从framebuffer升级为drm(linux-5.10)
linux·openharmony·drm
AlfredZhao9 个月前
永远不要轻易设置Oracle的隐藏参数,哪怕是DRM
oracle·drm·_gc_undo_affinity
芒果黑1 年前
Qt WebEngine播放DRM音视频
drm·qt webengine
炭烤毛蛋2 年前
modetest
drm·framebuffer
wenshizhang2 年前
AMD显卡休眠唤醒流程分析
linux·内核·drm·amdgpu
Android系统攻城狮2 年前
Android12之DRM架构(一)
drm
蓝天居士2 年前
DRM全解析 —— connector详解(1)
drm