All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Hellstrom <thellstrom@vmware.com>
To: dri-devel@lists.freedesktop.org, linux-graphics-maintainer@vmware.com
Cc: pv-drivers@vmware.com, Thomas Hellstrom <thellstrom@vmware.com>,
	Matthew Wilcox <willy@infradead.org>
Subject: [PATCH -fixes 5/5] drm/vmwgfx: Fix a buffer object eviction regression
Date: Thu, 13 Sep 2018 13:58:37 +0200	[thread overview]
Message-ID: <20180913115837.7746-5-thellstrom@vmware.com> (raw)
In-Reply-To: <20180913115837.7746-1-thellstrom@vmware.com>

Commit 4eb085e42fde ("drm/vmwgfx: Convert to new IDA API") indroduced
an incorrect return value from the function vmw_gmrid_man_get_node(),
when we run out if integer ids. Instead of returning 0 (meaning
non-fatal error) we forward the ida_simple_get error code -ENOSPC.
This causes TTM not to retry allocation after buffer eviction and
instead return -ENOSPC to user-space.

Fix this by returning 0 when ida_simple_get() returns -ENOSPC.

Tested using glretrace.

Cc: Matthew Wilcox <willy@infradead.org>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Deepak Rawat <drawat@vmware.com>
---
 drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c b/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c
index b93c558dd86e..a38a0c3777f7 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c
@@ -57,7 +57,7 @@ static int vmw_gmrid_man_get_node(struct ttm_mem_type_manager *man,
 
 	id = ida_alloc_max(&gman->gmr_ida, gman->max_gmr_ids - 1, GFP_KERNEL);
 	if (id < 0)
-		return id;
+		return (id == -ENOSPC ? 0 : id);
 
 	spin_lock(&gman->lock);
 
-- 
2.19.0.rc1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2018-09-13 11:59 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-13 11:58 [PATCH -fixes 1/5] drm/vmwgfx: don't check for old_crtc_state enable status Thomas Hellstrom
2018-09-13 11:58 ` [PATCH -fixes 2/5] drm/vmwgfx: limit screen size to stdu_max during check_modeset Thomas Hellstrom
2018-09-13 11:58 ` [PATCH -fixes 3/5] drm/vmwgfx: limit mode size for all display unit to texture_max Thomas Hellstrom
2018-09-13 11:58 ` [PATCH -fixes 4/5] drm/vmwgfx: Don't impose STDU limits on framebuffer size Thomas Hellstrom
2018-09-13 11:58 ` Thomas Hellstrom [this message]
2018-09-13 14:10   ` [PATCH -fixes 5/5] drm/vmwgfx: Fix a buffer object eviction regression Matthew Wilcox
2018-09-13 14:56     ` Thomas Hellstrom
2018-09-13 15:28       ` Matthew Wilcox
2018-09-13 16:52         ` Thomas Hellstrom
2018-09-13 17:38           ` Matthew Wilcox
2018-09-13 18:17             ` Thomas Hellstrom

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180913115837.7746-5-thellstrom@vmware.com \
    --to=thellstrom@vmware.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-graphics-maintainer@vmware.com \
    --cc=pv-drivers@vmware.com \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.