summaryrefslogtreecommitdiff
path: root/src/gallium/winsys
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/winsys')
-rw-r--r--src/gallium/winsys/amdgpu/drm/amdgpu_bo.c3
-rw-r--r--src/gallium/winsys/amdgpu/drm/amdgpu_cs.c14
-rw-r--r--src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c2
-rw-r--r--src/gallium/winsys/asahi/drm/asahi_drm_public.h36
-rw-r--r--src/gallium/winsys/asahi/drm/asahi_drm_winsys.c49
-rw-r--r--src/gallium/winsys/asahi/drm/meson.build30
-rw-r--r--src/gallium/winsys/freedreno/drm/freedreno_drm_winsys.c2
-rw-r--r--src/gallium/winsys/i915/drm/i915_drm_winsys.c12
-rw-r--r--src/gallium/winsys/i915/drm/meson.build1
-rw-r--r--src/gallium/winsys/kmsro/drm/kmsro_drm_winsys.c14
-rw-r--r--src/gallium/winsys/kmsro/drm/meson.build3
-rw-r--r--src/gallium/winsys/nouveau/drm/nouveau_drm_winsys.c3
-rw-r--r--src/gallium/winsys/radeon/drm/radeon_drm_bo.c4
-rw-r--r--src/gallium/winsys/radeon/drm/radeon_drm_bo.h2
-rw-r--r--src/gallium/winsys/radeon/drm/radeon_drm_winsys.c2
-rw-r--r--src/gallium/winsys/svga/drm/pb_buffer_simple_fenced.c8
-rw-r--r--src/gallium/winsys/svga/drm/vmw_context.h2
-rw-r--r--src/gallium/winsys/svga/drm/vmw_fence.c2
-rw-r--r--src/gallium/winsys/svga/drm/vmw_msg.c6
-rw-r--r--src/gallium/winsys/svga/drm/vmw_screen.c8
-rw-r--r--src/gallium/winsys/svga/drm/vmw_screen.h2
-rw-r--r--src/gallium/winsys/svga/drm/vmw_screen_ioctl.c28
-rw-r--r--src/gallium/winsys/svga/drm/vmw_screen_svga.c8
-rw-r--r--src/gallium/winsys/svga/drm/vmw_surface.h2
-rw-r--r--src/gallium/winsys/sw/dri/dri_sw_winsys.c2
-rw-r--r--src/gallium/winsys/sw/gdi/gdi_sw_winsys.c2
-rw-r--r--src/gallium/winsys/sw/hgl/hgl_sw_winsys.cpp2
-rw-r--r--src/gallium/winsys/sw/kms-dri/kms_dri_sw_winsys.c2
-rw-r--r--src/gallium/winsys/sw/null/null_sw_winsys.c2
-rw-r--r--src/gallium/winsys/sw/wrapper/wrapper_sw_winsys.c2
-rw-r--r--src/gallium/winsys/sw/xlib/xlib_sw_winsys.c2
-rw-r--r--src/gallium/winsys/virgl/drm/virgl_drm_winsys.c2
-rw-r--r--src/gallium/winsys/virgl/drm/virgl_drm_winsys.h2
-rw-r--r--src/gallium/winsys/virgl/vtest/virgl_vtest_winsys.c2
-rw-r--r--src/gallium/winsys/virgl/vtest/virgl_vtest_winsys.h2
35 files changed, 202 insertions, 63 deletions
diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c b/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c
index 76b34149292..1b53bcc61b0 100644
--- a/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c
+++ b/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c
@@ -1550,7 +1550,8 @@ static struct pb_buffer *amdgpu_bo_from_handle(struct radeon_winsys *rws,
/* Initialize the structure. */
simple_mtx_init(&bo->lock, mtx_plain);
pipe_reference_init(&bo->base.reference, 1);
- bo->base.alignment_log2 = util_logbase2(info.phys_alignment);
+ bo->base.alignment_log2 = util_logbase2(info.phys_alignment ?
+ info.phys_alignment : ws->info.gart_page_size);
bo->bo = result.buf_handle;
bo->base.size = result.alloc_size;
bo->base.vtbl = &amdgpu_winsys_bo_vtbl;
diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c
index a6cb9d81e2b..7ac0118d7ad 100644
--- a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c
+++ b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c
@@ -740,6 +740,15 @@ static bool amdgpu_ib_new_buffer(struct amdgpu_winsys *ws,
enum radeon_bo_domain domain = RADEON_DOMAIN_GTT;
unsigned flags = RADEON_FLAG_NO_INTERPROCESS_SHARING;
+ if (cs->ip_type == AMD_IP_GFX ||
+ cs->ip_type == AMD_IP_COMPUTE ||
+ cs->ip_type == AMD_IP_SDMA) {
+ /* Avoids hangs with "rendercheck -t cacomposite -f a8r8g8b8" via glamor
+ * on Navi 14
+ */
+ flags |= RADEON_FLAG_32BIT;
+ }
+
pb = amdgpu_bo_create(ws, buffer_size,
ws->info.gart_page_size,
domain, flags);
@@ -824,7 +833,8 @@ static void amdgpu_set_ib_size(struct radeon_cmdbuf *rcs, struct amdgpu_ib *ib)
{
if (ib->ptr_ib_size_inside_ib) {
*ib->ptr_ib_size = rcs->current.cdw |
- S_3F2_CHAIN(1) | S_3F2_VALID(1);
+ S_3F2_CHAIN(1) | S_3F2_VALID(1) |
+ S_3F2_PRE_ENA(((struct amdgpu_cs*)ib)->preamble_ib_bo != NULL);
} else {
*ib->ptr_ib_size = rcs->current.cdw;
}
@@ -1383,7 +1393,7 @@ static bool amdgpu_add_sparse_backing_buffers(struct amdgpu_cs_context *cs)
*/
int idx = amdgpu_do_add_real_buffer(cs, backing->bo);
if (idx < 0) {
- fprintf(stderr, "%s: failed to add buffer\n", __FUNCTION__);
+ fprintf(stderr, "%s: failed to add buffer\n", __func__);
simple_mtx_unlock(&bo->lock);
return false;
}
diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c b/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c
index 318197b1ae2..05ff784d34f 100644
--- a/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c
+++ b/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c
@@ -44,7 +44,7 @@
#include "sid.h"
static struct hash_table *dev_tab = NULL;
-static simple_mtx_t dev_tab_mutex = _SIMPLE_MTX_INITIALIZER_NP;
+static simple_mtx_t dev_tab_mutex = SIMPLE_MTX_INITIALIZER;
#if DEBUG
DEBUG_GET_ONCE_BOOL_OPTION(all_bos, "RADEON_ALL_BOS", false)
diff --git a/src/gallium/winsys/asahi/drm/asahi_drm_public.h b/src/gallium/winsys/asahi/drm/asahi_drm_public.h
new file mode 100644
index 00000000000..cdc800133b7
--- /dev/null
+++ b/src/gallium/winsys/asahi/drm/asahi_drm_public.h
@@ -0,0 +1,36 @@
+/*
+ * Copyright © 2014 Broadcom
+ * Copyright © 208 Alyssa Rosenzweig
+ *
+ * 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 __ASAHI_DRM_PUBLIC_H__
+#define __ASAHI_DRM_PUBLIC_H__
+
+#include <stdbool.h>
+
+struct pipe_screen;
+struct renderonly;
+
+struct pipe_screen *asahi_drm_screen_create(int drmFD);
+struct pipe_screen *asahi_drm_screen_create_renderonly(struct renderonly *ro);
+
+#endif /* __ASAHI_DRM_PUBLIC_H__ */
diff --git a/src/gallium/winsys/asahi/drm/asahi_drm_winsys.c b/src/gallium/winsys/asahi/drm/asahi_drm_winsys.c
new file mode 100644
index 00000000000..97273507c5c
--- /dev/null
+++ b/src/gallium/winsys/asahi/drm/asahi_drm_winsys.c
@@ -0,0 +1,49 @@
+/*
+ * Copyright © 2014 Broadcom
+ * Copyright © 208 Alyssa Rosenzweig
+ *
+ * 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 <errno.h>
+#include <unistd.h>
+#include <fcntl.h>
+
+#include "util/format/u_format.h"
+#include "util/os_file.h"
+#include "util/u_math.h"
+#include "util/u_memory.h"
+
+#include "drm-uapi/drm.h"
+#include "renderonly/renderonly.h"
+#include "asahi_drm_public.h"
+#include "asahi/agx_public.h"
+
+struct pipe_screen *
+asahi_drm_screen_create(int fd)
+{
+ return agx_screen_create(os_dupfd_cloexec(fd), NULL, NULL);
+}
+
+struct pipe_screen *
+asahi_drm_screen_create_renderonly(struct renderonly *ro)
+{
+ return agx_screen_create(os_dupfd_cloexec(ro->gpu_fd), ro, NULL);
+}
diff --git a/src/gallium/winsys/asahi/drm/meson.build b/src/gallium/winsys/asahi/drm/meson.build
new file mode 100644
index 00000000000..225ed799392
--- /dev/null
+++ b/src/gallium/winsys/asahi/drm/meson.build
@@ -0,0 +1,30 @@
+# Copyright © 2017 Broadcom
+#
+# 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.
+
+libasahiwinsys = static_library(
+ 'asahiwinsys',
+ files('asahi_drm_winsys.c'),
+ include_directories : [
+ inc_src, inc_include,
+ inc_gallium, inc_gallium_aux, inc_gallium_drivers,
+ ],
+ gnu_symbol_visibility : 'hidden',
+ dependencies: dep_libdrm,
+)
diff --git a/src/gallium/winsys/freedreno/drm/freedreno_drm_winsys.c b/src/gallium/winsys/freedreno/drm/freedreno_drm_winsys.c
index 3e4109e3e9a..3b01bd73a3f 100644
--- a/src/gallium/winsys/freedreno/drm/freedreno_drm_winsys.c
+++ b/src/gallium/winsys/freedreno/drm/freedreno_drm_winsys.c
@@ -33,7 +33,7 @@
#include "util/u_inlines.h"
#include "util/u_hash_table.h"
#include "util/u_pointer.h"
-#include "os/os_thread.h"
+#include "util/u_thread.h"
#include "freedreno_drm_public.h"
diff --git a/src/gallium/winsys/i915/drm/i915_drm_winsys.c b/src/gallium/winsys/i915/drm/i915_drm_winsys.c
index 3baccb48989..74f1cfd0b33 100644
--- a/src/gallium/winsys/i915/drm/i915_drm_winsys.c
+++ b/src/gallium/winsys/i915/drm/i915_drm_winsys.c
@@ -9,6 +9,7 @@
#include "i915_drm_public.h"
#include "util/u_memory.h"
+#include "intel/common/intel_gem.h"
/*
* Helper functions
@@ -18,14 +19,7 @@
static void
i915_drm_get_device_id(int fd, unsigned int *device_id)
{
- int ret;
- struct drm_i915_getparam gp;
-
- gp.param = I915_PARAM_CHIPSET_ID;
- gp.value = (int *)device_id;
-
- ret = ioctl(fd, DRM_IOCTL_I915_GETPARAM, &gp, sizeof(gp));
- assert(ret == 0);
+ assert(intel_gem_get_param(fd, I915_PARAM_CHIPSET_ID, (int *)&device_id));
}
static int
@@ -53,7 +47,7 @@ struct i915_winsys *
i915_drm_winsys_create(int drmFD)
{
struct i915_drm_winsys *idws;
- unsigned int deviceID;
+ unsigned int deviceID = 0;
idws = CALLOC_STRUCT(i915_drm_winsys);
if (!idws)
diff --git a/src/gallium/winsys/i915/drm/meson.build b/src/gallium/winsys/i915/drm/meson.build
index 01300ad4c91..57597972417 100644
--- a/src/gallium/winsys/i915/drm/meson.build
+++ b/src/gallium/winsys/i915/drm/meson.build
@@ -27,5 +27,6 @@ libi915drm = static_library(
include_directories : [
inc_include, inc_src, inc_gallium, inc_gallium_aux, inc_gallium_drivers
],
+ link_with : [libintel_common],
dependencies : [dep_libdrm, dep_libdrm_intel],
)
diff --git a/src/gallium/winsys/kmsro/drm/kmsro_drm_winsys.c b/src/gallium/winsys/kmsro/drm/kmsro_drm_winsys.c
index 6d2f0cabd67..3c8a3c4519f 100644
--- a/src/gallium/winsys/kmsro/drm/kmsro_drm_winsys.c
+++ b/src/gallium/winsys/kmsro/drm/kmsro_drm_winsys.c
@@ -32,6 +32,7 @@
#include "freedreno/drm/freedreno_drm_public.h"
#include "panfrost/drm/panfrost_drm_public.h"
#include "lima/drm/lima_drm_public.h"
+#include "asahi/drm/asahi_drm_public.h"
#include "xf86drm.h"
#include "pipe/p_screen.h"
@@ -136,6 +137,19 @@ struct pipe_screen *kmsro_drm_screen_create(int fd,
}
#endif
+#if defined(GALLIUM_ASAHI)
+ ro->gpu_fd = drmOpenWithType("asahi", NULL, DRM_NODE_RENDER);
+
+ if (ro->gpu_fd >= 0) {
+ ro->create_for_resource = renderonly_create_kms_dumb_buffer_for_resource;
+ screen = asahi_drm_screen_create_renderonly(ro);
+ if (!screen)
+ goto out_free;
+
+ return screen;
+ }
+#endif
+
return screen;
out_free:
diff --git a/src/gallium/winsys/kmsro/drm/meson.build b/src/gallium/winsys/kmsro/drm/meson.build
index cec92b1fa15..9b47841407a 100644
--- a/src/gallium/winsys/kmsro/drm/meson.build
+++ b/src/gallium/winsys/kmsro/drm/meson.build
@@ -37,6 +37,9 @@ endif
if with_gallium_panfrost
kmsro_c_args += '-DGALLIUM_PANFROST'
endif
+if with_gallium_asahi
+ kmsro_c_args += '-DGALLIUM_ASAHI'
+endif
libkmsrowinsys = static_library(
'kmsrowinsys',
diff --git a/src/gallium/winsys/nouveau/drm/nouveau_drm_winsys.c b/src/gallium/winsys/nouveau/drm/nouveau_drm_winsys.c
index 3c8345b249f..3df4a67a6d9 100644
--- a/src/gallium/winsys/nouveau/drm/nouveau_drm_winsys.c
+++ b/src/gallium/winsys/nouveau/drm/nouveau_drm_winsys.c
@@ -9,7 +9,7 @@
#include "util/u_inlines.h"
#include "util/u_hash_table.h"
#include "util/u_pointer.h"
-#include "os/os_thread.h"
+#include "util/u_thread.h"
#include "nouveau_drm_public.h"
@@ -107,6 +107,7 @@ nouveau_drm_screen_create(int fd)
case 0x130:
case 0x140:
case 0x160:
+ case 0x170:
init = nvc0_screen_create;
break;
default:
diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_bo.c b/src/gallium/winsys/radeon/drm/radeon_drm_bo.c
index 9a67434398e..bafc6983367 100644
--- a/src/gallium/winsys/radeon/drm/radeon_drm_bo.c
+++ b/src/gallium/winsys/radeon/drm/radeon_drm_bo.c
@@ -28,8 +28,8 @@
#include "util/u_hash_table.h"
#include "util/u_memory.h"
-#include "os/os_thread.h"
-#include "os/os_mman.h"
+#include "util/u_thread.h"
+#include "util/os_mman.h"
#include "util/os_time.h"
#include "frontend/drm_driver.h"
diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_bo.h b/src/gallium/winsys/radeon/drm/radeon_drm_bo.h
index 84052f43b69..b74d2519461 100644
--- a/src/gallium/winsys/radeon/drm/radeon_drm_bo.h
+++ b/src/gallium/winsys/radeon/drm/radeon_drm_bo.h
@@ -29,7 +29,7 @@
#define RADEON_DRM_BO_H
#include "radeon_drm_winsys.h"
-#include "os/os_thread.h"
+#include "util/u_thread.h"
#include "pipebuffer/pb_slab.h"
struct radeon_bo {
diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c b/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c
index 0c94f9f769b..26fa21ba809 100644
--- a/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c
+++ b/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c
@@ -156,7 +156,7 @@ static bool do_winsys_init(struct radeon_drm_winsys *ws)
version->version_minor < 50) {
fprintf(stderr, "%s: DRM version is %d.%d.%d but this driver is "
"only compatible with 2.50.0 (kernel 4.12) or later.\n",
- __FUNCTION__,
+ __func__,
version->version_major,
version->version_minor,
version->version_patchlevel);
diff --git a/src/gallium/winsys/svga/drm/pb_buffer_simple_fenced.c b/src/gallium/winsys/svga/drm/pb_buffer_simple_fenced.c
index f0179f96d1d..b754a066a9e 100644
--- a/src/gallium/winsys/svga/drm/pb_buffer_simple_fenced.c
+++ b/src/gallium/winsys/svga/drm/pb_buffer_simple_fenced.c
@@ -34,9 +34,9 @@
*/
-#include "pipe/p_config.h"
+#include "util/detect.h"
-#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS)
+#if DETECT_OS_LINUX || DETECT_OS_BSD || DETECT_OS_SOLARIS
#include <unistd.h>
#include <sched.h>
#endif
@@ -45,7 +45,7 @@
#include "pipe/p_compiler.h"
#include "pipe/p_defines.h"
#include "util/u_debug.h"
-#include "os/os_thread.h"
+#include "util/u_thread.h"
#include "util/u_memory.h"
#include "util/list.h"
@@ -796,7 +796,7 @@ fenced_bufmgr_destroy(struct pb_manager *mgr)
/* Wait on outstanding fences */
while (fenced_mgr->num_fenced) {
mtx_unlock(&fenced_mgr->mutex);
-#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS)
+#if DETECT_OS_LINUX || DETECT_OS_BSD || DETECT_OS_SOLARIS
sched_yield();
#endif
mtx_lock(&fenced_mgr->mutex);
diff --git a/src/gallium/winsys/svga/drm/vmw_context.h b/src/gallium/winsys/svga/drm/vmw_context.h
index b71af6f04a0..87d54e5b8ea 100644
--- a/src/gallium/winsys/svga/drm/vmw_context.h
+++ b/src/gallium/winsys/svga/drm/vmw_context.h
@@ -45,7 +45,7 @@ struct pipe_screen;
#if VMW_DEBUG
#define vmw_printf debug_printf
-#define VMW_FUNC debug_printf("%s\n", __FUNCTION__)
+#define VMW_FUNC debug_printf("%s\n", __func__)
#else
#define VMW_FUNC
#define vmw_printf(...)
diff --git a/src/gallium/winsys/svga/drm/vmw_fence.c b/src/gallium/winsys/svga/drm/vmw_fence.c
index a31c3df0b70..0981e741803 100644
--- a/src/gallium/winsys/svga/drm/vmw_fence.c
+++ b/src/gallium/winsys/svga/drm/vmw_fence.c
@@ -27,7 +27,7 @@
#include "util/u_memory.h"
#include "util/u_atomic.h"
#include "util/list.h"
-#include "os/os_thread.h"
+#include "util/u_thread.h"
#include "pipebuffer/pb_buffer_fenced.h"
diff --git a/src/gallium/winsys/svga/drm/vmw_msg.c b/src/gallium/winsys/svga/drm/vmw_msg.c
index cc00b8ebc33..0ecb7390b9a 100644
--- a/src/gallium/winsys/svga/drm/vmw_msg.c
+++ b/src/gallium/winsys/svga/drm/vmw_msg.c
@@ -61,7 +61,7 @@
#define HIGH_WORD(X) ((X & 0xFFFF0000) >> 16)
-#if defined(PIPE_CC_GCC) && (PIPE_CC_GCC_VERSION > 502) && (defined(PIPE_ARCH_X86) || defined(PIPE_ARCH_X86_64))
+#if DETECT_CC_GCC && (DETECT_CC_GCC_VERSION > 502) && (DETECT_ARCH_X86 || DETECT_ARCH_X86_64)
/**
* Hypervisor-specific bi-directional communication channel. Should never
@@ -124,7 +124,7 @@
* @si: [OUT]
* @di: [OUT]
*/
-#if defined(PIPE_ARCH_X86_64)
+#if DETECT_ARCH_X86_64
typedef uint64_t VMW_REG;
@@ -273,7 +273,7 @@ typedef uint32_t VMW_REG;
(void) ax; (void) bx; (void) cx; \
(void) dx; (void) si; (void) di;
-#endif /* #if PIPE_CC_GCC */
+#endif /* #if DETECT_CC_GCC */
enum rpc_msg_type {
diff --git a/src/gallium/winsys/svga/drm/vmw_screen.c b/src/gallium/winsys/svga/drm/vmw_screen.c
index 1451a96ca05..8dd4f4dda8b 100644
--- a/src/gallium/winsys/svga/drm/vmw_screen.c
+++ b/src/gallium/winsys/svga/drm/vmw_screen.c
@@ -87,7 +87,7 @@ vmw_winsys_screen_deinit_mksstat(struct vmw_winsys_screen *vws)
uint32_t expected = __atomic_load_n(&vws->mksstat_tls[i].pid, __ATOMIC_ACQUIRE);
if (expected == -1U) {
- fprintf(stderr, "%s encountered locked mksstat TLS entry at index %lu.\n", __FUNCTION__, i);
+ fprintf(stderr, "%s encountered locked mksstat TLS entry at index %lu.\n", __func__, i);
continue;
}
@@ -103,12 +103,12 @@ vmw_winsys_screen_deinit_mksstat(struct vmw_winsys_screen *vws)
assert(vws->mksstat_tls[i].stat_id != -1UL);
if (drmCommandWrite(vws->ioctl.drm_fd, DRM_VMW_MKSSTAT_REMOVE, &arg, sizeof(arg))) {
- fprintf(stderr, "%s could not ioctl: %s\n", __FUNCTION__, strerror(errno));
+ fprintf(stderr, "%s could not ioctl: %s\n", __func__, strerror(errno));
} else if (munmap(vws->mksstat_tls[i].stat_pages, vmw_svga_winsys_stats_len())) {
- fprintf(stderr, "%s could not munmap: %s\n", __FUNCTION__, strerror(errno));
+ fprintf(stderr, "%s could not munmap: %s\n", __func__, strerror(errno));
}
} else {
- fprintf(stderr, "%s encountered volatile mksstat TLS entry at index %lu.\n", __FUNCTION__, i);
+ fprintf(stderr, "%s encountered volatile mksstat TLS entry at index %lu.\n", __func__, i);
}
}
}
diff --git a/src/gallium/winsys/svga/drm/vmw_screen.h b/src/gallium/winsys/svga/drm/vmw_screen.h
index 127ef16d6e3..75439c58a34 100644
--- a/src/gallium/winsys/svga/drm/vmw_screen.h
+++ b/src/gallium/winsys/svga/drm/vmw_screen.h
@@ -40,7 +40,7 @@
#include "svga_winsys.h"
#include "pipebuffer/pb_buffer_fenced.h"
-#include <os/os_thread.h>
+#include "util/u_thread.h"
#include <sys/types.h>
#define VMW_GMR_POOL_SIZE (16*1024*1024)
diff --git a/src/gallium/winsys/svga/drm/vmw_screen_ioctl.c b/src/gallium/winsys/svga/drm/vmw_screen_ioctl.c
index 7b83cbce26d..cc0a1e3eb46 100644
--- a/src/gallium/winsys/svga/drm/vmw_screen_ioctl.c
+++ b/src/gallium/winsys/svga/drm/vmw_screen_ioctl.c
@@ -46,7 +46,7 @@
#include "svga3d_caps.h"
#include "svga3d_reg.h"
-#include "os/os_mman.h"
+#include "util/os_mman.h"
#include <errno.h>
#include <unistd.h>
@@ -153,7 +153,7 @@ vmw_ioctl_surface_create(struct vmw_winsys_screen *vws,
uint32_t iMipLevel;
int ret;
- vmw_printf("%s flags %d format %d\n", __FUNCTION__, flags, format);
+ vmw_printf("%s flags %d format %d\n", __func__, flags, format);
memset(&s_arg, 0, sizeof(s_arg));
req->flags = (uint32_t) flags;
@@ -218,7 +218,7 @@ vmw_ioctl_gb_surface_create(struct vmw_winsys_screen *vws,
struct vmw_region *region = NULL;
int ret;
- vmw_printf("%s flags %d format %d\n", __FUNCTION__, flags, format);
+ vmw_printf("%s flags %d format %d\n", __func__, flags, format);
if (p_region) {
region = CALLOC_STRUCT(vmw_region);
@@ -478,7 +478,7 @@ vmw_ioctl_gb_surface_ref(struct vmw_winsys_screen *vws,
*numMipLevels = rep->creq.mip_levels;
}
- vmw_printf("%s flags %d format %d\n", __FUNCTION__, *flags, *format);
+ vmw_printf("%s flags %d format %d\n", __func__, *flags, *format);
if (needs_unref)
vmw_ioctl_surface_destroy(vws, *handle);
@@ -573,7 +573,7 @@ vmw_ioctl_command(struct vmw_winsys_screen *vws, int32_t cid,
usleep(1000);
} while(ret == -ERESTART || ret == -EBUSY);
if (ret) {
- vmw_error("%s error %s.\n", __FUNCTION__, strerror(-ret));
+ vmw_error("%s error %s.\n", __func__, strerror(-ret));
abort();
}
@@ -617,7 +617,7 @@ vmw_ioctl_region_create(struct vmw_winsys_screen *vws, uint32_t size)
struct drm_vmw_dmabuf_rep *rep = &arg.rep;
int ret;
- vmw_printf("%s: size = %u\n", __FUNCTION__, size);
+ vmw_printf("%s: size = %u\n", __func__, size);
region = CALLOC_STRUCT(vmw_region);
if (!region)
@@ -657,7 +657,7 @@ vmw_ioctl_region_destroy(struct vmw_region *region)
{
struct drm_vmw_unref_dmabuf_arg arg;
- vmw_printf("%s: gmrId = %u, offset = %u\n", __FUNCTION__,
+ vmw_printf("%s: gmrId = %u, offset = %u\n", __func__,
region->ptr.gmrId, region->ptr.offset);
if (region->data) {
@@ -684,14 +684,14 @@ vmw_ioctl_region_map(struct vmw_region *region)
{
void *map;
- vmw_printf("%s: gmrId = %u, offset = %u\n", __FUNCTION__,
+ vmw_printf("%s: gmrId = %u, offset = %u\n", __func__,
region->ptr.gmrId, region->ptr.offset);
if (region->data == NULL) {
map = os_mmap(NULL, region->size, PROT_READ | PROT_WRITE, MAP_SHARED,
region->drm_fd, region->map_handle);
if (map == MAP_FAILED) {
- vmw_error("%s: Map failed.\n", __FUNCTION__);
+ vmw_error("%s: Map failed.\n", __func__);
return NULL;
}
@@ -710,7 +710,7 @@ vmw_ioctl_region_map(struct vmw_region *region)
void
vmw_ioctl_region_unmap(struct vmw_region *region)
{
- vmw_printf("%s: gmrId = %u, offset = %u\n", __FUNCTION__,
+ vmw_printf("%s: gmrId = %u, offset = %u\n", __func__,
region->ptr.gmrId, region->ptr.offset);
--region->map_count;
@@ -794,7 +794,7 @@ vmw_ioctl_fence_unref(struct vmw_winsys_screen *vws,
ret = drmCommandWrite(vws->ioctl.drm_fd, DRM_VMW_FENCE_UNREF,
&arg, sizeof(arg));
if (ret != 0)
- vmw_error("%s Failed\n", __FUNCTION__);
+ vmw_error("%s Failed\n", __func__);
}
static inline uint32_t
@@ -857,7 +857,7 @@ vmw_ioctl_fence_finish(struct vmw_winsys_screen *vws,
&arg, sizeof(arg));
if (ret != 0)
- vmw_error("%s Failed\n", __FUNCTION__);
+ vmw_error("%s Failed\n", __func__);
return 0;
}
@@ -1244,7 +1244,7 @@ vmw_ioctl_init(struct vmw_winsys_screen *vws)
free(cap_buffer);
drmFreeVersion(version);
- vmw_printf("%s OK\n", __FUNCTION__);
+ vmw_printf("%s OK\n", __func__);
return TRUE;
out_no_caps:
free(vws->ioctl.cap_3d);
@@ -1254,7 +1254,7 @@ vmw_ioctl_init(struct vmw_winsys_screen *vws)
drmFreeVersion(version);
out_no_version:
vws->ioctl.num_cap_3d = 0;
- debug_printf("%s Failed\n", __FUNCTION__);
+ debug_printf("%s Failed\n", __func__);
return FALSE;
}
diff --git a/src/gallium/winsys/svga/drm/vmw_screen_svga.c b/src/gallium/winsys/svga/drm/vmw_screen_svga.c
index 98b38322917..db7cdcc4482 100644
--- a/src/gallium/winsys/svga/drm/vmw_screen_svga.c
+++ b/src/gallium/winsys/svga/drm/vmw_screen_svga.c
@@ -227,7 +227,7 @@ vmw_svga_winsys_add_stats(struct vmw_winsys_screen *vws, int slot)
void *area = mmap(NULL, area_size, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_SHARED | MAP_NORESERVE, -1, 0);
if (area == MAP_FAILED) {
- fprintf(stderr, "%s could not mmap memory: %s\n", __FUNCTION__, strerror(errno));
+ fprintf(stderr, "%s could not mmap memory: %s\n", __func__, strerror(errno));
return -1;
}
@@ -237,13 +237,13 @@ vmw_svga_winsys_add_stats(struct vmw_winsys_screen *vws, int slot)
pstatTime = vmw_mksstat_get_pstat_time(area, pg_size);
if (mlock(area, area_size)) {
- fprintf(stderr, "%s could not mlock memory: %s\n", __FUNCTION__, strerror(errno));
+ fprintf(stderr, "%s could not mlock memory: %s\n", __func__, strerror(errno));
goto error;
}
/* Suppress pages copy-on-write; for MAP_SHARED this should not really matter; it would if we go MAP_PRIVATE */
if (madvise(area, area_size, MADV_DONTFORK)) {
- fprintf(stderr, "%s could not madvise memory: %s\n", __FUNCTION__, strerror(errno));
+ fprintf(stderr, "%s could not madvise memory: %s\n", __func__, strerror(errno));
goto error;
}
@@ -286,7 +286,7 @@ vmw_svga_winsys_add_stats(struct vmw_winsys_screen *vws, int slot)
.id = -1U
};
if (drmCommandWriteRead(vws->ioctl.drm_fd, DRM_VMW_MKSSTAT_ADD, &arg, sizeof(arg))) {
- fprintf(stderr, "%s could not ioctl: %s\n", __FUNCTION__, strerror(errno));
+ fprintf(stderr, "%s could not ioctl: %s\n", __func__, strerror(errno));
goto error;
}
id = arg.id;
diff --git a/src/gallium/winsys/svga/drm/vmw_surface.h b/src/gallium/winsys/svga/drm/vmw_surface.h
index b6cf63bb476..bfa1bd8fb00 100644
--- a/src/gallium/winsys/svga/drm/vmw_surface.h
+++ b/src/gallium/winsys/svga/drm/vmw_surface.h
@@ -38,7 +38,7 @@
#include "pipe/p_compiler.h"
#include "util/u_atomic.h"
#include "util/u_inlines.h"
-#include "os/os_thread.h"
+#include "util/u_thread.h"
#include "pipebuffer/pb_buffer.h"
#define VMW_MAX_PRESENTS 3
diff --git a/src/gallium/winsys/sw/dri/dri_sw_winsys.c b/src/gallium/winsys/sw/dri/dri_sw_winsys.c
index e319d50a04d..35a267fbd85 100644
--- a/src/gallium/winsys/sw/dri/dri_sw_winsys.c
+++ b/src/gallium/winsys/sw/dri/dri_sw_winsys.c
@@ -38,7 +38,7 @@
#endif
#include "pipe/p_compiler.h"
-#include "pipe/p_format.h"
+#include "util/format/u_formats.h"
#include "pipe/p_state.h"
#include "util/u_inlines.h"
#include "util/format/u_format.h"
diff --git a/src/gallium/winsys/sw/gdi/gdi_sw_winsys.c b/src/gallium/winsys/sw/gdi/gdi_sw_winsys.c
index 87ffbcc0689..49a138c9f06 100644
--- a/src/gallium/winsys/sw/gdi/gdi_sw_winsys.c
+++ b/src/gallium/winsys/sw/gdi/gdi_sw_winsys.c
@@ -36,7 +36,7 @@
#include <windows.h>
-#include "pipe/p_format.h"
+#include "util/format/u_formats.h"
#include "pipe/p_context.h"
#include "util/u_inlines.h"
#include "util/format/u_format.h"
diff --git a/src/gallium/winsys/sw/hgl/hgl_sw_winsys.cpp b/src/gallium/winsys/sw/hgl/hgl_sw_winsys.cpp
index 564f9f61268..3c0dc4d8430 100644
--- a/src/gallium/winsys/sw/hgl/hgl_sw_winsys.cpp
+++ b/src/gallium/winsys/sw/hgl/hgl_sw_winsys.cpp
@@ -29,7 +29,7 @@
#include "pipe/p_compiler.h"
#include "pipe/p_defines.h"
-#include "pipe/p_format.h"
+#include "util/format/u_formats.h"
#include "util/u_inlines.h"
#include "util/format/u_format.h"
#include "util/u_math.h"
diff --git a/src/gallium/winsys/sw/kms-dri/kms_dri_sw_winsys.c b/src/gallium/winsys/sw/kms-dri/kms_dri_sw_winsys.c
index aa1257acea9..19898312227 100644
--- a/src/gallium/winsys/sw/kms-dri/kms_dri_sw_winsys.c
+++ b/src/gallium/winsys/sw/kms-dri/kms_dri_sw_winsys.c
@@ -43,7 +43,7 @@
#include <xf86drm.h>
#include "pipe/p_compiler.h"
-#include "pipe/p_format.h"
+#include "util/format/u_formats.h"
#include "pipe/p_state.h"
#include "util/u_inlines.h"
#include "util/format/u_format.h"
diff --git a/src/gallium/winsys/sw/null/null_sw_winsys.c b/src/gallium/winsys/sw/null/null_sw_winsys.c
index a39f74c879c..60d2a830421 100644
--- a/src/gallium/winsys/sw/null/null_sw_winsys.c
+++ b/src/gallium/winsys/sw/null/null_sw_winsys.c
@@ -37,7 +37,7 @@
#include <stdio.h>
-#include "pipe/p_format.h"
+#include "util/format/u_formats.h"
#include "util/u_memory.h"
#include "frontend/sw_winsys.h"
#include "null_sw_winsys.h"
diff --git a/src/gallium/winsys/sw/wrapper/wrapper_sw_winsys.c b/src/gallium/winsys/sw/wrapper/wrapper_sw_winsys.c
index a61a4458f28..427cbff7b42 100644
--- a/src/gallium/winsys/sw/wrapper/wrapper_sw_winsys.c
+++ b/src/gallium/winsys/sw/wrapper/wrapper_sw_winsys.c
@@ -26,7 +26,7 @@
#include "wrapper_sw_winsys.h"
-#include "pipe/p_format.h"
+#include "util/format/u_formats.h"
#include "pipe/p_state.h"
#include "frontend/sw_winsys.h"
diff --git a/src/gallium/winsys/sw/xlib/xlib_sw_winsys.c b/src/gallium/winsys/sw/xlib/xlib_sw_winsys.c
index 57e13084037..7141fcbc7bb 100644
--- a/src/gallium/winsys/sw/xlib/xlib_sw_winsys.c
+++ b/src/gallium/winsys/sw/xlib/xlib_sw_winsys.c
@@ -32,7 +32,7 @@
* Brian Paul
*/
-#include "pipe/p_format.h"
+#include "util/format/u_formats.h"
#include "pipe/p_context.h"
#include "util/u_inlines.h"
#include "util/format/u_format.h"
diff --git a/src/gallium/winsys/virgl/drm/virgl_drm_winsys.c b/src/gallium/winsys/virgl/drm/virgl_drm_winsys.c
index 9c1137ada49..6ae63e75758 100644
--- a/src/gallium/winsys/virgl/drm/virgl_drm_winsys.c
+++ b/src/gallium/winsys/virgl/drm/virgl_drm_winsys.c
@@ -28,7 +28,7 @@
#include <sys/ioctl.h>
#include <sys/stat.h>
-#include "os/os_mman.h"
+#include "util/os_mman.h"
#include "util/os_file.h"
#include "util/os_time.h"
#include "util/u_memory.h"
diff --git a/src/gallium/winsys/virgl/drm/virgl_drm_winsys.h b/src/gallium/winsys/virgl/drm/virgl_drm_winsys.h
index 5c6c4f9ef1a..f17d89c098b 100644
--- a/src/gallium/winsys/virgl/drm/virgl_drm_winsys.h
+++ b/src/gallium/winsys/virgl/drm/virgl_drm_winsys.h
@@ -24,7 +24,7 @@
#define VIRGL_DRM_WINSYS_H
#include <stdint.h>
-#include "os/os_thread.h"
+#include "util/u_thread.h"
#include "pipe/p_state.h"
#include "util/list.h"
diff --git a/src/gallium/winsys/virgl/vtest/virgl_vtest_winsys.c b/src/gallium/winsys/virgl/vtest/virgl_vtest_winsys.c
index b69b9ceee16..ede5b6894ee 100644
--- a/src/gallium/winsys/virgl/vtest/virgl_vtest_winsys.c
+++ b/src/gallium/winsys/virgl/vtest/virgl_vtest_winsys.c
@@ -27,7 +27,7 @@
#include "util/u_inlines.h"
#include "util/os_time.h"
#include "frontend/sw_winsys.h"
-#include "os/os_mman.h"
+#include "util/os_mman.h"
#include "virgl_vtest_winsys.h"
#include "virgl_vtest_public.h"
diff --git a/src/gallium/winsys/virgl/vtest/virgl_vtest_winsys.h b/src/gallium/winsys/virgl/vtest/virgl_vtest_winsys.h
index 4254a551f01..29cfb3a9ca6 100644
--- a/src/gallium/winsys/virgl/vtest/virgl_vtest_winsys.h
+++ b/src/gallium/winsys/virgl/vtest/virgl_vtest_winsys.h
@@ -28,7 +28,7 @@
#include "pipe/p_defines.h"
#include "pipe/p_state.h"
#include "util/list.h"
-#include "os/os_thread.h"
+#include "util/u_thread.h"
#include "virgl/virgl_winsys.h"
#include "vtest/vtest_protocol.h"