* module.
*/
struct vmw_winsys_screen *
-vmw_winsys_create( int fd )
+vmw_winsys_create( int fd, boolean use_old_scanout_flag )
{
struct vmw_winsys_screen *vws = CALLOC_STRUCT(vmw_winsys_screen);
if (!vws)
goto out_no_vws;
vws->ioctl.drm_fd = fd;
+ vws->use_old_scanout_flag = use_old_scanout_flag;
+ debug_printf("%s: use_old_scanout_flag == %s\n", __FUNCTION__,
+ use_old_scanout_flag ? "true" : "false");
if (!vmw_ioctl_init(vws))
goto out_no_ioctl;
{
struct svga_winsys_screen base;
+ boolean use_old_scanout_flag;
+
struct {
volatile uint32_t *fifo_map;
uint64_t last_fence;
void vmw_ioctl_cleanup(struct vmw_winsys_screen *vws);
void vmw_pools_cleanup(struct vmw_winsys_screen *vws);
-struct vmw_winsys_screen *vmw_winsys_create(int fd);
+struct vmw_winsys_screen *vmw_winsys_create(int fd, boolean use_old_scanout_flag);
void vmw_winsys_destroy(struct vmw_winsys_screen *sws);
static struct dri1_api_version dri_compat = { 4, 0, 0 };
static struct dri1_api_version drm_required = { 0, 1, 0 };
static struct dri1_api_version drm_compat = { 0, 0, 0 };
+static struct dri1_api_version drm_scanout = { 0, 9, 0 };
static boolean
vmw_dri1_check_version(const struct dri1_api_version *cur,
struct vmw_winsys_screen *vws;
struct pipe_screen *screen;
struct dri1_create_screen_arg *dri1;
+ boolean use_old_scanout_flag = FALSE;
if (!arg || arg->mode == DRM_CREATE_NORMAL) {
struct dri1_api_version drm_ver;
drm_ver.major = ver->version_major;
drm_ver.minor = ver->version_minor;
+ drm_ver.patch_level = 0; /* ??? */
drmFreeVersion(ver);
if (!vmw_dri1_check_version(&drm_ver, &drm_required,
&drm_compat, "vmwgfx drm driver"))
return NULL;
+
+ if (!vmw_dri1_check_version(&drm_ver, &drm_scanout,
+ &drm_compat, "use old scanout field (not a error)"))
+ use_old_scanout_flag = TRUE;
}
if (arg != NULL) {
if (!vmw_dri1_check_version(&dri1->drm_version, &drm_required,
&drm_compat, "vmwgfx drm driver"))
return NULL;
+ if (!vmw_dri1_check_version(&dri1->drm_version, &drm_scanout,
+ &drm_compat, "use old scanout field (not a error)"))
+ use_old_scanout_flag = TRUE;
dri1->api = &dri1_api_hooks;
break;
default:
}
}
- vws = vmw_winsys_create( fd );
+ vws = vmw_winsys_create( fd, use_old_scanout_flag );
if (!vws)
goto out_no_vws;
uint32_t size;
};
+/* XXX: This isn't a real hardware flag, but just a hack for kernel to
+ * know about primary surfaces. In newer versions of the kernel
+ * interface the driver uses a special field.
+ */
+#define SVGA3D_SURFACE_HINT_SCANOUT (1 << 9)
+
static void
vmw_check_last_cmd(struct vmw_winsys_screen *vws)
{
vmw_printf("%s flags %d format %d\n", __FUNCTION__, flags, format);
memset(&s_arg, 0, sizeof(s_arg));
- req->flags = (uint32_t) flags;
+ if (vws->use_old_scanout_flag &&
+ (req->flags & SVGA3D_SURFACE_HINT_SCANOUT)) {
+ req->flags = (uint32_t) (flags & ~SVGA3D_SURFACE_HINT_SCANOUT);
+ req->scanout = false;
+ } else if (req->flags & SVGA3D_SURFACE_HINT_SCANOUT) {
+ req->flags = (uint32_t) (flags & ~SVGA3D_SURFACE_HINT_SCANOUT);
+ req->scanout = false;
+ } else {
+ req->flags = (uint32_t) flags;
+ req->scanout = false;
+ }
req->format = (uint32_t) format;
req->shareable = 1;