Files
fml13v01-buildroot/package/mesa3d/0017-dri-use-a-supported-API-in-driCreateNewContext.patch
T
Andy Hu 7566503cc1 package/{mesa3d, mesa3d-headers}: bump version to 22.1.3
upgrade the mesa3d and mesa3d-headers to v22.1.3
and copy patch from IMG DDK 1.19

keep the 0002-Force-Mesa-to-use-the-PVR-driver-for-platform-device.patch
to force the pvr driver

Note that the new version mesa3d support gallium driver
and no longer support dri driver

Signed-off-by: Andy Hu <andy.hu@starfivetech.com>
Signed-off-by: Windsome Zeng <Windsome.Zeng@starfivetech.com>
2023-06-01 22:08:04 +08:00

55 lines
1.6 KiB
Diff

From ab34a212ab8980dd68c7022f31c3ddf70f9b2647 Mon Sep 17 00:00:00 2001
From: Brendan King <Brendan.King@imgtec.com>
Date: Thu, 23 Nov 2017 15:50:21 +0000
Subject: [PATCH 17/58] dri: use a supported API in driCreateNewContext
Don't assume the screen supports OpenGL when creating a new context,
use an API that the screen supports.
---
src/gallium/frontends/dri/dri_util.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/src/gallium/frontends/dri/dri_util.c b/src/gallium/frontends/dri/dri_util.c
index abc84a22ac6..e22a3eb8e6b 100644
--- a/src/gallium/frontends/dri/dri_util.c
+++ b/src/gallium/frontends/dri/dri_util.c
@@ -49,6 +49,7 @@
#include "main/version.h"
#include "main/debug_output.h"
#include "main/errors.h"
+#include "util/bitscan.h"
driOptionDescription __dri2ConfigOptions[] = {
DRI_CONF_SECTION_DEBUG
@@ -333,7 +334,11 @@ driCreateContextAttribs(__DRIscreen *screen, int api,
mesa_api = API_OPENGLES;
break;
case __DRI_API_GLES2:
+ ctx_config.major_version = 2;
+ mesa_api = API_OPENGLES2;
+ break;
case __DRI_API_GLES3:
+ ctx_config.major_version = 3;
mesa_api = API_OPENGLES2;
break;
case __DRI_API_OPENGL_CORE:
@@ -512,7 +517,14 @@ static __DRIcontext *
driCreateNewContext(__DRIscreen *screen, const __DRIconfig *config,
__DRIcontext *shared, void *data)
{
- return driCreateNewContextForAPI(screen, __DRI_API_OPENGL,
+ int apifs;
+
+ apifs = ffs(screen->api_mask);
+
+ if (!apifs)
+ return NULL;
+
+ return driCreateNewContextForAPI(screen, apifs - 1,
config, shared, data);
}
--
2.25.1