staticint imx_drm_atomic_check(struct drm_device *dev, struct drm_atomic_state *state)
{ int ret;
ret = drm_atomic_helper_check(dev, state); if (ret) return ret;
/* * Check modeset again in case crtc_state->mode_changed is * updated in plane's ->atomic_check callback.
*/
ret = drm_atomic_helper_check_modeset(dev, state); if (ret) return ret;
/* Assign PRG/PRE channels and check if all constrains are satisfied. */
ret = ipu_planes_assign_pre(dev, state); if (ret) return ret;
/* * The flip done wait is only strictly required by imx-drm if a deferred * plane disable is in-flight. As the core requires blocking commits * to wait for the flip it is done here unconditionally. This keeps the * workitem around a bit longer than required for the majority of * non-blocking commits, but we accept that for the sake of simplicity.
*/
drm_atomic_helper_wait_for_flip_done(dev, state);
if (plane_disabling) {
for_each_old_plane_in_state(state, plane, old_plane_state, i)
ipu_plane_disable_deferred(plane);
/* * If we failed to find the CRTC(s) which this encoder is * supposed to be connected to, it's because the CRTC has * not been registered yet. Defer probing, and hope that * the required CRTC is added later.
*/ if (crtc_mask == 0) return -EPROBE_DEFER;
encoder->possible_crtcs = crtc_mask;
/* FIXME: cloning support not clear, disable it all for now */
encoder->possible_clones = 0;
/* Special case for DI, dev->of_node may not be set yet */ if (strcmp(dev->driver->name, "imx-ipuv3-crtc") == 0) { struct ipu_client_platformdata *pdata = dev->platform_data;
return pdata->of_node == np;
}
/* Special case for LDB, one device for two channels */ if (of_node_name_eq(np, "lvds-channel")) {
np = of_get_parent(np);
of_node_put(np);
}
return dev->of_node == np;
}
staticint imx_drm_bind(struct device *dev)
{ struct drm_device *drm; int ret;
drm = drm_dev_alloc(&imx_drm_driver, dev); if (IS_ERR(drm)) return PTR_ERR(drm);
/* * set max width and height as default value(4096x4096). * this value would be used to check framebuffer size limitation * at drm_mode_addfb().
*/
drm->mode_config.min_width = 1;
drm->mode_config.min_height = 1;
drm->mode_config.max_width = 4096;
drm->mode_config.max_height = 4096;
drm->mode_config.funcs = &imx_drm_mode_config_funcs;
drm->mode_config.helper_private = &imx_drm_mode_config_helpers;
drm->mode_config.normalize_zpos = true;
ret = drmm_mode_config_init(drm); if (ret) goto err_kms;
ret = drm_vblank_init(drm, MAX_CRTC); if (ret) goto err_kms;
dev_set_drvdata(dev, drm);
/* Now try and bind all our sub-components */
ret = component_bind_all(dev, drm); if (ret) goto err_kms;
drm_mode_config_reset(drm);
/* * All components are now initialised, so setup the fb helper. * The fb helper takes copies of key hardware information, so the * crtcs/connectors/encoders must not change after this point.
*/ if (legacyfb_depth != 16 && legacyfb_depth != 32) {
dev_warn(dev, "Invalid legacyfb_depth. Defaulting to 16bpp\n");
legacyfb_depth = 16;
}
drm_kms_helper_poll_init(drm);
ret = drm_dev_register(drm, 0); if (ret) goto err_poll_fini;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.