diff options
author | Lionel Landwerlin <[email protected]> | 2018-03-13 11:21:17 +0000 |
---|---|---|
committer | Lionel Landwerlin <[email protected]> | 2018-03-20 13:56:07 +0000 |
commit | 035cc7a12dc03ef8b8184f75b880ae41e452b215 (patch) | |
tree | 4555826f1704fa14db1e8dccf68f1ab645e1e575 /src/mesa/drivers/dri/i965/Makefile.sources | |
parent | e9a9e859486104ff9326cbc424480e53dc4e81ba (diff) |
i965: perf: reduce i965 binary size
Performance metric numbers are calculated the following way :
- out of the 256 bytes long OA reports, we accumulate the deltas
into an array of uint64_t
- the equations' generated code reads the accumulated uint64_t
deltas and normalizes them for a particular platform
Our hardware is such that a number of counters in the OA reports
always return the same values (i.e. they're not programmable), and
they return the same values even across generations, and as a result a
number of equations are identical in different metric sets across
different generations.
Up to now we've kept the generated code of the equations separated in
different files (per generation/GT), and didn't apply any
factorization of the common equations. We could have make some
improvement by reusing equations within a given metrics file, but we
can go even further and reuse across generations (i.e. all files).
This change changes the code generation to emit a single file in which
we reuse equations emitted code based on the hash of equations'
strings.
Here are the savings in a meson build :
Before(.old)/after :
$ du -h ./build/src/mesa/drivers/dri/libmesa_dri_drivers.so ./build/src/mesa/drivers/dri/libmesa_dri_drivers.so.old
43M ./build/src/mesa/drivers/dri/libmesa_dri_drivers.so
47M ./build/src/mesa/drivers/dri/libmesa_dri_drivers.so.old
$ size build/src/mesa/drivers/dri/libmesa_dri_drivers.so build/src/mesa/drivers/dri/libmesa_dri_drivers.so.old
text data bss dec hex filename
13054002 409424 671856 14135282 d7aff2 build/src/mesa/drivers/dri/libmesa_dri_drivers.so
14550386 409552 671856 15631794 ee85b2 build/src/mesa/drivers/dri/libmesa_dri_drivers.so.old
As a side comment here is the size of the drivers if we remove all of
the metrics from the build :
$ du -sh build/src/mesa/drivers/dri/libmesa_dri_drivers.so
40M build/src/mesa/drivers/dri/libmesa_dri_drivers.so
v2: Fix an issue with hashing of counter equations (Lionel)
Build system rework (Emil)
Signed-off-by: Lionel Landwerlin <[email protected]>
Reviewed-by: Emil Velikov <[email protected]> (build system part)
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965/Makefile.sources')
-rw-r--r-- | src/mesa/drivers/dri/i965/Makefile.sources | 40 |
1 files changed, 16 insertions, 24 deletions
diff --git a/src/mesa/drivers/dri/i965/Makefile.sources b/src/mesa/drivers/dri/i965/Makefile.sources index 2f349aa07ab..ad45cd84692 100644 --- a/src/mesa/drivers/dri/i965/Makefile.sources +++ b/src/mesa/drivers/dri/i965/Makefile.sources @@ -156,27 +156,19 @@ i965_gen11_FILES = \ genX_state_upload.c i965_oa_GENERATED_FILES = \ - brw_oa_hsw.h \ - brw_oa_hsw.c \ - brw_oa_bdw.h \ - brw_oa_bdw.c \ - brw_oa_chv.h \ - brw_oa_chv.c \ - brw_oa_sklgt2.h \ - brw_oa_sklgt2.c \ - brw_oa_sklgt3.h \ - brw_oa_sklgt3.c \ - brw_oa_sklgt4.h \ - brw_oa_sklgt4.c \ - brw_oa_bxt.h \ - brw_oa_bxt.c \ - brw_oa_kblgt2.h \ - brw_oa_kblgt2.c \ - brw_oa_kblgt3.h \ - brw_oa_kblgt3.c \ - brw_oa_glk.h \ - brw_oa_glk.c \ - brw_oa_cflgt2.h \ - brw_oa_cflgt2.c \ - brw_oa_cflgt3.h \ - brw_oa_cflgt3.c + brw_oa_metrics.c \ + brw_oa_metrics.h + +i965_oa_xml_FILES = \ + brw_oa_hsw.xml \ + brw_oa_bdw.xml \ + brw_oa_chv.xml \ + brw_oa_sklgt2.xml \ + brw_oa_sklgt3.xml \ + brw_oa_sklgt4.xml \ + brw_oa_bxt.xml \ + brw_oa_kblgt2.xml \ + brw_oa_kblgt3.xml \ + brw_oa_glk.xml \ + brw_oa_cflgt2.xml \ + brw_oa_cflgt3.xml |