--- /dev/null
+Overview
+========
+
+Common functionality shared between freedreno drivers (that are not
+registers, layout or the compiler), e.g UUID generation.
--- /dev/null
+/*
+ * Copyright © 2020 Igalia S.L.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include "freedreno_uuid.h"
+#include <stdio.h>
+#include <string.h>
+
+/* (Re)define UUID_SIZE to avoid including vulkan.h (or p_defines.h) here. */
+#define UUID_SIZE 16
+
+void
+fd_get_driver_uuid(void *uuid)
+{
+ memset(uuid, 0, UUID_SIZE);
+ snprintf(uuid, UUID_SIZE, "freedreno");
+}
+
+void
+fd_get_device_uuid(void *uuid)
+{
+ memset(uuid, 0, UUID_SIZE);
+}
--- /dev/null
+/*
+ * Copyright © 2020 Igalia S.L.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#ifndef __FREEDRENO_UUID_H__
+#define __FREEDRENO_UUID_H__
+
+void fd_get_driver_uuid(void *uuid);
+void fd_get_device_uuid(void *uuid);
+
+#endif /* __FREEDRENO_UUID_H__ */
--- /dev/null
+# Copyright © 2020 Igalia S.L
+
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+libfreedreno_common = static_library(
+ 'freedreno_common',
+ [
+ 'freedreno_uuid.c',
+ 'freedreno_uuid.h',
+ ],
+ include_directories : [inc_freedreno],
+ c_args : [c_vis_args, no_override_init_args],
+ build_by_default : true,
+ dependencies: [idep_mesautil]
+)
+
+idep_libfreedreno_common = declare_dependency(
+ link_with: [libfreedreno_common],
+)
inc_freedreno = include_directories(['.', './registers'])
+subdir('common')
subdir('registers')
subdir('drm')
subdir('ir3')
libfreedreno_layout,
],
dependencies : [
+ idep_libfreedreno_common,
dep_dl,
dep_elf,
dep_libdrm,
#include "drm-uapi/msm_drm.h"
+/* for fd_get_driver/device_uuid() */
+#include "freedreno/common/freedreno_uuid.h"
+
static int
tu_device_get_cache_uuid(uint16_t family, void *uuid)
{
return 0;
}
-static void
-tu_get_driver_uuid(void *uuid)
-{
- memset(uuid, 0, VK_UUID_SIZE);
- snprintf(uuid, VK_UUID_SIZE, "freedreno");
-}
-
-static void
-tu_get_device_uuid(void *uuid)
-{
- memset(uuid, 0, VK_UUID_SIZE);
-}
-
static VkResult
tu_bo_init(struct tu_device *dev,
struct tu_bo *bo,
fprintf(stderr, "WARNING: tu is not a conformant vulkan implementation, "
"testing use only.\n");
- tu_get_driver_uuid(&device->device_uuid);
- tu_get_device_uuid(&device->device_uuid);
+ fd_get_driver_uuid(device->driver_uuid);
+ fd_get_device_uuid(device->device_uuid);
tu_physical_device_get_supported_extensions(device, &device->supported_extensions);