/** * psb_framebuffer_init - initialize a framebuffer * @dev: our DRM device * @fb: framebuffer to set up * @mode_cmd: mode description * @obj: backing object * * Configure and fill in the boilerplate for our frame buffer. Return * 0 on success or an error code if we fail.
*/ staticint psb_framebuffer_init(struct drm_device *dev, struct drm_framebuffer *fb, conststruct drm_format_info *info, conststruct drm_mode_fb_cmd2 *mode_cmd, struct drm_gem_object *obj)
{ int ret;
/* * Reject unknown formats, YUV formats, and formats with more than * 4 bytes per pixel.
*/ if (!info->depth || info->cpp[0] > 4) return -EINVAL;
/** * psb_framebuffer_create - create a framebuffer backed by gt * @dev: our DRM device * @info: pixel format information * @mode_cmd: the description of the requested mode * @obj: the backing object * * Create a framebuffer object backed by the gt, and fill in the * boilerplate required * * TODO: review object references
*/ struct drm_framebuffer *psb_framebuffer_create(struct drm_device *dev, conststruct drm_format_info *info, conststruct drm_mode_fb_cmd2 *mode_cmd, struct drm_gem_object *obj)
{ struct drm_framebuffer *fb; int ret;
fb = kzalloc(sizeof(*fb), GFP_KERNEL); if (!fb) return ERR_PTR(-ENOMEM);
ret = psb_framebuffer_init(dev, fb, info, mode_cmd, obj); if (ret) {
kfree(fb); return ERR_PTR(ret);
} return fb;
}
/* * Find the GEM object and thus the gtt range object that is * to back this space
*/
obj = drm_gem_object_lookup(filp, cmd->handles[0]); if (obj == NULL) return ERR_PTR(-ENOENT);
/* Let the core code do all the work */
fb = psb_framebuffer_create(dev, info, cmd, obj); if (IS_ERR(fb))
drm_gem_object_put(obj);
/* It is ok for this to fail - we just don't get backlight control */ if (!dev_priv->backlight_property)
dev_priv->backlight_property = drm_property_create_range(dev, 0, "backlight", 0, 100);
dev_priv->ops->output_init(dev);
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.