drm/ttm:fix incorrect calculate on shrink_pages
Subsystems (4)
PATCH 1/7 drm/ttm:fix incorrect calculate on shrink_pages
shrink_pages is in unit of Order after ttm_page_pool_free, but it is used by nr_free in next round so need change it into native page unit
--- drivers/gpu/drm/ttm/ttm_page_alloc.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/ttm/ttm_page_alloc.c +1 -0
@@ -455,6 +455,7 @@ ttm_pool_shrink_scan(struct shrinker *shrink, struct shrink_control *sc) freed += (nr_free_pool - shrink_pages) << pool->order;if (freed >= sc->nr_to_scan)break ; + shrink_pages <<= pool->order; }mutex_unlock (&lock);return freed;
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 2/7 drm/ttm:max_cpages is in unit of native page
In reply to a message not in the archive--- drivers/gpu/drm/ttm/ttm_page_alloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/ttm/ttm_page_alloc.c +1 -1
@@ -544,7 +544,7 @@ static int ttm_alloc_new_pages(struct list_head *pages, gfp_t gfp_flags,int r =0 ;unsigned i, j, cpages;unsigned npages =1 << order; -unsigned max_cpages =min (count, (unsigned )NUM_PAGES_TO_ALLOC ); +unsigned max_cpages =min (count << order, (unsigned )NUM_PAGES_TO_ALLOC );/* allocate array for page caching change */ caching_array =kmalloc (max_cpages*sizeof (struct page *),GFP_KERNEL );
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 3/7 drm/amdgpu:no need to evict VRAM in device_fini
In reply to a message not in the archive--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +1 -2
@@ -2461,8 +2461,7 @@ void amdgpu_device_fini(struct amdgpu_device *adev) adev->shutdown = true;if (adev->mode_info.mode_config_initialized)drm_crtc_force_disable_all (adev->ddev); -/* evict vram memory */ -amdgpu_bo_evict_vram (adev); +amdgpu_ib_pool_fini (adev);amdgpu_fence_driver_fini (adev);amdgpu_fbdev_fini (adev);
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 4/7 drm/amdgpu:return ETIME if really time out
In reply to a message not in the archive--- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +2 -2
@@ -1506,8 +1506,8 @@ static int amdgpu_cs_wait_any_fence(struct amdgpu_device *adev,if (first < fence_count && array[first]) r = array[first]->error; -else - r =0 ; +else if (r ==0 ) + r = -ETIME ; err_free_fence_array:for (i =0 ; i < fence_count; i++)
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 5/7 drm/amdgpu:no need with INT for fence polling
In reply to a message not in the archive--- drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c +1 -1
@@ -187,7 +187,7 @@ int amdgpu_fence_emit_polling(struct amdgpu_ring *ring, uint32_t *s) seq = ++ring->fence_drv.sync_seq;amdgpu_ring_emit_fence (ring, ring->fence_drv.gpu_addr, - seq,AMDGPU_FENCE_FLAG_INT ); + seq,0 ); *s = seq;
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 6/7 drm/amdgpu:fix MAP_QUEUES paramter
In reply to a message not in the archive--- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +1 -1
@@ -2405,7 +2405,7 @@ static int gfx_v9_0_kiq_kcq_enable(struct amdgpu_device *adev)PACKET3_MAP_QUEUES_PIPE (ring->pipe) |PACKET3_MAP_QUEUES_ME ((ring->me ==1 ?0 :1 )) |PACKET3_MAP_QUEUES_QUEUE_TYPE (0 ) |/*queue_type: normal compute queue */ -PACKET3_MAP_QUEUES_ALLOC_FORMAT (1 ) |/* alloc format: all_on_one_pipe */ +PACKET3_MAP_QUEUES_ALLOC_FORMAT (0 ) |/* alloc format: all_on_one_pipe */ PACKET3_MAP_QUEUES_ENGINE_SEL (0 ) |/* engine_sel: compute */ PACKET3_MAP_QUEUES_NUM_QUEUES(1)); /* num_queues: must be 1 */amdgpu_ring_write (kiq_ring,PACKET3_MAP_QUEUES_DOORBELL_OFFSET (ring->doorbell_index));
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 7/7 drm/amdgpu:correct vce fw data and stack size config
In reply to a message not in the archiveFrom: Frank Min <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/vce_v4_0.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/vce_v4_0.c +1 -1
@@ -423,7 +423,7 @@ static int vce_v4_0_sw_init(void *handle)if (r)return r; - size = (VCE_V4_0_STACK_SIZE +VCE_V4_0_DATA_SIZE ) *2 ; + size =VCE_V4_0_STACK_SIZE +VCE_V4_0_DATA_SIZE ;if (adev->firmware.load_type !=AMDGPU_FW_LOAD_PSP ) size +=VCE_V4_0_FW_SIZE ;
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
He, Roger
Reviewed-by Roger HeThanks
Roger(Hongbo.He)
-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Monk Liu
Sent: Tuesday, December 12, 2017 5:47 PM
To: [email protected]
Cc: Liu, Monk <[email protected]>
Subject: [PATCH 1/7] drm/ttm:fix incorrect calculate on shrink_pages
shrink_pages is in unit of Order after ttm_page_pool_free, but it is used by nr_free in next round so need change it into native page unit
--- drivers/gpu/drm/ttm/ttm_page_alloc.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/ttm/ttm_page_alloc.c +1 -0
@@ -455,6 +455,7 @@ ttm_pool_shrink_scan(struct shrinker *shrink, struct shrink_control *sc) freed += (nr_free_pool - shrink_pages) << pool->order;if (freed >= sc->nr_to_scan)break ; + shrink_pages <<= pool->order; }mutex_unlock (&lock);return freed;
--
2.7.4
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Christian König
NAKRe: [PATCH 4/7] drm/amdgpu:return ETIME if really time out
In reply to a message not in the archiveNAK, it does make sense but that would change the user space interface in a non backward compatible way, wouldn't it?
Christian.
Am 12.12.2017 um 10:46 schrieb Monk Liu:
Quoted 11 lines
Change-Id I7304577a500fc2d41482f2fe3f1692ae3797f576Signed-off-by Monk Liu <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +0
-0
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c static int amdgpu_cs_wait_any_fence(struct amdgpu_device *adev, · line 1513
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +2
-2@@ -1506,8 +1506,8 @@ static int amdgpu_cs_wait_any_fence(struct amdgpu_device *adev,if (first < fence_count && array[first]) r = array[first]->error; -else - r =0 ; +else if (r ==0 ) + r = -ETIME ; err_free_fence_array:for (i =0 ; i < fence_count; i++)
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Patch #1-#3 and #5 are Reviewed-by: Christian König <[email protected]>.
Patch #6 and #7 are Acked-by: Christian König <[email protected]>.
Regards,
Christian.
Am 12.12.2017 um 10:46 schrieb Monk Liu:
Quoted 15 lines
shrink_pagesis in unit of Order afterttm_page_pool_free, but it is used bynr_freein next round so need change it into native page unitChange-Id I33b77ac1616e24b1b881eee54c3bd7342cfa9ab8Signed-off-by Monk Liu <[email protected]>--- drivers/gpu/drm/ttm/ttm_page_alloc.c | 1 + 1 file changed, 1 insertion(+)drivers/gpu/drm/ttm/ttm_page_alloc.c +0
-0
drivers/gpu/drm/ttm/ttm_page_alloc.c ttm_pool_shrink_scan(struct shrinker *shrink, struct shrink_control *sc) · line 461
Quoted 7 lines
drivers/gpu/drm/ttm/ttm_page_alloc.c +1
-0@@ -455,6 +455,7 @@ ttm_pool_shrink_scan(struct shrinker *shrink, struct shrink_control *sc) freed += (nr_free_pool - shrink_pages) << pool->order;if (freed >= sc->nr_to_scan)break ; + shrink_pages <<= pool->order; }mutex_unlock (&lock);return freed;
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
BTW, in the shortlog (subject) there should always be a space after the prefix's ":".
Quoted 16 lines · Monk Liu
shrink_pagesis in unit of Order afterttm_page_pool_free, but it is used bynr_freein next round so need change it into native page unitChange-Id I33b77ac1616e24b1b881eee54c3bd7342cfa9ab8Signed-off-by Monk Liu <[email protected]>--- drivers/gpu/drm/ttm/ttm_page_alloc.c | 1 + 1 file changed, 1 insertion(+)drivers/gpu/drm/ttm/ttm_page_alloc.c +0
-0
drivers/gpu/drm/ttm/ttm_page_alloc.c ttm_pool_shrink_scan(struct shrinker *shrink, struct shrink_control *sc) · line 461
Quoted 7 lines
drivers/gpu/drm/ttm/ttm_page_alloc.c +1
-0@@ -455,6 +455,7 @@ ttm_pool_shrink_scan(struct shrinker *shrink, struct shrink_control *sc) freed += (nr_free_pool - shrink_pages) << pool->order;if (freed >= sc->nr_to_scan)break ; + shrink_pages <<= pool->order; }mutex_unlock (&lock);return freed;
TTM patches need to be sent to the dri-devel list as well for review. It's better not to mix TTM and amdgpu patches in the same series unless absolutely necessary.
Signature · 6 lines
Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Liu, Monk
NAKRE: [PATCH 4/7] drm/amdgpu:return ETIME if really time out
In reply to a message not in the archiveWithout this patch a timed out submit will never be caught, is it really good ?
For the backward compatible why it's applied on incorrect logic ?
-----Original Message-----
From: Christian König [mailto:[email protected]]
Sent: 2017年12月12日 18:20
To: Liu, Monk <[email protected]>; [email protected]
Subject: Re: [PATCH 4/7] drm/amdgpu:return ETIME if really time out
NAK, it does make sense but that would change the user space interface in a non backward compatible way, wouldn't it?
Christian.
Am 12.12.2017 um 10:46 schrieb Monk Liu:
Quoted 22 lines
Change-Id I7304577a500fc2d41482f2fe3f1692ae3797f576Signed-off-by Monk Liu <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +2
-2@@ -1506,8 +1506,8 @@ static int amdgpu_cs_wait_any_fence(struct amdgpu_device *adev, if (first < fence_count && array[first]) r = array[first]->error; - else - r =0 ; + else if (r == 0) + r = -ETIME ; err_free_fence_array:
Quoted 1 line
for (i = 0; i <
fence_count; i++)
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH 4/7] drm/amdgpu:return ETIME if really time out
In reply to a message not in the archivedma_fence_wait_any_timeout() return 1 when some fences was signaled even when the timeout parameter is 0.
And later on we check for "wait->out.status = (r > 0);". So the logic should actually work correct.
If it doesn't we need to fix something else.
Christian.
Am 12.12.2017 um 11:23 schrieb Liu, Monk:
Quoted 36 lines
Without this patch a timed out submit will never be caught, is it really good ?
For the backward compatible why it's applied on incorrect logic ?
-----Original Message-----
From: Christian König [mailto:[email protected]]
Sent: 2017年12月12日 18:20
To: Liu, Monk <[email protected]>; [email protected]
Subject: Re: [PATCH 4/7] drm/amdgpu:return ETIME if really time outNAK, it does make sense but that would change the user space interface in a non backward compatible way, wouldn't it?
Christian.
Am 12.12.2017 um 10:46 schrieb Monk Liu:
Quoted 21 lines
Change-Id I7304577a500fc2d41482f2fe3f1692ae3797f576Signed-off-by Monk Liu <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +2
-2@@ -1506,8 +1506,8 @@ static int amdgpu_cs_wait_any_fence(struct amdgpu_device *adev, if (first < fence_count && array[first]) r = array[first]->error; - else - r =0 ; + else if (r == 0) + r = -ETIME ;
Quoted 6 lines
Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +0
-0err_free_fence_array:for (i = 0; i < fence_count; i++)_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
RE: [PATCH 4/7] drm/amdgpu:return ETIME if really time out
In reply to a message not in the archiveOkay
-----Original Message-----
From: Christian König [mailto:[email protected]]
Sent: 2017年12月12日 18:44
To: Liu, Monk <[email protected]>; Koenig, Christian <[email protected]>; [email protected]
Subject: Re: [PATCH 4/7] drm/amdgpu:return ETIME if really time out
dma_fence_wait_any_timeout() return 1 when some fences was signaled even when the timeout parameter is 0.
And later on we check for "wait->out.status = (r > 0);". So the logic should actually work correct.
If it doesn't we need to fix something else.
Christian.
Am 12.12.2017 um 11:23 schrieb Liu, Monk:
Quoted 36 lines
Without this patch a timed out submit will never be caught, is it really good ?
For the backward compatible why it's applied on incorrect logic ?
-----Original Message-----
From: Christian König [mailto:[email protected]]
Sent: 2017年12月12日 18:20
To: Liu, Monk <[email protected]>; [email protected]
Subject: Re: [PATCH 4/7] drm/amdgpu:return ETIME if really time outNAK, it does make sense but that would change the user space interface in a non backward compatible way, wouldn't it?
Christian.
Am 12.12.2017 um 10:46 schrieb Monk Liu:
Quoted 21 lines
Change-Id I7304577a500fc2d41482f2fe3f1692ae3797f576Signed-off-by Monk Liu <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +2
-2@@ -1506,8 +1506,8 @@ static int amdgpu_cs_wait_any_fence(struct amdgpu_device *adev, if (first < fence_count && array[first]) r = array[first]->error; - else - r =0 ; + else if (r == 0) + r = -ETIME ;
Quoted 6 lines
Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +0
-0err_free_fence_array:for (i = 0; i < fence_count; i++)_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx