#include "pipe/p_defines.h"
#include "svga_winsys.h"
#include "vmw_msg.h"
+#include "vmwgfx_drm.h"
+#include "vmw_screen.h"
+#include "xf86drm.h"
#define MESSAGE_STATUS_SUCCESS 0x0001
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;
sprintf(msg, "log %s", log);
- if (!(ret = vmw_open_channel(&channel, RPCI_PROTOCOL_NUM))) {
- ret = vmw_send_msg(&channel, msg);
- vmw_close_channel(&channel);
+ if (vws->ioctl.have_drm_2_17) {
+ struct drm_vmw_msg_arg msg_arg;
+
+ memset(&msg_arg, 0, sizeof(msg_arg));
+ msg_arg.send = (uint64_t) (unsigned long) (msg);
+ msg_arg.send_only = 1;
+
+ ret = drmCommandWriteRead(vws->ioctl.drm_fd, DRM_VMW_MSG,
+ &msg_arg, sizeof(msg_arg));
+
+ } else {
+ if (!(ret = vmw_open_channel(&channel, RPCI_PROTOCOL_NUM))) {
+ ret = vmw_send_msg(&channel, msg);
+ vmw_close_channel(&channel);
+ }
}
if (ret)
boolean have_drm_2_9;
uint32_t drm_execbuf_version;
boolean have_drm_2_15;
+ boolean have_drm_2_16;
+ boolean have_drm_2_17;
} ioctl;
struct {
drmVersionPtr version;
boolean drm_gb_capable;
boolean have_drm_2_5;
- boolean have_drm_2_16;
const char *getenv_val;
VMW_FUNC;
(version->version_major == 2 && version->version_minor > 8);
vws->ioctl.have_drm_2_15 = version->version_major > 2 ||
(version->version_major == 2 && version->version_minor > 14);
- have_drm_2_16 = version->version_major > 2 ||
+ vws->ioctl.have_drm_2_16 = version->version_major > 2 ||
(version->version_major == 2 && version->version_minor > 15);
+ vws->ioctl.have_drm_2_17 = version->version_major > 2 ||
+ (version->version_major == 2 && version->version_minor > 16);
vws->ioctl.drm_execbuf_version = vws->ioctl.have_drm_2_9 ? 2 : 1;
else
vws->ioctl.num_cap_3d = SVGA3D_DEVCAP_MAX;
- if (have_drm_2_16) {
+ if (vws->ioctl.have_drm_2_16) {
vws->base.have_coherent = TRUE;
getenv_val = getenv("SVGA_FORCE_COHERENT");
if (getenv_val && strcmp(getenv_val, "0") != 0)
#define DRM_VMW_CREATE_EXTENDED_CONTEXT 26
#define DRM_VMW_GB_SURFACE_CREATE_EXT 27
#define DRM_VMW_GB_SURFACE_REF_EXT 28
+#define DRM_VMW_MSG 29
/*************************************************************************/
/**
struct drm_vmw_surface_arg req;
};
+/**
+ * struct drm_vmw_msg_arg
+ *
+ * @send: Pointer to user-space msg string (null terminated).
+ * @receive: Pointer to user-space receive buffer.
+ * @send_only: Boolean whether this is only sending or receiving too.
+ *
+ * Argument to the DRM_VMW_MSG ioctl.
+ */
+struct drm_vmw_msg_arg {
+ __u64 send;
+ __u64 receive;
+ __s32 send_only;
+ __u32 receive_len;
+};
+
#if defined(__cplusplus)
}
#endif