summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2018-03-23 06:18:48 +1000
committerDave Airlie <airlied@redhat.com>2018-03-23 06:18:48 +1000
commit2a2553cc45c889f15a1df0355891a809f17ca43d (patch)
treee5664857265d4c1d47c5191ea0b71d569ba69613 /drivers/gpu/drm/vmwgfx/vmwgfx_msg.c
parentf3924ae723d84746546bd74bdefc99c17da2a467 (diff)
parent43bfefedd0281ef476f8154397cd283a710d8baf (diff)
Merge branch 'vmwgfx-next' of git://people.freedesktop.org/~thomash/linux into drm-next
A relative large set of various improvements for vmwgfx. Some of them have been around for a while, some are relatively new, but functionality should have been tested in our standalone repo. * 'vmwgfx-next' of git://people.freedesktop.org/~thomash/linux: drm/vmwgfx: Bump version patchlevel and date drm/vmwgfx: use monotonic event timestamps drm/vmwgfx: Unpin the screen object backup buffer when not used drm/vmwgfx: Stricter count of legacy surface device resources drm/vmwgfx: Use kasprintf drm/vmwgfx: Get rid of the device-private suspended member drm/vmwgfx: Improve on hibernation drm/vmwgfx: Avoid pinning fbdev framebuffers drm/vmwgfx: Fix multiple command buffer context use drm/vmwgfx: Use the cpu blit utility for framebuffer to screen target blits drm/vmwgfx: Add a cpu blit utility that can be used for page-backed bos drm/ttm: Export the ttm_k[un]map_atomic_prot API. drm/ttm: Clean up kmap_atomic_prot selection code drm/vmwgfx: Cursor update fixes drm/vmwgfx: Send the correct nonblock option for atomic_commit drm/vmwgfx: Move the stdu vblank event to atomic function drm/vmwgfx: Move screen object page flip to atomic function drm/vmwgfx: Remove drm_crtc_arm_vblank_event from atomic flush drm/vmwgfx: Move surface copy cmd to atomic function drm/vmwgfx: Avoid iterating over display unit if crtc is available
Diffstat (limited to 'drivers/gpu/drm/vmwgfx/vmwgfx_msg.c')
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_msg.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c b/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c
index 97000996b8dc..cdff99211602 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c
@@ -328,7 +328,7 @@ int vmw_host_get_guestinfo(const char *guest_info_param,
{
struct rpc_channel channel;
char *msg, *reply = NULL;
- size_t msg_len, reply_len = 0;
+ size_t reply_len = 0;
int ret = 0;
@@ -338,15 +338,12 @@ int vmw_host_get_guestinfo(const char *guest_info_param,
if (!guest_info_param || !length)
return -EINVAL;
- msg_len = strlen(guest_info_param) + strlen("info-get ") + 1;
- msg = kzalloc(msg_len, GFP_KERNEL);
+ msg = kasprintf(GFP_KERNEL, "info-get %s", guest_info_param);
if (!msg) {
DRM_ERROR("Cannot allocate memory to get %s", guest_info_param);
return -ENOMEM;
}
- sprintf(msg, "info-get %s", guest_info_param);
-
if (vmw_open_channel(&channel, RPCI_PROTOCOL_NUM) ||
vmw_send_msg(&channel, msg) ||
vmw_recv_msg(&channel, (void *) &reply, &reply_len) ||
@@ -388,7 +385,6 @@ int vmw_host_log(const char *log)
{
struct rpc_channel channel;
char *msg;
- int msg_len;
int ret = 0;
@@ -398,15 +394,12 @@ int vmw_host_log(const char *log)
if (!log)
return ret;
- msg_len = strlen(log) + strlen("log ") + 1;
- msg = kzalloc(msg_len, GFP_KERNEL);
+ msg = kasprintf(GFP_KERNEL, "log %s", log);
if (!msg) {
DRM_ERROR("Cannot allocate memory for log message\n");
return -ENOMEM;
}
- sprintf(msg, "log %s", log);
-
if (vmw_open_channel(&channel, RPCI_PROTOCOL_NUM) ||
vmw_send_msg(&channel, msg) ||
vmw_close_channel(&channel)) {