| .. | .. |
|---|
| 23 | 23 | * Alon Levy |
|---|
| 24 | 24 | */ |
|---|
| 25 | 25 | |
|---|
| 26 | | -#include <drm/drmP.h> |
|---|
| 27 | 26 | #include <drm/drm.h> |
|---|
| 28 | 27 | |
|---|
| 29 | 28 | #include "qxl_drv.h" |
|---|
| .. | .. |
|---|
| 35 | 34 | struct qxl_device *qdev; |
|---|
| 36 | 35 | struct ttm_buffer_object *tbo; |
|---|
| 37 | 36 | |
|---|
| 38 | | - qdev = (struct qxl_device *)gobj->dev->dev_private; |
|---|
| 37 | + qdev = to_qxl(gobj->dev); |
|---|
| 39 | 38 | |
|---|
| 40 | 39 | qxl_surface_evict(qdev, qobj, false); |
|---|
| 41 | 40 | |
|---|
| 42 | 41 | tbo = &qobj->tbo; |
|---|
| 43 | | - ttm_bo_unref(&tbo); |
|---|
| 42 | + ttm_bo_put(tbo); |
|---|
| 44 | 43 | } |
|---|
| 45 | 44 | |
|---|
| 46 | 45 | int qxl_gem_object_create(struct qxl_device *qdev, int size, |
|---|
| .. | .. |
|---|
| 56 | 55 | /* At least align on page size */ |
|---|
| 57 | 56 | if (alignment < PAGE_SIZE) |
|---|
| 58 | 57 | alignment = PAGE_SIZE; |
|---|
| 59 | | - r = qxl_bo_create(qdev, size, kernel, false, initial_domain, surf, &qbo); |
|---|
| 58 | + r = qxl_bo_create(qdev, size, kernel, false, initial_domain, 0, surf, &qbo); |
|---|
| 60 | 59 | if (r) { |
|---|
| 61 | 60 | if (r != -ERESTARTSYS) |
|---|
| 62 | 61 | DRM_ERROR( |
|---|
| .. | .. |
|---|
| 64 | 63 | size, initial_domain, alignment, r); |
|---|
| 65 | 64 | return r; |
|---|
| 66 | 65 | } |
|---|
| 67 | | - *obj = &qbo->gem_base; |
|---|
| 66 | + *obj = &qbo->tbo.base; |
|---|
| 68 | 67 | |
|---|
| 69 | 68 | mutex_lock(&qdev->gem.mutex); |
|---|
| 70 | 69 | list_add_tail(&qbo->list, &qdev->gem.objects); |
|---|
| .. | .. |
|---|
| 98 | 97 | return r; |
|---|
| 99 | 98 | /* drop reference from allocate - handle holds it now */ |
|---|
| 100 | 99 | *qobj = gem_to_qxl_bo(gobj); |
|---|
| 101 | | - drm_gem_object_put_unlocked(gobj); |
|---|
| 100 | + drm_gem_object_put(gobj); |
|---|
| 102 | 101 | return 0; |
|---|
| 103 | 102 | } |
|---|
| 104 | 103 | |
|---|