Home | History | Annotate | Download | only in drm

Lines Matching refs:blob

522 	 * NOTE: The idea seems to have been to use this to read all the blob
525 blob property. It also doesn't make a lot of
537 struct drm_property_blob *blob =
540 mutex_lock(&blob->dev->mode_config.blob_lock);
541 list_del(&blob->head_global);
542 mutex_unlock(&blob->dev->mode_config.blob_lock);
544 drm_mode_object_unregister(blob->dev, &blob->base);
546 kvfree(blob);
550 * drm_property_create_blob - Create new blob property
552 * @length: Length to allocate for blob data
553 * @data: If specified, copies data into blob
555 * Creates a new blob property for a specified DRM device, optionally
556 * copying data. Note that blob properties are meant to be invariant, hence the
557 * data must be filled out before the blob is used as the value of any property.
560 * New blob property with a single reference on success, or an ERR_PTR
567 struct drm_property_blob *blob;
573 blob = kvzalloc(sizeof(struct drm_property_blob)+length, GFP_KERNEL);
574 if (!blob)
579 INIT_LIST_HEAD(&blob->head_file);
580 blob->data = (char *)blob + sizeof(*blob);
581 blob->length = length;
582 blob->dev = dev;
585 memcpy(blob->data, data, length);
587 ret = __drm_mode_object_add(dev, &blob->base, DRM_MODE_OBJECT_BLOB,
590 kvfree(blob);
595 list_add_tail(&blob->head_global,
599 return blob;
604 * drm_property_blob_put - release a blob property reference
605 * @blob: DRM blob property
607 * Releases a reference to a blob property. May free the object.
609 void drm_property_blob_put(struct drm_property_blob *blob)
611 if (!blob)
614 drm_mode_object_put(&blob->base);
621 struct drm_property_blob *blob, *bt;
625 * blob list any more, so no need to grab dev->blob_lock.
627 list_for_each_entry_safe(blob, bt, &file_priv->blobs, head_file) {
628 list_del_init(&blob->head_file);
629 drm_property_blob_put(blob);
634 * drm_property_blob_get - acquire blob property reference
635 * @blob: DRM blob property
637 * Acquires a reference to an existing blob property. Returns @blob, which
640 struct drm_property_blob *drm_property_blob_get(struct drm_property_blob *blob)
642 drm_mode_object_get(&blob->base);
643 return blob;
648 * drm_property_lookup_blob - look up a blob property and take a reference
650 * @id: id of the blob property
652 * If successful, this takes an additional reference to the blob property.
657 * NULL on failure, pointer to the blob on success.
663 struct drm_property_blob *blob = NULL;
667 blob = obj_to_blob(obj);
668 return blob;
673 * drm_property_replace_global_blob - replace existing blob property
675 * @replace: location of blob property pointer to be replaced
676 * @length: length of data for new blob, or 0 for no data
677 * @data: content for new blob, or NULL for no data
678 * @obj_holds_id: optional object for property holding blob ID
679 * @prop_holds_id: optional property holding blob ID
682 * This function will replace a global property in the blob list, optionally
685 * If length is 0 or data is NULL, no new blob will be created, and the holding
692 * of a blob property with the value of the MST path information. Calling this
741 * drm_property_replace_blob - replace a blob property
742 * @blob: a pointer to the member blob to be replaced
743 * @new_blob: the new blob to replace with
745 * Return: true if the blob was in fact replaced.
747 bool drm_property_replace_blob(struct drm_property_blob **blob,
750 struct drm_property_blob *old_blob = *blob;
758 *blob = new_blob;
767 struct drm_property_blob *blob;
773 blob = drm_property_lookup_blob(dev, out_resp->blob_id);
774 if (!blob)
777 if (out_resp->length == blob->length) {
779 blob->data,
780 blob->length)) {
785 out_resp->length = blob->length;
787 drm_property_blob_put(blob);
796 struct drm_property_blob *blob;
802 blob = drm_property_create_blob(dev, out_resp->length, NULL);
803 if (IS_ERR(blob))
804 return PTR_ERR(blob);
806 if (copy_from_user(blob->data,
814 * as only the same file_priv can remove the blob; at this point, it is
817 out_resp->blob_id = blob->base.id;
818 list_add_tail(&blob->head_file, &file_priv->blobs);
824 drm_property_blob_put(blob);
832 struct drm_property_blob *blob = NULL, *bt;
839 blob = drm_property_lookup_blob(dev, out_resp->blob_id);
840 if (!blob)
846 if (bt == blob) {
858 * reference on the blob. */
859 list_del_init(&blob->head_file);
863 drm_property_blob_put(blob);
864 drm_property_blob_put(blob);
870 drm_property_blob_put(blob);
911 struct drm_property_blob *blob;
916 blob = drm_property_lookup_blob(property->dev, value);
917 if (blob) {
918 *ref = &blob->base;