21 drm_gem_object_unreference_unlocked(cirrus_fb->
obj);
26 static int cirrus_user_framebuffer_create_handle(
struct drm_framebuffer *fb,
27 struct drm_file *file_priv,
34 .destroy = cirrus_user_framebuffer_destroy,
35 .create_handle = cirrus_user_framebuffer_create_handle,
41 struct drm_gem_object *obj)
47 DRM_ERROR(
"drm_framebuffer_init failed: %d\n", ret);
57 struct drm_file *filp,
60 struct drm_gem_object *obj;
74 cirrus_fb = kzalloc(
sizeof(*cirrus_fb),
GFP_KERNEL);
76 drm_gem_object_unreference_unlocked(obj);
82 drm_gem_object_unreference_unlocked(obj);
86 return &cirrus_fb->
base;
90 .fb_create = cirrus_user_framebuffer_create,
98 if (cdev->
mc.vram_base)
108 cdev->
mc.vram_size = 4 * 1024 * 1024;
111 "cirrusdrmfb_vram")) {
112 DRM_ERROR(
"can't reserve VRAM\n");
143 "cirrusdrmfb_mmio")) {
144 DRM_ERROR(
"can't reserve mmio registers\n");
153 ret = cirrus_vram_init(cdev);
165 cirrus_vram_fini(cdev);
181 dev->dev_private = (
void *)cdev;
185 dev_err(&dev->pdev->dev,
"Fatal error during GPU init: %d\n", r);
191 dev_err(&dev->pdev->dev,
"fatal err on mm init\n");
195 dev_err(&dev->pdev->dev,
"Fatal error during modeset init: %d\n", r);
197 dev->mode_config.funcs = (
void *)&cirrus_mode_funcs;
214 dev->dev_private =
NULL;
220 struct drm_gem_object **obj)
234 DRM_ERROR(
"failed to allocate GEM object\n");
237 *obj = &cirrusbo->
gem;
246 struct drm_gem_object *gobj;
258 drm_gem_object_unreference_unlocked(gobj);
305 return bo->
bo.addr_space_offset;
314 struct drm_gem_object *obj;
326 *offset = cirrus_bo_mmap_offset(bo);
328 drm_gem_object_unreference(obj);