[Mesa-dev] Rename mesa/src/util (Was: gallium/util: add u_bit_scan64)

Jose Fonseca jfonseca at vmware.com
Sat Feb 7 06:46:00 PST 2015

On 07/02/15 00:10, Matt Turner wrote:
> On Fri, Feb 6, 2015 at 3:58 PM, Emil Velikov <emil.l.velikov at gmail.com> wrote:
>>> "util" is meant to be for shared utility across the entire code base -
>>> both Mesa and Gallium.  It's been growing slowly as people move things
>>> there.  It might make sense to move a lot of src/gallium/auxiliary/util
>>> there, in fact - there's always been a lot of duplication between Mesa
>>> and Gallium's utility code.  But that's up to the Gallium developers.
>> Imho currently the util library is growing on the basis of "we can
>> share X let's throw it in there" rather than putting much thought
>> about the structure/"design" of it - unlike in gallium.
> Are you serious? Let's be honest with ourselves. I probably would have
> been a better plan to not put commonly useful code deep in Gallium in
> the first place.

Historic reasons, as Brian explained.  Gallium was supposed to become a 
dependency of Mesa but it didn't panned out.

> Apparently this is what I get for trying to do the right thing an pull
> the atomics code out into a place the rest of the Mesa project can use
> it.

I really appreciate you went the extra mile there.  And for me it's way 
more important that we start sharing code than the naming structure.

Especially when naming is subject to test/style whereas code reuse is 
something everybody can readily agree on.

If the outcome of this email thread would be to dicentivate you to share 
more code, then that would be worst outcome indeed.

Anyway, let's get out of this criticism spiral, and instead focus on how 
we can solve the issues to everybody's satisfaction.

> How about instead of an annoying bikeshed thread we just finish moving
> bits of Gallium's util directory to src/util and be done with it?

If renaming src/util is not something we can agree fine.  Let's forget 
about it.

But I don't think I (or anybody) has the time to move 
src/gallium/auxiliary/util to src/util in one go.  The code is entangled 
with src/gallium/include .

That is, moving the whole src/gaullium/auxiliary/util to src/util equals 
to add gallium as dependency to whole mesa.  If that's OK, then I agree 
with Brian's suggestion: might as well do that (leave util in 
src/gallium/axuliary ) and add src/gallium/* as includes/dependency 

I think for Mesa (src/mesa) this is fine.  I'm not sure about src/glsl.

Again, I suspect this won't be something we'll agree neither.

So I'm back to the beginning: I want to move some math helpers from 
src/gallium/auxiliary/util/u_math to somewhere inside src/util.  I need 
_some_ name: cgrt_*.h is no good, math.h would collide with standard C 
headers, u_math.h would collide with src/gallium/auxiliary/util, so it 
must be something else.  I'm open to suggestions.  If none I'll go with 


More information about the mesa-dev mailing list