Lines Matching full:encoder
40 * generic sink entity, represented by &struct drm_connector). An encoder takes
74 struct drm_encoder *encoder; in drm_encoder_register_all() local
77 drm_for_each_encoder(encoder, dev) { in drm_encoder_register_all()
78 drm_debugfs_encoder_add(encoder); in drm_encoder_register_all()
80 if (encoder->funcs && encoder->funcs->late_register) in drm_encoder_register_all()
81 ret = encoder->funcs->late_register(encoder); in drm_encoder_register_all()
91 struct drm_encoder *encoder; in drm_encoder_unregister_all() local
93 drm_for_each_encoder(encoder, dev) { in drm_encoder_unregister_all()
94 if (encoder->funcs && encoder->funcs->early_unregister) in drm_encoder_unregister_all()
95 encoder->funcs->early_unregister(encoder); in drm_encoder_unregister_all()
96 drm_debugfs_encoder_remove(encoder); in drm_encoder_unregister_all()
102 struct drm_encoder *encoder, in __drm_encoder_init() argument
108 /* encoder index is used with 32bit bitmasks */ in __drm_encoder_init()
112 ret = drm_mode_object_add(dev, &encoder->base, DRM_MODE_OBJECT_ENCODER); in __drm_encoder_init()
116 encoder->dev = dev; in __drm_encoder_init()
117 encoder->encoder_type = encoder_type; in __drm_encoder_init()
118 encoder->funcs = funcs; in __drm_encoder_init()
120 encoder->name = kvasprintf(GFP_KERNEL, name, ap); in __drm_encoder_init()
122 encoder->name = kasprintf(GFP_KERNEL, "%s-%d", in __drm_encoder_init()
124 encoder->base.id); in __drm_encoder_init()
126 if (!encoder->name) { in __drm_encoder_init()
131 INIT_LIST_HEAD(&encoder->bridge_chain); in __drm_encoder_init()
132 list_add_tail(&encoder->head, &dev->mode_config.encoder_list); in __drm_encoder_init()
133 encoder->index = dev->mode_config.num_encoder++; in __drm_encoder_init()
137 drm_mode_object_unregister(dev, &encoder->base); in __drm_encoder_init()
143 * drm_encoder_init - Init a preallocated encoder
145 * @encoder: the encoder to init
146 * @funcs: callbacks for this encoder
147 * @encoder_type: user visible type of the encoder
148 * @name: printf style format string for the encoder name, or NULL for default name
150 * Initializes a preallocated encoder. Encoder should be subclassed as part of
151 * driver encoder objects. At driver unload time the driver's
153 * the encoder structure. The encoder structure should not be allocated with
164 struct drm_encoder *encoder, in drm_encoder_init() argument
174 ret = __drm_encoder_init(dev, encoder, funcs, encoder_type, name, ap); in drm_encoder_init()
182 * drm_encoder_cleanup - cleans up an initialised encoder
183 * @encoder: encoder to cleanup
185 * Cleans up the encoder but doesn't free the object.
187 void drm_encoder_cleanup(struct drm_encoder *encoder) in drm_encoder_cleanup() argument
189 struct drm_device *dev = encoder->dev; in drm_encoder_cleanup()
197 list_for_each_entry_safe(bridge, next, &encoder->bridge_chain, in drm_encoder_cleanup()
201 drm_mode_object_unregister(dev, &encoder->base); in drm_encoder_cleanup()
202 kfree(encoder->name); in drm_encoder_cleanup()
203 list_del(&encoder->head); in drm_encoder_cleanup()
206 memset(encoder, 0, sizeof(*encoder)); in drm_encoder_cleanup()
212 struct drm_encoder *encoder = ptr; in drmm_encoder_alloc_release() local
214 if (WARN_ON(!encoder->dev)) in drmm_encoder_alloc_release()
217 drm_encoder_cleanup(encoder); in drmm_encoder_alloc_release()
222 struct drm_encoder *encoder, in __drmm_encoder_init() argument
233 ret = __drm_encoder_init(dev, encoder, funcs, encoder_type, name, args); in __drmm_encoder_init()
237 ret = drmm_add_action_or_reset(dev, drmm_encoder_alloc_release, encoder); in __drmm_encoder_init()
249 struct drm_encoder *encoder; in __drmm_encoder_alloc() local
257 encoder = container + offset; in __drmm_encoder_alloc()
260 ret = __drmm_encoder_init(dev, encoder, funcs, encoder_type, name, ap); in __drmm_encoder_alloc()
270 * drmm_encoder_init - Initialize a preallocated encoder
272 * @encoder: the encoder to init
273 * @funcs: callbacks for this encoder (optional)
274 * @encoder_type: user visible type of the encoder
275 * @name: printf style format string for the encoder name, or NULL for default name
277 * Initializes a preallocated encoder. Encoder should be subclassed as
278 * part of driver encoder objects. Cleanup is automatically handled
280 * encoder structure should be allocated with drmm_kzalloc().
287 int drmm_encoder_init(struct drm_device *dev, struct drm_encoder *encoder, in drmm_encoder_init() argument
295 ret = __drmm_encoder_init(dev, encoder, funcs, encoder_type, name, ap); in drmm_encoder_init()
304 static struct drm_crtc *drm_encoder_get_crtc(struct drm_encoder *encoder) in drm_encoder_get_crtc() argument
307 struct drm_device *dev = encoder->dev; in drm_encoder_get_crtc()
320 if (connector->state->best_encoder != encoder) in drm_encoder_get_crtc()
332 return encoder->crtc; in drm_encoder_get_crtc()
339 struct drm_encoder *encoder; in drm_mode_getencoder() local
345 encoder = drm_encoder_find(dev, file_priv, enc_resp->encoder_id); in drm_mode_getencoder()
346 if (!encoder) in drm_mode_getencoder()
350 crtc = drm_encoder_get_crtc(encoder); in drm_mode_getencoder()
357 enc_resp->encoder_type = encoder->encoder_type; in drm_mode_getencoder()
358 enc_resp->encoder_id = encoder->base.id; in drm_mode_getencoder()
360 encoder->possible_crtcs); in drm_mode_getencoder()
361 enc_resp->possible_clones = encoder->possible_clones; in drm_mode_getencoder()