38 #define to_exynos_fb(x) container_of(x, struct exynos_drm_fb, fb)
58 DRM_DEBUG_KMS(
"%s\n", __FILE__);
63 struct drm_gem_object *obj;
69 drm_gem_object_unreference_unlocked(obj);
77 struct drm_file *file_priv,
82 DRM_DEBUG_KMS(
"%s\n", __FILE__);
89 struct drm_file *file_priv,
unsigned flags,
93 DRM_DEBUG_KMS(
"%s\n", __FILE__);
101 .destroy = exynos_drm_fb_destroy,
102 .create_handle = exynos_drm_fb_create_handle,
103 .dirty = exynos_drm_fb_dirty,
128 struct drm_gem_object *obj)
133 exynos_fb = kzalloc(
sizeof(*exynos_fb),
GFP_KERNEL);
135 DRM_ERROR(
"failed to allocate exynos drm framebuffer\n");
141 DRM_ERROR(
"failed to initialize framebuffer\n");
148 return &exynos_fb->
fb;
153 unsigned int cnt = 0;
189 exynos_user_fb_create(
struct drm_device *
dev,
struct drm_file *file_priv,
192 struct drm_gem_object *obj;
197 DRM_DEBUG_KMS(
"%s\n", __FILE__);
201 DRM_ERROR(
"failed to lookup gem object\n");
207 drm_gem_object_unreference_unlocked(obj);
212 exynos_fb->
buf_cnt = exynos_drm_format_num_buffers(mode_cmd);
214 DRM_DEBUG_KMS(
"buf_cnt = %d\n", exynos_fb->
buf_cnt);
216 for (i = 1; i < exynos_fb->
buf_cnt; i++) {
220 DRM_ERROR(
"failed to lookup gem object\n");
221 exynos_drm_fb_destroy(fb);
237 DRM_DEBUG_KMS(
"%s\n", __FILE__);
246 DRM_DEBUG_KMS(
"vaddr = 0x%lx, dma_addr = 0x%lx\n",
247 (
unsigned long)buffer->
kvaddr,
253 static void exynos_drm_output_poll_changed(
struct drm_device *dev)
263 .fb_create = exynos_user_fb_create,
264 .output_poll_changed = exynos_drm_output_poll_changed,
269 dev->mode_config.min_width = 0;
270 dev->mode_config.min_height = 0;
277 dev->mode_config.max_width = 4096;
278 dev->mode_config.max_height = 4096;
280 dev->mode_config.funcs = &exynos_drm_mode_config_funcs;