summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gallium/drivers/svga/Makefile.sources2
-rw-r--r--src/gallium/drivers/svga/meson.build1
-rw-r--r--src/gallium/drivers/svga/svga_screen.c12
-rw-r--r--src/gallium/drivers/svga/svga_winsys.h5
-rw-r--r--src/gallium/winsys/svga/drm/Makefile.sources2
-rw-r--r--src/gallium/winsys/svga/drm/meson.build1
-rw-r--r--[-rwxr-xr-x]src/gallium/winsys/svga/drm/vmw_msg.c (renamed from src/gallium/drivers/svga/svga_msg.c)49
-rw-r--r--src/gallium/winsys/svga/drm/vmw_msg.h (renamed from src/gallium/drivers/svga/svga_msg.h)9
-rw-r--r--src/gallium/winsys/svga/drm/vmw_screen_svga.c3
9 files changed, 44 insertions, 40 deletions
diff --git a/src/gallium/drivers/svga/Makefile.sources b/src/gallium/drivers/svga/Makefile.sources
index 72024cf60e1..229d2863c84 100644
--- a/src/gallium/drivers/svga/Makefile.sources
+++ b/src/gallium/drivers/svga/Makefile.sources
@@ -15,8 +15,6 @@ C_SOURCES := \
svga_hw_reg.h \
svga_link.c \
svga_link.h \
- svga_msg.c \
- svga_msg.h \
svga_mksstats.h \
svga_pipe_blend.c \
svga_pipe_blit.c \
diff --git a/src/gallium/drivers/svga/meson.build b/src/gallium/drivers/svga/meson.build
index 7981e2991f3..4d3207a9942 100644
--- a/src/gallium/drivers/svga/meson.build
+++ b/src/gallium/drivers/svga/meson.build
@@ -27,7 +27,6 @@ files_svga = files(
'svga_draw_elements.c',
'svga_format.c',
'svga_link.c',
- 'svga_msg.c',
'svga_pipe_blend.c',
'svga_pipe_blit.c',
'svga_pipe_clear.c',
diff --git a/src/gallium/drivers/svga/svga_screen.c b/src/gallium/drivers/svga/svga_screen.c
index 6cb5a14f5b0..664b9bf615d 100644
--- a/src/gallium/drivers/svga/svga_screen.c
+++ b/src/gallium/drivers/svga/svga_screen.c
@@ -37,7 +37,6 @@
#include "svga_public.h"
#include "svga_context.h"
#include "svga_format.h"
-#include "svga_msg.h"
#include "svga_screen.h"
#include "svga_tgsi.h"
#include "svga_resource_texture.h"
@@ -891,17 +890,18 @@ svga_get_driver_query_info(struct pipe_screen *screen,
static void
init_logging(struct pipe_screen *screen)
{
+ struct svga_screen *svgascreen = svga_screen(screen);
static const char *log_prefix = "Mesa: ";
char host_log[1000];
/* Log Version to Host */
util_snprintf(host_log, sizeof(host_log) - strlen(log_prefix),
- "%s%s", log_prefix, svga_get_name(screen));
- svga_host_log(host_log);
+ "%s%s\n", log_prefix, svga_get_name(screen));
+ svgascreen->sws->host_log(svgascreen->sws, host_log);
util_snprintf(host_log, sizeof(host_log) - strlen(log_prefix),
"%s" PACKAGE_VERSION MESA_GIT_SHA1, log_prefix);
- svga_host_log(host_log);
+ svgascreen->sws->host_log(svgascreen->sws, host_log);
/* If the SVGA_EXTRA_LOGGING env var is set, log the process's command
* line (program name and arguments).
@@ -910,8 +910,8 @@ init_logging(struct pipe_screen *screen)
char cmdline[1000];
if (os_get_command_line(cmdline, sizeof(cmdline))) {
util_snprintf(host_log, sizeof(host_log) - strlen(log_prefix),
- "%s%s", log_prefix, cmdline);
- svga_host_log(host_log);
+ "%s%s\n", log_prefix, cmdline);
+ svgascreen->sws->host_log(svgascreen->sws, host_log);
}
}
}
diff --git a/src/gallium/drivers/svga/svga_winsys.h b/src/gallium/drivers/svga/svga_winsys.h
index a067a7ba09d..14782e19a7d 100644
--- a/src/gallium/drivers/svga/svga_winsys.h
+++ b/src/gallium/drivers/svga/svga_winsys.h
@@ -753,6 +753,11 @@ struct svga_winsys_screen
void
(*stats_time_pop)();
+ /**
+ * Send a host log message
+ */
+ void
+ (*host_log)(struct svga_winsys_screen *sws, const char *message);
/** Have VGPU v10 hardware? */
boolean have_vgpu10;
diff --git a/src/gallium/winsys/svga/drm/Makefile.sources b/src/gallium/winsys/svga/drm/Makefile.sources
index f82b0097b5b..191f0b88b4a 100644
--- a/src/gallium/winsys/svga/drm/Makefile.sources
+++ b/src/gallium/winsys/svga/drm/Makefile.sources
@@ -8,6 +8,8 @@ C_SOURCES := \
vmw_fence.c \
vmw_fence.h \
vmwgfx_drm.h \
+ vmw_msg.c \
+ vmw_msg.h \
vmw_screen.c \
vmw_screen_dri.c \
vmw_screen.h \
diff --git a/src/gallium/winsys/svga/drm/meson.build b/src/gallium/winsys/svga/drm/meson.build
index 24f67aca9ec..55266ce1623 100644
--- a/src/gallium/winsys/svga/drm/meson.build
+++ b/src/gallium/winsys/svga/drm/meson.build
@@ -23,6 +23,7 @@ files_svgadrm = files(
'vmw_buffer.c',
'vmw_context.c',
'vmw_fence.c',
+ 'vmw_msg.c',
'vmw_screen.c',
'vmw_screen_dri.c',
'vmw_screen_ioctl.c',
diff --git a/src/gallium/drivers/svga/svga_msg.c b/src/gallium/winsys/svga/drm/vmw_msg.c
index 8b63132cb57..8cce2241f36 100755..100644
--- a/src/gallium/drivers/svga/svga_msg.c
+++ b/src/gallium/winsys/svga/drm/vmw_msg.c
@@ -29,7 +29,8 @@
#include "util/u_memory.h"
#include "util/u_string.h"
#include "pipe/p_defines.h"
-#include "svga_msg.h"
+#include "svga_winsys.h"
+#include "vmw_msg.h"
#define MESSAGE_STATUS_SUCCESS 0x0001
@@ -83,7 +84,7 @@
port_num, magic, \
ax, bx, cx, dx, si, di) \
({ \
- __asm__ volatile ("inl %%dx, %%eax;" : \
+ __asm__ volatile ("inl %%dx, %%eax;" : \
"=a"(ax), \
"=b"(bx), \
"=c"(cx), \
@@ -128,7 +129,7 @@ typedef uint64_t VMW_REG;
port_num, magic, bp, \
ax, bx, cx, dx, si, di) \
({ \
- __asm__ volatile ("push %%rbp;" \
+ __asm__ volatile ("push %%rbp;" \
"movq %12, %%rbp;" \
"rep outsb;" \
"pop %%rbp;" : \
@@ -152,7 +153,7 @@ typedef uint64_t VMW_REG;
port_num, magic, bp, \
ax, bx, cx, dx, si, di) \
({ \
- __asm__ volatile ("push %%rbp;" \
+ __asm__ volatile ("push %%rbp;" \
"movq %12, %%rbp;" \
"rep insb;" \
"pop %%rbp" : \
@@ -183,7 +184,7 @@ typedef uint32_t VMW_REG;
port_num, magic, bp, \
ax, bx, cx, dx, si, di) \
({ \
- __asm__ volatile ("push %%ebp;" \
+ __asm__ volatile ("push %%ebp;" \
"mov %12, %%ebp;" \
"rep outsb;" \
"pop %%ebp;" : \
@@ -208,7 +209,7 @@ typedef uint32_t VMW_REG;
port_num, magic, bp, \
ax, bx, cx, dx, si, di) \
({ \
- __asm__ volatile ("push %%ebp;" \
+ __asm__ volatile ("push %%ebp;" \
"mov %12, %%ebp;" \
"rep insb;" \
"pop %%ebp" : \
@@ -252,7 +253,7 @@ typedef uint32_t VMW_REG;
(void) in_cx; (void) bp; \
(void) ax; (void) bx; (void) cx; \
(void) dx; (void) si; (void) di;
-
+
#define VMW_PORT_HB_IN(cmd, in_cx, in_si, in_di, \
port_num, magic, bp, \
@@ -283,7 +284,7 @@ struct rpc_channel {
/**
- * svga_open_channel
+ * vmw_open_channel
*
* @channel: RPC channel
* @protocol:
@@ -291,7 +292,7 @@ struct rpc_channel {
* Returns: PIPE_OK on success, PIPE_ERROR otherwise
*/
static enum pipe_error
-svga_open_channel(struct rpc_channel *channel, unsigned protocol)
+vmw_open_channel(struct rpc_channel *channel, unsigned protocol)
{
VMW_REG ax = 0, bx = 0, cx = 0, dx = 0, si = 0, di = 0;
@@ -321,7 +322,7 @@ svga_open_channel(struct rpc_channel *channel, unsigned protocol)
* Returns: PIPE_OK on success, PIPE_ERROR otherwises
*/
static enum pipe_error
-svga_close_channel(struct rpc_channel *channel)
+vmw_close_channel(struct rpc_channel *channel)
{
VMW_REG ax = 0, bx = 0, cx = 0, dx = 0, si, di;
@@ -344,7 +345,7 @@ svga_close_channel(struct rpc_channel *channel)
/**
- * svga_send_msg: Sends a message to the host
+ * vmw_send_msg: Sends a message to the host
*
* @channel: RPC channel
* @logmsg: NULL terminated string
@@ -352,7 +353,7 @@ svga_close_channel(struct rpc_channel *channel)
* Returns: PIPE_OK on success
*/
static enum pipe_error
-svga_send_msg(struct rpc_channel *channel, const char *msg)
+vmw_send_msg(struct rpc_channel *channel, const char *msg)
{
VMW_REG ax = 0, bx = 0, cx = 0, dx = 0, si, di, bp;
size_t msg_len = strlen(msg);
@@ -406,46 +407,42 @@ svga_send_msg(struct rpc_channel *channel, const char *msg)
/**
- * svga_host_log: Sends a log message to the host
+ * vmw_svga_winsys_host_log: Sends a log message to the host
*
* @log: NULL terminated string
*
- * Returns: PIPE_OK on success
*/
-enum pipe_error
-svga_host_log(const char *log)
+void
+vmw_svga_winsys_host_log(struct svga_winsys_screen *sws, const char *log)
{
struct rpc_channel channel;
char *msg;
int msg_len;
- enum pipe_error ret = PIPE_OK;
#ifdef MSG_NOT_IMPLEMENTED
- return ret;
+ return;
#endif
if (!log)
- return ret;
+ return;
msg_len = strlen(log) + strlen("log ") + 1;
msg = CALLOC(1, msg_len);
if (msg == NULL) {
debug_printf("Cannot allocate memory for log message\n");
- return PIPE_ERROR_OUT_OF_MEMORY;
+ return;
}
util_sprintf(msg, "log %s", log);
- if (svga_open_channel(&channel, RPCI_PROTOCOL_NUM) ||
- svga_send_msg(&channel, msg) ||
- svga_close_channel(&channel)) {
+ if (vmw_open_channel(&channel, RPCI_PROTOCOL_NUM) ||
+ vmw_send_msg(&channel, msg) ||
+ vmw_close_channel(&channel)) {
debug_printf("Failed to send log\n");
-
- ret = PIPE_ERROR;
}
FREE(msg);
- return ret;
+ return;
}
diff --git a/src/gallium/drivers/svga/svga_msg.h b/src/gallium/winsys/svga/drm/vmw_msg.h
index 9132ba7e240..57057f23638 100644
--- a/src/gallium/drivers/svga/svga_msg.h
+++ b/src/gallium/winsys/svga/drm/vmw_msg.h
@@ -26,17 +26,16 @@
* Author:
* Sinclair Yeh <[email protected]>
*/
-#ifndef _SVGA_MSG_H
-#define _SVGA_MSG_H
+#ifndef _VMW_MSG_H
+#define _VMW_MSG_H
/**
- * svga_host_log: Sends a log message to the host
+ * vmw_host_log: Sends a log message to the host
*
* @log: NULL terminated string
*
- * Returns: PIPE_OK on success
*/
-enum pipe_error svga_host_log(const char *log);
+void vmw_svga_winsys_host_log(struct svga_winsys_screen *sws, const char *log);
#endif
diff --git a/src/gallium/winsys/svga/drm/vmw_screen_svga.c b/src/gallium/winsys/svga/drm/vmw_screen_svga.c
index a6990414e20..cd3f21f6033 100644
--- a/src/gallium/winsys/svga/drm/vmw_screen_svga.c
+++ b/src/gallium/winsys/svga/drm/vmw_screen_svga.c
@@ -48,6 +48,7 @@
#include "vmw_surface.h"
#include "vmw_buffer.h"
#include "vmw_fence.h"
+#include "vmw_msg.h"
#include "vmw_shader.h"
#include "vmw_query.h"
#include "svga3d_surfacedefs.h"
@@ -509,6 +510,8 @@ vmw_winsys_screen_init_svga(struct vmw_winsys_screen *vws)
vws->base.stats_time_push = vmw_svga_winsys_stats_time_push;
vws->base.stats_time_pop = vmw_svga_winsys_stats_time_pop;
+ vws->base.host_log = vmw_svga_winsys_host_log;
+
return TRUE;
}