All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <ckoenig.leichtzumerken@gmail.com>
To: "Ruhl, Michael J" <michael.j.ruhl@intel.com>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>
Cc: "bskeggs@redhat.com" <bskeggs@redhat.com>
Subject: Re: [PATCH] drm/ttm: cleanup ttm_agp_backend
Date: Mon, 26 Apr 2021 21:47:17 +0200	[thread overview]
Message-ID: <12493c6f-303a-6fc0-3219-2dbaae210c47@gmail.com> (raw)
In-Reply-To: <f245337776cb4949b2f36e1bb2d24c51@intel.com>



Am 26.04.21 um 21:36 schrieb Ruhl, Michael J:
>> -----Original Message-----
>> From: dri-devel <dri-devel-bounces@lists.freedesktop.org> On Behalf Of
>> Christian König
>> Sent: Monday, April 26, 2021 1:58 PM
>> To: dri-devel@lists.freedesktop.org
>> Cc: bskeggs@redhat.com
>> Subject: [PATCH] drm/ttm: cleanup ttm_agp_backend
>>
>> Audit the includes and stop accessing the internal drm_mm_node.
>>
>> The ttm_resource::start should be the same value as the
>> drm_mm_node::start.
> "should be"?
>
> Are you sure?  😊

Nope, that's why Ben is on CC. He explicitly changed that for nouveau 
about 10 years ago :)

But I'm pretty sure that this is completely outdated and not necessary 
any more.

> If it isn't, is there an issue?
>
> If they are the same (set in ttm_range_man_alloc?), maybe:
>
> The ttm_resource::start is the same value as the drm_mm_node::start.

Yes, as far as I can see that is true for all current code paths. Going 
to update the commit message.

>
> With that change:
>
> Reviewed-by: Michael J. Ruhl <michael.j.ruhl@intel.com>

Thanks,
Christian.

>
> M
>
>> Signed-off-by: Christian König <christian.koenig@amd.com>
>> ---
>> drivers/gpu/drm/ttm/ttm_agp_backend.c | 8 ++++----
>> 1 file changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/ttm/ttm_agp_backend.c
>> b/drivers/gpu/drm/ttm/ttm_agp_backend.c
>> index 0226ae69d3ab..6ddc16f0fe2b 100644
>> --- a/drivers/gpu/drm/ttm/ttm_agp_backend.c
>> +++ b/drivers/gpu/drm/ttm/ttm_agp_backend.c
>> @@ -32,8 +32,9 @@
>>
>> #define pr_fmt(fmt) "[TTM] " fmt
>>
>> -#include <drm/ttm/ttm_bo_driver.h>
>> -#include <drm/ttm/ttm_placement.h>
>> +#include <drm/ttm/ttm_device.h>
>> +#include <drm/ttm/ttm_tt.h>
>> +#include <drm/ttm/ttm_resource.h>
>> #include <linux/agp_backend.h>
>> #include <linux/module.h>
>> #include <linux/slab.h>
>> @@ -50,7 +51,6 @@ int ttm_agp_bind(struct ttm_tt *ttm, struct
>> ttm_resource *bo_mem)
>> {
>> 	struct ttm_agp_backend *agp_be = container_of(ttm, struct
>> ttm_agp_backend, ttm);
>> 	struct page *dummy_read_page = ttm_glob.dummy_read_page;
>> -	struct drm_mm_node *node = bo_mem->mm_node;
>> 	struct agp_memory *mem;
>> 	int ret, cached = ttm->caching == ttm_cached;
>> 	unsigned i;
>> @@ -76,7 +76,7 @@ int ttm_agp_bind(struct ttm_tt *ttm, struct
>> ttm_resource *bo_mem)
>> 	mem->is_flushed = 1;
>> 	mem->type = (cached) ? AGP_USER_CACHED_MEMORY :
>> AGP_USER_MEMORY;
>>
>> -	ret = agp_bind_memory(mem, node->start);
>> +	ret = agp_bind_memory(mem, bo_mem->start);
>> 	if (ret)
>> 		pr_err("AGP Bind memory failed\n");
>>
>> --
>> 2.25.1
>>
>> _______________________________________________
>> dri-devel mailing list
>> dri-devel@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/dri-devel

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

      reply	other threads:[~2021-04-26 19:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-26 17:58 [PATCH] drm/ttm: cleanup ttm_agp_backend Christian König
2021-04-26 19:36 ` Ruhl, Michael J
2021-04-26 19:47   ` Christian König [this message]

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=12493c6f-303a-6fc0-3219-2dbaae210c47@gmail.com \
    --to=ckoenig.leichtzumerken@gmail.com \
    --cc=bskeggs@redhat.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=michael.j.ruhl@intel.com \
    /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.