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