On 09.08.2016 15:58, Rob Clark wrote:
On Tue, Aug 9, 2016 at 9:47 AM, Nicolai Hähnle <nhaeh...@gmail.com> wrote:
Hi everybody,
addrlib is the addressing and alignment calculator which is used by
radeonsi. It's developed (and also used) internally at AMD, and so far we've
had one open source copy living in the Mesa repository at
src/gallium/winsys/amdgpu/drm/addrlib.
The question of using addrlib in non-Mesa parts of our open-source stack has
come up, in particular in relation to compute. We'd obviously like to share
the code rather than having multiple copies flying around. Since the
interface of addrlib is slow-moving but unstable, shared linking is not an
option.
I think the best way forward is to create a dedicated repository for addrlib
which is then integrated into Mesa as a git submodule.
The point of this email is to gather feedback from the Mesa community on
this plan, which is explicitly:
(0) Create an addrlib repository, say amd/addrlib on fd.o.
(1) Add it as a git submodule to the Mesa repository.
(2) Fix up whatever aspects of the build system that may be affected
(perhaps for building source tarballs).
(3) Go back to mostly ignoring addrlib, except for trying to get better at
syncing with the internal closed-source version.
From initial experiments, the impact on users interested in radeon is that
they will have to run `git submodule init` and then occasionally `git
submodule update`. Users who do not build radeonsi should be able to ignore
the change completely.
tbh, git submodules are more annoying than they need to be, and I'm
not really terribly excited to use that for something that is a build
dependency. Maybe just move it into libdrm instead?
I know. That's what I would have proposed if the addrlib interface were
stable. Unfortunately it isn't, and realistically speaking, that's not
going to change.
So shared linking is right out.
Static linking or just including source files from a separate repository
could be considered, but then what's the process for ensuring you have
the right version?
The nice aspect of submodules is that every commit of the Mesa
repository "knows" what the corresponding right version of addrlib is,
and so git can update the submodule to the correct version for you
automatically.
Cheers,
Nicolai
BR,
-R
There are alternatives. For example, ROCm uses Google's repo tool already.
But for Mesa, git submodule looks like a lightweight, well supported and
overall conservative option that everybody should already have installed. If
there are good arguments for something else, let's hear them!
Another point: if we proceed with this plan, I think we should consider
moving addrlib into src/amd/addrlib. There are two reasons: First,
transitioning to a submodule *without* changing the directory is probably
more fragile, i.e. what happens when you switch between checkouts before and
after the transition. Second, if/when radv ends up being merged into Mesa
master, it makes sense to have addrlib there anyway.
Thoughts? Complaints? Praise?
Nicolai
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev