All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jerome Glisse <j.glisse@gmail.com>
To: "Christian König" <deathsimple@vodafone.de>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 3/8] drm/radeon: move IB pool to 1MB offset
Date: Tue, 11 Sep 2012 12:15:45 -0400	[thread overview]
Message-ID: <CAH3drwb79Gqw35WSkGCLjvUVi1tBjgbQC5FX9BGie1uZ2UtLMg@mail.gmail.com> (raw)
In-Reply-To: <1347372604-26557-3-git-send-email-deathsimple@vodafone.de>

On Tue, Sep 11, 2012 at 10:09 AM, Christian König
<deathsimple@vodafone.de> wrote:
> Even GPUs can have a null pointer dereference, so move
> the IB pool to another offset to catch those.

Reviewed-by: Jerome Glisse <jglisse@redhat.com>

>
> Signed-off-by: Christian König <deathsimple@vodafone.de>
> ---
>  drivers/gpu/drm/radeon/radeon.h      |    1 +
>  drivers/gpu/drm/radeon/radeon_gart.c |    2 +-
>  drivers/gpu/drm/radeon/radeon_ring.c |    6 +++---
>  3 files changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h
> index d48bd30..55f17f9 100644
> --- a/drivers/gpu/drm/radeon/radeon.h
> +++ b/drivers/gpu/drm/radeon/radeon.h
> @@ -123,6 +123,7 @@ extern int radeon_lockup_timeout;
>  #define CAYMAN_RING_TYPE_CP2_INDEX             2
>
>  /* hardcode those limit for now */
> +#define RADEON_VA_IB_OFFSET                    (1 << 20)
>  #define RADEON_VA_RESERVED_SIZE                        (8 << 20)
>  #define RADEON_IB_VM_MAX_SIZE                  (64 << 10)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_gart.c b/drivers/gpu/drm/radeon/radeon_gart.c
> index 5694421..1b1c001 100644
> --- a/drivers/gpu/drm/radeon/radeon_gart.c
> +++ b/drivers/gpu/drm/radeon/radeon_gart.c
> @@ -980,7 +980,7 @@ int radeon_vm_init(struct radeon_device *rdev, struct radeon_vm *vm)
>         /* map the ib pool buffer at 0 in virtual address space, set
>          * read only
>          */
> -       r = radeon_vm_bo_add(rdev, vm, rdev->ring_tmp_bo.bo, 0,
> +       r = radeon_vm_bo_add(rdev, vm, rdev->ring_tmp_bo.bo, RADEON_VA_IB_OFFSET,
>                              RADEON_VM_PAGE_READABLE | RADEON_VM_PAGE_SNOOPED);
>         return r;
>  }
> diff --git a/drivers/gpu/drm/radeon/radeon_ring.c b/drivers/gpu/drm/radeon/radeon_ring.c
> index 993cf71..d90b0bc 100644
> --- a/drivers/gpu/drm/radeon/radeon_ring.c
> +++ b/drivers/gpu/drm/radeon/radeon_ring.c
> @@ -79,10 +79,10 @@ int radeon_ib_get(struct radeon_device *rdev, int ring,
>         ib->ptr = radeon_sa_bo_cpu_addr(ib->sa_bo);
>         ib->vm = vm;
>         if (vm) {
> -               /* ib pool is bind at 0 in virtual address space,
> -                * so gpu_addr is the offset inside the pool bo
> +               /* ib pool is bound at RADEON_VA_IB_OFFSET in virtual address
> +                * space and soffset is the offset inside the pool bo
>                  */
> -               ib->gpu_addr = ib->sa_bo->soffset;
> +               ib->gpu_addr = ib->sa_bo->soffset + RADEON_VA_IB_OFFSET;
>         } else {
>                 ib->gpu_addr = radeon_sa_bo_gpu_addr(ib->sa_bo);
>         }
> --
> 1.7.9.5
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2012-09-11 16:15 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-11 14:09 [PATCH 1/8] drm/radeon: fix VA range check Christian König
2012-09-11 14:09 ` [PATCH 2/8] drm/radeon: fix VA overlap check Christian König
2012-09-11 16:14   ` Jerome Glisse
2012-09-11 14:09 ` [PATCH 3/8] drm/radeon: move IB pool to 1MB offset Christian König
2012-09-11 16:15   ` Jerome Glisse [this message]
2012-09-11 14:10 ` [PATCH 4/8] drm/radeon: move and rename radeon_bo_va function Christian König
2012-09-11 16:15   ` Jerome Glisse
2012-09-11 14:10 ` [PATCH 5/8] drm/radeon: let bo_reserve take no_intr instead of no_wait param Christian König
2012-09-11 16:14   ` Jerome Glisse
2012-09-11 14:10 ` [PATCH 6/8] drm/radeon: fix gem_close_object handling Christian König
2012-09-11 16:14   ` Jerome Glisse
2012-09-11 14:10 ` [PATCH 7/8] drm/radeon: remove radeon_bo_clear_va Christian König
2012-09-11 16:12   ` Jerome Glisse
2012-09-12 12:16     ` Christian König
2012-09-11 14:10 ` [PATCH 8/8] drm/radeon: rework the VM code a bit more Christian König
2012-09-11 16:11   ` Jerome Glisse
2012-09-12 12:08     ` Christian König
2012-09-12 13:54       ` Jerome Glisse
2012-09-12 17:13         ` Christian König
2012-09-12 17:45           ` Jerome Glisse
2012-09-12 17:14         ` Christian König
2012-09-11 16:15 ` [PATCH 1/8] drm/radeon: fix VA range check Jerome Glisse

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAH3drwb79Gqw35WSkGCLjvUVi1tBjgbQC5FX9BGie1uZ2UtLMg@mail.gmail.com \
    --to=j.glisse@gmail.com \
    --cc=deathsimple@vodafone.de \
    --cc=dri-devel@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.