drm/amdgpu/userq: use BIT(x) instead of 1 << x
Subsystems (2)
PATCH 1/3 drm/amdgpu/userq: use BIT(x) instead of 1 << x
Use the official BIT macro instead of directly
using the shift operation on a constant.
Signed-off-by Sunil Khatri <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c +1 -1
@@ -32,7 +32,7 @@#include "amdgpu.h" #include "amdgpu_trace.h" -#define AMDGPU_USERQ_MAX_HANDLES (1U << 16) +#define AMDGPU_USERQ_MAX_HANDLES BIT(16)static const struct dma_fence_ops amdgpu_userq_fence_ops;
Signature · 1 line
2.34.1
PATCH 2/3 drm/amdgpu/userq: add an blank line after declaration
After declaration we should have an blank line. While at it also add an blank line after for loop for readability.
Signed-off-by Sunil Khatri <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c +2 -0
@@ -130,8 +130,10 @@ static void amdgpu_userq_fence_put_fence_drv_array(struct amdgpu_userq_fence *userq_fence) {unsigned long i; +for (i =0 ; i < userq_fence->fence_drv_array_count; i++)amdgpu_userq_fence_driver_put (userq_fence->fence_drv_array[i]); + userq_fence->fence_drv_array_count =0 ; }
Signature · 1 line
2.34.1
PATCH 3/3 drm/amdgpu/userq: remove extra blank lines
In reply to Sunil KhatriRemove extra blank lines from so many functions.
Signed-off-by Sunil Khatri <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c | 6 ------ drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c | 2 -- 2 files changed, 8 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c +0 -6
@@ -52,7 +52,6 @@ u32 amdgpu_userq_get_supported_ip_mask(struct amdgpu_device *adev)static bool amdgpu_userq_is_reset_type_supported (struct amdgpu_device *adev,enum amdgpu_ring_type ring_type,int reset_type) { -if (ring_type <0 || ring_type >=AMDGPU_RING_TYPE_MAX )return false;
@@ -304,8 +303,6 @@ static bool amdgpu_userq_buffer_vas_mapped(struct amdgpu_usermode_queue *queue)return true; } - -static int amdgpu_userq_preempt_helper (struct amdgpu_usermode_queue *queue) {struct amdgpu_userq_mgr *uq_mgr = queue->userq_mgr;
@@ -458,8 +455,6 @@ amdgpu_userq_ensure_ev_fence(struct amdgpu_userq_mgr *uq_mgr,dma_fence_put (ev_fence); } - - static int amdgpu_userq_get_doorbell_index(struct amdgpu_userq_mgr *uq_mgr, struct amdgpu_db_info *db_info,
@@ -962,7 +957,6 @@ amdgpu_userq_restore_all(struct amdgpu_userq_mgr *uq_mgr)mutex_lock (&uq_mgr->userq_mutex);/* Resume all the queues for this process */ xa_for_each (&uq_mgr->userq_xa, queue_id, queue) { -if (!amdgpu_userq_buffer_vas_mapped (queue)) {drm_file_err (uq_mgr->file,"trying restore queue without va mapping\n" );
drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c +0 -2
@@ -457,7 +457,6 @@ amdgpu_userq_fence_driver_force_completion(struct amdgpu_usermode_queue *userq)amdgpu_userq_fence_driver_set_error (fence, -ECANCELED );amdgpu_userq_fence_write (fence_drv, wptr);amdgpu_userq_fence_driver_process (fence_drv); - } }
@@ -821,7 +820,6 @@ amdgpu_userq_wait_return_fence_info(struct drm_device *dev, struct drm_file *fildma_fence_put (fence);if (r) goto free_fences; - }/* Lock all the GEM objects */
Signature · 1 line
2.34.1
Re: [PATCH v1 3/3] drm/amdgpu/userq: remove extra blank lines
Quoted 4 lines · Sunil Khatri
Remove extra blank lines from so many functions.
Signed-off-by Sunil Khatri <[email protected]>
Series is:
Reviewed-by Alex Deucher <[email protected]>
Quoted 66 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c | 6 ------ drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c | 2 -- 2 files changed, 8 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c +0
-6@@ -52,7 +52,6 @@ u32 amdgpu_userq_get_supported_ip_mask(struct amdgpu_device *adev)static bool amdgpu_userq_is_reset_type_supported (struct amdgpu_device *adev,enum amdgpu_ring_type ring_type,int reset_type) { -if (ring_type <0 || ring_type >=AMDGPU_RING_TYPE_MAX )return false;@@ -304,8 +303,6 @@ static bool amdgpu_userq_buffer_vas_mapped(struct amdgpu_usermode_queue *queue)return true; } - -static int amdgpu_userq_preempt_helper (struct amdgpu_usermode_queue *queue) {struct amdgpu_userq_mgr *uq_mgr = queue->userq_mgr;@@ -458,8 +455,6 @@ amdgpu_userq_ensure_ev_fence(struct amdgpu_userq_mgr *uq_mgr,dma_fence_put (ev_fence); } - - static int amdgpu_userq_get_doorbell_index(struct amdgpu_userq_mgr *uq_mgr, struct amdgpu_db_info *db_info,@@ -962,7 +957,6 @@ amdgpu_userq_restore_all(struct amdgpu_userq_mgr *uq_mgr)mutex_lock (&uq_mgr->userq_mutex);/* Resume all the queues for this process */ xa_for_each (&uq_mgr->userq_xa, queue_id, queue) { -if (!amdgpu_userq_buffer_vas_mapped (queue)) {drm_file_err (uq_mgr->file,"trying restore queue without va mapping\n" );drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c +0
-3@@ -457,7 +457,6 @@ amdgpu_userq_fence_driver_force_completion(struct amdgpu_usermode_queue *userq)amdgpu_userq_fence_driver_set_error (fence, -ECANCELED );amdgpu_userq_fence_write (fence_drv, wptr);amdgpu_userq_fence_driver_process (fence_drv); - } }@@ -821,7 +820,6 @@ amdgpu_userq_wait_return_fence_info(struct drm_device *dev, struct drm_file *fildma_fence_put (fence);if (r) goto free_fences; - }/* Lock all the GEM objects */ --2.34.1
Re: [PATCH v1 3/3] drm/amdgpu/userq: remove extra blank lines
Quoted 8 lines · Alex Deucher
Quoted 4 lines · Sunil Khatri
Remove extra blank lines from so many functions.
Signed-off-by Sunil Khatri <[email protected]>Series is:
Reviewed-by Alex Deucher <[email protected]>
Reviewed-by Christian König <[email protected]>
Quoted 67 lines
Quoted 67 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c | 6 ------ drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c | 2 -- 2 files changed, 8 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c +0
-6@@ -52,7 +52,6 @@ u32 amdgpu_userq_get_supported_ip_mask(struct amdgpu_device *adev)static bool amdgpu_userq_is_reset_type_supported (struct amdgpu_device *adev,enum amdgpu_ring_type ring_type,int reset_type) { -if (ring_type <0 || ring_type >=AMDGPU_RING_TYPE_MAX )return false;@@ -304,8 +303,6 @@ static bool amdgpu_userq_buffer_vas_mapped(struct amdgpu_usermode_queue *queue)return true; } - -static int amdgpu_userq_preempt_helper (struct amdgpu_usermode_queue *queue) {struct amdgpu_userq_mgr *uq_mgr = queue->userq_mgr;@@ -458,8 +455,6 @@ amdgpu_userq_ensure_ev_fence(struct amdgpu_userq_mgr *uq_mgr,dma_fence_put (ev_fence); } - - static int amdgpu_userq_get_doorbell_index(struct amdgpu_userq_mgr *uq_mgr, struct amdgpu_db_info *db_info,@@ -962,7 +957,6 @@ amdgpu_userq_restore_all(struct amdgpu_userq_mgr *uq_mgr)mutex_lock (&uq_mgr->userq_mutex);/* Resume all the queues for this process */ xa_for_each (&uq_mgr->userq_xa, queue_id, queue) { -if (!amdgpu_userq_buffer_vas_mapped (queue)) {drm_file_err (uq_mgr->file,"trying restore queue without va mapping\n" );drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c +0
-3@@ -457,7 +457,6 @@ amdgpu_userq_fence_driver_force_completion(struct amdgpu_usermode_queue *userq)amdgpu_userq_fence_driver_set_error (fence, -ECANCELED );amdgpu_userq_fence_write (fence_drv, wptr);amdgpu_userq_fence_driver_process (fence_drv); - } }@@ -821,7 +820,6 @@ amdgpu_userq_wait_return_fence_info(struct drm_device *dev, struct drm_file *fildma_fence_put (fence);if (r) goto free_fences; - }/* Lock all the GEM objects */ --2.34.1