diff options
author | Joonyoung Shim <jy0922.shim@samsung.com> | 2011-12-08 01:05:19 -0500 |
---|---|---|
committer | Inki Dae <inki.dae@samsung.com> | 2011-12-21 01:14:17 -0500 |
commit | a794d57da8031a45fed4e4cb71a999694ba02f7e (patch) | |
tree | 6ff01ad2d4488434a7038060ff765125c3b37f7c /drivers/gpu/drm | |
parent | ac2bdf73143f05ffcd08376ff9ff6a66f835d72d (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')
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_fb.c | 20 | ||||
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_fb.h | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_fbdev.c | 14 |
3 files changed, 19 insertions, 19 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fb.c b/drivers/gpu/drm/exynos/exynos_drm_fb.c index 5bf4a1ac7f82..df5eec6c1aba 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 | ||
105 | static struct drm_framebuffer * | 105 | static struct drm_framebuffer * |
106 | exynos_drm_fb_init(struct drm_file *file_priv, struct drm_device *dev, | 106 | exynos_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 | ||
216 | struct drm_framebuffer *exynos_drm_fb_create(struct drm_device *dev, | 214 | struct 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 | ||
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fb.h b/drivers/gpu/drm/exynos/exynos_drm_fb.h index eb35931d302c..52c5982bdbbc 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fb.h +++ b/drivers/gpu/drm/exynos/exynos_drm_fb.h | |||
@@ -29,8 +29,8 @@ | |||
29 | #define _EXYNOS_DRM_FB_H | 29 | #define _EXYNOS_DRM_FB_H |
30 | 30 | ||
31 | struct drm_framebuffer *exynos_drm_fb_create(struct drm_device *dev, | 31 | struct drm_framebuffer *exynos_drm_fb_create(struct drm_device *dev, |
32 | struct drm_file *filp, | 32 | struct drm_file *filp, |
33 | struct drm_mode_fb_cmd *mode_cmd); | 33 | struct drm_mode_fb_cmd2 *mode_cmd); |
34 | 34 | ||
35 | void exynos_drm_mode_config_init(struct drm_device *dev); | 35 | void exynos_drm_mode_config_init(struct drm_device *dev); |
36 | 36 | ||
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c index f79f768a56ca..c8b278447c4f 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c | |||
@@ -126,7 +126,7 @@ static int exynos_drm_fbdev_create(struct drm_fb_helper *helper, | |||
126 | struct exynos_drm_fbdev *exynos_fbdev = to_exynos_fbdev(helper); | 126 | struct exynos_drm_fbdev *exynos_fbdev = to_exynos_fbdev(helper); |
127 | struct drm_device *dev = helper->dev; | 127 | struct drm_device *dev = helper->dev; |
128 | struct fb_info *fbi; | 128 | struct fb_info *fbi; |
129 | struct drm_mode_fb_cmd mode_cmd = { 0 }; | 129 | struct drm_mode_fb_cmd2 mode_cmd = { 0 }; |
130 | struct platform_device *pdev = dev->platformdev; | 130 | struct platform_device *pdev = dev->platformdev; |
131 | int ret; | 131 | int ret; |
132 | 132 | ||
@@ -138,8 +138,9 @@ static int exynos_drm_fbdev_create(struct drm_fb_helper *helper, | |||
138 | 138 | ||
139 | mode_cmd.width = sizes->surface_width; | 139 | mode_cmd.width = sizes->surface_width; |
140 | mode_cmd.height = sizes->surface_height; | 140 | mode_cmd.height = sizes->surface_height; |
141 | mode_cmd.bpp = sizes->surface_bpp; | 141 | mode_cmd.pitches[0] = sizes->surface_width * (sizes->surface_bpp >> 3); |
142 | mode_cmd.depth = sizes->surface_depth; | 142 | mode_cmd.pixel_format = drm_mode_legacy_fb_format(sizes->surface_bpp, |
143 | sizes->surface_depth); | ||
143 | 144 | ||
144 | mutex_lock(&dev->struct_mutex); | 145 | mutex_lock(&dev->struct_mutex); |
145 | 146 | ||
@@ -206,7 +207,7 @@ static int exynos_drm_fbdev_recreate(struct drm_fb_helper *helper, | |||
206 | struct drm_device *dev = helper->dev; | 207 | struct drm_device *dev = helper->dev; |
207 | struct exynos_drm_fbdev *exynos_fbdev = to_exynos_fbdev(helper); | 208 | struct exynos_drm_fbdev *exynos_fbdev = to_exynos_fbdev(helper); |
208 | struct drm_framebuffer *fb = exynos_fbdev->fb; | 209 | struct drm_framebuffer *fb = exynos_fbdev->fb; |
209 | struct drm_mode_fb_cmd mode_cmd = { 0 }; | 210 | struct drm_mode_fb_cmd2 mode_cmd = { 0 }; |
210 | 211 | ||
211 | DRM_DEBUG_KMS("%s\n", __FILE__); | 212 | DRM_DEBUG_KMS("%s\n", __FILE__); |
212 | 213 | ||
@@ -220,8 +221,9 @@ static int exynos_drm_fbdev_recreate(struct drm_fb_helper *helper, | |||
220 | 221 | ||
221 | mode_cmd.width = sizes->surface_width; | 222 | mode_cmd.width = sizes->surface_width; |
222 | mode_cmd.height = sizes->surface_height; | 223 | mode_cmd.height = sizes->surface_height; |
223 | mode_cmd.bpp = sizes->surface_bpp; | 224 | mode_cmd.pitches[0] = sizes->surface_width * (sizes->surface_bpp >> 3); |
224 | mode_cmd.depth = sizes->surface_depth; | 225 | mode_cmd.pixel_format = drm_mode_legacy_fb_format(sizes->surface_bpp, |
226 | sizes->surface_depth); | ||
225 | 227 | ||
226 | if (fb->funcs->destroy) | 228 | if (fb->funcs->destroy) |
227 | fb->funcs->destroy(fb); | 229 | fb->funcs->destroy(fb); |