All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <deathsimple@vodafone.de>
To: Alex Deucher <alexdeucher@gmail.com>
Cc: Maling list - DRI developers <dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH 1/3] drm/radeon: fix VMID use tracking
Date: Fri, 24 Jan 2014 16:52:37 +0100	[thread overview]
Message-ID: <52E28C45.4030502@vodafone.de> (raw)
In-Reply-To: <CADnq5_PPnb=CFpwRnieRdqooy4PRiHgqen9_W1p=J3ztNMm9ow@mail.gmail.com>

Am 23.01.2014 18:46, schrieb Alex Deucher:
> On Thu, Jan 23, 2014 at 8:24 AM, Christian König
> <deathsimple@vodafone.de> wrote:
>> From: Christian König <christian.koenig@amd.com>
>>
>> Otherwise we allocate a new VMID on nearly every submit.
> I wonder if this fix would allow us to fix up this:
> http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=466476dfdcafbb4286ffa232a3a792731b9dc852

It's probably a step into the right direction, but not necessary the 
complete solution.

For now I would say we should keep the extra flushing as it is.

Christian.

> Alex
>
>> Signed-off-by: Christian König <christian.koenig@amd.com>
>> ---
>>   drivers/gpu/drm/radeon/radeon.h      | 2 ++
>>   drivers/gpu/drm/radeon/radeon_gart.c | 8 +++++++-
>>   2 files changed, 9 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h
>> index c5519ca..4a8ac1c 100644
>> --- a/drivers/gpu/drm/radeon/radeon.h
>> +++ b/drivers/gpu/drm/radeon/radeon.h
>> @@ -867,6 +867,8 @@ struct radeon_vm {
>>          struct radeon_fence             *fence;
>>          /* last flush or NULL if we still need to flush */
>>          struct radeon_fence             *last_flush;
>> +       /* last use of vmid */
>> +       struct radeon_fence             *last_id_use;
>>   };
>>
>>   struct radeon_vm_manager {
>> diff --git a/drivers/gpu/drm/radeon/radeon_gart.c b/drivers/gpu/drm/radeon/radeon_gart.c
>> index 96e4400..0e9143b 100644
>> --- a/drivers/gpu/drm/radeon/radeon_gart.c
>> +++ b/drivers/gpu/drm/radeon/radeon_gart.c
>> @@ -713,7 +713,7 @@ struct radeon_fence *radeon_vm_grab_id(struct radeon_device *rdev,
>>          unsigned i;
>>
>>          /* check if the id is still valid */
>> -       if (vm->fence && vm->fence == rdev->vm_manager.active[vm->id])
>> +       if (vm->last_id_use && vm->last_id_use == rdev->vm_manager.active[vm->id])
>>                  return NULL;
>>
>>          /* we definately need to flush */
>> @@ -769,6 +769,9 @@ void radeon_vm_fence(struct radeon_device *rdev,
>>
>>          radeon_fence_unref(&vm->fence);
>>          vm->fence = radeon_fence_ref(fence);
>> +
>> +       radeon_fence_unref(&vm->last_id_use);
>> +       vm->last_id_use = radeon_fence_ref(fence);
>>   }
>>
>>   /**
>> @@ -1303,6 +1306,8 @@ void radeon_vm_init(struct radeon_device *rdev, struct radeon_vm *vm)
>>   {
>>          vm->id = 0;
>>          vm->fence = NULL;
>> +       vm->last_flush = NULL;
>> +       vm->last_id_use = NULL;
>>          mutex_init(&vm->mutex);
>>          INIT_LIST_HEAD(&vm->list);
>>          INIT_LIST_HEAD(&vm->va);
>> @@ -1341,5 +1346,6 @@ void radeon_vm_fini(struct radeon_device *rdev, struct radeon_vm *vm)
>>          }
>>          radeon_fence_unref(&vm->fence);
>>          radeon_fence_unref(&vm->last_flush);
>> +       radeon_fence_unref(&vm->last_id_use);
>>          mutex_unlock(&vm->mutex);
>>   }
>> --
>> 1.8.1.2
>>

  reply	other threads:[~2014-01-24 15:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-23 13:24 [PATCH 1/3] drm/radeon: fix VMID use tracking Christian König
2014-01-23 13:24 ` [PATCH 2/3] drm/radeon: add missing trace point Christian König
2014-01-23 13:24 ` [PATCH 3/3] drm/radeon: add ring to fence trace functions Christian König
2014-01-23 17:46 ` [PATCH 1/3] drm/radeon: fix VMID use tracking Alex Deucher
2014-01-24 15:52   ` Christian König [this message]
2014-01-24 15:55     ` Alex Deucher

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=52E28C45.4030502@vodafone.de \
    --to=deathsimple@vodafone.de \
    --cc=alexdeucher@gmail.com \
    --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.