[Mesa-dev] [PATCH] fixup! genxml: Add enough XML for gens 4, 4.5, and 5 to get SURFACE_STATE

Emil Velikov emil.l.velikov at gmail.com
Mon Jun 13 22:53:10 UTC 2016


Hi Mauro,

On 13 June 2016 at 23:15, Mauro Rossi <issor.oruam at gmail.com> wrote:
> Hi Jason, Emil,
>
> Jason patch  equires additional changes to correctly complete the
> builld as the new generated headers gen{4,45,5}_pack.h need also to be
> added to src/intel/Makefile.sources in GENXML_GENERATED_FILES variable
>
The patch that I've sent was a "fixup" (i.e. is to be squashed with
the commit name that follows). That very same has the headers in the
Makefiles.sources

> I've not been able to explore the reuse if autoconf rules, because it
> is a task too complex for me,
> but I've found a way to reduce the complexity in genxml Android.mk by
> using wildcards and $(call transform-generated-source) macro like in
> src/mesa/util Android.mk makefile.
>
> Emil, when you talk about reusing autoconf rules, do you mean to use
> androgenizer (from collabora?) as a mean to generate the Android.mk
> (on the fly)?
>
Last time I've tried that androgenizer wasn't worth it for a couple of reasons:
 - one needs to explicitly run ./autogen.sh && make android (iirc) to
generate the android makefiles
 - but most importantly, all the difference(s) between android and
autoconf had to be moved in the Makefile.am

What I'm saying is that there's not need for all the Android abstraction imho.

1) Take the newly (reduced) hunk

$(LOCAL_GENERATED_SOURCES): PRIVATE_PYTHON := $(MESA_PYTHON2)
$(LOCAL_GENERATED_SOURCES): PRIVATE_CUSTOM_TOOL = $(PRIVATE_PYTHON) $^ > $@
$(LOCAL_GENERATED_SOURCES): $(intermediates)/genxml/%_pack.h:
$(LOCAL_PATH)/gen_pack_header.py $(LOCAL_PATH)/%.xml
   $(transform-generated-source)

2) Strip out all the Androidisms and you'll get something like:

$(LOCAL_GENERATED_SOURCES): $(intermediates)/genxml/%_pack.h:
$(LOCAL_PATH)/gen_pack_header.py $(LOCAL_PATH)/%.xml
  $(MESA_PYTHON2) $^ > $@

3) Now if we assume that Android hasn't borken SUFFIX rules, that could become

SUFFIXES = _pack.h .xml

$(LOCAL_GENERATED_SOURCES): $(LOCAL_PATH)/gen_pack_header.py
.xml_pack.h:
    $(MESA_PYTHON2) $(LOCAL_PATH)/gen_pack_header.py $< > $@

4) and a similar looking autoconf one

SUFFIXES = _pack.h .xml

$(BUILT_SOURCES): gen_pack_header.py
.xml_pack.h:
       $(PYTHON_GEN) $(srcdir)/gen_pack_header.py $< > $@

Step 5 and onwards entails expanding (add srcdir for both
gen_pack_header.py) and moving the autoconf one to another file (might
need to prefix gen_pack_header.py. And finally doing flexing the
android and autoconf variables (PYTHON_GEN := MESA_PYTHON2 and/or
alike) and including the rule file into the android build.

Note: most of the above is approximation, but should serve as nice
guide what I have in mind.

Please don't worry to much if you cannot test on autoconf side of
things. Just post some patch(es) once things are working on Android
side.

> In the meantime this is what I can provide now.
> Emil fixup! can be skipped and, as a proposal, can be replaced by the
> following two addendum patches to Jason's
>
> The first was tested and build was completed correctly, for the second
> it should be ok, but please review them.
> KR
>
Jason, feel free to pick whichever patch you like - the annoyingly
verbose from me or the shorter (en route to victory) from Mauro.

-Emil


More information about the mesa-dev mailing list