mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Lucas Stach <l.stach@pengutronix.de>
To: Alexey Brodkin <Alexey.Brodkin@synopsys.com>
Cc: "dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"christian.gmeiner@gmail.com" <christian.gmeiner@gmail.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Vineet Gupta <Vineet.Gupta1@synopsys.com>,
	"linux-snps-arc@lists.infradead.org" 
	<linux-snps-arc@lists.infradead.org>
Subject: Re: etnaviv: PHYS_OFFSET usage
Date: Wed, 15 Nov 2017 17:44:03 +0100	[thread overview]
Message-ID: <1510764243.2835.13.camel@pengutronix.de> (raw)
In-Reply-To: <1510763053.29843.64.camel@synopsys.com>

Hi Alexey,

Am Mittwoch, den 15.11.2017, 16:24 +0000 schrieb Alexey Brodkin:
> Hi Lucas,
> 
> As we discussed on ELCE last month in Prague we have Vivante GPU
> built-in our new ARC HSDK development board.
> 
> And even though [thanks to your suggestions] I got Etnaviv driver
> working perfectly fine on our board I faced one quite a tricky
> situation [which I dirty worked-around for now].
> 
> Etnaviv driver uses some PHYS_OFFSET define which is not very
> usual across all architectures and platforms supported by Linux kernel.
> 
> In fact for ARC we don't have PHYS_OFFSET defined [yet].
> And I'm wondering how to get this resolved.
> 
> Essentially we have 2 options:
>  1. Define PHYS_OFFSET for ARC (and later for other arches once needed)
>  2. Replace PHYS_OFFSET with something else in etnaviv sources.
> 
> Even though (1) seems to be the simplest solution is doesn't look very nice
> because it seems to be quite ARM-specific but not something really generic
> and portable.
> 
> As for (2) frankly I din't quite understand why do we really care about
> DDR start offset in the GPU driver. If some more light could be shed on this
> topic probably we'll figure out what would be more elegant solution.

Basically the GPU has a linear address window which is 2GB in size and
all GPU command buffers must be mapped through this window. The window
has a base offset, so we can move it to point to different locations in
the physical address space of the system.

Etnaviv uses the PHYS_OFFSET to find out where in the physical address
space the RAM starts. If the start of RAM is above the 2GB mark we
_must_ use the linear window in order to make the command buffers
available to the GPU.

I'm not aware of any other kernel API that would allow us to find the
start of RAM. If there is I would be happy to replace the PHYS_OFFSET
stuff. If you don't like to copy the PHYS_OFFSET stuff to ARC, you
would need to introduce some new API, which allows us to retrieve this
information.

Regards,
Lucas

  reply	other threads:[~2017-11-15 16:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-15 16:24 Alexey Brodkin
2017-11-15 16:44 ` Lucas Stach [this message]
2017-11-15 17:36   ` Alexey Brodkin
2017-11-15 17:56     ` Lucas Stach
2017-12-05  9:32       ` Alexey Brodkin

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=1510764243.2835.13.camel@pengutronix.de \
    --to=l.stach@pengutronix.de \
    --cc=Alexey.Brodkin@synopsys.com \
    --cc=Vineet.Gupta1@synopsys.com \
    --cc=christian.gmeiner@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-snps-arc@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®