Skip to contentSkip to conversation

staging: vboxvideo: adapt to new TTM interface

PATCH In review Christian König 3 participants 5 messages Nov 24, 2017 – Nov 27, 2017 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: vboxvideo: adapt to new TTM interface

Fixes interface changes done in the following commits:
drm/ttm: add operation ctx to ttm_bo_validate v2 drm/ttm: add context to driver move callback as well

I missed this driver because it is in the staging area.

---
 drivers/staging/vboxvideo/vbox_ttm.c | 17 ++++++-----------
 1 file changed, 6 insertions(+), 11 deletions(-)
drivers/staging/vboxvideo/vbox_ttm.c +6 -11
index 4eb410a2a1a8..231c89e0699c 100644
@@ -183,13 +183,6 @@ static void vbox_ttm_io_mem_free(struct ttm_bo_device *bdev,
 {
 }
 
-static int vbox_bo_move(struct ttm_buffer_object *bo,
-			bool evict, bool interruptible,
-			bool no_wait_gpu, struct ttm_mem_reg *new_mem)
-{
-	return ttm_bo_move_memcpy(bo, interruptible, no_wait_gpu, new_mem);
-}
-
 static void vbox_ttm_backend_destroy(struct ttm_tt *tt)
 {
 	ttm_tt_fini(tt);
@@ -237,7 +230,6 @@ static struct ttm_bo_driver vbox_bo_driver = {
 	.init_mem_type = vbox_bo_init_mem_type,
 	.eviction_valuable = ttm_bo_eviction_valuable,
 	.evict_flags = vbox_bo_evict_flags,
-	.move = vbox_bo_move,
 	.verify_access = vbox_bo_verify_access,
 	.io_mem_reserve = &vbox_ttm_io_mem_reserve,
 	.io_mem_free = &vbox_ttm_io_mem_free,
@@ -374,6 +366,7 @@ static inline u64 vbox_bo_gpu_offset(struct vbox_bo *bo)
 
 int vbox_bo_pin(struct vbox_bo *bo, u32 pl_flag, u64 *gpu_addr)
 {
+	struct ttm_operation_ctx ctx = { false, false };
 	int i, ret;
 
 	if (bo->pin_count) {
@@ -389,7 +382,7 @@ int vbox_bo_pin(struct vbox_bo *bo, u32 pl_flag, u64 *gpu_addr)
 	for (i = 0; i < bo->placement.num_placement; i++)
 		bo->placements[i].flags |= TTM_PL_FLAG_NO_EVICT;
 
-	ret = ttm_bo_validate(&bo->bo, &bo->placement, false, false);
+	ret = ttm_bo_validate(&bo->bo, &bo->placement, &ctx);
 	if (ret)
 		return ret;
 
@@ -403,6 +396,7 @@ int vbox_bo_pin(struct vbox_bo *bo, u32 pl_flag, u64 *gpu_addr)
 
 int vbox_bo_unpin(struct vbox_bo *bo)
 {
+	struct ttm_operation_ctx ctx = { false, false };
 	int i, ret;
 
 	if (!bo->pin_count) {
@@ -416,7 +410,7 @@ int vbox_bo_unpin(struct vbox_bo *bo)
 	for (i = 0; i < bo->placement.num_placement; i++)
 		bo->placements[i].flags &= ~TTM_PL_FLAG_NO_EVICT;
 
-	ret = ttm_bo_validate(&bo->bo, &bo->placement, false, false);
+	ret = ttm_bo_validate(&bo->bo, &bo->placement, &ctx);
 	if (ret)
 		return ret;
 
@@ -430,6 +424,7 @@ int vbox_bo_unpin(struct vbox_bo *bo)
  */
 int vbox_bo_push_sysram(struct vbox_bo *bo)
 {
+	struct ttm_operation_ctx ctx = { false, false };
 	int i, ret;
 
 	if (!bo->pin_count) {
@@ -448,7 +443,7 @@ int vbox_bo_push_sysram(struct vbox_bo *bo)
 	for (i = 0; i < bo->placement.num_placement; i++)
 		bo->placements[i].flags |= TTM_PL_FLAG_NO_EVICT;
 
-	ret = ttm_bo_validate(&bo->bo, &bo->placement, false, false);
+	ret = ttm_bo_validate(&bo->bo, &bo->placement, &ctx);
 	if (ret) {
 		DRM_ERROR("pushing to VRAM failed\n");
 		return ret;
Signature · 6 lines
2.11.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#1 lore raw
Quoted 3 lines · Christian König

Fixes interface changes done in the following commits:
drm/ttm: add operation ctx to ttm_bo_validate v2 drm/ttm: add context to driver move callback as well

Any hints on the git commit ids in Linus's tree?

And does this mean the driver's build is now broken? Should this go through the staging tree, or is it to go through the drm tree?

thanks,

greg k-h
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#2 lore raw

Am 24.11.2017 um 11:37 schrieb Greg KH:

Quoted 5 lines · Christian König
Quoted 3 lines

Fixes interface changes done in the following commits:
drm/ttm: add operation ctx to ttm_bo_validate v2 drm/ttm: add context to driver move callback as well

Any hints on the git commit ids in Linus's tree?

Those haven't arrived in Linus tree yet.

Quoted 1 line

And does this mean the driver's build is now broken?

Yes, it broke the build. Sorry that was my fault, didn't had this staging driver activated in the config nor noticed that there is an user of ttm outside the drm directory.

Quoted 1 line

Should this go through the staging tree, or is it to go through the drm tree?

The DRM tree I think. We should probably squash this patch into the original change which broke the driver in the DRM tree.

Regards,
Christian.

Quoted 4 lines

thanks,

greg k-h

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Acked-by Greg Kroah-Hartman
#3 lore raw
Quoted 11 lines · Christian König

Am 24.11.2017 um 11:37 schrieb Greg KH:

Quoted 5 lines · Christian König
Quoted 3 lines

Fixes interface changes done in the following commits:
drm/ttm: add operation ctx to ttm_bo_validate v2 drm/ttm: add context to driver move callback as well

Any hints on the git commit ids in Linus's tree?

Those haven't arrived in Linus tree yet.

Quoted 1 line

And does this mean the driver's build is now broken?

Quoted 8 lines

Yes, it broke the build. Sorry that was my fault, didn't had this staging driver activated in the config nor noticed that there is an user of ttm outside the drm directory.

Quoted 1 line

Should this go through the staging tree, or is it to go through the drm tree?

The DRM tree I think. We should probably squash this patch into the original change which broke the driver in the DRM tree.

That's fine with me, thanks for the patch:

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Acked-by on v1 1/1
#4 lore raw
In reply to Christian König
Quoted 8 lines · Christian König

Fixes interface changes done in the following commits:
drm/ttm: add operation ctx to ttm_bo_validate v2 drm/ttm: add context to driver move callback as well

I missed this driver because it is in the staging area.

Alex

Quoted 84 lines
---
 drivers/staging/vboxvideo/vbox_ttm.c | 17 ++++++-----------
 1 file changed, 6 insertions(+), 11 deletions(-)
drivers/staging/vboxvideo/vbox_ttm.c +6 -12
index 4eb410a2a1a8..231c89e0699c 100644
@@ -183,13 +183,6 @@ static void vbox_ttm_io_mem_free(struct ttm_bo_device *bdev,
 {
 }
 
-static int vbox_bo_move(struct ttm_buffer_object *bo,
-                       bool evict, bool interruptible,
-                       bool no_wait_gpu, struct ttm_mem_reg *new_mem)
-{
-       return ttm_bo_move_memcpy(bo, interruptible, no_wait_gpu, new_mem);
-}
-
 static void vbox_ttm_backend_destroy(struct ttm_tt *tt)
 {
        ttm_tt_fini(tt);
@@ -237,7 +230,6 @@ static struct ttm_bo_driver vbox_bo_driver = {
        .init_mem_type = vbox_bo_init_mem_type,
        .eviction_valuable = ttm_bo_eviction_valuable,
        .evict_flags = vbox_bo_evict_flags,
-       .move = vbox_bo_move,
        .verify_access = vbox_bo_verify_access,
        .io_mem_reserve = &vbox_ttm_io_mem_reserve,
        .io_mem_free = &vbox_ttm_io_mem_free,
@@ -374,6 +366,7 @@ static inline u64 vbox_bo_gpu_offset(struct vbox_bo *bo)
 
 int vbox_bo_pin(struct vbox_bo *bo, u32 pl_flag, u64 *gpu_addr)
 {
+       struct ttm_operation_ctx ctx = { false, false };
        int i, ret;
 
        if (bo->pin_count) {
@@ -389,7 +382,7 @@ int vbox_bo_pin(struct vbox_bo *bo, u32 pl_flag, u64 *gpu_addr)
        for (i = 0; i < bo->placement.num_placement; i++)
                bo->placements[i].flags |= TTM_PL_FLAG_NO_EVICT;
 
-       ret = ttm_bo_validate(&bo->bo, &bo->placement, false, false);
+       ret = ttm_bo_validate(&bo->bo, &bo->placement, &ctx);
        if (ret)
                return ret;
 
@@ -403,6 +396,7 @@ int vbox_bo_pin(struct vbox_bo *bo, u32 pl_flag, u64 *gpu_addr)
 
 int vbox_bo_unpin(struct vbox_bo *bo)
 {
+       struct ttm_operation_ctx ctx = { false, false };
        int i, ret;
 
        if (!bo->pin_count) {
@@ -416,7 +410,7 @@ int vbox_bo_unpin(struct vbox_bo *bo)
        for (i = 0; i < bo->placement.num_placement; i++)
                bo->placements[i].flags &= ~TTM_PL_FLAG_NO_EVICT;
 
-       ret = ttm_bo_validate(&bo->bo, &bo->placement, false, false);
+       ret = ttm_bo_validate(&bo->bo, &bo->placement, &ctx);
        if (ret)
                return ret;
 
@@ -430,6 +424,7 @@ int vbox_bo_unpin(struct vbox_bo *bo)
  */
 int vbox_bo_push_sysram(struct vbox_bo *bo)
 {
+       struct ttm_operation_ctx ctx = { false, false };
        int i, ret;
 
        if (!bo->pin_count) {
@@ -448,7 +443,7 @@ int vbox_bo_push_sysram(struct vbox_bo *bo)
        for (i = 0; i < bo->placement.num_placement; i++)
                bo->placements[i].flags |= TTM_PL_FLAG_NO_EVICT;
 
-       ret = ttm_bo_validate(&bo->bo, &bo->placement, false, false);
+       ret = ttm_bo_validate(&bo->bo, &bo->placement, &ctx);
        if (ret) {
                DRM_ERROR("pushing to VRAM failed\n");
                return ret;
--

2.11.0

Quoted 4 lines

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel