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就释义完成了。后续会对此结构中涉及到的结构进行深入讲解。

相关推荐
芒果黑1 个月前
Qt WebEngine播放DRM音视频
drm·qt webengine
炭烤毛蛋9 个月前
modetest
drm·framebuffer
wenshizhang10 个月前
AMD显卡休眠唤醒流程分析
linux·内核·drm·amdgpu
Android系统攻城狮1 年前
Android12之DRM架构(一)
drm
蓝天居士1 年前
DRM全解析 —— connector详解(1)
drm
蓝天居士1 年前
DRM全解析 —— encoder详解(1)
drm
山东布谷科技官方1 年前
直播系统源码平台内容安全与版权维护技术:DRM
网络安全·drm·直播系统源码·数字版权管理·版权
风雨兼程80231 年前
Linux内核4.14版本——drm框架分析(14)——Atomic KMS 架构(struct drm_atomic_state)
drm
蓝天居士1 年前
DRM全解析 —— CREATE_DUMB(4)
linux内核·libdrm·drm