Lines Matching +full:dpi +full:- +full:to +full:- +full:lvds
4 * Permission to use, copy, modify, distribute, and sell this software and its
9 * publicity pertaining to distribution of the software without specific,
14 * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
40 * pixel data from a CRTC and converts it to a format suitable for any attached
41 * connector. Encoders are objects exposed to userspace, originally to allow
42 * userspace to infer cloning and connector/CRTC restrictions. Unfortunately
45 * the recommended way to infer restrictions is by using the
50 * free to use them however they wish. Modeset helper libraries make strong use
51 * of encoders to facilitate code sharing. But for more complex settings it is
52 * usually better to move shared code into a separate &drm_bridge. Compared to
54 * abstraction since they are not exposed to userspace at all.
63 { DRM_MODE_ENCODER_LVDS, "LVDS" },
68 { DRM_MODE_ENCODER_DPI, "DPI" },
77 if (encoder->funcs && encoder->funcs->late_register) in drm_encoder_register_all()
78 ret = encoder->funcs->late_register(encoder); in drm_encoder_register_all()
91 if (encoder->funcs && encoder->funcs->early_unregister) in drm_encoder_unregister_all()
92 encoder->funcs->early_unregister(encoder); in drm_encoder_unregister_all()
105 if (WARN_ON(dev->mode_config.num_encoder >= 32)) in __drm_encoder_init()
106 return -EINVAL; in __drm_encoder_init()
108 ret = drm_mode_object_add(dev, &encoder->base, DRM_MODE_OBJECT_ENCODER); in __drm_encoder_init()
112 encoder->dev = dev; in __drm_encoder_init()
113 encoder->encoder_type = encoder_type; in __drm_encoder_init()
114 encoder->funcs = funcs; in __drm_encoder_init()
116 encoder->name = kvasprintf(GFP_KERNEL, name, ap); in __drm_encoder_init()
118 encoder->name = kasprintf(GFP_KERNEL, "%s-%d", in __drm_encoder_init()
120 encoder->base.id); in __drm_encoder_init()
122 if (!encoder->name) { in __drm_encoder_init()
123 ret = -ENOMEM; in __drm_encoder_init()
127 INIT_LIST_HEAD(&encoder->bridge_chain); in __drm_encoder_init()
128 list_add_tail(&encoder->head, &dev->mode_config.encoder_list); in __drm_encoder_init()
129 encoder->index = dev->mode_config.num_encoder++; in __drm_encoder_init()
133 drm_mode_object_unregister(dev, &encoder->base); in __drm_encoder_init()
139 * drm_encoder_init - Init a preallocated encoder
141 * @encoder: the encoder to init
153 * instead of drm_encoder_init() to let the DRM managed resource
167 WARN_ON(!funcs->destroy); in drm_encoder_init()
178 * drm_encoder_cleanup - cleans up an initialised encoder
179 * @encoder: encoder to cleanup
185 struct drm_device *dev = encoder->dev; in drm_encoder_cleanup()
188 /* Note that the encoder_list is considered to be static; should we in drm_encoder_cleanup()
189 * remove the drm_encoder at runtime we would have to decrement all in drm_encoder_cleanup()
193 list_for_each_entry_safe(bridge, next, &encoder->bridge_chain, in drm_encoder_cleanup()
197 drm_mode_object_unregister(dev, &encoder->base); in drm_encoder_cleanup()
198 kfree(encoder->name); in drm_encoder_cleanup()
199 list_del(&encoder->head); in drm_encoder_cleanup()
200 dev->mode_config.num_encoder--; in drm_encoder_cleanup()
210 if (WARN_ON(!encoder->dev)) in drmm_encoder_alloc_release()
226 if (drm_WARN_ON(dev, funcs && funcs->destroy)) in __drmm_encoder_init()
227 return -EINVAL; in __drmm_encoder_init()
251 return ERR_PTR(-ENOMEM); in __drmm_encoder_alloc()
266 * drmm_encoder_init - Initialize a preallocated encoder
268 * @encoder: the encoder to init
303 struct drm_device *dev = encoder->dev; in drm_encoder_get_crtc()
311 if (!connector->state) in drm_encoder_get_crtc()
316 if (connector->state->best_encoder != encoder) in drm_encoder_get_crtc()
320 return connector->state->crtc; in drm_encoder_get_crtc()
328 return encoder->crtc; in drm_encoder_get_crtc()
339 return -EOPNOTSUPP; in drm_mode_getencoder()
341 encoder = drm_encoder_find(dev, file_priv, enc_resp->encoder_id); in drm_mode_getencoder()
343 return -ENOENT; in drm_mode_getencoder()
345 drm_modeset_lock(&dev->mode_config.connection_mutex, NULL); in drm_mode_getencoder()
347 if (crtc && drm_lease_held(file_priv, crtc->base.id)) in drm_mode_getencoder()
348 enc_resp->crtc_id = crtc->base.id; in drm_mode_getencoder()
350 enc_resp->crtc_id = 0; in drm_mode_getencoder()
351 drm_modeset_unlock(&dev->mode_config.connection_mutex); in drm_mode_getencoder()
353 enc_resp->encoder_type = encoder->encoder_type; in drm_mode_getencoder()
354 enc_resp->encoder_id = encoder->base.id; in drm_mode_getencoder()
355 enc_resp->possible_crtcs = drm_lease_filter_crtcs(file_priv, in drm_mode_getencoder()
356 encoder->possible_crtcs); in drm_mode_getencoder()
357 enc_resp->possible_clones = encoder->possible_clones; in drm_mode_getencoder()