Re: [PATCH 2/2] drm/radeon/uvd: Fix forgotten unmap buffer objects

2022-02-08 Thread zhanglianjie

Hi,
Thanks for your review. I have resubmitted, see 
https://lkml.org/lkml/2022/2/7/2014





Am 29.01.22 um 08:35 schrieb zhanglianjie:
after the buffer object is successfully mapped, call radeon_bo_kunmap 
before the function returns.


Signed-off-by: zhanglianjie 

diff --git a/drivers/gpu/drm/radeon/radeon_uvd.c 
b/drivers/gpu/drm/radeon/radeon_uvd.c

index 377f9cdb5b53..c5482f7793db 100644
--- a/drivers/gpu/drm/radeon/radeon_uvd.c
+++ b/drivers/gpu/drm/radeon/radeon_uvd.c
@@ -497,6 +497,7 @@ static int radeon_uvd_cs_msg(struct 
radeon_cs_parser *p, struct radeon_bo *bo,

  handle = msg[2];

  if (handle == 0) {
+    radeon_bo_kunmap(bo);
  DRM_ERROR("Invalid UVD handle!\n");
  return -EINVAL;
  }
@@ -559,11 +560,10 @@ static int radeon_uvd_cs_msg(struct 
radeon_cs_parser *p, struct radeon_bo *bo,

  return 0;

  default:
-
  DRM_ERROR("Illegal UVD message type (%d)!\n", msg_type);
-    return -EINVAL;
  }

+    radeon_bo_kunmap(bo);
  BUG();


That looks like it will trigger this BUG() now. Please also remove that 
line.


Apart from that the patches look good to me.

Regards,
Christian.


  return -EINVAL;
  }
--
2.20.1











Re: [PATCH 2/2] drm/radeon/uvd: Fix forgotten unmap buffer objects

2022-01-30 Thread Christian König




Am 29.01.22 um 08:35 schrieb zhanglianjie:

after the buffer object is successfully mapped, call radeon_bo_kunmap before 
the function returns.

Signed-off-by: zhanglianjie 

diff --git a/drivers/gpu/drm/radeon/radeon_uvd.c 
b/drivers/gpu/drm/radeon/radeon_uvd.c
index 377f9cdb5b53..c5482f7793db 100644
--- a/drivers/gpu/drm/radeon/radeon_uvd.c
+++ b/drivers/gpu/drm/radeon/radeon_uvd.c
@@ -497,6 +497,7 @@ static int radeon_uvd_cs_msg(struct radeon_cs_parser *p, 
struct radeon_bo *bo,
handle = msg[2];

if (handle == 0) {
+   radeon_bo_kunmap(bo);
DRM_ERROR("Invalid UVD handle!\n");
return -EINVAL;
}
@@ -559,11 +560,10 @@ static int radeon_uvd_cs_msg(struct radeon_cs_parser *p, 
struct radeon_bo *bo,
return 0;

default:
-
DRM_ERROR("Illegal UVD message type (%d)!\n", msg_type);
-   return -EINVAL;
}

+   radeon_bo_kunmap(bo);
BUG();


That looks like it will trigger this BUG() now. Please also remove that 
line.


Apart from that the patches look good to me.

Regards,
Christian.


return -EINVAL;
  }
--
2.20.1







[PATCH 2/2] drm/radeon/uvd: Fix forgotten unmap buffer objects

2022-01-29 Thread zhanglianjie
after the buffer object is successfully mapped, call radeon_bo_kunmap before 
the function returns.

Signed-off-by: zhanglianjie 

diff --git a/drivers/gpu/drm/radeon/radeon_uvd.c 
b/drivers/gpu/drm/radeon/radeon_uvd.c
index 377f9cdb5b53..c5482f7793db 100644
--- a/drivers/gpu/drm/radeon/radeon_uvd.c
+++ b/drivers/gpu/drm/radeon/radeon_uvd.c
@@ -497,6 +497,7 @@ static int radeon_uvd_cs_msg(struct radeon_cs_parser *p, 
struct radeon_bo *bo,
handle = msg[2];

if (handle == 0) {
+   radeon_bo_kunmap(bo);
DRM_ERROR("Invalid UVD handle!\n");
return -EINVAL;
}
@@ -559,11 +560,10 @@ static int radeon_uvd_cs_msg(struct radeon_cs_parser *p, 
struct radeon_bo *bo,
return 0;

default:
-
DRM_ERROR("Illegal UVD message type (%d)!\n", msg_type);
-   return -EINVAL;
}

+   radeon_bo_kunmap(bo);
BUG();
return -EINVAL;
 }
--
2.20.1