]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/blobdiff - drivers/gpu/drm/vmwgfx/vmwgfx_msg.c
Merge tag 'drm-next-2019-09-18' of git://anongit.freedesktop.org/drm/drm
[mirror_ubuntu-focal-kernel.git] / drivers / gpu / drm / vmwgfx / vmwgfx_msg.c
index 81a86c3b77bc12a832fd8284522bd62bb7910172..b6c5e4c2ac3c0d3050ae37883db2d5eaa786015e 100644 (file)
@@ -45,8 +45,6 @@
 #define RETRIES                 3
 
 #define VMW_HYPERVISOR_MAGIC    0x564D5868
-#define VMW_HYPERVISOR_PORT     0x5658
-#define VMW_HYPERVISOR_HB_PORT  0x5659
 
 #define VMW_PORT_CMD_MSG        30
 #define VMW_PORT_CMD_HB_MSG     0
@@ -92,7 +90,7 @@ static int vmw_open_channel(struct rpc_channel *channel, unsigned int protocol)
 
        VMW_PORT(VMW_PORT_CMD_OPEN_CHANNEL,
                (protocol | GUESTMSG_FLAG_COOKIE), si, di,
-               VMW_HYPERVISOR_PORT,
+               0,
                VMW_HYPERVISOR_MAGIC,
                eax, ebx, ecx, edx, si, di);
 
@@ -125,7 +123,7 @@ static int vmw_close_channel(struct rpc_channel *channel)
 
        VMW_PORT(VMW_PORT_CMD_CLOSE_CHANNEL,
                0, si, di,
-               (VMW_HYPERVISOR_PORT | (channel->channel_id << 16)),
+               channel->channel_id << 16,
                VMW_HYPERVISOR_MAGIC,
                eax, ebx, ecx, edx, si, di);
 
@@ -159,7 +157,8 @@ static unsigned long vmw_port_hb_out(struct rpc_channel *channel,
                VMW_PORT_HB_OUT(
                        (MESSAGE_STATUS_SUCCESS << 16) | VMW_PORT_CMD_HB_MSG,
                        msg_len, si, di,
-                       VMW_HYPERVISOR_HB_PORT | (channel->channel_id << 16),
+                       VMWARE_HYPERVISOR_HB | (channel->channel_id << 16) |
+                       VMWARE_HYPERVISOR_OUT,
                        VMW_HYPERVISOR_MAGIC, bp,
                        eax, ebx, ecx, edx, si, di);
 
@@ -180,7 +179,7 @@ static unsigned long vmw_port_hb_out(struct rpc_channel *channel,
 
                VMW_PORT(VMW_PORT_CMD_MSG | (MSG_TYPE_SENDPAYLOAD << 16),
                         word, si, di,
-                        VMW_HYPERVISOR_PORT | (channel->channel_id << 16),
+                        channel->channel_id << 16,
                         VMW_HYPERVISOR_MAGIC,
                         eax, ebx, ecx, edx, si, di);
        }
@@ -212,7 +211,7 @@ static unsigned long vmw_port_hb_in(struct rpc_channel *channel, char *reply,
                VMW_PORT_HB_IN(
                        (MESSAGE_STATUS_SUCCESS << 16) | VMW_PORT_CMD_HB_MSG,
                        reply_len, si, di,
-                       VMW_HYPERVISOR_HB_PORT | (channel->channel_id << 16),
+                       VMWARE_HYPERVISOR_HB | (channel->channel_id << 16),
                        VMW_HYPERVISOR_MAGIC, bp,
                        eax, ebx, ecx, edx, si, di);
 
@@ -229,7 +228,7 @@ static unsigned long vmw_port_hb_in(struct rpc_channel *channel, char *reply,
 
                VMW_PORT(VMW_PORT_CMD_MSG | (MSG_TYPE_RECVPAYLOAD << 16),
                         MESSAGE_STATUS_SUCCESS, si, di,
-                        VMW_HYPERVISOR_PORT | (channel->channel_id << 16),
+                        channel->channel_id << 16,
                         VMW_HYPERVISOR_MAGIC,
                         eax, ebx, ecx, edx, si, di);
 
@@ -268,7 +267,7 @@ static int vmw_send_msg(struct rpc_channel *channel, const char *msg)
 
                VMW_PORT(VMW_PORT_CMD_SENDSIZE,
                        msg_len, si, di,
-                       VMW_HYPERVISOR_PORT | (channel->channel_id << 16),
+                       channel->channel_id << 16,
                        VMW_HYPERVISOR_MAGIC,
                        eax, ebx, ecx, edx, si, di);
 
@@ -326,7 +325,7 @@ static int vmw_recv_msg(struct rpc_channel *channel, void **msg,
 
                VMW_PORT(VMW_PORT_CMD_RECVSIZE,
                        0, si, di,
-                       (VMW_HYPERVISOR_PORT | (channel->channel_id << 16)),
+                       channel->channel_id << 16,
                        VMW_HYPERVISOR_MAGIC,
                        eax, ebx, ecx, edx, si, di);
 
@@ -352,7 +351,7 @@ static int vmw_recv_msg(struct rpc_channel *channel, void **msg,
                                     !!(HIGH_WORD(ecx) & MESSAGE_STATUS_HB));
                if ((HIGH_WORD(ebx) & MESSAGE_STATUS_SUCCESS) == 0) {
                        kfree(reply);
-
+                       reply = NULL;
                        if ((HIGH_WORD(ebx) & MESSAGE_STATUS_CPT) != 0) {
                                /* A checkpoint occurred. Retry. */
                                continue;
@@ -370,13 +369,13 @@ static int vmw_recv_msg(struct rpc_channel *channel, void **msg,
 
                VMW_PORT(VMW_PORT_CMD_RECVSTATUS,
                        MESSAGE_STATUS_SUCCESS, si, di,
-                       (VMW_HYPERVISOR_PORT | (channel->channel_id << 16)),
+                       channel->channel_id << 16,
                        VMW_HYPERVISOR_MAGIC,
                        eax, ebx, ecx, edx, si, di);
 
                if ((HIGH_WORD(ecx) & MESSAGE_STATUS_SUCCESS) == 0) {
                        kfree(reply);
-
+                       reply = NULL;
                        if ((HIGH_WORD(ecx) & MESSAGE_STATUS_CPT) != 0) {
                                /* A checkpoint occurred. Retry. */
                                continue;
@@ -388,7 +387,7 @@ static int vmw_recv_msg(struct rpc_channel *channel, void **msg,
                break;
        }
 
-       if (retries == RETRIES)
+       if (!reply)
                return -EINVAL;
 
        *msg_len = reply_len;