/** * drm_fbdev_client_setup() - Setup fbdev emulation * @dev: DRM device * @format: Preferred color format for the device. DRM_FORMAT_XRGB8888 * is used if this is zero. * * This function sets up fbdev emulation. Restore, hotplug events and * teardown are all taken care of. Drivers that do suspend/resume need * to call drm_client_dev_suspend() and drm_client_dev_resume() by * themselves. Simple drivers might use drm_mode_config_helper_suspend(). * * This function is safe to call even when there are no connectors present. * Setup will be retried on the next hotplug event. * * The fbdev client is destroyed by drm_dev_unregister(). * * Returns: * 0 on success, or a negative errno code otherwise.
*/ int drm_fbdev_client_setup(struct drm_device *dev, conststruct drm_format_info *format)
{ struct drm_fb_helper *fb_helper; unsignedint color_mode; int ret;
/* TODO: Use format info throughout DRM */ if (format) { unsignedint bpp = drm_format_info_bpp(format, 0);
switch (bpp) { case 16:
color_mode = format->depth; // could also be 15 break; default:
color_mode = bpp;
}
} else { switch (dev->mode_config.preferred_depth) { case 0: case 24:
color_mode = 32; break; default:
color_mode = dev->mode_config.preferred_depth;
}
}
drm_WARN(dev, !dev->registered, "Device has not been registered.\n");
drm_WARN(dev, dev->fb_helper, "fb_helper is already set!\n");
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.