dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm: document that blobs are ref'counted
@ 2020-10-22  9:38 Simon Ser
  2020-10-22  9:53 ` Jonas Ådahl
  2020-11-01 20:35 ` Simon Ser
  0 siblings, 2 replies; 5+ messages in thread
From: Simon Ser @ 2020-10-22  9:38 UTC (permalink / raw)
  To: dri-devel

User-space doesn't need to keep track of blobs that might be in use by
the kernel. User-space can just destroy blobs as soon as they don't need
them anymore.

Signed-off-by: Simon Ser <contact@emersion.fr>
Cc: Pekka Paalanen <ppaalanen@gmail.com>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Jonas Ådahl <jadahl@gmail.com>
---
 include/uapi/drm/drm_mode.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/include/uapi/drm/drm_mode.h b/include/uapi/drm/drm_mode.h
index 863eda048265..f7c41aa4b5eb 100644
--- a/include/uapi/drm/drm_mode.h
+++ b/include/uapi/drm/drm_mode.h
@@ -924,6 +924,10 @@ struct drm_mode_create_blob {
  * struct drm_mode_destroy_blob - Destroy user blob
  * @blob_id: blob_id to destroy
  * Destroy a user-created blob property.
+ *
+ * Blobs are reference-counted by the kernel, so user-space can destroy them as
+ * soon as they're done with them.  For instance user-space can destroy a blob
+ * used in an atomic commit right after performing the atomic commit ioctl.
  */
 struct drm_mode_destroy_blob {
 	__u32 blob_id;
-- 
2.28.0


_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] drm: document that blobs are ref'counted
  2020-10-22  9:38 [PATCH] drm: document that blobs are ref'counted Simon Ser
@ 2020-10-22  9:53 ` Jonas Ådahl
  2020-11-01 20:35 ` Simon Ser
  1 sibling, 0 replies; 5+ messages in thread
From: Jonas Ådahl @ 2020-10-22  9:53 UTC (permalink / raw)
  To: Simon Ser; +Cc: dri-devel

Thanks for this!

I can't review the correctness, but the description looks clear to me
so,

Reviewed-by: Jonas Ådahl <jadahl@gmail.com>


Jonas

On Thu, Oct 22, 2020 at 09:38:05AM +0000, Simon Ser wrote:
> User-space doesn't need to keep track of blobs that might be in use by
> the kernel. User-space can just destroy blobs as soon as they don't need
> them anymore.
> 
> Signed-off-by: Simon Ser <contact@emersion.fr>
> Cc: Pekka Paalanen <ppaalanen@gmail.com>
> Cc: Daniel Vetter <daniel@ffwll.ch>
> Cc: Jonas Ådahl <jadahl@gmail.com>
> ---
>  include/uapi/drm/drm_mode.h | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/include/uapi/drm/drm_mode.h b/include/uapi/drm/drm_mode.h
> index 863eda048265..f7c41aa4b5eb 100644
> --- a/include/uapi/drm/drm_mode.h
> +++ b/include/uapi/drm/drm_mode.h
> @@ -924,6 +924,10 @@ struct drm_mode_create_blob {
>   * struct drm_mode_destroy_blob - Destroy user blob
>   * @blob_id: blob_id to destroy
>   * Destroy a user-created blob property.
> + *
> + * Blobs are reference-counted by the kernel, so user-space can destroy them as
> + * soon as they're done with them.  For instance user-space can destroy a blob
> + * used in an atomic commit right after performing the atomic commit ioctl.
>   */
>  struct drm_mode_destroy_blob {
>  	__u32 blob_id;
> -- 
> 2.28.0
> 
> 
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] drm: document that blobs are ref'counted
  2020-10-22  9:38 [PATCH] drm: document that blobs are ref'counted Simon Ser
  2020-10-22  9:53 ` Jonas Ådahl
@ 2020-11-01 20:35 ` Simon Ser
  2020-11-01 21:07   ` Daniel Stone
  1 sibling, 1 reply; 5+ messages in thread
From: Simon Ser @ 2020-11-01 20:35 UTC (permalink / raw)
  To: dri-devel

Daniel, does this patch look good to you?
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] drm: document that blobs are ref'counted
  2020-11-01 20:35 ` Simon Ser
@ 2020-11-01 21:07   ` Daniel Stone
  2020-11-04 17:00     ` Simon Ser
  0 siblings, 1 reply; 5+ messages in thread
From: Daniel Stone @ 2020-11-01 21:07 UTC (permalink / raw)
  To: Simon Ser; +Cc: dri-devel

Hi,

On Sun, 1 Nov 2020 at 20:35, Simon Ser <contact@emersion.fr> wrote:
> Daniel, does this patch look good to you?

Unsure which Daniel you meant, but I would probably instead say:
'Userspace can release blobs as soon as they do not need to refer to
them by their blob object ID. For instance, if you are using a MODE_ID
blob in an atomic commit and you will not make another commit reusing
the same ID, you can destroy the blob as soon as the commit has been
issued, without waiting for it to complete.'

Cheers,
Daniel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] drm: document that blobs are ref'counted
  2020-11-01 21:07   ` Daniel Stone
@ 2020-11-04 17:00     ` Simon Ser
  0 siblings, 0 replies; 5+ messages in thread
From: Simon Ser @ 2020-11-04 17:00 UTC (permalink / raw)
  To: Daniel Stone; +Cc: dri-devel

On Sunday, November 1, 2020 10:07 PM, Daniel Stone <daniel@fooishbar.org> wrote:

> > Daniel, does this patch look good to you?
>
> Unsure which Daniel you meant

I was thinking of Daniel Vetter :P

> but I would probably instead say:
> 'Userspace can release blobs as soon as they do not need to refer to
> them by their blob object ID. For instance, if you are using a MODE_ID
> blob in an atomic commit and you will not make another commit reusing
> the same ID, you can destroy the blob as soon as the commit has been
> issued, without waiting for it to complete.'

But thanks! That sounds much better and avoids using the term
"reference counting" (which is nice because it's an internal detail).

Sending a v2 now.
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-11-04 17:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-22  9:38 [PATCH] drm: document that blobs are ref'counted Simon Ser
2020-10-22  9:53 ` Jonas Ådahl
2020-11-01 20:35 ` Simon Ser
2020-11-01 21:07   ` Daniel Stone
2020-11-04 17:00     ` Simon Ser

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).