search for: virtio_gpu_array_add_obj

Displaying 20 results from an estimated 28 matches for "virtio_gpu_array_add_obj".

2019 Jul 02
2
[PATCH v6 16/18] drm/virtio: rework virtio_gpu_cmd_context_{attach, detach}_resource
...er_priv; - struct virtio_gpu_object *qobj = gem_to_virtio_gpu_obj(obj); - int r; + struct virtio_gpu_object_array *objs; if (!vgdev->has_virgl_3d) return 0; - r = virtio_gpu_object_reserve(qobj); - if (r) - return r; + objs = virtio_gpu_array_alloc(1); + if (!objs) + return -ENOMEM; + virtio_gpu_array_add_obj(objs, obj); virtio_gpu_cmd_context_attach_resource(vgdev, vfpriv->ctx_id, - qobj->hw_res_handle); - virtio_gpu_object_unreserve(qobj); + objs); return 0; } @@ -132,19 +131,18 @@ void virtio_gpu_gem_object_close(struct drm_gem_object *obj, { struct virtio_gpu_...
2019 Jul 02
2
[PATCH v6 16/18] drm/virtio: rework virtio_gpu_cmd_context_{attach, detach}_resource
...er_priv; - struct virtio_gpu_object *qobj = gem_to_virtio_gpu_obj(obj); - int r; + struct virtio_gpu_object_array *objs; if (!vgdev->has_virgl_3d) return 0; - r = virtio_gpu_object_reserve(qobj); - if (r) - return r; + objs = virtio_gpu_array_alloc(1); + if (!objs) + return -ENOMEM; + virtio_gpu_array_add_obj(objs, obj); virtio_gpu_cmd_context_attach_resource(vgdev, vfpriv->ctx_id, - qobj->hw_res_handle); - virtio_gpu_object_unreserve(qobj); + objs); return 0; } @@ -132,19 +131,18 @@ void virtio_gpu_gem_object_close(struct drm_gem_object *obj, { struct virtio_gpu_...
2019 Jul 02
3
[PATCH v6 07/18] drm/virtio: add virtio_gpu_object_array & helpers
...uct drm_file *file_priv, struct drm_device *dev, uint32_t handle, uint64_t *offset_p); +struct virtio_gpu_object_array *virtio_gpu_array_alloc(u32 nents); +struct virtio_gpu_object_array* +virtio_gpu_array_from_handles(struct drm_file *drm_file, u32 *handles, u32 nents); +void virtio_gpu_array_add_obj(struct virtio_gpu_object_array *objs, + struct drm_gem_object *obj); +int virtio_gpu_array_lock_resv(struct virtio_gpu_object_array *objs); +void virtio_gpu_array_unlock_resv(struct virtio_gpu_object_array *objs); +void virtio_gpu_array_add_fence(struct virtio_gpu_object_array *objs, + s...
2019 Jul 02
3
[PATCH v6 07/18] drm/virtio: add virtio_gpu_object_array & helpers
...uct drm_file *file_priv, struct drm_device *dev, uint32_t handle, uint64_t *offset_p); +struct virtio_gpu_object_array *virtio_gpu_array_alloc(u32 nents); +struct virtio_gpu_object_array* +virtio_gpu_array_from_handles(struct drm_file *drm_file, u32 *handles, u32 nents); +void virtio_gpu_array_add_obj(struct virtio_gpu_object_array *objs, + struct drm_gem_object *obj); +int virtio_gpu_array_lock_resv(struct virtio_gpu_object_array *objs); +void virtio_gpu_array_unlock_resv(struct virtio_gpu_object_array *objs); +void virtio_gpu_array_add_fence(struct virtio_gpu_object_array *objs, + s...
2019 Oct 18
1
[PATCH] drm/virtio: move byteorder handling into virtio_gpu_cmd_transfer_to_host_2d function
...rs/gpu/drm/virtio/virtgpu_plane.c b/drivers/gpu/drm/virtio/virtgpu_plane.c index f4b7360282ce..390524143139 100644 --- a/drivers/gpu/drm/virtio/virtgpu_plane.c +++ b/drivers/gpu/drm/virtio/virtgpu_plane.c @@ -132,10 +132,10 @@ static void virtio_gpu_primary_plane_update(struct drm_plane *plane, virtio_gpu_array_add_obj(objs, vgfb->base.obj[0]); virtio_gpu_cmd_transfer_to_host_2d (vgdev, 0, - cpu_to_le32(plane->state->src_w >> 16), - cpu_to_le32(plane->state->src_h >> 16), - cpu_to_le32(plane->state->src_x >> 16), - cpu_to_le32(plane->state->src...
2019 Oct 22
0
[PATCH 5/5] drm/virtio: factor out virtio_gpu_update_dumb_bo
...drm_plane *plane, return ret; } +static void virtio_gpu_update_dumb_bo(struct virtio_gpu_device *vgdev, + struct virtio_gpu_object *bo, + struct drm_plane_state *state) +{ + struct virtio_gpu_object_array *objs; + + objs = virtio_gpu_array_alloc(1); + if (!objs) + return; + virtio_gpu_array_add_obj(objs, &bo->base.base); + virtio_gpu_cmd_transfer_to_host_2d + (vgdev, 0, + state->src_w >> 16, + state->src_h >> 16, + state->src_x >> 16, + state->src_y >> 16, + objs, NULL); +} + static void virtio_gpu_primary_plane_update(struct drm_plane *p...
2019 Oct 23
0
[PATCH v2 3/3] drm/virtio: factor out virtio_gpu_update_dumb_bo
...drm_plane *plane, return ret; } +static void virtio_gpu_update_dumb_bo(struct virtio_gpu_device *vgdev, + struct virtio_gpu_object *bo, + struct drm_plane_state *state) +{ + struct virtio_gpu_object_array *objs; + + objs = virtio_gpu_array_alloc(1); + if (!objs) + return; + virtio_gpu_array_add_obj(objs, &bo->base.base); + virtio_gpu_cmd_transfer_to_host_2d + (vgdev, 0, + state->src_w >> 16, + state->src_h >> 16, + state->src_x >> 16, + state->src_y >> 16, + objs, NULL); +} + static void virtio_gpu_primary_plane_update(struct drm_plane *p...
2020 Feb 06
1
[PATCH 2/4] drm/virtio: resource teardown tweaks
...p_cb on errors. /me was thinking about that too. Yes, we will need either that, or a separate vbuf->error_cb callback. That'll be another patch though. > > + /* > > + * We are in the release callback and do NOT want refcount > > + * bo, so do NOT use virtio_gpu_array_add_obj(). > > + */ > > + vbuf->objs = virtio_gpu_array_alloc(1); > > + vbuf->objs->objs[0] = &bo->base.base > This is an abuse of obj array. Add "void *private_data;" to > virtio_gpu_vbuffer and use that maybe? I'd name that *cb_da...
2019 Oct 22
0
[PATCH 4/5] drm/virtio: Simplify virtio_gpu_primary_plane_update workflow.
...t;src_h >> 16, + 0, 0); + return; + } + + vgfb = to_virtio_gpu_framebuffer(plane->state->fb); + bo = gem_to_virtio_gpu_obj(vgfb->base.obj[0]); + if (bo->dumb) { + struct virtio_gpu_object_array *objs; - objs = virtio_gpu_array_alloc(1); - if (!objs) - return; - virtio_gpu_array_add_obj(objs, vgfb->base.obj[0]); - virtio_gpu_cmd_transfer_to_host_2d - (vgdev, 0, - plane->state->src_w >> 16, - plane->state->src_h >> 16, - plane->state->src_x >> 16, - plane->state->src_y >> 16, - objs, NULL); - } - } else {...
2019 Oct 23
0
[PATCH v2 2/3] drm/virtio: Simplify virtio_gpu_primary_plane_update workflow.
...t;src_h >> 16, + 0, 0); + return; + } + + vgfb = to_virtio_gpu_framebuffer(plane->state->fb); + bo = gem_to_virtio_gpu_obj(vgfb->base.obj[0]); + if (bo->dumb) { + struct virtio_gpu_object_array *objs; - objs = virtio_gpu_array_alloc(1); - if (!objs) - return; - virtio_gpu_array_add_obj(objs, vgfb->base.obj[0]); - virtio_gpu_cmd_transfer_to_host_2d - (vgdev, 0, - plane->state->src_w >> 16, - plane->state->src_h >> 16, - plane->state->src_x >> 16, - plane->state->src_y >> 16, - objs, NULL); - } - } else {...
2019 Oct 22
0
[PATCH 2/5] drm/virtio: move byteorder handling into virtio_gpu_cmd_transfer_to_host_2d function
...rs/gpu/drm/virtio/virtgpu_plane.c b/drivers/gpu/drm/virtio/virtgpu_plane.c index f4b7360282ce..390524143139 100644 --- a/drivers/gpu/drm/virtio/virtgpu_plane.c +++ b/drivers/gpu/drm/virtio/virtgpu_plane.c @@ -132,10 +132,10 @@ static void virtio_gpu_primary_plane_update(struct drm_plane *plane, virtio_gpu_array_add_obj(objs, vgfb->base.obj[0]); virtio_gpu_cmd_transfer_to_host_2d (vgdev, 0, - cpu_to_le32(plane->state->src_w >> 16), - cpu_to_le32(plane->state->src_h >> 16), - cpu_to_le32(plane->state->src_x >> 16), - cpu_to_le32(plane->state->src...
2019 Jul 03
0
[PATCH v6 07/18] drm/virtio: add virtio_gpu_object_array & helpers
...vice *dev, > uint32_t handle, uint64_t *offset_p); > > +struct virtio_gpu_object_array *virtio_gpu_array_alloc(u32 nents); > +struct virtio_gpu_object_array* > +virtio_gpu_array_from_handles(struct drm_file *drm_file, u32 *handles, u32 nents); > +void virtio_gpu_array_add_obj(struct virtio_gpu_object_array *objs, > + struct drm_gem_object *obj); > +int virtio_gpu_array_lock_resv(struct virtio_gpu_object_array *objs); > +void virtio_gpu_array_unlock_resv(struct virtio_gpu_object_array *objs); > +void virtio_gpu_array_add_fence(stru...
2019 Aug 02
0
[PATCH v7 12/18] drm/virtio: rework virtio_gpu_cmd_context_{attach, detach}_resource
...er_priv; - struct virtio_gpu_object *qobj = gem_to_virtio_gpu_obj(obj); - int r; + struct virtio_gpu_object_array *objs; if (!vgdev->has_virgl_3d) return 0; - r = virtio_gpu_object_reserve(qobj); - if (r) - return r; + objs = virtio_gpu_array_alloc(1); + if (!objs) + return -ENOMEM; + virtio_gpu_array_add_obj(objs, obj); virtio_gpu_cmd_context_attach_resource(vgdev, vfpriv->ctx_id, - qobj->hw_res_handle); - virtio_gpu_object_unreserve(qobj); + objs); return 0; } @@ -157,19 +156,18 @@ void virtio_gpu_gem_object_close(struct drm_gem_object *obj, { struct virtio_gpu_...
2019 Aug 02
0
[PATCH v7 07/18] drm/virtio: add virtio_gpu_object_array & helpers
...uct drm_file *file_priv, struct drm_device *dev, uint32_t handle, uint64_t *offset_p); +struct virtio_gpu_object_array *virtio_gpu_array_alloc(u32 nents); +struct virtio_gpu_object_array* +virtio_gpu_array_from_handles(struct drm_file *drm_file, u32 *handles, u32 nents); +void virtio_gpu_array_add_obj(struct virtio_gpu_object_array *objs, + struct drm_gem_object *obj); +int virtio_gpu_array_lock_resv(struct virtio_gpu_object_array *objs); +void virtio_gpu_array_unlock_resv(struct virtio_gpu_object_array *objs); +void virtio_gpu_array_add_fence(struct virtio_gpu_object_array *objs, + s...
2020 Feb 05
2
[PATCH 2/4] drm/virtio: resource teardown tweaks
...cmd_p, 0, sizeof(*cmd_p)); cmd_p->hdr.type = cpu_to_le32(VIRTIO_GPU_CMD_RESOURCE_UNREF); - cmd_p->resource_id = cpu_to_le32(resource_id); + cmd_p->resource_id = cpu_to_le32(bo->hw_res_handle); + + /* + * We are in the release callback and do NOT want refcount + * bo, so do NOT use virtio_gpu_array_add_obj(). + */ + vbuf->objs = virtio_gpu_array_alloc(1); + vbuf->objs->objs[0] = &bo->base.base; virtio_gpu_queue_ctrl_buffer(vgdev, vbuf); } -- 2.18.1
2020 Feb 05
2
[PATCH 2/4] drm/virtio: resource teardown tweaks
...cmd_p, 0, sizeof(*cmd_p)); cmd_p->hdr.type = cpu_to_le32(VIRTIO_GPU_CMD_RESOURCE_UNREF); - cmd_p->resource_id = cpu_to_le32(resource_id); + cmd_p->resource_id = cpu_to_le32(bo->hw_res_handle); + + /* + * We are in the release callback and do NOT want refcount + * bo, so do NOT use virtio_gpu_array_add_obj(). + */ + vbuf->objs = virtio_gpu_array_alloc(1); + vbuf->objs->objs[0] = &bo->base.base; virtio_gpu_queue_ctrl_buffer(vgdev, vbuf); } -- 2.18.1
2019 Jul 03
1
[PATCH v6 07/18] drm/virtio: add virtio_gpu_object_array & helpers
...uint32_t handle, uint64_t *offset_p); > > > > +struct virtio_gpu_object_array *virtio_gpu_array_alloc(u32 nents); > > +struct virtio_gpu_object_array* > > +virtio_gpu_array_from_handles(struct drm_file *drm_file, u32 *handles, u32 nents); > > +void virtio_gpu_array_add_obj(struct virtio_gpu_object_array *objs, > > + struct drm_gem_object *obj); > > +int virtio_gpu_array_lock_resv(struct virtio_gpu_object_array *objs); > > +void virtio_gpu_array_unlock_resv(struct virtio_gpu_object_array *objs); > > +void virtio_gpu_...
2019 Jul 03
0
[PATCH v6 16/18] drm/virtio: rework virtio_gpu_cmd_context_{attach, detach}_resource
...> if (!vgdev->has_virgl_3d) > return 0; > > - r = virtio_gpu_object_reserve(qobj); > - if (r) > - return r; > + objs = virtio_gpu_array_alloc(1); > + if (!objs) > + return -ENOMEM; > + virtio_gpu_array_add_obj(objs, obj); > > virtio_gpu_cmd_context_attach_resource(vgdev, vfpriv->ctx_id, > - qobj->hw_res_handle); > - virtio_gpu_object_unreserve(qobj); > + objs); > return...
2019 Dec 11
1
[PATCH 3/3] virtio-gpu: use damage info for display updates.
...>y2 - rect->y1; + uint32_t x = rect->x1 + (state->src_x >> 16); + uint32_t y = rect->y1 + (state->src_y >> 16); + uint32_t off = x * state->fb->format->cpp[0] + + y * state->fb->pitches[0]; objs = virtio_gpu_array_alloc(1); if (!objs) return; virtio_gpu_array_add_obj(objs, &bo->base.base); - virtio_gpu_cmd_transfer_to_host_2d - (vgdev, 0, - state->src_w >> 16, - state->src_h >> 16, - state->src_x >> 16, - state->src_y >> 16, - objs, NULL); + + virtio_gpu_cmd_transfer_to_host_2d(vgdev, off, w, h, x, y, +...
2019 Aug 02
0
[PATCH v7 11/18] drm/virtio: rework virtio_gpu_transfer_to_host_ioctl fencing
...9,19 @@ static void virtio_gpu_primary_plane_update(struct drm_plane *plane, bo = gem_to_virtio_gpu_obj(vgfb->base.obj[0]); handle = bo->hw_res_handle; if (bo->dumb) { + struct virtio_gpu_object_array *objs; + + objs = virtio_gpu_array_alloc(1); + if (!objs) + return; + virtio_gpu_array_add_obj(objs, vgfb->base.obj[0]); virtio_gpu_cmd_transfer_to_host_2d - (vgdev, bo, 0, + (vgdev, 0, cpu_to_le32(plane->state->src_w >> 16), cpu_to_le32(plane->state->src_h >> 16), cpu_to_le32(plane->state->src_x >> 16), - cpu_to_le32(pla...