Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 1 | /* exynos_drm_fb.c |
| 2 | * |
| 3 | * Copyright (c) 2011 Samsung Electronics Co., Ltd. |
| 4 | * Authors: |
| 5 | * Inki Dae <inki.dae@samsung.com> |
| 6 | * Joonyoung Shim <jy0922.shim@samsung.com> |
| 7 | * Seung-Woo Kim <sw0312.kim@samsung.com> |
| 8 | * |
Inki Dae | d81aecb | 2012-12-18 02:30:17 +0900 | [diff] [blame] | 9 | * This program is free software; you can redistribute it and/or modify it |
| 10 | * under the terms of the GNU General Public License as published by the |
| 11 | * Free Software Foundation; either version 2 of the License, or (at your |
| 12 | * option) any later version. |
Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 13 | */ |
| 14 | |
David Howells | 760285e | 2012-10-02 18:01:07 +0100 | [diff] [blame] | 15 | #include <drm/drmP.h> |
| 16 | #include <drm/drm_crtc.h> |
| 17 | #include <drm/drm_crtc_helper.h> |
| 18 | #include <drm/drm_fb_helper.h> |
Inki Dae | 0519f9a | 2012-10-20 07:53:42 -0700 | [diff] [blame] | 19 | #include <uapi/drm/exynos_drm.h> |
Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 20 | |
Seung-Woo Kim | 7db3eba | 2011-10-18 16:58:05 +0900 | [diff] [blame] | 21 | #include "exynos_drm_drv.h" |
Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 22 | #include "exynos_drm_fb.h" |
Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 23 | #include "exynos_drm_gem.h" |
Inki Dae | 0519f9a | 2012-10-20 07:53:42 -0700 | [diff] [blame] | 24 | #include "exynos_drm_iommu.h" |
Inki Dae | 1daa892 | 2012-11-22 17:41:23 +0900 | [diff] [blame] | 25 | #include "exynos_drm_encoder.h" |
Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 26 | |
| 27 | #define to_exynos_fb(x) container_of(x, struct exynos_drm_fb, fb) |
| 28 | |
| 29 | /* |
| 30 | * exynos specific framebuffer structure. |
| 31 | * |
| 32 | * @fb: drm framebuffer obejct. |
Inki Dae | 01ed812 | 2012-08-20 20:05:56 +0900 | [diff] [blame] | 33 | * @buf_cnt: a buffer count to drm framebuffer. |
Seung-Woo Kim | 229d353 | 2011-12-15 14:36:22 +0900 | [diff] [blame] | 34 | * @exynos_gem_obj: array of exynos specific gem object containing a gem object. |
Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 35 | */ |
| 36 | struct exynos_drm_fb { |
| 37 | struct drm_framebuffer fb; |
Inki Dae | 01ed812 | 2012-08-20 20:05:56 +0900 | [diff] [blame] | 38 | unsigned int buf_cnt; |
Seung-Woo Kim | 229d353 | 2011-12-15 14:36:22 +0900 | [diff] [blame] | 39 | struct exynos_drm_gem_obj *exynos_gem_obj[MAX_FB_BUFFER]; |
Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 40 | }; |
| 41 | |
Inki Dae | 0519f9a | 2012-10-20 07:53:42 -0700 | [diff] [blame] | 42 | static int check_fb_gem_memory_type(struct drm_device *drm_dev, |
| 43 | struct exynos_drm_gem_obj *exynos_gem_obj) |
| 44 | { |
| 45 | unsigned int flags; |
| 46 | |
| 47 | /* |
| 48 | * if exynos drm driver supports iommu then framebuffer can use |
| 49 | * all the buffer types. |
| 50 | */ |
| 51 | if (is_drm_iommu_supported(drm_dev)) |
| 52 | return 0; |
| 53 | |
| 54 | flags = exynos_gem_obj->flags; |
| 55 | |
| 56 | /* |
| 57 | * without iommu support, not support physically non-continuous memory |
| 58 | * for framebuffer. |
| 59 | */ |
| 60 | if (IS_NONCONTIG_BUFFER(flags)) { |
| 61 | DRM_ERROR("cannot use this gem memory type for fb.\n"); |
| 62 | return -EINVAL; |
| 63 | } |
| 64 | |
| 65 | return 0; |
| 66 | } |
| 67 | |
Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 68 | static void exynos_drm_fb_destroy(struct drm_framebuffer *fb) |
| 69 | { |
| 70 | struct exynos_drm_fb *exynos_fb = to_exynos_fb(fb); |
Laurent Pinchart | 07b6835 | 2012-05-16 17:08:56 +0200 | [diff] [blame] | 71 | unsigned int i; |
Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 72 | |
| 73 | DRM_DEBUG_KMS("%s\n", __FILE__); |
| 74 | |
Inki Dae | 1daa892 | 2012-11-22 17:41:23 +0900 | [diff] [blame] | 75 | /* make sure that overlay data are updated before relesing fb. */ |
| 76 | exynos_drm_encoder_complete_scanout(fb); |
| 77 | |
Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 78 | drm_framebuffer_cleanup(fb); |
| 79 | |
Laurent Pinchart | 07b6835 | 2012-05-16 17:08:56 +0200 | [diff] [blame] | 80 | for (i = 0; i < ARRAY_SIZE(exynos_fb->exynos_gem_obj); i++) { |
| 81 | struct drm_gem_object *obj; |
| 82 | |
| 83 | if (exynos_fb->exynos_gem_obj[i] == NULL) |
| 84 | continue; |
| 85 | |
| 86 | obj = &exynos_fb->exynos_gem_obj[i]->base; |
| 87 | drm_gem_object_unreference_unlocked(obj); |
| 88 | } |
| 89 | |
Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 90 | kfree(exynos_fb); |
| 91 | exynos_fb = NULL; |
| 92 | } |
| 93 | |
| 94 | static int exynos_drm_fb_create_handle(struct drm_framebuffer *fb, |
| 95 | struct drm_file *file_priv, |
| 96 | unsigned int *handle) |
| 97 | { |
| 98 | struct exynos_drm_fb *exynos_fb = to_exynos_fb(fb); |
| 99 | |
| 100 | DRM_DEBUG_KMS("%s\n", __FILE__); |
| 101 | |
Inki Dae | b9ede27 | 2013-01-29 17:51:09 +0900 | [diff] [blame] | 102 | /* This fb should have only one gem object. */ |
| 103 | if (WARN_ON(exynos_fb->buf_cnt != 1)) |
| 104 | return -EINVAL; |
| 105 | |
Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 106 | return drm_gem_handle_create(file_priv, |
Seung-Woo Kim | 229d353 | 2011-12-15 14:36:22 +0900 | [diff] [blame] | 107 | &exynos_fb->exynos_gem_obj[0]->base, handle); |
Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 108 | } |
| 109 | |
| 110 | static int exynos_drm_fb_dirty(struct drm_framebuffer *fb, |
| 111 | struct drm_file *file_priv, unsigned flags, |
| 112 | unsigned color, struct drm_clip_rect *clips, |
| 113 | unsigned num_clips) |
| 114 | { |
| 115 | DRM_DEBUG_KMS("%s\n", __FILE__); |
| 116 | |
| 117 | /* TODO */ |
| 118 | |
| 119 | return 0; |
| 120 | } |
| 121 | |
| 122 | static struct drm_framebuffer_funcs exynos_drm_fb_funcs = { |
| 123 | .destroy = exynos_drm_fb_destroy, |
| 124 | .create_handle = exynos_drm_fb_create_handle, |
| 125 | .dirty = exynos_drm_fb_dirty, |
| 126 | }; |
| 127 | |
Inki Dae | 01ed812 | 2012-08-20 20:05:56 +0900 | [diff] [blame] | 128 | void exynos_drm_fb_set_buf_cnt(struct drm_framebuffer *fb, |
| 129 | unsigned int cnt) |
| 130 | { |
| 131 | struct exynos_drm_fb *exynos_fb; |
| 132 | |
| 133 | exynos_fb = to_exynos_fb(fb); |
| 134 | |
| 135 | exynos_fb->buf_cnt = cnt; |
| 136 | } |
| 137 | |
| 138 | unsigned int exynos_drm_fb_get_buf_cnt(struct drm_framebuffer *fb) |
| 139 | { |
| 140 | struct exynos_drm_fb *exynos_fb; |
| 141 | |
| 142 | exynos_fb = to_exynos_fb(fb); |
| 143 | |
| 144 | return exynos_fb->buf_cnt; |
| 145 | } |
| 146 | |
Joonyoung Shim | e1533c0 | 2011-12-13 14:46:57 +0900 | [diff] [blame] | 147 | struct drm_framebuffer * |
| 148 | exynos_drm_framebuffer_init(struct drm_device *dev, |
| 149 | struct drm_mode_fb_cmd2 *mode_cmd, |
| 150 | struct drm_gem_object *obj) |
Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 151 | { |
| 152 | struct exynos_drm_fb *exynos_fb; |
Inki Dae | 0519f9a | 2012-10-20 07:53:42 -0700 | [diff] [blame] | 153 | struct exynos_drm_gem_obj *exynos_gem_obj; |
Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 154 | int ret; |
| 155 | |
Inki Dae | 0519f9a | 2012-10-20 07:53:42 -0700 | [diff] [blame] | 156 | exynos_gem_obj = to_exynos_gem_obj(obj); |
| 157 | |
| 158 | ret = check_fb_gem_memory_type(dev, exynos_gem_obj); |
| 159 | if (ret < 0) { |
| 160 | DRM_ERROR("cannot use this gem memory type for fb.\n"); |
| 161 | return ERR_PTR(-EINVAL); |
| 162 | } |
| 163 | |
Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 164 | exynos_fb = kzalloc(sizeof(*exynos_fb), GFP_KERNEL); |
| 165 | if (!exynos_fb) { |
Joonyoung Shim | e1533c0 | 2011-12-13 14:46:57 +0900 | [diff] [blame] | 166 | DRM_ERROR("failed to allocate exynos drm framebuffer\n"); |
Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 167 | return ERR_PTR(-ENOMEM); |
| 168 | } |
| 169 | |
Daniel Vetter | f2c0095 | 2012-12-14 13:39:03 +0900 | [diff] [blame] | 170 | drm_helper_mode_fill_fb_struct(&exynos_fb->fb, mode_cmd); |
Inki Dae | 0519f9a | 2012-10-20 07:53:42 -0700 | [diff] [blame] | 171 | exynos_fb->exynos_gem_obj[0] = exynos_gem_obj; |
| 172 | |
Joonyoung Shim | e1533c0 | 2011-12-13 14:46:57 +0900 | [diff] [blame] | 173 | ret = drm_framebuffer_init(dev, &exynos_fb->fb, &exynos_drm_fb_funcs); |
Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 174 | if (ret) { |
Joonyoung Shim | e1533c0 | 2011-12-13 14:46:57 +0900 | [diff] [blame] | 175 | DRM_ERROR("failed to initialize framebuffer\n"); |
| 176 | return ERR_PTR(ret); |
Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 177 | } |
| 178 | |
Joonyoung Shim | e1533c0 | 2011-12-13 14:46:57 +0900 | [diff] [blame] | 179 | return &exynos_fb->fb; |
Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 180 | } |
| 181 | |
Inki Dae | 01ed812 | 2012-08-20 20:05:56 +0900 | [diff] [blame] | 182 | static u32 exynos_drm_format_num_buffers(struct drm_mode_fb_cmd2 *mode_cmd) |
| 183 | { |
| 184 | unsigned int cnt = 0; |
| 185 | |
| 186 | if (mode_cmd->pixel_format != DRM_FORMAT_NV12) |
| 187 | return drm_format_num_planes(mode_cmd->pixel_format); |
| 188 | |
| 189 | while (cnt != MAX_FB_BUFFER) { |
| 190 | if (!mode_cmd->handles[cnt]) |
| 191 | break; |
| 192 | cnt++; |
| 193 | } |
| 194 | |
| 195 | /* |
| 196 | * check if NV12 or NV12M. |
| 197 | * |
| 198 | * NV12 |
| 199 | * handles[0] = base1, offsets[0] = 0 |
| 200 | * handles[1] = base1, offsets[1] = Y_size |
| 201 | * |
| 202 | * NV12M |
| 203 | * handles[0] = base1, offsets[0] = 0 |
| 204 | * handles[1] = base2, offsets[1] = 0 |
| 205 | */ |
| 206 | if (cnt == 2) { |
| 207 | /* |
| 208 | * in case of NV12 format, offsets[1] is not 0 and |
| 209 | * handles[0] is same as handles[1]. |
| 210 | */ |
| 211 | if (mode_cmd->offsets[1] && |
| 212 | mode_cmd->handles[0] == mode_cmd->handles[1]) |
| 213 | cnt = 1; |
| 214 | } |
| 215 | |
| 216 | return cnt; |
| 217 | } |
| 218 | |
Joonyoung Shim | e1533c0 | 2011-12-13 14:46:57 +0900 | [diff] [blame] | 219 | static struct drm_framebuffer * |
| 220 | exynos_user_fb_create(struct drm_device *dev, struct drm_file *file_priv, |
| 221 | struct drm_mode_fb_cmd2 *mode_cmd) |
Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 222 | { |
Joonyoung Shim | e1533c0 | 2011-12-13 14:46:57 +0900 | [diff] [blame] | 223 | struct drm_gem_object *obj; |
YoungJun Cho | 979c0c7 | 2013-02-12 21:23:54 +0900 | [diff] [blame] | 224 | struct exynos_drm_gem_obj *exynos_gem_obj; |
Seung-Woo Kim | 229d353 | 2011-12-15 14:36:22 +0900 | [diff] [blame] | 225 | struct exynos_drm_fb *exynos_fb; |
Daniel Vetter | f2c0095 | 2012-12-14 13:39:03 +0900 | [diff] [blame] | 226 | int i, ret; |
Joonyoung Shim | e1533c0 | 2011-12-13 14:46:57 +0900 | [diff] [blame] | 227 | |
Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 228 | DRM_DEBUG_KMS("%s\n", __FILE__); |
| 229 | |
Daniel Vetter | f2c0095 | 2012-12-14 13:39:03 +0900 | [diff] [blame] | 230 | exynos_fb = kzalloc(sizeof(*exynos_fb), GFP_KERNEL); |
| 231 | if (!exynos_fb) { |
| 232 | DRM_ERROR("failed to allocate exynos drm framebuffer\n"); |
| 233 | return ERR_PTR(-ENOMEM); |
Laurent Pinchart | 07b6835 | 2012-05-16 17:08:56 +0200 | [diff] [blame] | 234 | } |
Seung-Woo Kim | 229d353 | 2011-12-15 14:36:22 +0900 | [diff] [blame] | 235 | |
YoungJun Cho | 979c0c7 | 2013-02-12 21:23:54 +0900 | [diff] [blame] | 236 | obj = drm_gem_object_lookup(dev, file_priv, mode_cmd->handles[0]); |
| 237 | if (!obj) { |
| 238 | DRM_ERROR("failed to lookup gem object\n"); |
| 239 | ret = -ENOENT; |
| 240 | goto err_free; |
| 241 | } |
| 242 | |
Daniel Vetter | f2c0095 | 2012-12-14 13:39:03 +0900 | [diff] [blame] | 243 | drm_helper_mode_fill_fb_struct(&exynos_fb->fb, mode_cmd); |
| 244 | exynos_fb->exynos_gem_obj[0] = to_exynos_gem_obj(obj); |
Inki Dae | 01ed812 | 2012-08-20 20:05:56 +0900 | [diff] [blame] | 245 | exynos_fb->buf_cnt = exynos_drm_format_num_buffers(mode_cmd); |
Seung-Woo Kim | 229d353 | 2011-12-15 14:36:22 +0900 | [diff] [blame] | 246 | |
Inki Dae | 01ed812 | 2012-08-20 20:05:56 +0900 | [diff] [blame] | 247 | DRM_DEBUG_KMS("buf_cnt = %d\n", exynos_fb->buf_cnt); |
| 248 | |
| 249 | for (i = 1; i < exynos_fb->buf_cnt; i++) { |
Seung-Woo Kim | 229d353 | 2011-12-15 14:36:22 +0900 | [diff] [blame] | 250 | obj = drm_gem_object_lookup(dev, file_priv, |
| 251 | mode_cmd->handles[i]); |
| 252 | if (!obj) { |
| 253 | DRM_ERROR("failed to lookup gem object\n"); |
YoungJun Cho | 979c0c7 | 2013-02-12 21:23:54 +0900 | [diff] [blame] | 254 | ret = -ENOENT; |
| 255 | exynos_fb->buf_cnt = i; |
| 256 | goto err_unreference; |
Seung-Woo Kim | 229d353 | 2011-12-15 14:36:22 +0900 | [diff] [blame] | 257 | } |
| 258 | |
Inki Dae | 0519f9a | 2012-10-20 07:53:42 -0700 | [diff] [blame] | 259 | exynos_gem_obj = to_exynos_gem_obj(obj); |
YoungJun Cho | 979c0c7 | 2013-02-12 21:23:54 +0900 | [diff] [blame] | 260 | exynos_fb->exynos_gem_obj[i] = exynos_gem_obj; |
Inki Dae | 0519f9a | 2012-10-20 07:53:42 -0700 | [diff] [blame] | 261 | |
| 262 | ret = check_fb_gem_memory_type(dev, exynos_gem_obj); |
| 263 | if (ret < 0) { |
| 264 | DRM_ERROR("cannot use this gem memory type for fb.\n"); |
YoungJun Cho | 979c0c7 | 2013-02-12 21:23:54 +0900 | [diff] [blame] | 265 | goto err_unreference; |
Inki Dae | 0519f9a | 2012-10-20 07:53:42 -0700 | [diff] [blame] | 266 | } |
Seung-Woo Kim | 229d353 | 2011-12-15 14:36:22 +0900 | [diff] [blame] | 267 | } |
| 268 | |
Daniel Vetter | f2c0095 | 2012-12-14 13:39:03 +0900 | [diff] [blame] | 269 | ret = drm_framebuffer_init(dev, &exynos_fb->fb, &exynos_drm_fb_funcs); |
| 270 | if (ret) { |
YoungJun Cho | 979c0c7 | 2013-02-12 21:23:54 +0900 | [diff] [blame] | 271 | DRM_ERROR("failed to init framebuffer.\n"); |
| 272 | goto err_unreference; |
Daniel Vetter | f2c0095 | 2012-12-14 13:39:03 +0900 | [diff] [blame] | 273 | } |
| 274 | |
| 275 | return &exynos_fb->fb; |
YoungJun Cho | 979c0c7 | 2013-02-12 21:23:54 +0900 | [diff] [blame] | 276 | |
| 277 | err_unreference: |
| 278 | for (i = 0; i < exynos_fb->buf_cnt; i++) { |
| 279 | struct drm_gem_object *obj; |
| 280 | |
| 281 | obj = &exynos_fb->exynos_gem_obj[i]->base; |
| 282 | if (obj) |
| 283 | drm_gem_object_unreference_unlocked(obj); |
| 284 | } |
| 285 | err_free: |
| 286 | kfree(exynos_fb); |
| 287 | return ERR_PTR(ret); |
Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 288 | } |
| 289 | |
Seung-Woo Kim | 229d353 | 2011-12-15 14:36:22 +0900 | [diff] [blame] | 290 | struct exynos_drm_gem_buf *exynos_drm_fb_buffer(struct drm_framebuffer *fb, |
| 291 | int index) |
Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 292 | { |
| 293 | struct exynos_drm_fb *exynos_fb = to_exynos_fb(fb); |
Inki Dae | 2c87112 | 2011-11-12 15:23:32 +0900 | [diff] [blame] | 294 | struct exynos_drm_gem_buf *buffer; |
Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 295 | |
| 296 | DRM_DEBUG_KMS("%s\n", __FILE__); |
| 297 | |
Seung-Woo Kim | 229d353 | 2011-12-15 14:36:22 +0900 | [diff] [blame] | 298 | if (index >= MAX_FB_BUFFER) |
| 299 | return NULL; |
| 300 | |
| 301 | buffer = exynos_fb->exynos_gem_obj[index]->buffer; |
Inki Dae | 2c87112 | 2011-11-12 15:23:32 +0900 | [diff] [blame] | 302 | if (!buffer) |
Inki Dae | 19c8b83 | 2011-10-14 13:29:46 +0900 | [diff] [blame] | 303 | return NULL; |
Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 304 | |
Inki Dae | 4744ad2 | 2012-12-07 17:51:27 +0900 | [diff] [blame] | 305 | DRM_DEBUG_KMS("dma_addr = 0x%lx\n", (unsigned long)buffer->dma_addr); |
Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 306 | |
Inki Dae | 2c87112 | 2011-11-12 15:23:32 +0900 | [diff] [blame] | 307 | return buffer; |
Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 308 | } |
| 309 | |
Seung-Woo Kim | 7db3eba | 2011-10-18 16:58:05 +0900 | [diff] [blame] | 310 | static void exynos_drm_output_poll_changed(struct drm_device *dev) |
| 311 | { |
| 312 | struct exynos_drm_private *private = dev->dev_private; |
| 313 | struct drm_fb_helper *fb_helper = private->fb_helper; |
| 314 | |
| 315 | if (fb_helper) |
| 316 | drm_fb_helper_hotplug_event(fb_helper); |
| 317 | } |
| 318 | |
Laurent Pinchart | e6ecefa | 2012-05-17 13:27:23 +0200 | [diff] [blame] | 319 | static const struct drm_mode_config_funcs exynos_drm_mode_config_funcs = { |
Joonyoung Shim | e1533c0 | 2011-12-13 14:46:57 +0900 | [diff] [blame] | 320 | .fb_create = exynos_user_fb_create, |
Seung-Woo Kim | 7db3eba | 2011-10-18 16:58:05 +0900 | [diff] [blame] | 321 | .output_poll_changed = exynos_drm_output_poll_changed, |
Inki Dae | 1c248b7 | 2011-10-04 19:19:01 +0900 | [diff] [blame] | 322 | }; |
| 323 | |
| 324 | void exynos_drm_mode_config_init(struct drm_device *dev) |
| 325 | { |
| 326 | dev->mode_config.min_width = 0; |
| 327 | dev->mode_config.min_height = 0; |
| 328 | |
| 329 | /* |
| 330 | * set max width and height as default value(4096x4096). |
| 331 | * this value would be used to check framebuffer size limitation |
| 332 | * at drm_mode_addfb(). |
| 333 | */ |
| 334 | dev->mode_config.max_width = 4096; |
| 335 | dev->mode_config.max_height = 4096; |
| 336 | |
| 337 | dev->mode_config.funcs = &exynos_drm_mode_config_funcs; |
| 338 | } |