All of lore.kernel.org
 help / color / mirror / Atom feed
From: Helge Deller <deller@gmx.de>
To: Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	John David Anglin <dave.anglin@bell.net>
Cc: Sven Schnelle <svens@stackframe.org>, linux-parisc@vger.kernel.org
Subject: Re: some progress with radeon on C8000
Date: Fri, 4 Oct 2019 14:36:42 +0200	[thread overview]
Message-ID: <2a3a3491-7437-7969-29bb-368475d21e33@gmx.de> (raw)
In-Reply-To: <20191004120632.GA7472@alpha.franken.de>

On 04.10.19 14:06, Thomas Bogendoerfer wrote:
> On Wed, Oct 02, 2019 at 04:37:41PM -0400, John David Anglin wrote:
>> On 2019-10-02 10:19 a.m., Thomas Bogendoerfer wrote:
>>> +	pa = addr & IOVP_MASK;
>>> +	mtsp(0,1);
>>> +	asm("lci 0(%%sr1, %1), %0" : "=r" (ci) : "r" (__va(pa)));
>> I believe you can remove the mtsp and just use "lci 0(%1), %0" to load the coherence index.  The space
>> registers sr4 to sr7 are always 0 in kernel.
>
> ok, good to know.
>
> while reading this I realized what the other hacks were for, which I didn't
> include in my first mail.
>
> diff --git a/drivers/gpu/drm/ttm/ttm_agp_backend.c b/drivers/gpu/drm/ttm/ttm_agp_backend.c
> index 028ab6007873..e84c7652eb1b 100644
> --- a/drivers/gpu/drm/ttm/ttm_agp_backend.c
> +++ b/drivers/gpu/drm/ttm/ttm_agp_backend.c
> @@ -66,7 +67,8 @@ static int ttm_agp_bind(struct ttm_tt *ttm, struct ttm_mem_reg *bo_mem)
>   		if (!page)
>   			page = ttm->dummy_read_page;
>
> -		mem->pages[mem->page_count++] = page;
> +		mem->pages[(ttm->num_pages - 1) - mem->page_count] = page;
> +		mem->page_count++;
>   	}
>   	agp_be->mem = mem;
>
> diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c
> index d0459b392e5e..4bb301cab128 100644
> --- a/drivers/gpu/drm/ttm/ttm_bo_util.c
> +++ b/drivers/gpu/drm/ttm/ttm_bo_util.c
> @@ -571,8 +571,14 @@ static int ttm_bo_kmap_ttm(struct ttm_buffer_object *bo,
>   		 */
>   		prot = ttm_io_prot(mem->placement, PAGE_KERNEL);
>   		map->bo_kmap_type = ttm_bo_map_vmap;
> +		printk("vmap %p\n", ttm->pages[start_page]);
> +#if 0
>   		map->virtual = vmap(ttm->pages + start_page, num_pages,
>   				    0, prot);
> +#else
> +		map->virtual = kmap(ttm->pages[start_page]);
> +#endif
> +
>   	}
>   	return (!map->virtual) ? -ENOMEM : 0;
>   }
>
>
> This is needed to be able to get the virtual address with __va(pa).

Can you make a documented patch out of all that?
I'd like to include it at least into a test/hack branch, e.g.
https://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux.git/commit/?h=radeon-test&id=0ef942c21d37078ae6406b3e7075f3dbe6417a04

Helge

  reply	other threads:[~2019-10-04 12:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-28 21:44 some progress with radeon on C8000 Sven Schnelle
2019-10-02 14:19 ` Thomas Bogendoerfer
2019-10-02 20:37   ` John David Anglin
2019-10-04 12:06     ` Thomas Bogendoerfer
2019-10-04 12:36       ` Helge Deller [this message]
2019-10-07  7:33   ` Sven Schnelle

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=2a3a3491-7437-7969-29bb-368475d21e33@gmx.de \
    --to=deller@gmx.de \
    --cc=dave.anglin@bell.net \
    --cc=linux-parisc@vger.kernel.org \
    --cc=svens@stackframe.org \
    --cc=tsbogend@alpha.franken.de \
    /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.