egl_dri2: Add support for Tizen
authorXuelian <xuelian.bai@samsung.com>
Wed, 20 Nov 2019 09:38:53 +0000 (17:38 +0800)
committerXuelian Bai <xuelian.bai@samsung.com>
Tue, 21 Feb 2023 06:32:43 +0000 (14:32 +0800)
commit59843bffdf6179a575266d7c65b4635512474675
tree19e43617044314f45a8b5991b78bb2b8fce59a2d
parent6570a15662e7b174080ef62335bb226eec84a6e8
egl_dri2: Add support for Tizen

Re-implement _eglLog based on dlog
Add build support for Tizen platform.
Added missed dri2_fini_surface() at tizen_destroy_surface().

Add platform_tizen.c that supports _EGL_PLATFORM_TIZEN. It works with libtpl-egl
(Tizen Porting Layer for egl), libtbm(Tizen Buffer Manager) where back buffers
of windows are backed by GEM objects.

In Tizen a native window has a queue (tbm_surface_queue) of back buffers
allocated by the WL_TBM(wayland client case, WL_TBM is abbreviation of
wayland-tbm protocol) or gbm ( tizen has implements gbm with tbm) or tbm
through tbm_backend.

For each frame, EGL needs to

    dequeue the next back buffer
    render to the buffer
    enqueue the buffer

After enqueuing, the buffer is no longer valid to EGL.

It supports DRI image loader extension, DRI dri2 loader extension and DRI swrast
loader extension.

It supports EGL_NATIVE_SURFACE_TIZEN  target type for eglCreateImageKHR.
(https://www.khronos.org/registry/EGL/extensions/TIZEN/EGL_TIZEN_image_native_surface.txt)

BindWaylandDisplayWL / UnbindWaylandDisplayWL / QueryWaylandBufferWL are
overloaded because tizen platform has its own instead of WL_DRM.

Referenced documents:
https://www.x.org/wiki/Events/XDC2016/Program/XDC2016_Tizen_Window_System_EGL_Vulkan.pdf
https://wiki.tizen.org/wiki/3.0_Porting_Guide/Graphics_and_UI/libtpl-egl
https://wiki.tizen.org/wiki/TBM

egllog: add unlock call preventing the deadlock
Implement dlog for mesa main

_eglLog is a basic log function for mesa, re-implement
it based on dlog here for debug purpose.
Log level can be changed by setting environment variable
EGL_LOG_LEVEL.

Log API for mesa main module are all implemented in file
src/mesa/main/error.c, re-implement them based on dlog
for debug convenience

add configuration of building and packaging for rpi3 ( vc4 gpu driver )
add udev rule files for rpi3 (vc4 drm device)

Mered old commit:
commit f5205524bf20b63c2efe20e99429c9d55543b711
Author: Zhaowei Yuan <zhaowei.yuan@samsung.com>
Date:   Mon May 6 13:52:32 2019 +0800

commit 704bb72470589ede7246af8c6b0a9210df42f1c7
Author: Xuelian <xuelian.bai@samsung.com>
Date:   Wed Nov 20 19:08:41 2019 +0800

commit 247adc92138ad456f5db39acfe5be69748973df3
Author: Joonbum Ko <joonbum.ko@samsung.com>
Date:   Wed Apr 29 20:01:56 2020 +0900

Change-Id: I83348c1cff5f0f59f79bc3c016623adf6fbba32b
Signed-off-by: Xuelian <xuelian.bai@samsung.com>
16 files changed:
COPYING [new file with mode: 0644]
meson.build
meson_options.txt
packaging/99-GPU-Acceleration.rules [new file with mode: 0644]
packaging/mesa.manifest [new file with mode: 0644]
packaging/mesa.spec [new file with mode: 0644]
src/egl/drivers/dri2/egl_dri2.c
src/egl/drivers/dri2/egl_dri2.h
src/egl/drivers/dri2/platform_tizen.c [new file with mode: 0755]
src/egl/main/eglapi.c
src/egl/main/egldisplay.c
src/egl/main/egldisplay.h
src/egl/main/egllog.c
src/egl/meson.build
src/gallium/winsys/v3d/drm/meson.build
src/mesa/main/errors.c