Module: Mesa Branch: staging/22.1 Commit: aca012daa67b2253febf8081a2b54322b8739a74 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=aca012daa67b2253febf8081a2b54322b8739a74
Author: Zack Rusin <[email protected]> Date: Mon Aug 16 14:25:36 2021 -0400 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 <[email protected]> Reviewed-by: Reviewed-by: Neha Bhende <[email protected]> Reviewed-by: Martin Krastev <[email protected]> (cherry picked from commit 71a749bc7b05ebc7289c3201c9baeb183f436386) Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16564> --- 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)
