Displaying 20 results from an estimated 161 matches for "drm_gem_object_lookup".
2016 May 19
0
[PATCH 3/5] drm: mediatek: fixup drm_gem_object_lookup API change
On 18/05/16 18:07, Arnd Bergmann wrote:
> The drm_gem_object_lookup() function prototype changed while this
> driver was added, so it fails to build now:
>
> drivers/gpu/drm/mediatek/mtk_drm_gem.c: In function 'mtk_drm_gem_dumb_map_offset':
> drivers/gpu/drm/mediatek/mtk_drm_gem.c:142:30: error: passing argument 1 of 'drm_gem_object_lookup...
2016 May 18
0
[PATCH 3/5] drm: mediatek: fixup drm_gem_object_lookup API change
The drm_gem_object_lookup() function prototype changed while this
driver was added, so it fails to build now:
drivers/gpu/drm/mediatek/mtk_drm_gem.c: In function 'mtk_drm_gem_dumb_map_offset':
drivers/gpu/drm/mediatek/mtk_drm_gem.c:142:30: error: passing argument 1 of 'drm_gem_object_lookup' from incompatib...
2016 May 18
9
[PATCH 0/5] drm: fixes for merge-window regressions
...since
this morning's linux-next, so just ignore the ones are no
longer needed.
[resending because of missing Cc list for the actual patches,
sorry about that]
Arnd Bergmann (5):
headers_check: don't warn about c++ guards
drm: mediatek: add CONFIG_OF dependency
drm: mediatek: fixup drm_gem_object_lookup API change
drm: exynos: mark pm functions as __maybe_unused
drm: remove unused dev variables
drivers/gpu/drm/armada/armada_crtc.c | 1 -
drivers/gpu/drm/exynos/exynos_hdmi.c | 6 ++----
drivers/gpu/drm/mediatek/Kconfig | 1 +
drivers/gpu/drm/mediatek/mtk_drm_fb.c | 2 +-
drivers/gp...
2019 Jun 20
2
[PATCH v4 02/12] drm/virtio: switch virtio_gpu_wait_ioctl() to gem helper.
..._ioctl(struct drm_device *dev, void *data,
struct drm_file *file)
{
struct drm_virtgpu_3d_wait *args = data;
- struct drm_gem_object *gobj = NULL;
- struct virtio_gpu_object *qobj = NULL;
+ struct drm_gem_object *obj;
+ long timeout = 15 * HZ;
int ret;
- bool nowait = false;
- gobj = drm_gem_object_lookup(file, args->handle);
- if (gobj == NULL)
- return -ENOENT;
+ if (args->flags & VIRTGPU_WAIT_NOWAIT) {
+ obj = drm_gem_object_lookup(file, args->handle);
+ ret = reservation_object_test_signaled_rcu(obj->resv, true);
+ drm_gem_object_put_unlocked(obj);
+ return ret ? 0 : -EBUSY;...
2019 Jun 20
2
[PATCH v4 02/12] drm/virtio: switch virtio_gpu_wait_ioctl() to gem helper.
..._ioctl(struct drm_device *dev, void *data,
struct drm_file *file)
{
struct drm_virtgpu_3d_wait *args = data;
- struct drm_gem_object *gobj = NULL;
- struct virtio_gpu_object *qobj = NULL;
+ struct drm_gem_object *obj;
+ long timeout = 15 * HZ;
int ret;
- bool nowait = false;
- gobj = drm_gem_object_lookup(file, args->handle);
- if (gobj == NULL)
- return -ENOENT;
+ if (args->flags & VIRTGPU_WAIT_NOWAIT) {
+ obj = drm_gem_object_lookup(file, args->handle);
+ ret = reservation_object_test_signaled_rcu(obj->resv, true);
+ drm_gem_object_put_unlocked(obj);
+ return ret ? 0 : -EBUSY;...
2019 Jun 18
1
[PATCH v2 02/12] drm/virtio: switch virtio_gpu_wait_ioctl() to gem helper.
..._ioctl(struct drm_device *dev, void *data,
struct drm_file *file)
{
struct drm_virtgpu_3d_wait *args = data;
- struct drm_gem_object *gobj = NULL;
- struct virtio_gpu_object *qobj = NULL;
+ struct drm_gem_object *obj;
+ long timeout = 15 * HZ;
int ret;
- bool nowait = false;
- gobj = drm_gem_object_lookup(file, args->handle);
- if (gobj == NULL)
- return -ENOENT;
+ if (args->flags & VIRTGPU_WAIT_NOWAIT) {
+ obj = drm_gem_object_lookup(file, args->handle);
+ ret = reservation_object_test_signaled_rcu(obj->resv, true);
+ drm_gem_object_put_unlocked(obj);
+ return ret ? 0 : -EBUSY;...
2019 Jul 04
2
[PATCH v6 14/18] drm/virtio: rework virtio_gpu_transfer_from_host_ioctl fencing
...<kraxel at redhat.com> wrote:
> >
> > Switch to the virtio_gpu_array_* helper workflow.
> (just repeating my question on patch 6)
>
> Does this fix the obj refcount issue? When was the issue introduced?
obj refcount should be fine in both old and new code.
old code:
drm_gem_object_lookup
drm_gem_object_put_unlocked
new code:
virtio_gpu_array_from_handles
virtio_gpu_array_put_free (in virtio_gpu_dequeue_ctrl_func).
Or did I miss something?
cheers,
Gerd
2019 Jul 04
2
[PATCH v6 14/18] drm/virtio: rework virtio_gpu_transfer_from_host_ioctl fencing
...<kraxel at redhat.com> wrote:
> >
> > Switch to the virtio_gpu_array_* helper workflow.
> (just repeating my question on patch 6)
>
> Does this fix the obj refcount issue? When was the issue introduced?
obj refcount should be fine in both old and new code.
old code:
drm_gem_object_lookup
drm_gem_object_put_unlocked
new code:
virtio_gpu_array_from_handles
virtio_gpu_array_put_free (in virtio_gpu_dequeue_ctrl_func).
Or did I miss something?
cheers,
Gerd
2016 May 18
0
[PATCH 5/5] drm: remove unused dev variables
On Wed, May 18, 2016 at 06:07:33PM +0200, Arnd Bergmann wrote:
> After drm_gem_object_lookup() was changed along with all its callers,
> we have several drivers that have unused variables:
>
> drm/armada/armada_crtc.c: In function 'armada_drm_crtc_cursor_set':
> drm/armada/armada_crtc.c:900:21: error: unused variable 'dev' [-Werror=unused-variable]
> drm/nou...
2019 Jul 02
3
[PATCH v6 07/18] drm/virtio: add virtio_gpu_object_array & helpers
...ject_array*
+virtio_gpu_array_from_handles(struct drm_file *drm_file, u32 *handles, u32 nents)
+{
+ struct virtio_gpu_object_array *objs;
+ u32 i;
+
+ objs = virtio_gpu_array_alloc(nents);
+ if (!objs)
+ return NULL;
+
+ for (i = 0; i < nents; i++) {
+ objs->nents = i;
+ objs->objs[i] = drm_gem_object_lookup(drm_file, handles[i]);
+ if (!objs->objs[i]) {
+ virtio_gpu_array_put_free(objs);
+ return NULL;
+ }
+ }
+ objs->nents = i;
+ return objs;
+}
+
+void virtio_gpu_array_add_obj(struct virtio_gpu_object_array *objs,
+ struct drm_gem_object *obj)
+{
+ if (WARN_ON_ONCE(objs->nents...
2019 Jul 02
3
[PATCH v6 07/18] drm/virtio: add virtio_gpu_object_array & helpers
...ject_array*
+virtio_gpu_array_from_handles(struct drm_file *drm_file, u32 *handles, u32 nents)
+{
+ struct virtio_gpu_object_array *objs;
+ u32 i;
+
+ objs = virtio_gpu_array_alloc(nents);
+ if (!objs)
+ return NULL;
+
+ for (i = 0; i < nents; i++) {
+ objs->nents = i;
+ objs->objs[i] = drm_gem_object_lookup(drm_file, handles[i]);
+ if (!objs->objs[i]) {
+ virtio_gpu_array_put_free(objs);
+ return NULL;
+ }
+ }
+ objs->nents = i;
+ return objs;
+}
+
+void virtio_gpu_array_add_obj(struct virtio_gpu_object_array *objs,
+ struct drm_gem_object *obj)
+{
+ if (WARN_ON_ONCE(objs->nents...
2019 Jun 19
0
[PATCH v3 03/12] drm/virtio: switch virtio_gpu_wait_ioctl() to gem helper.
..._ioctl(struct drm_device *dev, void *data,
struct drm_file *file)
{
struct drm_virtgpu_3d_wait *args = data;
- struct drm_gem_object *gobj = NULL;
- struct virtio_gpu_object *qobj = NULL;
+ struct drm_gem_object *obj;
+ long timeout = 15 * HZ;
int ret;
- bool nowait = false;
- gobj = drm_gem_object_lookup(file, args->handle);
- if (gobj == NULL)
- return -ENOENT;
+ if (args->flags & VIRTGPU_WAIT_NOWAIT) {
+ obj = drm_gem_object_lookup(file, args->handle);
+ ret = reservation_object_test_signaled_rcu(obj->resv, true);
+ drm_gem_object_put_unlocked(obj);
+ return ret ? 0 : -EBUSY;...
2019 Jun 26
0
[PATCH v4 02/12] drm/virtio: switch virtio_gpu_wait_ioctl() to gem helper.
...truct drm_virtgpu_3d_wait *args = data;
> - struct drm_gem_object *gobj = NULL;
> - struct virtio_gpu_object *qobj = NULL;
> + struct drm_gem_object *obj;
> + long timeout = 15 * HZ;
> int ret;
> - bool nowait = false;
>
> - gobj = drm_gem_object_lookup(file, args->handle);
> - if (gobj == NULL)
> - return -ENOENT;
> + if (args->flags & VIRTGPU_WAIT_NOWAIT) {
> + obj = drm_gem_object_lookup(file, args->handle);
Don't we need a NULL check here?
> + ret = reservati...
2019 Jun 28
0
[PATCH v5 02/12] drm/virtio: switch virtio_gpu_wait_ioctl() to gem helper.
..._ioctl(struct drm_device *dev, void *data,
struct drm_file *file)
{
struct drm_virtgpu_3d_wait *args = data;
- struct drm_gem_object *gobj = NULL;
- struct virtio_gpu_object *qobj = NULL;
+ struct drm_gem_object *obj;
+ long timeout = 15 * HZ;
int ret;
- bool nowait = false;
- gobj = drm_gem_object_lookup(file, args->handle);
- if (gobj == NULL)
- return -ENOENT;
-
- qobj = gem_to_virtio_gpu_obj(gobj);
-
- if (args->flags & VIRTGPU_WAIT_NOWAIT)
- nowait = true;
- ret = virtio_gpu_object_wait(qobj, nowait);
-
- drm_gem_object_put_unlocked(gobj);
- return ret;
+ if (args->flags & VI...
2019 Jun 28
1
[PATCH v4 02/12] drm/virtio: switch virtio_gpu_wait_ioctl() to gem helper.
...help indeed (assuming it checks with NOWAIT).
How many objects does userspace check in one go typically? Maybe it
makes sense to add an ioctl which checks a list, to reduce the system
call overhead.
> > + if (args->flags & VIRTGPU_WAIT_NOWAIT) {
> > + obj = drm_gem_object_lookup(file, args->handle);
> Don't we need a NULL check here?
Yes, we do. Will fix.
thanks,
Gerd
2019 Jul 02
0
[PATCH v6 02/18] drm/virtio: switch virtio_gpu_wait_ioctl() to gem helper.
..._ioctl(struct drm_device *dev, void *data,
struct drm_file *file)
{
struct drm_virtgpu_3d_wait *args = data;
- struct drm_gem_object *gobj = NULL;
- struct virtio_gpu_object *qobj = NULL;
+ struct drm_gem_object *obj;
+ long timeout = 15 * HZ;
int ret;
- bool nowait = false;
- gobj = drm_gem_object_lookup(file, args->handle);
- if (gobj == NULL)
- return -ENOENT;
-
- qobj = gem_to_virtio_gpu_obj(gobj);
-
- if (args->flags & VIRTGPU_WAIT_NOWAIT)
- nowait = true;
- ret = virtio_gpu_object_wait(qobj, nowait);
-
- drm_gem_object_put_unlocked(gobj);
- return ret;
+ if (args->flags & VI...
2019 Aug 02
0
[PATCH v7 02/18] drm/virtio: switch virtio_gpu_wait_ioctl() to gem helper.
..._ioctl(struct drm_device *dev, void *data,
struct drm_file *file)
{
struct drm_virtgpu_3d_wait *args = data;
- struct drm_gem_object *gobj = NULL;
- struct virtio_gpu_object *qobj = NULL;
+ struct drm_gem_object *obj;
+ long timeout = 15 * HZ;
int ret;
- bool nowait = false;
- gobj = drm_gem_object_lookup(file, args->handle);
- if (gobj == NULL)
- return -ENOENT;
-
- qobj = gem_to_virtio_gpu_obj(gobj);
-
- if (args->flags & VIRTGPU_WAIT_NOWAIT)
- nowait = true;
- ret = virtio_gpu_object_wait(qobj, nowait);
-
- drm_gem_object_put_unlocked(gobj);
- return ret;
+ if (args->flags & VI...
2019 Dec 10
0
[PATCH AUTOSEL 5.4 002/350] drm/virtio: switch virtio_gpu_wait_ioctl() to gem helper.
..., void *data,
- struct drm_file *file)
+ struct drm_file *file)
{
struct drm_virtgpu_3d_wait *args = data;
- struct drm_gem_object *gobj = NULL;
- struct virtio_gpu_object *qobj = NULL;
+ struct drm_gem_object *obj;
+ long timeout = 15 * HZ;
int ret;
- bool nowait = false;
- gobj = drm_gem_object_lookup(file, args->handle);
- if (gobj == NULL)
+ obj = drm_gem_object_lookup(file, args->handle);
+ if (obj == NULL)
return -ENOENT;
- qobj = gem_to_virtio_gpu_obj(gobj);
-
- if (args->flags & VIRTGPU_WAIT_NOWAIT)
- nowait = true;
- ret = virtio_gpu_object_wait(qobj, nowait);
+ if (arg...
2019 Jun 17
1
[PATCH 2/4] drm/virtio: switch virtio_gpu_wait_ioctl() to gem helper.
...ioctl.c
@@ -464,23 +464,13 @@ static int virtio_gpu_wait_ioctl(struct drm_device *dev, void *data,
struct drm_file *file)
{
struct drm_virtgpu_3d_wait *args = data;
- struct drm_gem_object *gobj = NULL;
- struct virtio_gpu_object *qobj = NULL;
- int ret;
- bool nowait = false;
-
- gobj = drm_gem_object_lookup(file, args->handle);
- if (gobj == NULL)
- return -ENOENT;
-
- qobj = gem_to_virtio_gpu_obj(gobj);
+ long timeout = 15 * HZ;
if (args->flags & VIRTGPU_WAIT_NOWAIT)
- nowait = true;
- ret = virtio_gpu_object_wait(qobj, nowait);
+ timeout = 0;
- drm_gem_object_put_unlocked(gobj);
-...
2019 Jul 02
2
[PATCH v6 14/18] drm/virtio: rework virtio_gpu_transfer_from_host_ioctl fencing
...object *qobj = NULL;
+ struct virtio_gpu_object_array *objs;
struct virtio_gpu_fence *fence;
int ret;
u32 offset = args->offset;
@@ -308,35 +307,31 @@ static int virtio_gpu_transfer_from_host_ioctl(struct drm_device *dev,
if (vgdev->has_virgl_3d == false)
return -ENOSYS;
- gobj = drm_gem_object_lookup(file, args->bo_handle);
- if (gobj == NULL)
+ objs = virtio_gpu_array_from_handles(file, &args->bo_handle, 1);
+ if (objs == NULL)
return -ENOENT;
- qobj = gem_to_virtio_gpu_obj(gobj);
-
- ret = virtio_gpu_object_reserve(qobj);
- if (ret)
- goto out;
+ ret = virtio_gpu_array_lock_re...