[Mesa-dev] Concern about proposed patch "egl/android: remove HAL_PIXEL_FORMAT_BGRA_8888 support"
Lepton Wu
lepton at chromium.org
Wed Aug 28 02:14:19 UTC 2019
On Thu, Aug 15, 2019 at 3:31 PM Mauro Rossi <issor.oruam at gmail.com> wrote:
>
> Hi Lepton,
>
> On Thu, Aug 15, 2019 at 9:58 PM Lepton Wu <lepton at chromium.org> wrote:
>>
>> That's interesting. The android frame work will hard coded to use
>> RGBA_8888 and set it as window format here:
>>
>> https://android.googlesource.com/platform/frameworks/native/+/refs/heads/master/opengl/libs/EGL/eglApi.cpp#738
>>
>> Do you have a custom version of android which do different code here?
>
>
> Affirmative, you may check [1] for reference
>
> [1] http://git.osdn.net/view?p=android-x86/frameworks-native.git;a=commit;h=792c8dc009bd3a0c44eb39e757a95e099c03b54c
>
>>
>>
>> For other GPU, like intel, if we choose a EGL config with BGRA ,
>> finally we got a wrong color on screen.
>
>
> android-x86 implementation selects BGRA_8888 only when RGBA_8888 not available,
> in a similar way to a pre-existing Workaround 10194508 that was removed from AOSP code
>
> Removing HAL_PIXEL_FORMAT_BGRA_8888 support from egl/android
> SurfaceFlinger will just crash with SIGABRT on nouveau
Then how about this: since aosp android really doesn't support
HAL_PIXEL_FORMAT_BGRA_8888, let me guard HAL_PIXEL_FORMAT_BGRA_8888
with
a macro, maybe something like #ifdef ENABLE_ANDROID_EGL_CONFIG_BGRA,
and also send a patch at android-x86 side to set it when compiling
mesa.
This make sure it works for aosp android tree and also android-x86
>
>>
>>
>> On Thu, Aug 15, 2019 at 12:49 PM Mauro Rossi <issor.oruam at gmail.com> wrote:
>> >
>> > Hi,
>> >
>> > sorry if I'm communicating in dedicated thread, but I don't know how to reply to existing one.
>> >
>> > The proposed patch is based on the wrong assumption that all drivers used with Android have RGBA_8888, which is not correct, for example nouveau does not support RGBA on primary planes, infact we have a fallback to simpler EGL query in android-x86 and we use BGRA_8888 (pixel format = 5)
>> >
>> > If patch does not solve a specific problem and it will cause a regression at least in nouveau, it is recommended to abandon the patch
>> >
>> > Thanks for your feedbacks
>> >
>> > Mauro
More information about the mesa-dev
mailing list