summarylogtreecommitdiffstats
path: root/0061-gallium-pvr-add-the-DRIconfigOptions-extension.patch
blob: 124c25659b510b9dc5e3a05f3d765066ec29241e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
From be07c28ca7c66f81808a2a104f6cb800e77583f5 Mon Sep 17 00:00:00 2001
From: Brendan King <Brendan.King@imgtec.com>
Date: Mon, 8 Aug 2022 13:04:39 +0100
Subject: [PATCH] gallium/pvr: add the DRIconfigOptions extension

Add the DRIconfigOptions DRI extension, which is needed by the EGL
MESA_query_driver extension. The PVR driver does not support the DRI
configuration mechanism, and returns a minimal XML string for use
by eglGetDisplayDriverConfig.

IMG NOTE: This patch should be merged into the "Add PVR Gallium
driver" patch the next time the Mesa version is upgraded in the
IMG DDK.

---
 src/gallium/frontends/pvr/pvrdri.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/src/gallium/frontends/pvr/pvrdri.c b/src/gallium/frontends/pvr/pvrdri.c
index 945aafa..4945f7e 100644
--- a/src/gallium/frontends/pvr/pvrdri.c
+++ b/src/gallium/frontends/pvr/pvrdri.c
@@ -27,6 +27,8 @@
 
 #include "util/u_atomic.h"
 #include "utils.h"
+#include <util/xmlconfig.h>
+#include <util/driconf.h>
 
 #include "dri_screen.h"
 
@@ -579,6 +581,22 @@ PVRDRIReleaseBuffer(__DRIscreen *psDRIScreen, __DRIbuffer *psDRIBuffer)
    free(psPVRBuffer);
 }
 
+static char *
+PVRDRIGetXMLConfigOptions(const char *pszDriverName)
+{
+   const driOptionDescription asConfigOptions[] =
+   {
+      DRI_CONF_SECTION_MISCELLANEOUS
+      DRI_CONF_OPT_B("pvr_driconf_not_used", true,
+                     "The PowerVR driver does not use DRIConf")
+      DRI_CONF_SECTION_END
+   };
+
+   (void) pszDriverName;
+
+   return driGetOptionsXml(&asConfigOptions[0], ARRAY_SIZE(asConfigOptions));
+}
+
 const struct __DriverAPIRec pvr_driver_api = {
    .InitScreen = PVRDRIInitScreen,
    .DestroyScreen = PVRDRIDestroyScreen,
@@ -598,10 +616,16 @@ static const struct __DRIDriverVtableExtensionRec pvr_vtable = {
    .vtable = &pvr_driver_api,
 };
 
+const __DRIconfigOptionsExtension pvr_config_options = {
+   .base = { __DRI_CONFIG_OPTIONS, 2 },
+   .getXml = PVRDRIGetXMLConfigOptions,
+};
+
 const __DRIextension *pvr_driver_extensions[] = {
    &driCoreExtension.base,
    &driImageDriverExtension.base,
    &pvrDRI2Extension.base,
    &pvr_vtable.base,
+   &pvr_config_options.base,
    NULL
 };