drm: use anon-inode instead of relying on cdevs
[platform/adaptation/renesas_rcar/renesas_kernel.git] / drivers / gpu / drm / qxl / qxl_ttm.c
index c7e7e65..c2cea48 100644 (file)
@@ -433,6 +433,7 @@ static int qxl_sync_obj_flush(void *sync_obj)
 
 static void qxl_sync_obj_unref(void **sync_obj)
 {
+       *sync_obj = NULL;
 }
 
 static void *qxl_sync_obj_ref(void *sync_obj)
@@ -518,8 +519,7 @@ int qxl_ttm_init(struct qxl_device *qdev)
                 ((unsigned)num_io_pages * PAGE_SIZE) / (1024 * 1024));
        DRM_INFO("qxl: %uM of Surface memory size\n",
                 (unsigned)qdev->surfaceram_size / (1024 * 1024));
-       if (unlikely(qdev->mman.bdev.dev_mapping == NULL))
-               qdev->mman.bdev.dev_mapping = qdev->ddev->dev_mapping;
+       qdev->mman.bdev.dev_mapping = qdev->ddev->anon_inode->i_mapping;
        r = qxl_ttm_debugfs_init(qdev);
        if (r) {
                DRM_ERROR("Failed to init debugfs\n");