summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2019-10-17 15:26:38 +0200
committerGerd Hoffmann <kraxel@redhat.com>2019-10-22 11:34:03 +0200
commit8ee2f956c918e2de0ee85f01b94d1e0ff31b19b8 (patch)
tree219b62fa44d2de83e278e0ca0cbe0be6c5aa1574 /drivers/gpu/drm
parentdb262087833f5b750d38b1423ab61e08c1a16947 (diff)
drm/qxl: allocate small objects top-down
qxl uses small buffer objects for qxl commands. Allocate them top-down to reduce fragmentation. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/20191017132638.9693-6-kraxel@redhat.com
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r--drivers/gpu/drm/qxl/qxl_object.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/gpu/drm/qxl/qxl_object.c b/drivers/gpu/drm/qxl/qxl_object.c
index 927ab917b834..ad336c98a0cf 100644
--- a/drivers/gpu/drm/qxl/qxl_object.c
+++ b/drivers/gpu/drm/qxl/qxl_object.c
@@ -54,9 +54,14 @@ bool qxl_ttm_bo_is_qxl_bo(struct ttm_buffer_object *bo)
void qxl_ttm_placement_from_domain(struct qxl_bo *qbo, u32 domain, bool pinned)
{
u32 c = 0;
- u32 pflag = pinned ? TTM_PL_FLAG_NO_EVICT : 0;
+ u32 pflag = 0;
unsigned int i;
+ if (pinned)
+ pflag |= TTM_PL_FLAG_NO_EVICT;
+ if (qbo->tbo.base.size <= PAGE_SIZE)
+ pflag |= TTM_PL_FLAG_TOPDOWN;
+
qbo->placement.placement = qbo->placements;
qbo->placement.busy_placement = qbo->placements;
if (domain == QXL_GEM_DOMAIN_VRAM)