cheyang
122fd46b15
Android15 support gralloc IMapper5
...
In Android15 libui.so the vendor partition can access.
so use GraphicBufferMapper load mapper4 or mapper5.
still using U_GRALLOC_TYPE_GRALLOC4 because GraphicBufferMapper
load mapper5 fail will rollback loading mapper4
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/11091
Signed-off-by: cheyang <cheyang@bytedance.com >
Reviewed-by: Roman Stratiienko <r.stratiienko@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31766 >
2024-10-29 12:32:04 +00:00
C Stout
2fef9e9029
u_gralloc: include dep_android_mapper4 as needed
...
Since it is not included in dep_android.
Reviewed-by: Roman Stratiienko <r.stratiienko@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30353 >
2024-10-18 19:21:18 +00:00
Adam Jackson
3de62b2f9a
gallium/dril: Compatibility stub for the legacy DRI loader interface
...
This provides just enough of a "DRI driver" for non-glamor-using
xservers to initialize GLX and enable direct clients. We build it if you
build DRI support for GLX, or if you build any X11 client support for
EGL. We only build it at this point, we'll swap it into the install
next.
Co-authored-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com >
Co-authored-by: Pavel Ondračka <pavel.ondracka@gmail.com >
Acked-by: Daniel Stone <daniels@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28378 >
2024-07-17 23:47:05 +00:00
Adam Jackson
91e1ea52c9
mesa_interface: Move out of GL/internal/
...
Move it into src/gallium/include/ to make it absolutely clear this is a Mesa detail.
While we're at it, clean up its include sites, including some places
where we can just include kopper_interface.h instead since it includes
mesa_interface.h as its first act.
Acked-by: Daniel Stone <daniels@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28378 >
2024-07-17 23:47:05 +00:00
Adam Jackson
6be17e222d
treewide: Include mesa_interface.h not dri_interface.h
...
We're about to split the latter off as a compatibility detail for older
versions of Xorg, and the former includes the latter at this point, so
this should be just to prove no functional change.
Acked-by: Daniel Stone <daniels@collabora.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28378 >
2024-07-17 23:47:04 +00:00
Lucas Fryzek
6a2309b676
u_gralloc/fallback: Set fd from handle directly
...
Fix returned fd by populating directly from the handle, instead of
from the fds array which is never populated.
Fixes: 7ae4a2ae34 ("u_gralloc/fallback: Extract modifier from QCOM native_handle")
Reviewed-by: Roman Stratiienko <r.stratiienko@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29785 >
2024-06-20 05:57:06 +00:00
Roman Stratiienko
7ae4a2ae34
u_gralloc/fallback: Extract modifier from QCOM native_handle
...
After Turnip moved to u_gralloc, some users started complaining
about issues. It turns out that modern platforms do not have
grallocs{0,1} but have gralloc4 only. There's no
known way to build mesa3d with gralloc4 support using NDK.
So we add this workaround to fallback gralloc to mimic the original
behavior of the Turnip driver before switching to u_gralloc.
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/11171
Fixes: 1373b0966c ("turnip: ANB/AHB support")
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com >
Reviewed-by: Rob Clark <robdclark@chromium.org >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29260 >
2024-05-17 15:03:53 +00:00
Roman Stratiienko
4afcd0c6d6
u_gralloc: Add support for gbm_gralloc
...
Although gbm_gralloc has not been maintained for a long time, it is still
used in android-x86, BlissOS and WayDroid. Let's add support so that
x86 drivers no longer need to request tiling flags from the kernel.
Acked-by: Chia-I Wu <olvaffe@gmail.com >
Acked-by: David Heidelberg <david.heidelberg@collabora.com >
Tested-by: HMTheBoy154 <buingoc67@gmail.com > # BlissOS 15 & Mesa 23.3.2
Tested-by: Mauro Rossi <issor.oruam@gmail.com > # android-x86 for mesa 24.0.0-devel on Skylake GT2
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25380 >
2024-01-10 22:26:18 +00:00
Roman Stratiienko
436051f8ee
u_gralloc: Add QCOM gralloc support
...
Adds support for legacy QCOM grallocs that are a part of AOSP:
hardware/qcom/display/*/libgralloc
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com >
Tested-by: tarsin <yuanqingxiang233@163.com >
Acked-by: Chia-I Wu <olvaffe@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25410 >
2024-01-10 00:44:05 +00:00
Roman Stratiienko
3922bd5976
u_gralloc: Extract common code from fallback gralloc
...
... to reuse it later in QCOM gralloc.
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com >
Tested-by: tarsin <yuanqingxiang233@163.com >
Acked-by: Chia-I Wu <olvaffe@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25410 >
2024-01-10 00:44:05 +00:00
Roman Stratiienko
8f513813b1
u_gralloc: Add a function that returns gralloc type
...
This is needed by some drivers to reject the fallback gralloc.
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com >
Reviewed-by: Chia-I Wu <olvaffe@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25256 >
2023-09-21 10:50:34 +00:00
Roman Stratiienko
3b6f14c4d3
u_gralloc: Remove usage of NONNULL macro
...
We agreed in [1] not to use it since it has little value,
but making a code less readable.
[1]: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25256
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com >
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org >
Reviewed-by: Eric Engestrom <eric@igalia.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25256 >
2023-09-21 10:50:34 +00:00
Roman Stratiienko
28b21fae6e
u_gralloc: Remove inline modifiers from the functions
...
Suggested-by: Chia-I Wu <olvaffe@gmail.com >
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com >
Reviewed-by: Chia-I Wu <olvaffe@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25256 >
2023-09-21 10:50:34 +00:00
Chris Spencer
574bdee19d
android: Add explanatory comment to u_gralloc
...
Signed-off-by: Chris Spencer <spencercw@gmail.com >
Reviewed-by: Roman Stratiienko <r.stratiienko@gmail.com >
Reviewed-by: Tapani Pälli <tapani.palli@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24941 >
2023-09-05 10:02:24 +00:00
Roman Stratiienko
17f7ffcb36
android: Fix num_planes assignment in u_gralloc_fallback
...
That seems to be an uncaught porting issue from EGL code to a common.
Fixes: ee42e2166d ("android: Introduce the Android buffer info abstraction")
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com >
Reviewed-by: Tapani Pälli <tapani.palli@intel.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24953 >
2023-08-31 04:03:06 +00:00
Roman Stratiienko
ee42e2166d
android: Introduce the Android buffer info abstraction
...
Both EGL and Vulkan implementations require obtaining buffer metadata,
e.g., format, modifier, offsets, strides, etc.
Currently, mesa3d doesn't have a generic solution, and every Vulkan
implementation uses its getters. Most of the getters rely on
kernel metadata storage that is available for x86-based GPU drivers.
ARM-based Vulkan drivers rely on userspace metadata sharing, making it
important to use advanced metadata API. Otherwise, the driver will work
with limited functionality (no YUV, lack of support for modifiers, etc.)
Current EGL buffer getter implementation is advanced enough and used as
a base for a common Android buffer-getter logic.
Use example:
void
android_buffer_test(android_handle_type *a_handle)
{
// First, get the gralloc object. It will be created if it doesn't
// exist. Use U_GRALLOC_TYPE_AUTO to let the implementation choose
// the best gralloc
struct u_gralloc *gralloc = u_gralloc_create(U_GRALLOC_TYPE_AUTO);
// Prepare the internal handle structure (hal_format and
// pixel_stride are required for the fallback implementation).
// Both Vulkan and EGL clients expose HAL format / pixel stride
// in their structures.
u_gralloc_buffer_handle hnd = {
.handle = a_handle->native_handle,
.hal_format = a_handle->hal_format,
.pixel_stride = a_handle->pixel_stride,
};
// Get the basic buffer info
u_gralloc_buffer_basic_info basic_info;
int ret = u_gralloc_get_buffer_basic_info(gralloc, &hnd, &basic_info);
if (ret) {
// Handle the error
}
// Get the color info
u_gralloc_buffer_color_info color_info;
ret = u_gralloc_get_buffer_color_info(gralloc, &hnd, &color_info);
if (ret) {
// Handle the error
}
// unref the gralloc object
u_gralloc_destroy(&gralloc);
}
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com >
Reviewed-by: Chia-I Wu <olvaffe@gmail.com >
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18215 >
2023-08-12 18:46:57 +00:00