EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...OpenGLRenderer: Failed to choose config, error = EGL_BAD_DISPLAY in Android Oreo

HI I’m new to this so first of all I apologize if I’m very lost.

The thing is that I’m trying to upgrade from Android 7 to Android 8, for the Mipad 1 trablet with Nvidia Tegra k1 and GeForce Kepler GPU with the original blobs from xiaomi (for Android 4.4.2)

The thing is that I log in, but I get a continuous UI error because of the following crash:

W libEGL  : eglInitialize(0x1) failed (EGL_BAD_DISPLAY)
09-03 17:12:07.760  1506  1576 I org.lineageos.trebuchet: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasWideColorDisplay retrieved: 0
09-03 17:12:07.760  1506  1576 I OpenGLRenderer: Initialized EGL, version 1.4
09-03 17:12:07.760  1506  1576 D OpenGLRenderer: Swap behavior 1
09-03 17:12:07.760  1506  1576 W OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
09-03 17:12:07.760  1506  1576 D OpenGLRenderer: Swap behavior 0
09-03 17:12:07.760  1506  1576 F OpenGLRenderer: Failed to choose config, error = EGL_BAD_DISPLAY
--------- beginning of crash
09-03 17:12:07.760  1506  1576 F libc    : Fatal signal 6 (SIGABRT), code -6 in tid 1576 (RenderThread), pid 1506 (ageos.trebuchet)
09-03 17:12:07.770  1506  1506 W View    : requestLayout() improperly called by com.android.launcher3.graphics.GradientView{3281008 V.ED..... ......I. 0,0-0,0 #7f0b00be app:id/gradient_bg} during layout: running second layout pass
09-03 17:12:07.816   342  1434 I PreBootBroadcaster: Pre-boot of {com.android.providers.calendar/com.android.providers.calendar.CalendarUpgradeReceiver} for user 0
09-03 17:12:07.832   342  1434 I ActivityManager: Start proc 1598:org.lineageos.lockclock/u0a59 for broadcast org.lineageos.lockclock/.ClockWidgetProvider
09-03 17:12:07.838   342   342 I chatty  : uid=1000 system_server expire 13 lines
09-03 17:12:07.839   933   933 I RenderThread: type=1400 audit(0.0:221): avc: denied { ioctl } for path="/dev/nvhost-as-gpu" dev="tmpfs" ino=5411 ioctlcmd=4105 scontext=u:r:platform_app:s0:c512,c768 tcontext=u:object_r:device:s0 tclass=chr_file permissive=1
09-03 17:12:07.840  1596  1596 I crash_dump32: obtaining output fd from tombstoned, type: kDebuggerdTombstone
09-03 17:12:07.841   293   293 I /system/bin/tombstoned: received crash request for pid 1506
09-03 17:12:07.842  1596  1596 I crash_dump32: performing dump of process 1506 (target tid = 1576)
09-03 17:12:07.842  1596  1596 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
09-03 17:12:07.842  1596  1596 F DEBUG   : LineageOS Version: '15.1-20240903-UNOFFICIAL-mocha'
09-03 17:12:07.842  1596  1596 F DEBUG   : Build fingerprint: 'Xiaomi/lineage_mocha/mocha:8.1.0/OPM7.181205.001/a29ce903b9:userdebug/test-keys'
09-03 17:12:07.842  1596  1596 F DEBUG   : Revision: '0'
09-03 17:12:07.842  1596  1596 F DEBUG   : ABI: 'arm'
09-03 17:12:07.842  1596  1596 F DEBUG   : pid: 1506, tid: 1576, name: RenderThread  >>> org.lineageos.trebuchet <<<
09-03 17:12:07.842  1596  1596 F DEBUG   : signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
09-03 17:12:07.851  1596  1596 F DEBUG   : Abort message: 'Failed to choose config, error = EGL_BAD_DISPLAY'
09-03 17:12:07.851  1596  1596 F DEBUG   :     r0 00000000  r1 00000628  r2 00000006  r3 00000008
09-03 17:12:07.851  1596  1596 F DEBUG   :     r4 000005e2  r5 00000628  r6 997ff1f4  r7 0000010c
09-03 17:12:07.851  1596  1596 F DEBUG   :     r8 00000000  r9 997ff8c8  sl b238bf78  fp 00000000
09-03 17:12:07.851  1596  1596 F DEBUG   :     ip 997ff648  sp 997ff1e0  lr b4330a3f  pc b432a44c  cpsr 200f0030
09-03 17:12:07.944   342  1033 I ActivityManager: Start proc 1616:com.android.providers.calendar/u0a2 for broadcast com.android.providers.calendar/.CalendarUpgradeReceiver
09-03 17:12:07.951  1596  1596 F DEBUG   : 
09-03 17:12:07.951  1596  1596 F DEBUG   : backtrace:
09-03 17:12:07.951  1596  1596 F DEBUG   :     #00 pc 0001a44c  /system/lib/libc.so (abort+63)
09-03 17:12:07.951  1596  1596 F DEBUG   :     #01 pc 00006605  /system/lib/liblog.so (__android_log_assert+156)
09-03 17:12:07.951  1596  1596 F DEBUG   :     #02 pc 0004d37f  /system/lib/libhwui.so (android::uirenderer::renderthread::EglManager::loadConfigs()+350)
09-03 17:12:07.951  1596  1596 F DEBUG   :     #03 pc 0004d355  /system/lib/libhwui.so (android::uirenderer::renderthread::EglManager::loadConfigs()+308)
09-03 17:12:07.951  1596  1596 F DEBUG   :     #04 pc 0004ce91  /system/lib/libhwui.so (android::uirenderer::renderthread::EglManager::initialize()+148)
09-03 17:12:07.951  1596  1596 F DEBUG   :     #05 pc 0004d73b  /system/lib/libhwui.so (android::uirenderer::renderthread::EglManager::createSurface(ANativeWindow*, bool)+22)
09-03 17:12:07.951  1596  1596 F DEBUG   :     #06 pc 0004114f  /system/lib/libhwui.so (android::uirenderer::skiapipeline::SkiaOpenGLPipeline::setSurface(android::Surface*, android::uirenderer::renderthread::SwapBehavior, android::uirenderer::renderthread::ColorMode)+42)
09-03 17:12:07.951  1596  1596 F DEBUG   :     #07 pc 00049651  /system/lib/libhwui.so (android::uirenderer::renderthread::CanvasContext::setSurface(android::Surface*)+64)
09-03 17:12:07.951  1596  1596 F DEBUG   :     #08 pc 0004fb71  /system/lib/libhwui.so (android::uirenderer::renderthread::Bridge_initialize(android::uirenderer::renderthread::initializeArgs*)+8)
09-03 17:12:07.951  1596  1596 F DEBUG   :     #09 pc 00050b03  /system/lib/libhwui.so (android::uirenderer::renderthread::MethodInvokeRenderTask::run()+10)
09-03 17:12:07.951  1596  1596 F DEBUG   :     #10 pc 000519f3  /system/lib/libhwui.so (android::uirenderer::renderthread::RenderThread::threadLoop()+178)
09-03 17:12:07.951  1596  1596 F DEBUG   :     #11 pc 0000d2a1  /system/lib/libutils.so (android::Thread::_threadLoop(void*)+148)
09-03 17:12:07.951  1596  1596 F DEBUG   :     #12 pc 0006de69  /system/lib/libandroid_runtime.so (android::AndroidRuntime::javaThreadShell(void*)+80)
09-03 17:12:07.951  1596  1596 F DEBUG   :     #13 pc 000486d7  /system/lib/libc.so (__pthread_start(void*)+22)
09-03 17:12:07.952  1596  1596 F DEBUG   :     #14 pc 0001b039  /system/lib/libc.so (__start_thread+32)

The thing is that this error is at system startup but during bootanimation I get:

16 I SurfaceFlinger: Using composer version 1.1
09-02 20:15:15.919   216   216 D hwcomposer: config[0].x = 1536
09-02 20:15:15.919   216   216 D hwcomposer: config[0].y = 2048
09-02 20:15:15.919   216   216 D hwcomposer: config[0].x = 1536
09-02 20:15:15.919   216   216 D hwcomposer: config[0].y = 2048
09-02 20:15:15.919   216   216 W SurfaceFlinger: no suitable EGLConfig found, trying a simpler query
09-02 20:15:15.919   216   216 I SurfaceFlinger: EGL information:
09-02 20:15:15.919   216   216 I SurfaceFlinger: vendor    : Android
09-02 20:15:15.919   216   216 I SurfaceFlinger: version   : 1.4 Android META-EGL
09-02 20:15:15.919   216   216 I SurfaceFlinger: extensions: EGL_KHR_get_all_proc_addresses EGL_ANDROID_presentation_time EGL_KHR_swap_buffers_with_damage EGL_ANDROID_get_native_client_buffer EGL_ANDROID_front_buffer_auto_refresh EGL_ANDROID_get_frame_timestamps EGL_KHR_image EGL_KHR_image_base EGL_KHR_gl_texture_2D_image EGL_KHR_gl_texture_cubemap_image EGL_KHR_gl_renderbuffer_image EGL_KHR_reusable_sync EGL_KHR_fence_sync EGL_KHR_create_context EGL_KHR_config_attribs EGL_KHR_surfaceless_context EGL_KHR_stream EGL_KHR_stream_fifo EGL_KHR_stream_producer_eglsurface EGL_KHR_stream_consumer_gltexture EGL_EXT_create_context_robustness EGL_NV_system_time EGL_ANDROID_image_native_buffer EGL_KHR_wait_sync EGL_ANDROID_recordable EGL_EXT_buffer_age 
09-02 20:15:15.919   216   216 I SurfaceFlinger: Client API: OpenGL_ES
09-02 20:15:15.919   216   216 I SurfaceFlinger: EGLSurface: 8-8-8-8, config=0xcaf32d
      : Loading GLESv2 implementation libGLESv2_tegra_impl
09-02 20:15:16.341   216   216 I SurfaceFlinger: OpenGL ES informations:
09-02 20:15:16.341   216   216 I SurfaceFlinger: vendor    : NVIDIA Corporation
09-02 20:15:16.341   216   216 I SurfaceFlinger: renderer  : NVIDIA Tegra
09-02 20:15:16.341   216   216 I SurfaceFlinger: version   : OpenGL ES 3.1 334.00
09-02 20:15:16.341   216   216 I SurfaceFlinger: extensions: GL_EXT_debug_marker GL_EXT_blend_minmax GL_EXT_color_buffer_float GL_EXT_color_buffer_half_float GL_EXT_copy_image GL_EXT_debug_label GL_EXT_draw_buffers_indexed GL_EXT_frag_depth GL_EXT_geometry_point_size GL_EXT_geometry_shader GL_EXT_gpu_shader5 GL_EXT_map_buffer_range GL_EXT_occlusion_query_boolean GL_EXT_primitive_bounding_box GL_EXT_robustness GL_EXT_separate_shader_objects GL_EXT_shader_implicit_conversions GL_EXT_shader_integer_mix GL_EXT_shader_io_blocks GL_EXT_shadow_samplers GL_EXT_sRGB GL_EXT_sRGB_write_control GL_EXT_tessellation_point_size GL_EXT_tessellation_shader GL_EXT_texture_border_clamp GL_EXT_texture_buffer GL_EXT_texture_compression_dxt1 GL_EXT_texture_compression_s3tc GL_EXT_texture_cube_map_array GL_EXT_texture_filter_anisotropic GL_EXT_texture_format_BGRA8888 GL_EXT_texture_rg GL_EXT_texture_sRGB_decode GL_EXT_texture_storage GL_EXT_texture_view GL_EXT_unpack_subimage GL_KHR_debug GL_KHR_texture_compression_astc_ldr GL_NV_bgr GL_NV_bindless_texture GL_NV_blend_equation_a
09-02 20:15:16.341   216   216 I SurfaceFlinger: GL_MAX_TEXTURE_SIZE = 16384
09-02 20:15:16.341   216   216 I SurfaceFlinger: GL_MAX_VIEWPORT_DIMS = 16384
SurfaceFlinger: Set power mode=2, type=0 flinger=0xa9e4e000
09-02 20:15:16.652   216   216 D hwcomposer: hwc_blank: display 0: unblank
09-02 20:15:16.652   216   216 D hwcomposer: hwc_blank_display: display 0: [1 -> 0]
09-02 20:15:16.652   216   216 D hwcomposer: Display 0 layer clip is 1536 x 2048
09-02 20:15:16.652   216   216 D hwcomposer: Display 0 device clip is 1536 x 2048
09-02 20:15:16.652   216   216 D hwcomposer: dc_blank: display 0, [1 -> 0]

How can I fix it?