Merge v5.14-rc3 into usb-next
[linux-2.6-microblaze.git] / drivers / gpu / drm / qxl / qxl_ttm.c
index 47afe95..37a1b6a 100644 (file)
@@ -32,6 +32,7 @@
 #include <drm/ttm/ttm_bo_api.h>
 #include <drm/ttm/ttm_bo_driver.h>
 #include <drm/ttm/ttm_placement.h>
+#include <drm/ttm/ttm_range_manager.h>
 
 #include "qxl_drv.h"
 #include "qxl_object.h"
@@ -126,12 +127,12 @@ static void qxl_bo_move_notify(struct ttm_buffer_object *bo,
        struct qxl_bo *qbo;
        struct qxl_device *qdev;
 
-       if (!qxl_ttm_bo_is_qxl_bo(bo))
+       if (!qxl_ttm_bo_is_qxl_bo(bo) || !bo->resource)
                return;
        qbo = to_qxl_bo(bo);
        qdev = to_qxl(qbo->tbo.base.dev);
 
-       if (bo->mem.mem_type == TTM_PL_PRIV && qbo->surface_id)
+       if (bo->resource->mem_type == TTM_PL_PRIV && qbo->surface_id)
                qxl_surface_evict(qdev, qbo, new_mem ? true : false);
 }
 
@@ -140,7 +141,7 @@ static int qxl_bo_move(struct ttm_buffer_object *bo, bool evict,
                       struct ttm_resource *new_mem,
                       struct ttm_place *hop)
 {
-       struct ttm_resource *old_mem = &bo->mem;
+       struct ttm_resource *old_mem = bo->resource;
        int ret;
 
        qxl_bo_move_notify(bo, new_mem);