aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/exynos/exynos_drm_fb.c
diff options
context:
space:
mode:
authorJoonyoung Shim <jy0922.shim@samsung.com>2011-12-08 01:05:19 -0500
committerInki Dae <inki.dae@samsung.com>2011-12-21 01:14:17 -0500
commita794d57da8031a45fed4e4cb71a999694ba02f7e (patch)
tree6ff01ad2d4488434a7038060ff765125c3b37f7c /drivers/gpu/drm/exynos/exynos_drm_fb.c
parentac2bdf73143f05ffcd08376ff9ff6a66f835d72d (diff)
drm/exynos: Use struct drm_mode_fb_cmd2
The exynos drm also should use struct drm_mode_fb_cmd2 by changes of 308e5bcbdb10452e8aba31aa21432fb67ee46d72 commit(drm: add an fb creation ioctl that takes a pixel format v5). Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Diffstat (limited to 'drivers/gpu/drm/exynos/exynos_drm_fb.c')
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_fb.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fb.c b/drivers/gpu/drm/exynos/exynos_drm_fb.c
index 5bf4a1ac7f8..df5eec6c1ab 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fb.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fb.c
@@ -104,7 +104,7 @@ static struct drm_framebuffer_funcs exynos_drm_fb_funcs = {
104 104
105static struct drm_framebuffer * 105static struct drm_framebuffer *
106exynos_drm_fb_init(struct drm_file *file_priv, struct drm_device *dev, 106exynos_drm_fb_init(struct drm_file *file_priv, struct drm_device *dev,
107 struct drm_mode_fb_cmd *mode_cmd) 107 struct drm_mode_fb_cmd2 *mode_cmd)
108{ 108{
109 struct exynos_drm_fb *exynos_fb; 109 struct exynos_drm_fb *exynos_fb;
110 struct drm_framebuffer *fb; 110 struct drm_framebuffer *fb;
@@ -115,9 +115,6 @@ exynos_drm_fb_init(struct drm_file *file_priv, struct drm_device *dev,
115 115
116 DRM_DEBUG_KMS("%s\n", __FILE__); 116 DRM_DEBUG_KMS("%s\n", __FILE__);
117 117
118 mode_cmd->pitch = max(mode_cmd->pitch,
119 mode_cmd->width * (mode_cmd->bpp >> 3));
120
121 DRM_LOG_KMS("drm fb create(%dx%d)\n", 118 DRM_LOG_KMS("drm fb create(%dx%d)\n",
122 mode_cmd->width, mode_cmd->height); 119 mode_cmd->width, mode_cmd->height);
123 120
@@ -136,14 +133,14 @@ exynos_drm_fb_init(struct drm_file *file_priv, struct drm_device *dev,
136 133
137 DRM_LOG_KMS("create: fb id: %d\n", fb->base.id); 134 DRM_LOG_KMS("create: fb id: %d\n", fb->base.id);
138 135
139 size = mode_cmd->pitch * mode_cmd->height; 136 size = mode_cmd->pitches[0] * mode_cmd->height;
140 137
141 /* 138 /*
142 * mode_cmd->handle could be NULL at booting time or 139 * mode_cmd->handles[0] could be NULL at booting time or
143 * with user request. if NULL, a new buffer or a gem object 140 * with user request. if NULL, a new buffer or a gem object
144 * would be allocated. 141 * would be allocated.
145 */ 142 */
146 if (!mode_cmd->handle) { 143 if (!mode_cmd->handles[0]) {
147 if (!file_priv) { 144 if (!file_priv) {
148 struct exynos_drm_gem_buf *buffer; 145 struct exynos_drm_gem_buf *buffer;
149 146
@@ -166,7 +163,7 @@ exynos_drm_fb_init(struct drm_file *file_priv, struct drm_device *dev,
166 goto out; 163 goto out;
167 } else { 164 } else {
168 exynos_gem_obj = exynos_drm_gem_create(dev, file_priv, 165 exynos_gem_obj = exynos_drm_gem_create(dev, file_priv,
169 &mode_cmd->handle, 166 &mode_cmd->handles[0],
170 size); 167 size);
171 if (IS_ERR(exynos_gem_obj)) { 168 if (IS_ERR(exynos_gem_obj)) {
172 ret = PTR_ERR(exynos_gem_obj); 169 ret = PTR_ERR(exynos_gem_obj);
@@ -174,7 +171,8 @@ exynos_drm_fb_init(struct drm_file *file_priv, struct drm_device *dev,
174 } 171 }
175 } 172 }
176 } else { 173 } else {
177 obj = drm_gem_object_lookup(dev, file_priv, mode_cmd->handle); 174 obj = drm_gem_object_lookup(dev, file_priv,
175 mode_cmd->handles[0]);
178 if (!obj) { 176 if (!obj) {
179 DRM_ERROR("failed to lookup gem object.\n"); 177 DRM_ERROR("failed to lookup gem object.\n");
180 goto err_buffer; 178 goto err_buffer;
@@ -214,8 +212,8 @@ err_init:
214} 212}
215 213
216struct drm_framebuffer *exynos_drm_fb_create(struct drm_device *dev, 214struct drm_framebuffer *exynos_drm_fb_create(struct drm_device *dev,
217 struct drm_file *file_priv, 215 struct drm_file *file_priv,
218 struct drm_mode_fb_cmd *mode_cmd) 216 struct drm_mode_fb_cmd2 *mode_cmd)
219{ 217{
220 DRM_DEBUG_KMS("%s\n", __FILE__); 218 DRM_DEBUG_KMS("%s\n", __FILE__);
221 219