summaryrefslogtreecommitdiff
path: root/src/mesa/main
diff options
context:
space:
mode:
authorYonggang Luo <luoyonggang@gmail.com>2022-11-07 11:00:21 +0800
committerMarge Bot <emma+marge@anholt.net>2022-11-15 19:06:07 +0000
commited4fd1d90e3f3dca0ed0ac7a4a3366854c565f4b (patch)
treed2e3f1153381cb5f8a011f8ff335cf45690b9895 /src/mesa/main
parent7436669d55d3041c8f4eaa938ad38c3ec1dd7efa (diff)
util: cleanup cpuinfo.* and it's related files
_mesa_get_cpu_features is no more a needed thing as all it's usage are replaced with util_get_cpu_caps in u_cpu_detect.h Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19564>
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/context.c2
-rw-r--r--src/mesa/main/cpuinfo.c94
-rw-r--r--src/mesa/main/cpuinfo.h43
-rw-r--r--src/mesa/main/tests/disable_windows_include.c1
4 files changed, 0 insertions, 140 deletions
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index 6ab069fbd52..eacce936b0c 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -87,7 +87,6 @@
#include "bufferobj.h"
#include "conservativeraster.h"
#include "context.h"
-#include "cpuinfo.h"
#include "debug.h"
#include "debug_output.h"
#include "depth.h"
@@ -217,7 +216,6 @@ one_time_init(const char *extensions_override)
_mesa_one_time_init_extension_overrides(extensions_override);
- _mesa_get_cpu_features();
for (i = 0; i < 256; i++) {
_mesa_ubyte_to_float_color_tab[i] = (float) i / 255.0F;
diff --git a/src/mesa/main/cpuinfo.c b/src/mesa/main/cpuinfo.c
deleted file mode 100644
index 1623a20892e..00000000000
--- a/src/mesa/main/cpuinfo.c
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Mesa 3-D graphics library
- *
- * Copyright (C) 2009 VMware, Inc. All Rights Reserved.
- *
- * 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.
- */
-
-
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-
-#include "main/cpuinfo.h"
-
-
-/**
- * This function should be called before the various "cpu_has_foo" macros
- * are used.
- */
-void
-_mesa_get_cpu_features(void)
-{
-#if defined USE_X86_ASM || defined USE_X86_64_ASM
- _mesa_get_x86_features();
-#endif
-}
-
-
-/**
- * Return a string describing the CPU architexture and extensions that
- * Mesa is using (such as SSE or Altivec).
- * \return information string, free it with free()
- */
-char *
-_mesa_get_cpu_string(void)
-{
-#define MAX_STRING 50
- char *buffer;
-
- buffer = malloc(MAX_STRING);
- if (!buffer)
- return NULL;
-
- buffer[0] = 0;
-
-#ifdef USE_X86_ASM
-
- if (_mesa_x86_cpu_features) {
- strcat(buffer, "x86");
- }
-
-# ifdef USE_MMX_ASM
- if (cpu_has_mmx) {
- strcat(buffer, (cpu_has_mmxext) ? "/MMX+" : "/MMX");
- }
-# endif
-# ifdef USE_3DNOW_ASM
- if (cpu_has_3dnow) {
- strcat(buffer, (cpu_has_3dnowext) ? "/3DNow!+" : "/3DNow!");
- }
-# endif
-# ifdef USE_SSE_ASM
- if (cpu_has_xmm) {
- strcat(buffer, (cpu_has_xmm2) ? "/SSE2" : "/SSE");
- }
-# endif
-
-#elif defined(USE_SPARC_ASM)
-
- strcat(buffer, "SPARC");
-
-#endif
-
- assert(strlen(buffer) < MAX_STRING);
-
- return buffer;
-}
diff --git a/src/mesa/main/cpuinfo.h b/src/mesa/main/cpuinfo.h
deleted file mode 100644
index 57925e82bf2..00000000000
--- a/src/mesa/main/cpuinfo.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Mesa 3-D graphics library
- *
- * Copyright (C) 2009 VMware, Inc. All Rights Reserved.
- *
- * 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.
- */
-
-
-#ifndef CPUINFO_H
-#define CPUINFO_H
-
-
-#if defined USE_X86_ASM || defined USE_X86_64_ASM
-#include "x86/common_x86_asm.h"
-#endif
-
-
-extern void
-_mesa_get_cpu_features(void);
-
-
-extern char *
-_mesa_get_cpu_string(void);
-
-
-#endif /* CPUINFO_H */
diff --git a/src/mesa/main/tests/disable_windows_include.c b/src/mesa/main/tests/disable_windows_include.c
index 9f40c7eac5e..8a1df65d110 100644
--- a/src/mesa/main/tests/disable_windows_include.c
+++ b/src/mesa/main/tests/disable_windows_include.c
@@ -39,7 +39,6 @@
#include <mesa/main/conservativeraster.h>
#include <mesa/main/consts_exts.h>
#include <mesa/main/context.h>
-#include <mesa/main/cpuinfo.h>
#include <mesa/main/dd.h>
#include <mesa/main/debug.h>
#include <mesa/main/debug_output.h>