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

Jose Fonseca jfonseca at vmware.com
Sun Feb 8 12:08:55 PST 2015


As I said earlier on this thread, it's not that simple: u_math.c depends on u_cpu_detect.c and more.  I wish it was a matter of merely moving u_math.[ch] to src/util, but it's not.

And because I don't believe I have the time to untangle u_math.[ch] from everything else, I'm restrictied to more incremental solutions.  That is, add a new header to src/util with an unique name, and cherry-pick bits and pieces from u_math.[ch] as deemed necessary/practical.

Jose


________________________________________
From: Marek Olšák <maraeo at gmail.com>
Sent: 08 February 2015 11:27
To: Jose Fonseca
Cc: Matt Turner; Emil Velikov; ML mesa-dev
Subject: Re: [Mesa-dev] Rename mesa/src/util (Was: gallium/util: add u_bit_scan64)

I kind of like the "util_" prefix everywhere. u_math only depends on
p_config.h and p_compiler.h. I don't think it would be hard to move
those two into src/util as well. We have always wanted Mesa to use
more of Gallium. This might be a good start.

Just my 2 cents.

Marek

On Sat, Feb 7, 2015 at 3:46 PM, Jose Fonseca <jfonseca at vmware.com> wrote:
> 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
> everwhere.
>
> 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
> mathhelpers.h
>
>
>
> Jose
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.freedesktop.org_mailman_listinfo_mesa-2Ddev&d=AwIBaQ&c=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEs&r=zfmBZnnVGHeYde45pMKNnVyzeaZbdIqVLprmZCM2zzE&m=sAgl8jEh0WnJsnslLG59t6U2AbWzLAmPO3N7rrA9YPE&s=L3d9gFZyZkC0vZ0eYA6Bl3TFEihZ0Btt56_Hl3iTvS0&e=


More information about the mesa-dev mailing list