Amit Pundir | aa5b306 | 2022-11-26 12:13:57 +0530 | [diff] [blame^] | 1 | These instructions will help you build upstream Mesa binaries for DB845c/RB5 |
| 2 | and prepare linaro vendor-package. |
| 3 | |
| 4 | |
| 5 | Build and boot upstream Mesa (freedreno) with AOSP: |
| 6 | --------------------------------------------------- |
| 7 | * Build AOSP with upstream Mesa: |
| 8 | |
| 9 | $ mkdir $AOSP |
| 10 | $ cd $AOSP |
| 11 | $ repo init -u https://android.googlesource.com/platform/manifest -b master |
| 12 | $ repo sync -j`nproc` |
| 13 | $ cd $AOSP/external/mesa3d |
| 14 | $ git checkout aosp/upstream-main |
| 15 | $ cd $AOSP |
| 16 | $ . build/envsetup.sh |
| 17 | $ lunch db845c-userdebug |
| 18 | $ make TARGET_BUILD_MESA=true -j`nproc` |
| 19 | |
| 20 | * Boot the DB845c/RB5 in fastboot mode and flash the images: |
| 21 | |
| 22 | $ cd $AOSP/out/target/product/db845c |
| 23 | $ fastboot flash super ./super.img flash boot ./boot.img \ |
| 24 | flash vendor_boot ./vendor_boot.img reboot |
| 25 | |
| 26 | |
| 27 | Updating the Mesa prebuilt binaries in linaro vendor-package: |
| 28 | ------------------------------------------------------------ |
| 29 | * Before we update and ship the new set of Mesa prebuilt binaries, please make |
| 30 | sure that there are no new or obvious regressions when we test run |
| 31 | CtsGraphicsTestcases, CtsDEQPTestcases and CtsHardwareTestcases on DB845c and |
| 32 | RB5 with the new binaries. |
| 33 | |
| 34 | Report any breakages or regressions at https://gitlab.freedesktop.org/mesa/mesa/-/issues |
| 35 | |
| 36 | * Copy new Mesa binaries over from AOSP build: |
| 37 | |
| 38 | $ git clone git@gitlab.com:LinaroLtd/linaro-aosp/linaro-vendor-package |
| 39 | $ cd linaro-vendor-package/src/db845c/mesa_prebuilt/ |
| 40 | $ ./copy_bins.sh # This script will copy Mesa prebuilt binaries from \ |
| 41 | $ANDROID_PRODUCT_OUT pre-set by "lunch db845c-userdebug" \ |
| 42 | or user need to set it explicitly to $AOSP/out/target/product/db845c |
| 43 | |
| 44 | Run "git status" to look for modified binaries. Discard any new *_dri.so in |
| 45 | ./lib{,64}/dri/ directory which are usually just a symlink to libgallium_dri.so. |
| 46 | Commit the changes with detailed change log and update top-level src/README |
| 47 | accordingly. |
| 48 | |
| 49 | |
| 50 | Preparing linaro vendor-package for AOSP: |
| 51 | ----------------------------------------- |
| 52 | * Follow instructions in src/README_PrepareVendorPackage to prepare linaro |
| 53 | vendor-package for AOSP. |
| 54 | |
| 55 | |
| 56 | Troubleshooting: |
| 57 | ---------------- |
| 58 | * Upstream Mesa is/was broken due to deprecated libbacktrace in AOSP |
| 59 | https://gitlab.freedesktop.org/mesa/mesa/-/issues/7465, |
| 60 | so we may have to use following hack to workaround that build error: |
| 61 | |
| 62 | -- a/src/util/meson.build |
| 63 | +++ b/src/util/meson.build |
| 64 | @@ -269,7 +269,7 @@ libmesa_util_sse41 = static_library( |
| 65 | |
| 66 | _libmesa_util = static_library( |
| 67 | 'mesa_util', |
| 68 | - [files_mesa_util, files_debug_stack, format_srgb, u_indices_gen_c, u_unfilled_gen_c], |
| 69 | + [files_mesa_util, format_srgb, u_indices_gen_c, u_unfilled_gen_c], |
| 70 | include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux], |
| 71 | dependencies : deps_for_libmesa_util, |
| 72 | link_with: [libmesa_format, libmesa_util_sse41], |
| 73 | |
| 74 | * Upstream also has a new dependency on meson version >= 0.54 now, |
| 75 | and that broke the build on Ubuntu 20.04.5. So update meson by |
| 76 | adding the following untrusted PPA: |
| 77 | |
| 78 | $ sudo add-apt-repository ppa:ubuntu-support-team/meson |
| 79 | $ sudo apt update |
| 80 | $ sudo apt install meson |
| 81 | |
| 82 | h/t: https://launchpad.net/~ubuntu-support-team/+archive/ubuntu/meson |