All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: Russell King - ARM Linux <linux@armlinux.org.uk>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm/etnaviv: Always init gpu->memory_base
Date: Sun, 4 Sep 2016 19:05:38 +0200	[thread overview]
Message-ID: <5bc1be43-4eb8-b005-d1ec-b83b07ae2a2b@denx.de> (raw)
In-Reply-To: <20160826160651.GT1041@n2100.armlinux.org.uk>

On 08/26/2016 06:06 PM, Russell King - ARM Linux wrote:
> On Fri, Aug 26, 2016 at 04:25:13PM +0200, Marek Vasut wrote:
>> The content of gpu->memory_base should point to start of RAM, not zero.
>>
>> Signed-off-by: Marek Vasut <marex@denx.de>
>> Cc: Lucas Stach <l.stach@pengutronix.de>
>> Cc: Christian Gmeiner <christian.gmeiner@gmail.com>
>> Cc: Russell King <rmk+kernel@arm.linux.org.uk>
>> ---
>>  drivers/gpu/drm/etnaviv/etnaviv_gpu.c | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
>> index ff6aa5d..a168532 100644
>> --- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
>> +++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
>> @@ -588,6 +588,8 @@ int etnaviv_gpu_init(struct etnaviv_gpu *gpu)
>>  			gpu->memory_base = PHYS_OFFSET;
>>  		else
>>  			gpu->memory_base = dma_mask - SZ_2G + 1;
>> +	} else {
>> +		gpu->memory_base = PHYS_OFFSET;
>>  	}
> 
> The code is correct as-is.  Etnaviv GPUs are not without their own
> weirdness.

I suspected as much. I think my GPU isn't MC2.0 if I read the
minor_features0 bits right .

> For MC1.0 3D GPUs (eg, GC600 as found on Dove), there is an issue
> where _most_ GPU accesses go through a memory offsetting via the
> memory base, but accesses by the tiler do not: they bypass the
> memory base offsetting.
> 
> We have two options to work around that:
> 
> 1. Maintain two GPU address spaces, and mark relocations according
>    to their use.  This is error prone: we would have to have the
>    kernel verify the relocation type is valid for the load state
>    address to avoid obvious security issues, and the maintanence
>    of these different address spaces becomes more complex.
> 
> 2. Force the address offset to zero so all GPU accesses map through
>    the same method irrespective of which GPU block is performing the
>    access.
> 
> We've chosen (2) because it is much simpler, and less error prone,
> plus it fits with the platforms that we're aware of at the moment.
> I did push for the relocations to have an additional member which
> can be used to flag the type of the relocation if necessary in the
> future without changing the interface structure layouts, so we do
> have that option if we really need to do it - but we'd all prefer
> to avoid it.

I see, thanks for the detailed explanation.

> Also, iirc, the GPU tiler with MC1.0 is unable to access addresses
>> = 2GiB no matter what - if you do have a 3D GPU with MC1.0, and
> you have physical memory above 2GiB... there's no currently known
> solution... you lose.

Yes, i.MX6SX has GC400T and the DRAM starts at 0x8000_0000 .
Did I misunderstand something ?

-- 
Best regards,
Marek Vasut
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

      reply	other threads:[~2016-09-04 18:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-26 14:25 [PATCH] drm/etnaviv: Always init gpu->memory_base Marek Vasut
2016-08-26 14:35 ` Lucas Stach
2016-08-26 14:38   ` Marek Vasut
2016-08-26 16:06 ` Russell King - ARM Linux
2016-09-04 17:05   ` Marek Vasut [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=5bc1be43-4eb8-b005-d1ec-b83b07ae2a2b@denx.de \
    --to=marex@denx.de \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux@armlinux.org.uk \
    /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.