search for: drm_gem_object_put

Displaying 20 results from an estimated 53 matches for "drm_gem_object_put".

2023 Nov 08
1
[PATCH drm-misc-next v9 09/12] drm/gpuvm: reference count drm_gpuvm structures
...te that it is a bug to call this function on a manager that still - * holds GPU VA mappings. - */ -void -drm_gpuvm_destroy(struct drm_gpuvm *gpuvm) +static void +drm_gpuvm_fini(struct drm_gpuvm *gpuvm) { gpuvm->name = NULL; @@ -790,7 +785,35 @@ drm_gpuvm_destroy(struct drm_gpuvm *gpuvm) drm_gem_object_put(gpuvm->r_obj); } -EXPORT_SYMBOL_GPL(drm_gpuvm_destroy); + +static void +drm_gpuvm_free(struct kref *kref) +{ + struct drm_gpuvm *gpuvm = container_of(kref, struct drm_gpuvm, kref); + + drm_gpuvm_fini(gpuvm); + + if (drm_WARN_ON(gpuvm->drm, !gpuvm->ops->vm_free)) + return; + + gpuvm-&g...
2023 Feb 14
3
[PATCH] drm/gem: Expose the buffer object handle to userspace last
...evoke(&obj->vma_node, file_priv); -err_remove: - spin_lock(&file_priv->table_lock); - idr_remove(&file_priv->object_idr, handle); - spin_unlock(&file_priv->table_lock); -err_unref: - drm_gem_object_handle_put_unlocked(obj); +err_put: + if (--obj->handle_count == 0) + drm_gem_object_put(obj); + + mutex_unlock(&dev->object_name_lock); + return ret; } -- 2.34.1
2023 Feb 14
3
[PATCH] drm/gem: Expose the buffer object handle to userspace last
...evoke(&obj->vma_node, file_priv); -err_remove: - spin_lock(&file_priv->table_lock); - idr_remove(&file_priv->object_idr, handle); - spin_unlock(&file_priv->table_lock); -err_unref: - drm_gem_object_handle_put_unlocked(obj); +err_put: + if (--obj->handle_count == 0) + drm_gem_object_put(obj); + + mutex_unlock(&dev->object_name_lock); + return ret; } -- 2.34.1
2023 Feb 20
2
[PATCH] drm/gem: Expose the buffer object handle to userspace last
...>table_lock); >> -??? idr_remove(&file_priv->object_idr, handle); >> -??? spin_unlock(&file_priv->table_lock); >> -err_unref: >> -??? drm_gem_object_handle_put_unlocked(obj); >> +err_put: >> +??? if (--obj->handle_count == 0) >> +??????? drm_gem_object_put(obj); >> + >> +??? mutex_unlock(&dev->object_name_lock); >> + >> ????? return ret; >> ? } >
2023 Feb 20
2
[PATCH] drm/gem: Expose the buffer object handle to userspace last
...>table_lock); >> -??? idr_remove(&file_priv->object_idr, handle); >> -??? spin_unlock(&file_priv->table_lock); >> -err_unref: >> -??? drm_gem_object_handle_put_unlocked(obj); >> +err_put: >> +??? if (--obj->handle_count == 0) >> +??????? drm_gem_object_put(obj); >> + >> +??? mutex_unlock(&dev->object_name_lock); >> + >> ????? return ret; >> ? } >
2018 Nov 18
0
[PATCH 8/9] drm: remove no longer needed drm-get-put coccinelle script
...rm_framebuffer_reference(object) > -+ drm_framebuffer_get(object) > -| > -- drm_framebuffer_unreference(object) > -+ drm_framebuffer_put(object) > -| > -- drm_gem_object_reference(object) > -+ drm_gem_object_get(object) > -| > -- drm_gem_object_unreference(object) > -+ drm_gem_object_put(object) > -| > -- __drm_gem_object_unreference(object) > -+ __drm_gem_object_put(object) > -| > -- drm_gem_object_unreference_unlocked(object) > -+ drm_gem_object_put_unlocked(object) > -| > -- drm_dev_unref(object) > -+ drm_dev_put(object) > -) > - > - at r depe...
2019 Jul 02
0
[PATCH v6 13/18] drm/virtio: drop virtio_gpu_object_{ref,unref}
...struct sg_table *sgt); -static inline struct virtio_gpu_object* -virtio_gpu_object_ref(struct virtio_gpu_object *bo) -{ - drm_gem_object_get(&bo->base.base); - return bo; -} - -static inline void virtio_gpu_object_unref(struct virtio_gpu_object **bo) -{ - if ((*bo) == NULL) - return; - drm_gem_object_put(&(*bo)->base.base); - *bo = NULL; -} - static inline u64 virtio_gpu_object_mmap_offset(struct virtio_gpu_object *bo) { return drm_vma_node_offset_addr(&bo->base.base.vma_node); -- 2.18.1
2019 Aug 02
0
[PATCH v7 16/18] drm/virtio: drop virtio_gpu_object_{ref,unref}
...struct sg_table *sgt); -static inline struct virtio_gpu_object* -virtio_gpu_object_ref(struct virtio_gpu_object *bo) -{ - drm_gem_object_get(&bo->base.base); - return bo; -} - -static inline void virtio_gpu_object_unref(struct virtio_gpu_object **bo) -{ - if ((*bo) == NULL) - return; - drm_gem_object_put(&(*bo)->base.base); - *bo = NULL; -} - static inline u64 virtio_gpu_object_mmap_offset(struct virtio_gpu_object *bo) { return drm_vma_node_offset_addr(&bo->base.base.vma_node); -- 2.18.1
2020 Sep 08
0
[PATCH 2/3] drm/qxl: release shadow on shutdown
.../drm/qxl/qxl_display.c index 4be04eaf7f37..85dcb7fe56a9 100644 --- a/drivers/gpu/drm/qxl/qxl_display.c +++ b/drivers/gpu/drm/qxl/qxl_display.c @@ -1224,5 +1224,9 @@ int qxl_modeset_init(struct qxl_device *qdev) void qxl_modeset_fini(struct qxl_device *qdev) { + if (qdev->dumb_shadow_bo) { + drm_gem_object_put(&qdev->dumb_shadow_bo->tbo.base); + qdev->dumb_shadow_bo = NULL; + } qxl_destroy_monitors_object(qdev); } -- 2.27.0
2020 Sep 29
0
[PATCH v2 2/4] drm/qxl: release shadow on shutdown
.../drm/qxl/qxl_display.c index 5bef8f121e54..1d9c51022be4 100644 --- a/drivers/gpu/drm/qxl/qxl_display.c +++ b/drivers/gpu/drm/qxl/qxl_display.c @@ -1220,5 +1220,9 @@ int qxl_modeset_init(struct qxl_device *qdev) void qxl_modeset_fini(struct qxl_device *qdev) { + if (qdev->dumb_shadow_bo) { + drm_gem_object_put(&qdev->dumb_shadow_bo->tbo.base); + qdev->dumb_shadow_bo = NULL; + } qxl_destroy_monitors_object(qdev); } -- 2.27.0
2020 Oct 22
2
[PATCH v5 08/10] drm/gem: Store client buffer mappings as struct dma_buf_map
...ic void drm_client_buffer_delete(struct drm_client_buffer *buffer) > { > struct drm_device *dev = buffer->client->dev; > > - drm_gem_vunmap(buffer->gem, buffer->vaddr); > + drm_gem_vunmap(buffer->gem, &buffer->map); > > if (buffer->gem) > drm_gem_object_put(buffer->gem); > @@ -291,25 +291,31 @@ drm_client_buffer_create(struct drm_client_dev *client, u32 width, u32 height, u > /** > * drm_client_buffer_vmap - Map DRM client buffer into address space > * @buffer: DRM client buffer > + * @map_copy: Returns the mapped memory's a...
2023 Feb 20
1
[PATCH] drm/gem: Expose the buffer object handle to userspace last
...ile_priv->object_idr, handle); >>>> -??? spin_unlock(&file_priv->table_lock); >>>> -err_unref: >>>> -??? drm_gem_object_handle_put_unlocked(obj); >>>> +err_put: >>>> +??? if (--obj->handle_count == 0) >>>> +??????? drm_gem_object_put(obj); >>>> + >>>> +??? mutex_unlock(&dev->object_name_lock); >>>> + >>>> ????? return ret; >>>> ? } >>> >
2023 Feb 20
1
[PATCH] drm/gem: Expose the buffer object handle to userspace last
...ile_priv->object_idr, handle); >>>> -??? spin_unlock(&file_priv->table_lock); >>>> -err_unref: >>>> -??? drm_gem_object_handle_put_unlocked(obj); >>>> +err_put: >>>> +??? if (--obj->handle_count == 0) >>>> +??????? drm_gem_object_put(obj); >>>> + >>>> +??? mutex_unlock(&dev->object_name_lock); >>>> + >>>> ????? return ret; >>>> ? } >>> >
2023 Aug 20
3
[PATCH drm-misc-next 0/3] [RFC] DRM GPUVA Manager GPU-VM features
So far the DRM GPUVA manager offers common infrastructure to track GPU VA allocations and mappings, generically connect GPU VA mappings to their backing buffers and perform more complex mapping operations on the GPU VA space. However, there are more design patterns commonly used by drivers, which can potentially be generalized in order to make the DRM GPUVA manager represent a basic GPU-VM
2018 Mar 21
0
[Outreachy kernel] [PATCH] drm/qxl: Replace drm_gem_object_reference/unreference() with _get/put()
...ixes, because it is shorter and consistent with the kernel > kref_get/put() functions. The following Coccinelle script was used: > > @@ > expression e; > @@ > > ( > -drm_gem_object_reference(e); > +drm_gem_object_get(e); > | > -drm_gem_object_unreference(e); > +drm_gem_object_put(e); > | > -drm_gem_object_unreference_unlocked(e); > +drm_gem_object_put_unlocked(e); > ) > > Signed-off-by: Santha Meena Ramamoorthy <santhameena13 at gmail.com> lgtm, thanks for your patch. Applied to drm-misc-next. -Daniel > --- > drivers/gpu/drm/qxl/qxl_display...
2023 Feb 14
0
[PATCH] drm/gem: Expose the buffer object handle to userspace last
...-err_remove: > - spin_lock(&file_priv->table_lock); > - idr_remove(&file_priv->object_idr, handle); > - spin_unlock(&file_priv->table_lock); > -err_unref: > - drm_gem_object_handle_put_unlocked(obj); > +err_put: > + if (--obj->handle_count == 0) > + drm_gem_object_put(obj); > + > + mutex_unlock(&dev->object_name_lock); > + > return ret; > } >
2018 Jan 15
2
[PATCH] fix drm-get-put.cocci warnings
...ertions(+), 8 deletions(-) --- a/drivers/gpu/drm/nouveau/nouveau_gem.c +++ b/drivers/gpu/drm/nouveau/nouveau_gem.c @@ -296,7 +296,7 @@ nouveau_gem_ioctl_new(struct drm_device } /* drop reference from allocate - handle holds it now */ - drm_gem_object_unreference_unlocked(&nvbo->gem); + drm_gem_object_put_unlocked(&nvbo->gem); return ret; } @@ -365,7 +365,7 @@ validate_fini_no_ticket(struct validate_ list_del(&nvbo->entry); nvbo->reserved_by = NULL; ttm_bo_unreserve(&nvbo->bo); - drm_gem_object_unreference_unlocked(&nvbo->gem); + drm_gem_object_put_unloc...
2023 Feb 14
0
[Nouveau] [PATCH] drm/gem: Expose the buffer object handle to userspace last
...-err_remove: > - spin_lock(&file_priv->table_lock); > - idr_remove(&file_priv->object_idr, handle); > - spin_unlock(&file_priv->table_lock); > -err_unref: > - drm_gem_object_handle_put_unlocked(obj); > +err_put: > + if (--obj->handle_count == 0) > + drm_gem_object_put(obj); > + > + mutex_unlock(&dev->object_name_lock); > + > return ret; > } >
2023 Feb 20
0
[Nouveau] [PATCH] drm/gem: Expose the buffer object handle to userspace last
...; -??? idr_remove(&file_priv->object_idr, handle); >>> -??? spin_unlock(&file_priv->table_lock); >>> -err_unref: >>> -??? drm_gem_object_handle_put_unlocked(obj); >>> +err_put: >>> +??? if (--obj->handle_count == 0) >>> +??????? drm_gem_object_put(obj); >>> + >>> +??? mutex_unlock(&dev->object_name_lock); >>> + >>> ????? return ret; >>> ? } >>
2020 Sep 29
0
[PATCH v3 5/7] drm/gem: Store client buffer mappings as struct dma_buf_map
...rm/drm_client.c @@ -235,7 +235,7 @@ static void drm_client_buffer_delete(struct drm_client_buffer *buffer) { struct drm_device *dev = buffer->client->dev; - drm_gem_vunmap(buffer->gem, buffer->vaddr); + drm_gem_vunmap(buffer->gem, &buffer->map); if (buffer->gem) drm_gem_object_put(buffer->gem); @@ -291,25 +291,31 @@ drm_client_buffer_create(struct drm_client_dev *client, u32 width, u32 height, u /** * drm_client_buffer_vmap - Map DRM client buffer into address space * @buffer: DRM client buffer + * @map_copy: Returns the mapped memory's address * * This funct...