dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] A couple of vmwgfx fixes
@ 2013-10-09  8:42 Thomas Hellstrom
  2013-10-09  8:42 ` [PATCH 1/2] drm/vmwgfx: Don't put resources with invalid id's on lru list Thomas Hellstrom
  2013-10-09  8:42 ` [PATCH 2/2] drm/vmwgfx: Don't kill clients on VT switch Thomas Hellstrom
  0 siblings, 2 replies; 3+ messages in thread
From: Thomas Hellstrom @ 2013-10-09  8:42 UTC (permalink / raw)
  To: airlied, airlied; +Cc: dri-devel

The log messages speak for themselves

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/2] drm/vmwgfx: Don't put resources with invalid id's on lru list
  2013-10-09  8:42 [PATCH 0/2] A couple of vmwgfx fixes Thomas Hellstrom
@ 2013-10-09  8:42 ` Thomas Hellstrom
  2013-10-09  8:42 ` [PATCH 2/2] drm/vmwgfx: Don't kill clients on VT switch Thomas Hellstrom
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Hellstrom @ 2013-10-09  8:42 UTC (permalink / raw)
  To: airlied, airlied; +Cc: dri-devel, Thomas Hellstrom, stable

The evict code may try to swap them out causing a BUG in the destroy
function.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Cc: stable@vger.kernel.org
---
 drivers/gpu/drm/vmwgfx/vmwgfx_resource.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_resource.c b/drivers/gpu/drm/vmwgfx/vmwgfx_resource.c
index 0e67cf4..37fb4be 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_resource.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_resource.c
@@ -970,7 +970,7 @@ void vmw_resource_unreserve(struct vmw_resource *res,
 	if (new_backup)
 		res->backup_offset = new_backup_offset;
 
-	if (!res->func->may_evict)
+	if (!res->func->may_evict || res->id == -1)
 		return;
 
 	write_lock(&dev_priv->resource_lock);
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] drm/vmwgfx: Don't kill clients on VT switch
  2013-10-09  8:42 [PATCH 0/2] A couple of vmwgfx fixes Thomas Hellstrom
  2013-10-09  8:42 ` [PATCH 1/2] drm/vmwgfx: Don't put resources with invalid id's on lru list Thomas Hellstrom
@ 2013-10-09  8:42 ` Thomas Hellstrom
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Hellstrom @ 2013-10-09  8:42 UTC (permalink / raw)
  To: airlied, airlied; +Cc: dri-devel, Thomas Hellstrom, stable

DRI clients that tried to grab the TTM lock when the master (X server) was
switched away during a VT switch were sent the SIGTERM signal by the
kernel. Fix this so that they are only sent that signal when the master has
exited.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Cc: stable@vger.kernel.org
---
 drivers/gpu/drm/vmwgfx/vmwgfx_drv.c |   17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
index 1a90f0a..0508f93 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
@@ -740,9 +740,17 @@ static void vmw_postclose(struct drm_device *dev,
 	struct vmw_fpriv *vmw_fp;
 
 	vmw_fp = vmw_fpriv(file_priv);
-	ttm_object_file_release(&vmw_fp->tfile);
-	if (vmw_fp->locked_master)
+
+	if (vmw_fp->locked_master) {
+		struct vmw_master *vmaster =
+			vmw_master(vmw_fp->locked_master);
+
+		ttm_lock_set_kill(&vmaster->lock, true, SIGTERM);
+		ttm_vt_unlock(&vmaster->lock);
 		drm_master_put(&vmw_fp->locked_master);
+	}
+
+	ttm_object_file_release(&vmw_fp->tfile);
 	kfree(vmw_fp);
 }
 
@@ -925,14 +933,13 @@ static void vmw_master_drop(struct drm_device *dev,
 
 	vmw_fp->locked_master = drm_master_get(file_priv->master);
 	ret = ttm_vt_lock(&vmaster->lock, false, vmw_fp->tfile);
-	vmw_execbuf_release_pinned_bo(dev_priv);
-
 	if (unlikely((ret != 0))) {
 		DRM_ERROR("Unable to lock TTM at VT switch.\n");
 		drm_master_put(&vmw_fp->locked_master);
 	}
 
-	ttm_lock_set_kill(&vmaster->lock, true, SIGTERM);
+	ttm_lock_set_kill(&vmaster->lock, false, SIGTERM);
+	vmw_execbuf_release_pinned_bo(dev_priv);
 
 	if (!dev_priv->enable_fb) {
 		ret = ttm_bo_evict_mm(&dev_priv->bdev, TTM_PL_VRAM);
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-10-09  8:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-09  8:42 [PATCH 0/2] A couple of vmwgfx fixes Thomas Hellstrom
2013-10-09  8:42 ` [PATCH 1/2] drm/vmwgfx: Don't put resources with invalid id's on lru list Thomas Hellstrom
2013-10-09  8:42 ` [PATCH 2/2] drm/vmwgfx: Don't kill clients on VT switch Thomas Hellstrom

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).