drm/radeon: TTM must be init with cpu-visible VRAM, v2
Subsystems (2)
PATCH 1/1 drm/radeon: TTM must be init with cpu-visible VRAM, v2
Without this, a bo may get created in the cpu-inaccessible vram. Before the CP engines get setup, all copies are done via cpu memcpy.
This means that the cpu tries to read from inaccessible memory, fails, and the radeon module proceeds to disable acceleration.
Doing this has no downsides, as the real VRAM size gets set as soon as the CP engines get init.
This is a candidate for 3.14 fixes.
v2: Add comment on why the function is used
--- drivers/gpu/drm/radeon/radeon_ttm.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/radeon/radeon_ttm.c +3 -0
@@ -715,6 +715,9 @@ int radeon_ttm_init(struct radeon_device *rdev)DRM_ERROR ("Failed initializing VRAM heap.\n" );return r; } +/* Change the size here instead of the init above so only lpfn is affected */ +radeon_ttm_set_active_vram_size (rdev, rdev->mc.visible_vram_size); + r =radeon_bo_create (rdev,256 *1024 ,PAGE_SIZE , true,RADEON_GEM_DOMAIN_VRAM ,NULL , &rdev->stollen_vga_memory);
Signature · 1 line
1.8.3.1
Alex Deucher
AppliedQuoted 6 lines · Lauri Kasanen
Without this, a bo may get created in the cpu-inaccessible vram. Before the CP engines get setup, all copies are done via cpu memcpy.
This means that the cpu tries to read from inaccessible memory, fails, and the radeon module proceeds to disable acceleration.
Quoted 8 lines
Doing this has no downsides, as the real VRAM size gets set as soon as the CP engines get init.
This is a candidate for 3.14 fixes.
v2: Add comment on why the function is used
Signed-off-by Lauri Kasanen <[email protected]>
Applied to my fixes tree. thanks!
Alex
Quoted 25 lines
--- drivers/gpu/drm/radeon/radeon_ttm.c | 3 +++ 1 file changed, 3 insertions(+)drivers/gpu/drm/radeon/radeon_ttm.c +3
-1@@ -715,6 +715,9 @@ int radeon_ttm_init(struct radeon_device *rdev)DRM_ERROR ("Failed initializing VRAM heap.\n" );return r; } +/* Change the size here instead of the init above so only lpfn is affected */ +radeon_ttm_set_active_vram_size (rdev, rdev->mc.visible_vram_size); + r =radeon_bo_create (rdev,256 *1024 ,PAGE_SIZE , true,RADEON_GEM_DOMAIN_VRAM ,NULL , &rdev->stollen_vga_memory); --1.8.3.1
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Am 28.02.2014 19:50, schrieb Lauri Kasanen:
Quoted 6 lines
Without this, a bo may get created in the cpu-inaccessible vram. Before the CP engines get setup, all copies are done via cpu memcpy.
This means that the cpu tries to read from inaccessible memory, fails, and the radeon module proceeds to disable acceleration.
Quoted 8 lines
Doing this has no downsides, as the real VRAM size gets set as soon as the CP engines get init.
This is a candidate for 3.14 fixes.
v2: Add comment on why the function is used
Signed-off-by Lauri Kasanen <[email protected]>
And I suggest to add "Cc: [email protected]" as well.
Christian.
Quoted 18 lines
--- drivers/gpu/drm/radeon/radeon_ttm.c | 3 +++ 1 file changed, 3 insertions(+)drivers/gpu/drm/radeon/radeon_ttm.c +3
-0@@ -715,6 +715,9 @@ int radeon_ttm_init(struct radeon_device *rdev)DRM_ERROR ("Failed initializing VRAM heap.\n" );return r; } +/* Change the size here instead of the init above so only lpfn is affected */ +radeon_ttm_set_active_vram_size (rdev, rdev->mc.visible_vram_size); + r =radeon_bo_create (rdev,256 *1024 ,PAGE_SIZE , true,RADEON_GEM_DOMAIN_VRAM ,NULL , &rdev->stollen_vga_memory);
Dave Airlie
maintainerQuoted 15 lines · Christian König
Am 28.02.2014 19:50, schrieb Lauri Kasanen:
Quoted 13 lines
Without this, a bo may get created in the cpu-inaccessible vram. Before the CP engines get setup, all copies are done via cpu memcpy.
This means that the cpu tries to read from inaccessible memory, fails, and the radeon module proceeds to disable acceleration.
Doing this has no downsides, as the real VRAM size gets set as soon as the CP engines get init.
This is a candidate for 3.14 fixes.
v2: Add comment on why the function is used
Quoted 8 lines
Quoted 1 line
Signed-off-by Lauri Kasanen <[email protected]>Reviewed-by Christian König <[email protected]>And I suggest to add "Cc: [email protected]" as well.
Christian.
Won't this create objects that are stuck in the middle of VRAM with the new top down approach?
then when we go to use all the VRAM they'll be pinned in the middle?
Dave.
Quoted 16 lines · On Sat, 1 Mar 2014 06:47:41 +1000 Dave Airlie <[email protected]> wrote:
Quoted 14 lines · Christian König
Am 28.02.2014 19:50, schrieb Lauri Kasanen:
Quoted 12 lines
Without this, a bo may get created in the cpu-inaccessible vram. Before the CP engines get setup, all copies are done via cpu memcpy.
This means that the cpu tries to read from inaccessible memory, fails, and the radeon module proceeds to disable acceleration.
Doing this has no downsides, as the real VRAM size gets set as soon as the CP engines get init.
This is a candidate for 3.14 fixes.
v2: Add comment on why the function is used
Quoted 8 lines
Quoted 3 lines
Reviewed-by Christian König <[email protected]>And I suggest to add "Cc: [email protected]" as well.
Won't this create objects that are stuck in the middle of VRAM with the new top down approach?
then when we go to use all the VRAM they'll be pinned in the middle?
Yes, the initial pins would act like that with the top-down code. But the top-down logic is 3.15 material and still WIP.
Depending on their constraints, I think I'll either add a new flag, or turn them into FIXED allocations - do they need to be at exact position foo or only at the beginning. (Christian?)
So sending this fix to stable is safe, as they all use bottom-up.
- Lauri
Am 01.03.2014 10:15, schrieb Lauri Kasanen:
Quoted 24 lines
Quoted 21 lines · On Sat, 1 Mar 2014 06:47:41 +1000 Dave Airlie <[email protected]> wrote:
Quoted 11 lines · Christian König
Am 28.02.2014 19:50, schrieb Lauri Kasanen:
Quoted 9 lines
Without this, a bo may get created in the cpu-inaccessible vram. Before the CP engines get setup, all copies are done via cpu memcpy.
This means that the cpu tries to read from inaccessible memory, fails, and the radeon module proceeds to disable acceleration.
Doing this has no downsides, as the real VRAM size gets set as soon as the CP engines get init.
Quoted 6 lines
Quoted 3 lines
This is a candidate for 3.14 fixes.
v2: Add comment on why the function is used
Reviewed-by Christian König <[email protected]>And I suggest to add "Cc: [email protected]" as well.
Won't this create objects that are stuck in the middle of VRAM with the new top down approach?
Quoted 7 lines
Quoted 1 line
then when we go to use all the VRAM they'll be pinned in the middle?
Yes, the initial pins would act like that with the top-down code. But the top-down logic is 3.15 material and still WIP.
Depending on their constraints, I think I'll either add a new flag, or turn them into FIXED allocations - do they need to be at exact position foo or only at the beginning. (Christian?)
AFAIK the stolen VGA memory must be at the very beginning.
The UVD firmware memory block needs to be in the first 256MB, allocated and initialized before all other blocks are started and after used once can't be moved around any more.
I'm not sure about this but we probably have more allocations that assume they end up at the beginning of the address space (GART?).
Christian.
Quoted 4 lines
So sending this fix to stable is safe, as they all use bottom-up.
- Lauri
Quoted 41 lines · Christian König
Am 01.03.2014 10:15, schrieb Lauri Kasanen:
Quoted 29 lines
Quoted 26 lines · On Sat, 1 Mar 2014 06:47:41 +1000 Dave Airlie <[email protected]> wrote:
Quoted 13 lines · Christian König
Am 28.02.2014 19:50, schrieb Lauri Kasanen:
Quoted 10 lines
Without this, a bo may get created in the cpu-inaccessible vram. Before the CP engines get setup, all copies are done via cpu memcpy.
This means that the cpu tries to read from inaccessible memory, fails, and the radeon module proceeds to disable acceleration.
Doing this has no downsides, as the real VRAM size gets set as soon as the
CP engines get init.Quoted 7 lines
Quoted 3 lines
This is a candidate for 3.14 fixes.
v2: Add comment on why the function is used
Reviewed-by Christian König <[email protected]>And I suggest to add "Cc: [email protected]" as well.
Won't this create objects that are stuck in the middle of VRAM with the new top down approach?
Quoted 8 lines
Quoted 1 line
then when we go to use all the VRAM they'll be pinned in the middle?
Yes, the initial pins would act like that with the top-down code. But the top-down logic is 3.15 material and still WIP.
Depending on their constraints, I think I'll either add a new flag, or turn them into FIXED allocations - do they need to be at exact position foo or only at the beginning. (Christian?)
Quoted 9 lines
AFAIK the stolen VGA memory must be at the very beginning.
The UVD firmware memory block needs to be in the first 256MB, allocated and initialized before all other blocks are started and after used once can't be moved around any more.
I'm not sure about this but we probably have more allocations that assume they end up at the beginning of the address space (GART?).
Gart (vmid 0) needs to be in the visible area since we use the CPU to update it.
Alex
Quoted 13 lines
Christian.
Quoted 4 lines
So sending this fix to stable is safe, as they all use bottom-up.
- Lauri
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel