/* * We may not want to change the frequency of the parent clock, since * it may be a parent for other peripherals. This is due to the fact * that on Tegra20 there's only a single clock dedicated to display * (pll_d_out0), whereas later generations have a second one that can * be used to independently drive a second output (pll_d2_out0). * * As a way to support multiple outputs on Tegra20 as well, pll_p is * typically used as the parent clock for the display controllers. * But this comes at a cost: pll_p is the parent of several other * peripherals, so its frequency shouldn't change out of the blue. * * The best we can do at this point is to use the shift clock divider * and hope that the desired frequency can be matched (or at least * matched sufficiently close that the panel will still work).
*/ if (tegra_rgb_pll_rate_change_allowed(rgb)) { /* * Set display controller clock to x2 of PCLK in order to * produce higher resolution pulse positions.
*/
div = 2;
pclk *= 2;
} else {
div = ((clk_get_rate(rgb->clk) * 2) / pclk) - 2;
pclk = 0;
}
/* * Wrap directly-connected panel into DRM bridge in order to let * DRM core to handle panel for us.
*/ if (output->panel) {
output->bridge = devm_drm_panel_bridge_add(output->dev,
output->panel); if (IS_ERR(output->bridge)) {
dev_err(output->dev, "failed to wrap panel into bridge: %pe\n",
output->bridge); return PTR_ERR(output->bridge);
}
output->panel = NULL;
}
/* * Tegra devices that have LVDS panel utilize LVDS encoder bridge * for converting up to 28 LCD LVTTL lanes into 5/4 LVDS lanes that * go to display panel's receiver. * * Encoder usually have a power-down control which needs to be enabled * in order to transmit data to the panel. Historically devices that * use an older device-tree version didn't model the bridge, assuming * that encoder is turned ON by default, while today's DRM allows us * to model LVDS encoder properly. * * Newer device-trees utilize LVDS encoder bridge, which provides * us with a connector and handles the display panel. * * For older device-trees we wrapped panel into the panel-bridge.
*/ if (output->bridge) {
err = drm_bridge_attach(&output->encoder, output->bridge,
NULL, DRM_BRIDGE_ATTACH_NO_CONNECTOR); if (err) return err;
connector = drm_bridge_connector_init(drm, &output->encoder); if (IS_ERR(connector)) {
dev_err(output->dev, "failed to initialize bridge connector: %pe\n",
connector); return PTR_ERR(connector);
}
err = tegra_output_init(drm, output); if (err < 0) {
dev_err(output->dev, "failed to initialize output: %d\n", err); return err;
}
/* * Other outputs can be attached to either display controller. The RGB * outputs are an exception and work only with their parent display * controller.
*/
output->encoder.possible_crtcs = drm_crtc_mask(&dc->base);
return 0;
}
int tegra_dc_rgb_exit(struct tegra_dc *dc)
{ if (dc->rgb)
tegra_output_exit(dc->rgb);
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.