[PATCH 2/3] drm/radeon: optimize SI VM handling

Alex Deucher alexdeucher at gmail.com
Tue May 27 08:45:03 PDT 2014


On Tue, May 27, 2014 at 10:47 AM, Christian König
<deathsimple at vodafone.de> wrote:
> From: Christian König <christian.koenig at amd.com>
>
> Fill VM page tables from the GART page table if applicable.
>
> Signed-off-by: Christian König <christian.koenig at amd.com>

Reviewed-by: Alex Deucher <alexander.deucher at amd.com>

> ---
>  drivers/gpu/drm/radeon/si_dma.c | 20 +++++++++++++++++++-
>  1 file changed, 19 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/radeon/si_dma.c b/drivers/gpu/drm/radeon/si_dma.c
> index cf0fdad..9521669 100644
> --- a/drivers/gpu/drm/radeon/si_dma.c
> +++ b/drivers/gpu/drm/radeon/si_dma.c
> @@ -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
>
> _______________________________________________
> dri-devel mailing list
> dri-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel


More information about the dri-devel mailing list