Skip to content
This repository has been archived by the owner on Jan 7, 2023. It is now read-only.

Add FP16 support on Android #124

Open
renchenglei opened this issue Sep 6, 2019 · 9 comments
Open

Add FP16 support on Android #124

renchenglei opened this issue Sep 6, 2019 · 9 comments

Comments

@renchenglei
Copy link
Contributor

Android 10 is already public. On latest android, we will need support FP16 format.
@strassek could you help back port your upstream patches set to github? Thanks a lot!
We will also have related minigbm changes for FP16 to enable the whole function on Android.
Upstream patch set: https://gitlab.freedesktop.org/mesa/mesa/merge_requests/794
CC @tpalli

@strassek
Copy link
Contributor

strassek commented Sep 6, 2019

I can help with the backport but I'll want to have the Android platform code in place before we push to master. Can you open an upstream PR? If it helps, I can make a topic branch available for you with the current fp16 code backported to external-mesa master.

@renchenglei
Copy link
Contributor Author

I can help with the backport but I'll want to have the Android platform code in place before we push to master. Can you open an upstream PR? If it helps, I can make a topic branch available for you with the current fp16 code backported to external-mesa master.

Do you mean Android 10 code? Now, we could download latest Celadon with Android 10, :)

@strassek
Copy link
Contributor

strassek commented Sep 9, 2019

There are some (hopefully) minor changes needed in the Android driver for EGL in order to make FP16 available to Android apps, the patch series that we landed upstream only covers GBM platform. @renchenglei I was under the impression that you had started that work, is that true?

btw, can you list the relevant CTS tests here?

@renchenglei
Copy link
Contributor Author

@strassek, yes, in fact, we have back ported your FP16 patches on GP 2.1 based on mesa 19.0.6. And have passed all related CTS test. Besides your FP16 patch set, we also need enable FP16 on Android platform(https://lists.freedesktop.org/archives/mesa-dev/2019-August/222379.html).
Here are some cases related to FP16:
CtsDeqpTestCases dEQP-VK.api.external.memory.android_hardware_buffer.image_formats#r16g16b16a16_sfloat(this may failed on x86 platform)
CtsDeqpTestCases dEQP-VK.wsi.android.incremental_present.scale_none.mailbox.*
CtsGraphicsTestCases android.graphics.cts.ImageDecoderTest#testTargetColorSpace
CtsGraphicsTestCases android.graphics.cts.BitmapColorSpaceTest#test16bitHardware
CtsNativeHardwareTestCases "here you could run the whole module"

@strassek
Copy link
Contributor

Interesting, I didn't see that patch. I guess that satisfies some checks to see if the HAL format is mapped to something, but I can tell you it doesn't actually expose the visual or enable fp16 in the dri driver. In other words, apps aren't going to find an fp16 egl config.

I used these tests in the past to check if a fp16 config can be found, without support in place they will pass as NotSupported:
dEQP-EGL.functional.wide_color.fp16
dEQP-EGL.functional.wide_color.window_fp16_default_colorspace

@strassek
Copy link
Contributor

strassek commented Sep 12, 2019

@renchenglei Was something like this needed in your GP 2.1 backport?

diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index f968cd7af27..82a0bed5c62 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -65,6 +65,7 @@
 #include "util/u_atomic.h"
 #include "util/u_vector.h"
 #include "mapi/glapi/glapi.h"
+#include "util/bitscan.h"
 
 /* Additional definitions not yet in the drm_fourcc.h.
  */

Submitted as https://gitlab.freedesktop.org/mesa/mesa/merge_requests/1973

@renchenglei
Copy link
Contributor Author

@strassek, for the two fp16 test, I tried on Android, and it does pass with "Not Supported". You are right, maybe we need some other more config to enable FP16?
For the ffs issue, we didn't encounter on GP 2.1.

@strassek
Copy link
Contributor

We need the Android equivalent of what Ajax did for Wayland and Surfaceless:
https://gitlab.freedesktop.org/mesa/mesa/merge_requests/1942

And then we need to switch it on by setting "allow_fp16_configs" to "true" in driconf.

@strassek
Copy link
Contributor

I've backported the fp16 patches and pushed to master. I'll leave this issue open until we add in the Android surface support.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants