size = vmw_devcaps_size(dev_priv, vmw_fp->gb_aware); if (unlikely(size == 0)) {
DRM_ERROR("Failed to figure out the devcaps size (no 3D).\n"); return -ENOMEM;
}
if (arg->max_size < size)
size = arg->max_size;
bounce = vzalloc(size); if (unlikely(bounce == NULL)) {
DRM_ERROR("Failed to allocate bounce buffer for 3D caps.\n"); return -ENOMEM;
}
ret = vmw_devcaps_copy(dev_priv, vmw_fp->gb_aware, bounce, size); if (unlikely (ret != 0)) goto out_err;
ret = copy_to_user(buffer, bounce, size); if (ret)
ret = -EFAULT;
out_err:
vfree(bounce);
if (unlikely(ret != 0))
DRM_ERROR("Failed to report 3D caps info.\n");
if (clips_ptr == NULL) {
VMW_DEBUG_USER("Variable clips_ptr must be specified.\n");
ret = -EINVAL; goto out_clips;
}
clips = kcalloc(num_clips, sizeof(*clips), GFP_KERNEL); if (clips == NULL) {
DRM_ERROR("Failed to allocate clip rect list.\n");
ret = -ENOMEM; goto out_clips;
}
ret = copy_from_user(clips, clips_ptr, num_clips * sizeof(*clips)); if (ret) {
DRM_ERROR("Failed to copy clip rects from userspace.\n");
ret = -EFAULT; goto out_no_copy;
}
drm_modeset_lock_all(dev);
fb = drm_framebuffer_lookup(dev, file_priv, arg->fb_id); if (!fb) {
VMW_DEBUG_USER("Invalid framebuffer id.\n");
ret = -ENOENT; goto out_no_fb;
}
vfb = vmw_framebuffer_to_vfb(fb);
ret = vmw_user_resource_lookup_handle(dev_priv, tfile, arg->sid,
user_surface_converter,
&res); if (ret) goto out_no_surface;
if (clips_ptr == NULL) {
VMW_DEBUG_USER("Argument clips_ptr must be specified.\n");
ret = -EINVAL; goto out_clips;
}
clips = kcalloc(num_clips, sizeof(*clips), GFP_KERNEL); if (clips == NULL) {
DRM_ERROR("Failed to allocate clip rect list.\n");
ret = -ENOMEM; goto out_clips;
}
ret = copy_from_user(clips, clips_ptr, num_clips * sizeof(*clips)); if (ret) {
DRM_ERROR("Failed to copy clip rects from userspace.\n");
ret = -EFAULT; goto out_no_copy;
}
drm_modeset_lock_all(dev);
fb = drm_framebuffer_lookup(dev, file_priv, arg->fb_id); if (!fb) {
VMW_DEBUG_USER("Invalid framebuffer id.\n");
ret = -ENOENT; goto out_no_fb;
}
vfb = vmw_framebuffer_to_vfb(fb); if (!vfb->bo) {
VMW_DEBUG_USER("Framebuffer not buffer backed.\n");
ret = -EINVAL; goto out_no_ttm_lock;
}
ret = vmw_kms_readback(dev_priv, file_priv,
vfb, user_fence_rep,
clips, num_clips);
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.