drm/radeon: add define for flags used in R600+ GTT
Subsystems (2)
PATCH 1/3 drm/radeon: add define for flags used in R600+ GTT
From: Christian König <[email protected]>
--- drivers/gpu/drm/radeon/radeon.h | 4 ++++ drivers/gpu/drm/radeon/rs600.c | 9 +-------- 2 files changed, 5 insertions(+), 8 deletions(-)
drivers/gpu/drm/radeon/radeon.h +4 -0
@@ -853,6 +853,10 @@ struct radeon_mec {#define R600_PTE_FRAG_64KB (4 << 7)#define R600_PTE_FRAG_256KB (6 << 7) +/* flags used for GART page table entries on R600+ */ +#define R600_PTE_GART ( R600_PTE_VALID | R600_PTE_SYSTEM | R600_PTE_SNOOPED \ + | R600_PTE_READABLE | R600_PTE_WRITEABLE) +struct radeon_vm_pt {struct radeon_bo *bo;uint64_t addr;
drivers/gpu/drm/radeon/rs600.c +1 -8
@@ -632,12 +632,6 @@ static void rs600_gart_fini(struct radeon_device *rdev)radeon_gart_table_vram_free (rdev); } -#define R600_PTE_VALID (1 << 0) -#define R600_PTE_SYSTEM (1 << 1) -#define R600_PTE_SNOOPED (1 << 2) -#define R600_PTE_READABLE (1 << 5) -#define R600_PTE_WRITEABLE (1 << 6) -int rs600_gart_set_page (struct radeon_device *rdev,int i,uint64_t addr) {void __iomem *ptr = (void *)rdev->gart.ptr;
@@ -646,8 +640,7 @@ int rs600_gart_set_page(struct radeon_device *rdev, int i, uint64_t addr)return -EINVAL ; } addr = addr &0xFFFFFFFFFFFFF000ULL ; - addr |=R600_PTE_VALID |R600_PTE_SYSTEM |R600_PTE_SNOOPED ; - addr |=R600_PTE_READABLE |R600_PTE_WRITEABLE ; + addr |=R600_PTE_GART ;writeq (addr, ptr + (i *8 ));return 0 ; }
Signature · 6 lines
1.9.1 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 2/3 drm/radeon: optimize SI VM handling
From: Christian König <[email protected]>
Fill VM page tables from the GART page table if applicable.
--- drivers/gpu/drm/radeon/si_dma.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-)
drivers/gpu/drm/radeon/si_dma.c +19 -1
@@ -79,7 +79,25 @@ void si_dma_vm_set_page(struct radeon_device *rdev,trace_radeon_vm_set_page (pe, addr, count, incr, flags); -if (flags &R600_PTE_SYSTEM ) { +if (flags ==R600_PTE_GART ) { +uint64_t src = rdev->gart.table_addr + (addr >>12 ) *8 ; +while (count) { +unsigned bytes = count *8 ; +if (bytes >0xFFFF8 ) + bytes =0xFFFF8 ; + + ib->ptr[ib->length_dw++] =DMA_PACKET (DMA_PACKET_COPY , +1 ,0 ,0 , bytes); + ib->ptr[ib->length_dw++] = pe &0xffffffff ; + ib->ptr[ib->length_dw++] = src &0xffffffff ; + ib->ptr[ib->length_dw++] =upper_32_bits (pe) &0xff ; + ib->ptr[ib->length_dw++] =upper_32_bits (src) &0xff ; + + pe += bytes; + src += bytes; + count -= bytes /8 ; + } + }else if (flags &R600_PTE_SYSTEM ) {while (count) { ndw = count *2 ;if (ndw >0xFFFFE )
Signature · 6 lines
1.9.1 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 2/3] drm/radeon: optimize SI VM handling
Quoted 5 lines · Christian König
From: Christian König <[email protected]>
Fill VM page tables from the GART page table if applicable.
Signed-off-by Christian König <[email protected]>
Quoted 38 lines
--- drivers/gpu/drm/radeon/si_dma.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-)drivers/gpu/drm/radeon/si_dma.c +19
-2@@ -79,7 +79,25 @@ void si_dma_vm_set_page(struct radeon_device *rdev,trace_radeon_vm_set_page (pe, addr, count, incr, flags); -if (flags &R600_PTE_SYSTEM ) { +if (flags ==R600_PTE_GART ) { +uint64_t src = rdev->gart.table_addr + (addr >>12 ) *8 ; +while (count) { +unsigned bytes = count *8 ; +if (bytes >0xFFFF8 ) + bytes =0xFFFF8 ; + + ib->ptr[ib->length_dw++] =DMA_PACKET (DMA_PACKET_COPY , +1 ,0 ,0 , bytes); + ib->ptr[ib->length_dw++] = pe &0xffffffff ; + ib->ptr[ib->length_dw++] = src &0xffffffff ; + ib->ptr[ib->length_dw++] =upper_32_bits (pe) &0xff ; + ib->ptr[ib->length_dw++] =upper_32_bits (src) &0xff ; + + pe += bytes; + src += bytes; + count -= bytes /8 ; + } + }else if (flags &R600_PTE_SYSTEM ) {while (count) { ndw = count *2 ;if (ndw >0xFFFFE ) --1.9.1
Quoted 4 lines
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 3/3 drm/radeon: optimize CIK VM handling
In reply to Christian KönigFrom: Christian König <[email protected]>
Fill VM page tables from the GART page table if applicable.
--- drivers/gpu/drm/radeon/cik_sdma.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-)
drivers/gpu/drm/radeon/cik_sdma.c +20 -1
@@ -741,7 +741,26 @@ void cik_sdma_vm_set_page(struct radeon_device *rdev,trace_radeon_vm_set_page (pe, addr, count, incr, flags); -if (flags &R600_PTE_SYSTEM ) { +if (flags ==R600_PTE_GART ) { +uint64_t src = rdev->gart.table_addr + (addr >>12 ) *8 ; +while (count) { +unsigned bytes = count *8 ; +if (bytes >0x1FFFF8 ) + bytes =0x1FFFF8 ; + + ib->ptr[ib->length_dw++] =SDMA_PACKET (SDMA_OPCODE_WRITE ,SDMA_WRITE_SUB_OPCODE_LINEAR ,0 ); + ib->ptr[ib->length_dw++] = bytes; + ib->ptr[ib->length_dw++] =0 ;/* src/dst endian swap */ + ib->ptr[ib->length_dw++] = src &0xffffffff ; + ib->ptr[ib->length_dw++] =upper_32_bits (src); + ib->ptr[ib->length_dw++] = pe &0xffffffff ; + ib->ptr[ib->length_dw++] =upper_32_bits (pe); + + pe += bytes; + src += bytes; + count -= bytes /8 ; + } + }else if (flags &R600_PTE_SYSTEM ) {while (count) { ndw = count *2 ;if (ndw >0xFFFFE )
Signature · 6 lines
1.9.1 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 3/3] drm/radeon: optimize CIK VM handling
Quoted 16 lines · Christian König
From: Christian König <[email protected]>
Fill VM page tables from the GART page table if applicable.
Signed-off-by Christian König <[email protected]>--- drivers/gpu/drm/radeon/cik_sdma.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-)drivers/gpu/drm/radeon/cik_sdma.c +0
-0@@ -741,7 +741,26 @@ void cik_sdma_vm_set_page(struct radeon_device *rdev,trace_radeon_vm_set_page (pe, addr, count, incr, flags);
drivers/gpu/drm/radeon/cik_sdma.c void cik_sdma_vm_set_page(struct radeon_device *rdev, · line 751
Quoted 10 lines
drivers/gpu/drm/radeon/cik_sdma.c +8
-1-if (flags &R600_PTE_SYSTEM ) { +if (flags ==R600_PTE_GART ) { +uint64_t src = rdev->gart.table_addr + (addr >>12 ) *8 ; +while (count) { +unsigned bytes = count *8 ; +if (bytes >0x1FFFF8 ) + bytes =0x1FFFF8 ; + + ib->ptr[ib->length_dw++] =SDMA_PACKET (SDMA_OPCODE_WRITE ,SDMA_WRITE_SUB_OPCODE_LINEAR ,0 );
Copy paste typo? This should be SDMA_OPCODE_COPY, SDMA_COPY_SUB_OPCODE_LINEAR.
With that fixed, this patch is:
Quoted 18 lines
drivers/gpu/drm/radeon/cik_sdma.c +12
-1+ ib->ptr[ib->length_dw++] = bytes; + ib->ptr[ib->length_dw++] =0 ;/* src/dst endian swap */ + ib->ptr[ib->length_dw++] = src &0xffffffff ; + ib->ptr[ib->length_dw++] =upper_32_bits (src); + ib->ptr[ib->length_dw++] = pe &0xffffffff ; + ib->ptr[ib->length_dw++] =upper_32_bits (pe); + + pe += bytes; + src += bytes; + count -= bytes /8 ; + } + }else if (flags &R600_PTE_SYSTEM ) {while (count) { ndw = count *2 ;if (ndw >0xFFFFE ) --1.9.1
Quoted 4 lines
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 3/3] drm/radeon: optimize CIK VM handling
Am 27.05.2014 17:44, schrieb Alex Deucher:
Quoted 19 lines
Quoted 17 lines · Christian König
From: Christian König <[email protected]>
Fill VM page tables from the GART page table if applicable.
Signed-off-by Christian König <[email protected]>--- drivers/gpu/drm/radeon/cik_sdma.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-)drivers/gpu/drm/radeon/cik_sdma.c +0
-0@@ -741,7 +741,26 @@ void cik_sdma_vm_set_page(struct radeon_device *rdev,trace_radeon_vm_set_page (pe, addr, count, incr, flags);
Quoted 11 lines
drivers/gpu/drm/radeon/cik_sdma.c void cik_sdma_vm_set_page(struct radeon_device *rdev, · line 751
Quoted 9 lines
drivers/gpu/drm/radeon/cik_sdma.c +8
-1-if (flags &R600_PTE_SYSTEM ) { +if (flags ==R600_PTE_GART ) { +uint64_t src = rdev->gart.table_addr + (addr >>12 ) *8 ; +while (count) { +unsigned bytes = count *8 ; +if (bytes >0x1FFFF8 ) + bytes =0x1FFFF8 ; + + ib->ptr[ib->length_dw++] =SDMA_PACKET (SDMA_OPCODE_WRITE ,SDMA_WRITE_SUB_OPCODE_LINEAR ,0 );Copy paste typo? This should be
SDMA_OPCODE_COPY,SDMA_COPY_SUB_OPCODE_LINEAR.
Oh, yes indeed. Thanks for the info.
Going to resend this patch in a minute. Can you add them to your 3.16-wip branch?
Thanks,
Christian.
Quoted 27 lines
With that fixed, this patch is:
Reviewed-by Alex Deucher <[email protected]>Quoted 22 lines
drivers/gpu/drm/radeon/cik_sdma.c +12
-1+ ib->ptr[ib->length_dw++] = bytes; + ib->ptr[ib->length_dw++] =0 ;/* src/dst endian swap */ + ib->ptr[ib->length_dw++] = src &0xffffffff ; + ib->ptr[ib->length_dw++] =upper_32_bits (src); + ib->ptr[ib->length_dw++] = pe &0xffffffff ; + ib->ptr[ib->length_dw++] =upper_32_bits (pe); + + pe += bytes; + src += bytes; + count -= bytes /8 ; + } + }else if (flags &R600_PTE_SYSTEM ) {while (count) { ndw = count *2 ;if (ndw >0xFFFFE ) --1.9.1
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 3/3] drm/radeon: optimize CIK VM handling
Quoted 40 lines · Christian König
Am 27.05.2014 17:44, schrieb Alex Deucher:
Quoted 22 lines
Quoted 20 lines · Christian König
From: Christian König <[email protected]>
Fill VM page tables from the GART page table if applicable.
Signed-off-by Christian König <[email protected]>--- drivers/gpu/drm/radeon/cik_sdma.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-)drivers/gpu/drm/radeon/cik_sdma.c +0
-0@@ -741,7 +741,26 @@ void cik_sdma_vm_set_page(struct radeon_device *rdev,trace_radeon_vm_set_page (pe, addr, count, incr, flags);Quoted 14 lines
drivers/gpu/drm/radeon/cik_sdma.c void cik_sdma_vm_set_page(struct radeon_device *rdev,
Quoted 10 lines
drivers/gpu/drm/radeon/cik_sdma.c +8
-1-if (flags &R600_PTE_SYSTEM ) { +if (flags ==R600_PTE_GART ) { +uint64_t src = rdev->gart.table_addr + (addr >>12 ) *8 ; +while (count) { +unsigned bytes = count *8 ; +if (bytes >0x1FFFF8 ) + bytes =0x1FFFF8 ; + + ib->ptr[ib->length_dw++] =SDMA_PACKET (SDMA_OPCODE_WRITE ,SDMA_WRITE_SUB_OPCODE_LINEAR ,0 );Copy paste typo? This should be
SDMA_OPCODE_COPY,SDMA_COPY_SUB_OPCODE_LINEAR.
Quoted 4 lines
Oh, yes indeed. Thanks for the info.
Going to resend this patch in a minute. Can you add them to your 3.16-wip branch?
Will do.
Alex
Quoted 35 lines
Thanks,
Christian.Quoted 28 lines
With that fixed, this patch is:
Reviewed-by Alex Deucher <[email protected]>Quoted 23 lines
drivers/gpu/drm/radeon/cik_sdma.c +2
-0+ ib->ptr[ib->length_dw++] = bytes; + ib->ptr[ib->length_dw++] =0 ;/* src/dst endian swap */
drivers/gpu/drm/radeon/cik_sdma.c +10
-1+ ib->ptr[ib->length_dw++] = src &0xffffffff ; + ib->ptr[ib->length_dw++] =upper_32_bits (src); + ib->ptr[ib->length_dw++] = pe &0xffffffff ; + ib->ptr[ib->length_dw++] =upper_32_bits (pe); + + pe += bytes; + src += bytes; + count -= bytes /8 ; + } + }else if (flags &R600_PTE_SYSTEM ) {while (count) { ndw = count *2 ;if (ndw >0xFFFFE ) --1.9.1
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 3 lines · Christian König
From: Christian König <[email protected]>
Signed-off-by Christian König <[email protected]>
Quoted 50 lines
--- drivers/gpu/drm/radeon/radeon.h | 4 ++++ drivers/gpu/drm/radeon/rs600.c | 9 +-------- 2 files changed, 5 insertions(+), 8 deletions(-)drivers/gpu/drm/radeon/radeon.h +4
-0@@ -853,6 +853,10 @@ struct radeon_mec {#define R600_PTE_FRAG_64KB (4 << 7)#define R600_PTE_FRAG_256KB (6 << 7) +/* flags used for GART page table entries on R600+ */ +#define R600_PTE_GART ( R600_PTE_VALID | R600_PTE_SYSTEM | R600_PTE_SNOOPED \ + | R600_PTE_READABLE | R600_PTE_WRITEABLE) +struct radeon_vm_pt {struct radeon_bo *bo;uint64_t addr;drivers/gpu/drm/radeon/rs600.c +1
-9@@ -632,12 +632,6 @@ static void rs600_gart_fini(struct radeon_device *rdev)radeon_gart_table_vram_free (rdev); } -#define R600_PTE_VALID (1 << 0) -#define R600_PTE_SYSTEM (1 << 1) -#define R600_PTE_SNOOPED (1 << 2) -#define R600_PTE_READABLE (1 << 5) -#define R600_PTE_WRITEABLE (1 << 6) -int rs600_gart_set_page (struct radeon_device *rdev,int i,uint64_t addr) {void __iomem *ptr = (void *)rdev->gart.ptr;@@ -646,8 +640,7 @@ int rs600_gart_set_page(struct radeon_device *rdev, int i, uint64_t addr)return -EINVAL ; } addr = addr &0xFFFFFFFFFFFFF000ULL ; - addr |=R600_PTE_VALID |R600_PTE_SYSTEM |R600_PTE_SNOOPED ; - addr |=R600_PTE_READABLE |R600_PTE_WRITEABLE ; + addr |=R600_PTE_GART ;writeq (addr, ptr + (i *8 ));return 0 ; } --1.9.1
Quoted 4 lines
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel