diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2014-04-12 06:08:23 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2014-04-12 06:08:23 +0000 |
commit | 30865f853ac6d2a93595a2a79dd56260ac3846e0 (patch) | |
tree | 0225485052f75e393191b4b4a17b60599e64be9e /sys/dev/pci/drm | |
parent | 12a8047fcc3a27dfbe746b0e332c8b75162d4a65 (diff) |
drm/ttm: don't oops if no invalidate_caches()
From Rob Clark
8af4707afcb6d191b9cc75dfd73b9550e8276253 in ubuntu 3.8
9ef7506f7eff3fc42724269f62e30164c141661f in mainline linux
Diffstat (limited to 'sys/dev/pci/drm')
-rw-r--r-- | sys/dev/pci/drm/ttm/ttm_bo.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/dev/pci/drm/ttm/ttm_bo.c b/sys/dev/pci/drm/ttm/ttm_bo.c index 9d1942f8c14..30e1eb9c20f 100644 --- a/sys/dev/pci/drm/ttm/ttm_bo.c +++ b/sys/dev/pci/drm/ttm/ttm_bo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ttm_bo.c,v 1.7 2014/02/10 02:35:09 jsg Exp $ */ +/* $OpenBSD: ttm_bo.c,v 1.8 2014/04/12 06:08:22 jsg Exp $ */ /************************************************************************** * * Copyright (c) 2006-2009 VMware, Inc., Palo Alto, CA., USA @@ -450,9 +450,11 @@ static int ttm_bo_handle_move_mem(struct ttm_buffer_object *bo, moved: if (bo->evicted) { - ret = bdev->driver->invalidate_caches(bdev, bo->mem.placement); - if (ret) - printf("Can not flush read caches\n"); + if (bdev->driver->invalidate_caches) { + ret = bdev->driver->invalidate_caches(bdev, bo->mem.placement); + if (ret) + printf("Can not flush read caches\n"); + } bo->evicted = false; } |