[Mesa-dev] [PATCH 0/3] misc janitorial

Emil Velikov emil.l.velikov at gmail.com
Fri Dec 4 05:50:05 PST 2015


On 4 December 2015 at 13:27, Giuseppe Bilotta
<giuseppe.bilotta at gmail.com> wrote:
> On Tue, Dec 1, 2015 at 6:04 PM, Emil Velikov <emil.l.velikov at gmail.com> wrote:
>
>>>>>> With the small comment in patch 3 addressed the series is
>>>>>> Reviewed-by: Emil Velikov <emil.l.velikov at gmail.com>
>
> And also:
>
>> Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
>
> for patch 1 and 2. Who should I ping for to get them pushed? ;-)
>
Hmm I thought I pushed those in a couple of days ago. Doing it now, thanks !

>>>> The long version:
>>>>  1. Grep for RADEON_R{1,2}00 and look at the guarded code
>>>>  1.1 Some guards can just be dropped (CHIP_FAMILY_*, get_chip_family_name),
>>>>  1.2 Other hunks of code can be split/moved into the respective
>>>> r100/r200 codebase (radeonTexBufferExtension and
>>>> r200TexBufferExtension).
>>>>  1.3 Or folded into the vtbl dispatch - get_depth_z32/16 or the
>>>> respective callers, depending on the overhead (neither one is likely
>>>> to be noticeable).
>>>>  2. Copy/pasta an existing radeon Makefile to radeon_common. Tweak to
>>>> produce an empty library and get it into the final mega_dri_drivers.so
>>>>  2.1 With most/all of the RADEON_R*00 guards gone, one should be able
>>>> to just git mv the files into the new location. (alongside dropping
>>>> the symlinks)
>>>>  2.2 Remove the symbol redefinition hack.
>
>> Three reasons - symlinks in git is frowned upon, binary is "bloated"
>> and nasty symbol redefinition(hack).
>
> Well, much of the “bloat” would probably be there even after the
> cleanup, since I'm not sure (from the cursory look I've given) how
> many of the functions would manage to go into a radeon-common. I
> suspect there'll end up being quite some code duplication to get rid
> of the symlinks and symbol redefinition hack.
Not quite ... currently ~50% of the "r200" sources are (almost)
identical to the radeon ones (ls -la src/mesa/drivers/dri/r200/).

> This is one of those
> contexts in which things could be done marginally more elegantly with
> C++. I am proficient enough with C macros and xincludes that I could
> probably hack together something that avoids the symlinks and the code
> duplication, but whether or not this would be considered an
> improvement is very much up to personal taste.
>
Before you start moving things around please fish around for
RADEON_R(12)00. Once things are free of those (either the macros are
just removed or the functions are split into r100 and r200 variant,
all the movement comes into play. The last one can be tedious if
you're unfamiliar with autotools, so just ping me on IRC (not there
today) and I can guide you around.

Cheers.
Emil


More information about the mesa-dev mailing list