summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/mesa/src/mesa/main/execmem.h3
-rw-r--r--lib/mesa/src/mesa/state_tracker/st_cb_memoryobjects.c56
-rw-r--r--lib/mesa/src/mesa/state_tracker/st_cb_memoryobjects.h28
-rw-r--r--lib/mesa/src/util/tests/string_buffer/string_buffer_test.cpp6
4 files changed, 16 insertions, 77 deletions
diff --git a/lib/mesa/src/mesa/main/execmem.h b/lib/mesa/src/mesa/main/execmem.h
index d98cad713..bc51a8c84 100644
--- a/lib/mesa/src/mesa/main/execmem.h
+++ b/lib/mesa/src/mesa/main/execmem.h
@@ -26,10 +26,9 @@
#ifndef EXECMEM_H
#define EXECMEM_H
-#include "glheader.h"
extern void *
-_mesa_exec_malloc(unsigned size);
+_mesa_exec_malloc(GLuint size);
extern void
_mesa_exec_free(void *addr);
diff --git a/lib/mesa/src/mesa/state_tracker/st_cb_memoryobjects.c b/lib/mesa/src/mesa/state_tracker/st_cb_memoryobjects.c
index b3089c030..7a4376326 100644
--- a/lib/mesa/src/mesa/state_tracker/st_cb_memoryobjects.c
+++ b/lib/mesa/src/mesa/state_tracker/st_cb_memoryobjects.c
@@ -1,44 +1,15 @@
-/*
- * Copyright © 2017 Red Hat.
- * Copyright © 2017 Valve Corporation.
- *
- * 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 "main/imports.h"
#include "main/mtypes.h"
#include "main/externalobjects.h"
#include "st_context.h"
#include "st_cb_memoryobjects.h"
-#include "st_util.h"
-#include "frontend/drm_driver.h"
+#include "state_tracker/drm_driver.h"
#include "pipe/p_context.h"
#include "pipe/p_screen.h"
-#ifdef HAVE_LIBDRM
-#include "drm-uapi/drm_fourcc.h"
-#endif
-
static struct gl_memory_object *
st_memoryobj_alloc(struct gl_context *ctx, GLuint name)
{
@@ -54,12 +25,6 @@ static void
st_memoryobj_free(struct gl_context *ctx,
struct gl_memory_object *obj)
{
- struct st_memory_object *st_obj = st_memory_object(obj);
- struct st_context *st = st_context(ctx);
- struct pipe_screen *screen = st->screen;
-
- if (st_obj->memory)
- screen->memobj_destroy(screen, st_obj->memory);
_mesa_delete_memory_object(ctx, obj);
}
@@ -72,14 +37,15 @@ st_import_memoryobj_fd(struct gl_context *ctx,
{
struct st_memory_object *st_obj = st_memory_object(obj);
struct st_context *st = st_context(ctx);
- struct pipe_screen *screen = st->screen;
- struct winsys_handle whandle = {
- .type = WINSYS_HANDLE_TYPE_FD,
- .handle = fd,
-#ifdef HAVE_LIBDRM
- .modifier = DRM_FORMAT_MOD_INVALID,
-#endif
- };
+ struct pipe_context *pipe = st->pipe;
+ struct pipe_screen *screen = pipe->screen;
+ struct winsys_handle whandle;
+
+ whandle.type = DRM_API_HANDLE_TYPE_FD;
+ whandle.handle = fd;
+ whandle.offset = 0;
+ whandle.layer = 0;
+ whandle.stride = 0;
st_obj->memory = screen->memobj_create_from_handle(screen,
&whandle,
diff --git a/lib/mesa/src/mesa/state_tracker/st_cb_memoryobjects.h b/lib/mesa/src/mesa/state_tracker/st_cb_memoryobjects.h
index 565768eba..66065169e 100644
--- a/lib/mesa/src/mesa/state_tracker/st_cb_memoryobjects.h
+++ b/lib/mesa/src/mesa/state_tracker/st_cb_memoryobjects.h
@@ -1,30 +1,7 @@
-/*
- * Copyright © 2017 Red Hat.
- * Copyright © 2017 Valve Corporation.
- *
- * 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 ST_CB_MEMORYOBJECTS_H
#define ST_CB_MEMORYOBJECTS_H
+#include "main/compiler.h"
#include "main/mtypes.h"
struct dd_function_table;
@@ -34,9 +11,6 @@ struct st_memory_object
{
struct gl_memory_object Base;
struct pipe_memory_object *memory;
-
- /* TEXTURE_TILING_EXT param from gl_texture_object */
- GLuint TextureTiling;
};
static inline struct st_memory_object *
diff --git a/lib/mesa/src/util/tests/string_buffer/string_buffer_test.cpp b/lib/mesa/src/util/tests/string_buffer/string_buffer_test.cpp
index afb6dfb2a..545f607fa 100644
--- a/lib/mesa/src/util/tests/string_buffer/string_buffer_test.cpp
+++ b/lib/mesa/src/util/tests/string_buffer/string_buffer_test.cpp
@@ -95,15 +95,15 @@ TEST_F(string_buffer, string_buffer_tests)
EXPECT_TRUE(strlen(buf->buf) == 0);
/* Test a string with some formatting */
- snprintf(str4, sizeof(str4), "Testing formatting %d, %f", 100, 1.0);
+ sprintf(str4, "Testing formatting %d, %f", 100, 1.0);
EXPECT_TRUE(_mesa_string_buffer_printf(buf, "Testing formatting %d, %f", 100, 1.0));
EXPECT_TRUE(strcmp(buf->buf, str4) == 0);
/* Compile a string with some other formatting */
- snprintf(str5, sizeof(str5), "Testing formatting %d, %x", 100, 0xDEADBEAF);
+ sprintf(str5, "Testing formatting %d, %x", 100, 0xDEADBEAF);
/* Concatenate str5 to str4 */
- strncat(str4, str5, sizeof(str5));
+ strcat(str4, str5);
/* Now use the formatted append function again */
EXPECT_TRUE(_mesa_string_buffer_printf(buf, "Testing formatting %d, %x", 100, 0xDEADBEAF));