aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nouveau_gem.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_gem.c')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_gem.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_gem.c b/drivers/gpu/drm/nouveau/nouveau_gem.c
index ed52a6f41613..30f542316944 100644
--- a/drivers/gpu/drm/nouveau/nouveau_gem.c
+++ b/drivers/gpu/drm/nouveau/nouveau_gem.c
@@ -23,12 +23,14 @@
23 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 * 24 *
25 */ 25 */
26#include <linux/dma-buf.h>
26#include "drmP.h" 27#include "drmP.h"
27#include "drm.h" 28#include "drm.h"
28 29
29#include "nouveau_drv.h" 30#include "nouveau_drv.h"
30#include "nouveau_drm.h" 31#include "nouveau_drm.h"
31#include "nouveau_dma.h" 32#include "nouveau_dma.h"
33#include "nouveau_fence.h"
32 34
33#define nouveau_gem_pushbuf_sync(chan) 0 35#define nouveau_gem_pushbuf_sync(chan) 0
34 36
@@ -53,6 +55,9 @@ nouveau_gem_object_del(struct drm_gem_object *gem)
53 nouveau_bo_unpin(nvbo); 55 nouveau_bo_unpin(nvbo);
54 } 56 }
55 57
58 if (gem->import_attach)
59 drm_prime_gem_destroy(gem, nvbo->bo.sg);
60
56 ttm_bo_unref(&bo); 61 ttm_bo_unref(&bo);
57 62
58 drm_gem_object_release(gem); 63 drm_gem_object_release(gem);
@@ -139,7 +144,7 @@ nouveau_gem_new(struct drm_device *dev, int size, int align, uint32_t domain,
139 flags |= TTM_PL_FLAG_SYSTEM; 144 flags |= TTM_PL_FLAG_SYSTEM;
140 145
141 ret = nouveau_bo_new(dev, size, align, flags, tile_mode, 146 ret = nouveau_bo_new(dev, size, align, flags, tile_mode,
142 tile_flags, pnvbo); 147 tile_flags, NULL, pnvbo);
143 if (ret) 148 if (ret)
144 return ret; 149 return ret;
145 nvbo = *pnvbo; 150 nvbo = *pnvbo;
@@ -704,7 +709,7 @@ nouveau_gem_ioctl_pushbuf(struct drm_device *dev, void *data,
704 } 709 }
705 710
706 if (chan->dma.ib_max) { 711 if (chan->dma.ib_max) {
707 ret = nouveau_dma_wait(chan, req->nr_push + 1, 6); 712 ret = nouveau_dma_wait(chan, req->nr_push + 1, 16);
708 if (ret) { 713 if (ret) {
709 NV_INFO(dev, "nv50cal_space: %d\n", ret); 714 NV_INFO(dev, "nv50cal_space: %d\n", ret);
710 goto out; 715 goto out;
@@ -774,7 +779,7 @@ nouveau_gem_ioctl_pushbuf(struct drm_device *dev, void *data,
774 } 779 }
775 } 780 }
776 781
777 ret = nouveau_fence_new(chan, &fence, true); 782 ret = nouveau_fence_new(chan, &fence);
778 if (ret) { 783 if (ret) {
779 NV_ERROR(dev, "error fencing pushbuf: %d\n", ret); 784 NV_ERROR(dev, "error fencing pushbuf: %d\n", ret);
780 WIND_RING(chan); 785 WIND_RING(chan);