From 6ec3f71e05dbf3f26e6f4a37189da871d40fa139 Mon Sep 17 00:00:00 2001 From: Zack Rusin Date: Mon, 16 Aug 2021 14:25:36 -0400 Subject: [PATCH] svga: Don't try to build x86/x64 assembly on different arch's svga used to use vmx backdoor directly to send logs to the host. This functionality has been implemented in vmwgfx 2.17, but to make sure we still work with old kernels the functionality to use the backdoor directly has been kept. There's no reason to port that code to arm since vmwgfx implements it and arm64 (or other new platforms) would depend on vmwgfx versions a lot newer than 2.17, so everywhere but on x86/x64 it's fine to assume vmwgfx always support the host logging ioctls. Signed-off-by: Zack Rusin Reviewed-by: Reviewed-by: Neha Bhende Reviewed-by: Martin Krastev (cherry picked from commit 71a749bc7b05ebc7289c3201c9baeb183f436386) Part-of: --- src/gallium/winsys/svga/drm/vmw_msg.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/gallium/winsys/svga/drm/vmw_msg.c b/src/gallium/winsys/svga/drm/vmw_msg.c index e664769c279..cc00b8ebc33 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) +#if defined(PIPE_CC_GCC) && (PIPE_CC_GCC_VERSION > 502) && (defined(PIPE_ARCH_X86) || defined(PIPE_ARCH_X86_64)) /** * Hypervisor-specific bi-directional communication channel. Should never @@ -426,15 +426,10 @@ vmw_send_msg(struct rpc_channel *channel, const char *msg) void vmw_svga_winsys_host_log(struct svga_winsys_screen *sws, const char *log) { - struct rpc_channel channel; struct vmw_winsys_screen *vws = vmw_winsys_screen(sws); char *msg; int msg_len; - int ret; - -#ifdef MSG_NOT_IMPLEMENTED - return; -#endif + int ret = 0; if (!log) return; @@ -459,10 +454,15 @@ vmw_svga_winsys_host_log(struct svga_winsys_screen *sws, const char *log) &msg_arg, sizeof(msg_arg)); } else { +#ifdef MSG_NOT_IMPLEMENTED + debug_printf("Old vmwgfx doesn't support message passing.\n"); +#else + struct rpc_channel channel; if (!(ret = vmw_open_channel(&channel, RPCI_PROTOCOL_NUM))) { ret = vmw_send_msg(&channel, msg); vmw_close_channel(&channel); } +#endif } if (ret)