Lines Matching full:blob
513 * NOTE: The idea seems to have been to use this to read all the blob in drm_mode_getproperty_ioctl()
516 * read the value for a blob property. It also doesn't make a lot of in drm_mode_getproperty_ioctl()
528 struct drm_property_blob *blob = in drm_property_free_blob() local
531 mutex_lock(&blob->dev->mode_config.blob_lock); in drm_property_free_blob()
532 list_del(&blob->head_global); in drm_property_free_blob()
533 mutex_unlock(&blob->dev->mode_config.blob_lock); in drm_property_free_blob()
535 drm_mode_object_unregister(blob->dev, &blob->base); in drm_property_free_blob()
537 kvfree(blob); in drm_property_free_blob()
541 * drm_property_create_blob - Create new blob property
543 * @length: Length to allocate for blob data
544 * @data: If specified, copies data into blob
546 * Creates a new blob property for a specified DRM device, optionally
547 * copying data. Note that blob properties are meant to be invariant, hence the
548 * data must be filled out before the blob is used as the value of any property.
551 * New blob property with a single reference on success, or an ERR_PTR
558 struct drm_property_blob *blob; in drm_property_create_blob() local
564 blob = kvzalloc(sizeof(struct drm_property_blob)+length, GFP_KERNEL); in drm_property_create_blob()
565 if (!blob) in drm_property_create_blob()
570 INIT_LIST_HEAD(&blob->head_file); in drm_property_create_blob()
571 blob->data = (void *)blob + sizeof(*blob); in drm_property_create_blob()
572 blob->length = length; in drm_property_create_blob()
573 blob->dev = dev; in drm_property_create_blob()
576 memcpy(blob->data, data, length); in drm_property_create_blob()
578 ret = __drm_mode_object_add(dev, &blob->base, DRM_MODE_OBJECT_BLOB, in drm_property_create_blob()
581 kvfree(blob); in drm_property_create_blob()
586 list_add_tail(&blob->head_global, in drm_property_create_blob()
590 return blob; in drm_property_create_blob()
595 * drm_property_blob_put - release a blob property reference
596 * @blob: DRM blob property
598 * Releases a reference to a blob property. May free the object.
600 void drm_property_blob_put(struct drm_property_blob *blob) in drm_property_blob_put() argument
602 if (!blob) in drm_property_blob_put()
605 drm_mode_object_put(&blob->base); in drm_property_blob_put()
612 struct drm_property_blob *blob, *bt; in drm_property_destroy_user_blobs() local
616 * blob list any more, so no need to grab dev->blob_lock. in drm_property_destroy_user_blobs()
618 list_for_each_entry_safe(blob, bt, &file_priv->blobs, head_file) { in drm_property_destroy_user_blobs()
619 list_del_init(&blob->head_file); in drm_property_destroy_user_blobs()
620 drm_property_blob_put(blob); in drm_property_destroy_user_blobs()
625 * drm_property_blob_get - acquire blob property reference
626 * @blob: DRM blob property
628 * Acquires a reference to an existing blob property. Returns @blob, which
631 struct drm_property_blob *drm_property_blob_get(struct drm_property_blob *blob) in drm_property_blob_get() argument
633 drm_mode_object_get(&blob->base); in drm_property_blob_get()
634 return blob; in drm_property_blob_get()
639 * drm_property_lookup_blob - look up a blob property and take a reference
641 * @id: id of the blob property
643 * If successful, this takes an additional reference to the blob property.
648 * NULL on failure, pointer to the blob on success.
654 struct drm_property_blob *blob = NULL; in drm_property_lookup_blob() local
658 blob = obj_to_blob(obj); in drm_property_lookup_blob()
659 return blob; in drm_property_lookup_blob()
664 * drm_property_replace_global_blob - replace existing blob property
666 * @replace: location of blob property pointer to be replaced
667 * @length: length of data for new blob, or 0 for no data
668 * @data: content for new blob, or NULL for no data
669 * @obj_holds_id: optional object for property holding blob ID
670 * @prop_holds_id: optional property holding blob ID
673 * This function will replace a global property in the blob list, optionally
676 * If length is 0 or data is NULL, no new blob will be created, and the holding
683 * of a blob property with the value of the MST path information. Calling this
732 * drm_property_replace_blob - replace a blob property
733 * @blob: a pointer to the member blob to be replaced
734 * @new_blob: the new blob to replace with
736 * Return: true if the blob was in fact replaced.
738 bool drm_property_replace_blob(struct drm_property_blob **blob, in drm_property_replace_blob() argument
741 struct drm_property_blob *old_blob = *blob; in drm_property_replace_blob()
749 *blob = new_blob; in drm_property_replace_blob()
758 struct drm_property_blob *blob; in drm_mode_getblob_ioctl() local
764 blob = drm_property_lookup_blob(dev, out_resp->blob_id); in drm_mode_getblob_ioctl()
765 if (!blob) in drm_mode_getblob_ioctl()
768 if (out_resp->length == blob->length) { in drm_mode_getblob_ioctl()
770 blob->data, in drm_mode_getblob_ioctl()
771 blob->length)) { in drm_mode_getblob_ioctl()
776 out_resp->length = blob->length; in drm_mode_getblob_ioctl()
778 drm_property_blob_put(blob); in drm_mode_getblob_ioctl()
787 struct drm_property_blob *blob; in drm_mode_createblob_ioctl() local
793 blob = drm_property_create_blob(dev, out_resp->length, NULL); in drm_mode_createblob_ioctl()
794 if (IS_ERR(blob)) in drm_mode_createblob_ioctl()
795 return PTR_ERR(blob); in drm_mode_createblob_ioctl()
797 if (copy_from_user(blob->data, in drm_mode_createblob_ioctl()
805 * as only the same file_priv can remove the blob; at this point, it is in drm_mode_createblob_ioctl()
808 out_resp->blob_id = blob->base.id; in drm_mode_createblob_ioctl()
809 list_add_tail(&blob->head_file, &file_priv->blobs); in drm_mode_createblob_ioctl()
815 drm_property_blob_put(blob); in drm_mode_createblob_ioctl()
823 struct drm_property_blob *blob = NULL, *bt; in drm_mode_destroyblob_ioctl() local
830 blob = drm_property_lookup_blob(dev, out_resp->blob_id); in drm_mode_destroyblob_ioctl()
831 if (!blob) in drm_mode_destroyblob_ioctl()
837 if (bt == blob) { in drm_mode_destroyblob_ioctl()
849 * reference on the blob. */ in drm_mode_destroyblob_ioctl()
850 list_del_init(&blob->head_file); in drm_mode_destroyblob_ioctl()
854 drm_property_blob_put(blob); in drm_mode_destroyblob_ioctl()
855 drm_property_blob_put(blob); in drm_mode_destroyblob_ioctl()
861 drm_property_blob_put(blob); in drm_mode_destroyblob_ioctl()
902 struct drm_property_blob *blob; in drm_property_change_valid_get() local
907 blob = drm_property_lookup_blob(property->dev, value); in drm_property_change_valid_get()
908 if (blob) { in drm_property_change_valid_get()
909 *ref = &blob->base; in drm_property_change_valid_get()