All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: David Stevens <stevensd@chromium.org>
Cc: David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
	"Michael S . Tsirkin" <mst@redhat.com>,
	Jason Wang <jasowang@redhat.com>,
	Sumit Semwal <sumit.semwal@linaro.org>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
	virtualization@lists.linux-foundation.org,
	linux-media@vger.kernel.org, linaro-mm-sig@lists.linaro.org,
	virtio-dev@lists.oasis-open.org
Subject: Re: [PATCH v2 4/4] drm/virtio: Support virtgpu exported resources
Date: Wed, 4 Mar 2020 09:01:19 +0100	[thread overview]
Message-ID: <20200304080119.i55opxkhk4kdt4hp@sirius.home.kraxel.org> (raw)
In-Reply-To: <20200302121524.7543-5-stevensd@chromium.org>

  Hi,

> +	if (vgdev->has_resource_assign_uuid) {
> +		spin_lock(&vgdev->resource_export_lock);
> +		if (bo->uuid_state == UUID_NOT_INITIALIZED) {
> +			bo->uuid_state = UUID_INITIALIZING;
> +			needs_init = true;
> +		}
> +		spin_unlock(&vgdev->resource_export_lock);
> +
> +		if (needs_init) {
> +			ret = virtio_gpu_cmd_resource_assign_uuid(vgdev, bo);

You can submit a fenced command, then wait on the fence here.  Removes
the need for UUID_INITIALIZING.

Also note that this function will be called only once, on the first
export.  When exporting the same object again drm will simply reuse
the existing dmabuf.  You can drop UUID_NOT_INITIALIZED and needs_init.

So you are left with only two uuid_state states.  You could turn uuid
into a pointer, so it gets only allocated when needed.  Also uuid ==
NULL can be used for "uuid not available" then.

cheers,
  Gerd


WARNING: multiple messages have this Message-ID (diff)
From: Gerd Hoffmann <kraxel@redhat.com>
To: David Stevens <stevensd@chromium.org>
Cc: virtio-dev@lists.oasis-open.org,
	Thomas Zimmermann <tzimmermann@suse.de>,
	"Michael S . Tsirkin" <mst@redhat.com>,
	David Airlie <airlied@linux.ie>, Jason Wang <jasowang@redhat.com>,
	linux-kernel@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linaro-mm-sig@lists.linaro.org, dri-devel@lists.freedesktop.org,
	linux-media@vger.kernel.org
Subject: Re: [PATCH v2 4/4] drm/virtio: Support virtgpu exported resources
Date: Wed, 4 Mar 2020 09:01:19 +0100	[thread overview]
Message-ID: <20200304080119.i55opxkhk4kdt4hp@sirius.home.kraxel.org> (raw)
In-Reply-To: <20200302121524.7543-5-stevensd@chromium.org>

  Hi,

> +	if (vgdev->has_resource_assign_uuid) {
> +		spin_lock(&vgdev->resource_export_lock);
> +		if (bo->uuid_state == UUID_NOT_INITIALIZED) {
> +			bo->uuid_state = UUID_INITIALIZING;
> +			needs_init = true;
> +		}
> +		spin_unlock(&vgdev->resource_export_lock);
> +
> +		if (needs_init) {
> +			ret = virtio_gpu_cmd_resource_assign_uuid(vgdev, bo);

You can submit a fenced command, then wait on the fence here.  Removes
the need for UUID_INITIALIZING.

Also note that this function will be called only once, on the first
export.  When exporting the same object again drm will simply reuse
the existing dmabuf.  You can drop UUID_NOT_INITIALIZED and needs_init.

So you are left with only two uuid_state states.  You could turn uuid
into a pointer, so it gets only allocated when needed.  Also uuid ==
NULL can be used for "uuid not available" then.

cheers,
  Gerd

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

WARNING: multiple messages have this Message-ID (diff)
From: Gerd Hoffmann <kraxel@redhat.com>
To: David Stevens <stevensd@chromium.org>
Cc: David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
	"Michael S . Tsirkin" <mst@redhat.com>,
	Jason Wang <jasowang@redhat.com>,
	Sumit Semwal <sumit.semwal@linaro.org>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
	virtualization@lists.linux-foundation.org,
	linux-media@vger.kernel.org, linaro-mm-sig@lists.linaro.org,
	virtio-dev@lists.oasis-open.org
Subject: [virtio-dev] Re: [PATCH v2 4/4] drm/virtio: Support virtgpu exported resources
Date: Wed, 4 Mar 2020 09:01:19 +0100	[thread overview]
Message-ID: <20200304080119.i55opxkhk4kdt4hp@sirius.home.kraxel.org> (raw)
In-Reply-To: <20200302121524.7543-5-stevensd@chromium.org>

  Hi,

> +	if (vgdev->has_resource_assign_uuid) {
> +		spin_lock(&vgdev->resource_export_lock);
> +		if (bo->uuid_state == UUID_NOT_INITIALIZED) {
> +			bo->uuid_state = UUID_INITIALIZING;
> +			needs_init = true;
> +		}
> +		spin_unlock(&vgdev->resource_export_lock);
> +
> +		if (needs_init) {
> +			ret = virtio_gpu_cmd_resource_assign_uuid(vgdev, bo);

You can submit a fenced command, then wait on the fence here.  Removes
the need for UUID_INITIALIZING.

Also note that this function will be called only once, on the first
export.  When exporting the same object again drm will simply reuse
the existing dmabuf.  You can drop UUID_NOT_INITIALIZED and needs_init.

So you are left with only two uuid_state states.  You could turn uuid
into a pointer, so it gets only allocated when needed.  Also uuid ==
NULL can be used for "uuid not available" then.

cheers,
  Gerd


---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


  parent reply	other threads:[~2020-03-04  8:01 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-02 12:15 [PATCH v2 0/4] Support virtio cross-device resources David Stevens
2020-03-02 12:15 ` [virtio-dev] " David Stevens
2020-03-02 12:15 ` David Stevens
2020-03-02 12:15 ` [PATCH v2 1/4] dma-buf: add support for virtio exported objects David Stevens
2020-03-02 12:15   ` [virtio-dev] " David Stevens
2020-03-02 12:15   ` David Stevens
2020-03-04  7:48   ` Gerd Hoffmann
2020-03-04  7:48     ` [virtio-dev] " Gerd Hoffmann
2020-03-04  7:48     ` Gerd Hoffmann
2020-03-02 12:15 ` [PATCH v2 2/4] drm/prime: " David Stevens
2020-03-02 12:15   ` [virtio-dev] " David Stevens
2020-03-02 12:15   ` David Stevens
2020-03-02 12:15 ` [PATCH v2 3/4] virtio-gpu: add VIRTIO_GPU_F_RESOURCE_UUID feature David Stevens
2020-03-02 12:15   ` [virtio-dev] " David Stevens
2020-03-02 12:15   ` David Stevens
2020-03-02 12:15 ` [PATCH v2 4/4] drm/virtio: Support virtgpu exported resources David Stevens
2020-03-02 12:15   ` [virtio-dev] " David Stevens
2020-03-02 12:15   ` David Stevens
2020-03-02 17:19   ` [virtio-dev] " Gurchetan Singh
2020-03-02 17:19     ` Gurchetan Singh
2020-03-02 17:19     ` Gurchetan Singh
2020-03-02 17:19     ` Gurchetan Singh
2020-03-03  2:42     ` David Stevens
2020-03-03  2:42       ` David Stevens
2020-03-03  2:42       ` David Stevens
2020-03-03  2:42       ` David Stevens
2020-03-04  8:05       ` [virtio-dev] " Gerd Hoffmann
2020-03-04  8:05         ` Gerd Hoffmann
2020-03-04  8:05         ` Gerd Hoffmann
2020-03-04  8:05         ` Gerd Hoffmann
2020-03-04  8:01   ` Gerd Hoffmann [this message]
2020-03-04  8:01     ` [virtio-dev] " Gerd Hoffmann
2020-03-04  8:01     ` Gerd Hoffmann
2020-03-05  8:50     ` David Stevens
2020-03-05  8:50       ` [virtio-dev] " David Stevens
2020-03-05  8:50       ` David Stevens
2020-03-05  8:50       ` David Stevens

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200304080119.i55opxkhk4kdt4hp@sirius.home.kraxel.org \
    --to=kraxel@redhat.com \
    --cc=airlied@linux.ie \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jasowang@redhat.com \
    --cc=linaro-mm-sig@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=mst@redhat.com \
    --cc=stevensd@chromium.org \
    --cc=sumit.semwal@linaro.org \
    --cc=tzimmermann@suse.de \
    --cc=virtio-dev@lists.oasis-open.org \
    --cc=virtualization@lists.linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.