diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2013-01-21 17:42:49 -0500 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2013-02-13 18:07:58 -0500 |
commit | cd5428a5447cc6ca77ec6547d6f86834b205eac7 (patch) | |
tree | 7c7102f091f92176e81d38545401945903eeceaa /drivers | |
parent | 8acf658ad6246be7913647e6e76da6a539bff425 (diff) |
drm/<drivers>: simplify ->fb_probe callback
The fb helper lost its support for reallocating an fb completely, so
no need to return special success values any more.
Reviewed-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/ast/ast_fb.c | 21 | ||||
-rw-r--r-- | drivers/gpu/drm/cirrus/cirrus_fbdev.c | 22 | ||||
-rw-r--r-- | drivers/gpu/drm/drm_fb_cma_helper.c | 17 | ||||
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_fbdev.c | 30 | ||||
-rw-r--r-- | drivers/gpu/drm/gma500/framebuffer.c | 10 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_fb.c | 21 | ||||
-rw-r--r-- | drivers/gpu/drm/mgag200/mgag200_fb.c | 22 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_fbcon.c | 22 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_fb.c | 21 | ||||
-rw-r--r-- | drivers/gpu/drm/udl/udl_fb.c | 22 | ||||
-rw-r--r-- | drivers/staging/omapdrm/omap_fbdev.c | 17 |
11 files changed, 25 insertions, 200 deletions
diff --git a/drivers/gpu/drm/ast/ast_fb.c b/drivers/gpu/drm/ast/ast_fb.c index 81763cad9940..34931fe7d2c5 100644 --- a/drivers/gpu/drm/ast/ast_fb.c +++ b/drivers/gpu/drm/ast/ast_fb.c | |||
@@ -146,9 +146,10 @@ static int astfb_create_object(struct ast_fbdev *afbdev, | |||
146 | return ret; | 146 | return ret; |
147 | } | 147 | } |
148 | 148 | ||
149 | static int astfb_create(struct ast_fbdev *afbdev, | 149 | static int astfb_create(struct drm_fb_helper *helper, |
150 | struct drm_fb_helper_surface_size *sizes) | 150 | struct drm_fb_helper_surface_size *sizes) |
151 | { | 151 | { |
152 | struct ast_fbdev *afbdev = (struct ast_fbdev *)helper; | ||
152 | struct drm_device *dev = afbdev->helper.dev; | 153 | struct drm_device *dev = afbdev->helper.dev; |
153 | struct drm_mode_fb_cmd2 mode_cmd; | 154 | struct drm_mode_fb_cmd2 mode_cmd; |
154 | struct drm_framebuffer *fb; | 155 | struct drm_framebuffer *fb; |
@@ -249,26 +250,10 @@ static void ast_fb_gamma_get(struct drm_crtc *crtc, u16 *red, u16 *green, | |||
249 | *blue = ast_crtc->lut_b[regno] << 8; | 250 | *blue = ast_crtc->lut_b[regno] << 8; |
250 | } | 251 | } |
251 | 252 | ||
252 | static int ast_find_or_create_single(struct drm_fb_helper *helper, | ||
253 | struct drm_fb_helper_surface_size *sizes) | ||
254 | { | ||
255 | struct ast_fbdev *afbdev = (struct ast_fbdev *)helper; | ||
256 | int new_fb = 0; | ||
257 | int ret; | ||
258 | |||
259 | if (!helper->fb) { | ||
260 | ret = astfb_create(afbdev, sizes); | ||
261 | if (ret) | ||
262 | return ret; | ||
263 | new_fb = 1; | ||
264 | } | ||
265 | return new_fb; | ||
266 | } | ||
267 | |||
268 | static struct drm_fb_helper_funcs ast_fb_helper_funcs = { | 253 | static struct drm_fb_helper_funcs ast_fb_helper_funcs = { |
269 | .gamma_set = ast_fb_gamma_set, | 254 | .gamma_set = ast_fb_gamma_set, |
270 | .gamma_get = ast_fb_gamma_get, | 255 | .gamma_get = ast_fb_gamma_get, |
271 | .fb_probe = ast_find_or_create_single, | 256 | .fb_probe = astfb_create, |
272 | }; | 257 | }; |
273 | 258 | ||
274 | static void ast_fbdev_destroy(struct drm_device *dev, | 259 | static void ast_fbdev_destroy(struct drm_device *dev, |
diff --git a/drivers/gpu/drm/cirrus/cirrus_fbdev.c b/drivers/gpu/drm/cirrus/cirrus_fbdev.c index b96605c6e1b6..e25afccaf85b 100644 --- a/drivers/gpu/drm/cirrus/cirrus_fbdev.c +++ b/drivers/gpu/drm/cirrus/cirrus_fbdev.c | |||
@@ -121,9 +121,10 @@ static int cirrusfb_create_object(struct cirrus_fbdev *afbdev, | |||
121 | return ret; | 121 | return ret; |
122 | } | 122 | } |
123 | 123 | ||
124 | static int cirrusfb_create(struct cirrus_fbdev *gfbdev, | 124 | static int cirrusfb_create(struct drm_fb_helper *helper, |
125 | struct drm_fb_helper_surface_size *sizes) | 125 | struct drm_fb_helper_surface_size *sizes) |
126 | { | 126 | { |
127 | struct cirrus_fbdev *gfbdev = (struct cirrus_fbdev *)helper; | ||
127 | struct drm_device *dev = gfbdev->helper.dev; | 128 | struct drm_device *dev = gfbdev->helper.dev; |
128 | struct cirrus_device *cdev = gfbdev->helper.dev->dev_private; | 129 | struct cirrus_device *cdev = gfbdev->helper.dev->dev_private; |
129 | struct fb_info *info; | 130 | struct fb_info *info; |
@@ -220,23 +221,6 @@ out_iounmap: | |||
220 | return ret; | 221 | return ret; |
221 | } | 222 | } |
222 | 223 | ||
223 | static int cirrus_fb_find_or_create_single(struct drm_fb_helper *helper, | ||
224 | struct drm_fb_helper_surface_size | ||
225 | *sizes) | ||
226 | { | ||
227 | struct cirrus_fbdev *gfbdev = (struct cirrus_fbdev *)helper; | ||
228 | int new_fb = 0; | ||
229 | int ret; | ||
230 | |||
231 | if (!helper->fb) { | ||
232 | ret = cirrusfb_create(gfbdev, sizes); | ||
233 | if (ret) | ||
234 | return ret; | ||
235 | new_fb = 1; | ||
236 | } | ||
237 | return new_fb; | ||
238 | } | ||
239 | |||
240 | static int cirrus_fbdev_destroy(struct drm_device *dev, | 224 | static int cirrus_fbdev_destroy(struct drm_device *dev, |
241 | struct cirrus_fbdev *gfbdev) | 225 | struct cirrus_fbdev *gfbdev) |
242 | { | 226 | { |
@@ -268,7 +252,7 @@ static int cirrus_fbdev_destroy(struct drm_device *dev, | |||
268 | static struct drm_fb_helper_funcs cirrus_fb_helper_funcs = { | 252 | static struct drm_fb_helper_funcs cirrus_fb_helper_funcs = { |
269 | .gamma_set = cirrus_crtc_fb_gamma_set, | 253 | .gamma_set = cirrus_crtc_fb_gamma_set, |
270 | .gamma_get = cirrus_crtc_fb_gamma_get, | 254 | .gamma_get = cirrus_crtc_fb_gamma_get, |
271 | .fb_probe = cirrus_fb_find_or_create_single, | 255 | .fb_probe = cirrusfb_create, |
272 | }; | 256 | }; |
273 | 257 | ||
274 | int cirrus_fbdev_init(struct cirrus_device *cdev) | 258 | int cirrus_fbdev_init(struct cirrus_device *cdev) |
diff --git a/drivers/gpu/drm/drm_fb_cma_helper.c b/drivers/gpu/drm/drm_fb_cma_helper.c index ef3d33a8a7e2..e851658f87d5 100644 --- a/drivers/gpu/drm/drm_fb_cma_helper.c +++ b/drivers/gpu/drm/drm_fb_cma_helper.c | |||
@@ -275,23 +275,8 @@ err_drm_gem_cma_free_object: | |||
275 | return ret; | 275 | return ret; |
276 | } | 276 | } |
277 | 277 | ||
278 | static int drm_fbdev_cma_probe(struct drm_fb_helper *helper, | ||
279 | struct drm_fb_helper_surface_size *sizes) | ||
280 | { | ||
281 | int ret = 0; | ||
282 | |||
283 | if (!helper->fb) { | ||
284 | ret = drm_fbdev_cma_create(helper, sizes); | ||
285 | if (ret < 0) | ||
286 | return ret; | ||
287 | ret = 1; | ||
288 | } | ||
289 | |||
290 | return ret; | ||
291 | } | ||
292 | |||
293 | static struct drm_fb_helper_funcs drm_fb_cma_helper_funcs = { | 278 | static struct drm_fb_helper_funcs drm_fb_cma_helper_funcs = { |
294 | .fb_probe = drm_fbdev_cma_probe, | 279 | .fb_probe = drm_fbdev_cma_create, |
295 | }; | 280 | }; |
296 | 281 | ||
297 | /** | 282 | /** |
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c index fe2a0f068af7..68f0045f86b8 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c | |||
@@ -226,36 +226,8 @@ out: | |||
226 | return ret; | 226 | return ret; |
227 | } | 227 | } |
228 | 228 | ||
229 | static int exynos_drm_fbdev_probe(struct drm_fb_helper *helper, | ||
230 | struct drm_fb_helper_surface_size *sizes) | ||
231 | { | ||
232 | int ret = 0; | ||
233 | |||
234 | DRM_DEBUG_KMS("%s\n", __FILE__); | ||
235 | |||
236 | /* | ||
237 | * with !helper->fb, it means that this funcion is called first time | ||
238 | * and after that, the helper->fb would be used as clone mode. | ||
239 | */ | ||
240 | if (!helper->fb) { | ||
241 | ret = exynos_drm_fbdev_create(helper, sizes); | ||
242 | if (ret < 0) { | ||
243 | DRM_ERROR("failed to create fbdev.\n"); | ||
244 | return ret; | ||
245 | } | ||
246 | |||
247 | /* | ||
248 | * fb_helper expects a value more than 1 if succeed | ||
249 | * because register_framebuffer() should be called. | ||
250 | */ | ||
251 | ret = 1; | ||
252 | } | ||
253 | |||
254 | return ret; | ||
255 | } | ||
256 | |||
257 | static struct drm_fb_helper_funcs exynos_drm_fb_helper_funcs = { | 229 | static struct drm_fb_helper_funcs exynos_drm_fb_helper_funcs = { |
258 | .fb_probe = exynos_drm_fbdev_probe, | 230 | .fb_probe = exynos_drm_fbdev_create, |
259 | }; | 231 | }; |
260 | 232 | ||
261 | int exynos_drm_fbdev_init(struct drm_device *dev) | 233 | int exynos_drm_fbdev_init(struct drm_device *dev) |
diff --git a/drivers/gpu/drm/gma500/framebuffer.c b/drivers/gpu/drm/gma500/framebuffer.c index fee3bf85af4a..2590cac84257 100644 --- a/drivers/gpu/drm/gma500/framebuffer.c +++ b/drivers/gpu/drm/gma500/framebuffer.c | |||
@@ -545,9 +545,7 @@ static int psbfb_probe(struct drm_fb_helper *helper, | |||
545 | struct psb_fbdev *psb_fbdev = (struct psb_fbdev *)helper; | 545 | struct psb_fbdev *psb_fbdev = (struct psb_fbdev *)helper; |
546 | struct drm_device *dev = psb_fbdev->psb_fb_helper.dev; | 546 | struct drm_device *dev = psb_fbdev->psb_fb_helper.dev; |
547 | struct drm_psb_private *dev_priv = dev->dev_private; | 547 | struct drm_psb_private *dev_priv = dev->dev_private; |
548 | int new_fb = 0; | ||
549 | int bytespp; | 548 | int bytespp; |
550 | int ret; | ||
551 | 549 | ||
552 | bytespp = sizes->surface_bpp / 8; | 550 | bytespp = sizes->surface_bpp / 8; |
553 | if (bytespp == 3) /* no 24bit packed */ | 551 | if (bytespp == 3) /* no 24bit packed */ |
@@ -562,13 +560,7 @@ static int psbfb_probe(struct drm_fb_helper *helper, | |||
562 | sizes->surface_depth = 16; | 560 | sizes->surface_depth = 16; |
563 | } | 561 | } |
564 | 562 | ||
565 | if (!helper->fb) { | 563 | return psbfb_create(psb_fbdev, sizes); |
566 | ret = psbfb_create(psb_fbdev, sizes); | ||
567 | if (ret) | ||
568 | return ret; | ||
569 | new_fb = 1; | ||
570 | } | ||
571 | return new_fb; | ||
572 | } | 564 | } |
573 | 565 | ||
574 | static struct drm_fb_helper_funcs psb_fb_helper_funcs = { | 566 | static struct drm_fb_helper_funcs psb_fb_helper_funcs = { |
diff --git a/drivers/gpu/drm/i915/intel_fb.c b/drivers/gpu/drm/i915/intel_fb.c index 1c510da04d16..981bdce3634e 100644 --- a/drivers/gpu/drm/i915/intel_fb.c +++ b/drivers/gpu/drm/i915/intel_fb.c | |||
@@ -57,9 +57,10 @@ static struct fb_ops intelfb_ops = { | |||
57 | .fb_debug_leave = drm_fb_helper_debug_leave, | 57 | .fb_debug_leave = drm_fb_helper_debug_leave, |
58 | }; | 58 | }; |
59 | 59 | ||
60 | static int intelfb_create(struct intel_fbdev *ifbdev, | 60 | static int intelfb_create(struct drm_fb_helper *helper, |
61 | struct drm_fb_helper_surface_size *sizes) | 61 | struct drm_fb_helper_surface_size *sizes) |
62 | { | 62 | { |
63 | struct intel_fbdev *ifbdev = (struct intel_fbdev *)helper; | ||
63 | struct drm_device *dev = ifbdev->helper.dev; | 64 | struct drm_device *dev = ifbdev->helper.dev; |
64 | struct drm_i915_private *dev_priv = dev->dev_private; | 65 | struct drm_i915_private *dev_priv = dev->dev_private; |
65 | struct fb_info *info; | 66 | struct fb_info *info; |
@@ -181,26 +182,10 @@ out: | |||
181 | return ret; | 182 | return ret; |
182 | } | 183 | } |
183 | 184 | ||
184 | static int intel_fb_find_or_create_single(struct drm_fb_helper *helper, | ||
185 | struct drm_fb_helper_surface_size *sizes) | ||
186 | { | ||
187 | struct intel_fbdev *ifbdev = (struct intel_fbdev *)helper; | ||
188 | int new_fb = 0; | ||
189 | int ret; | ||
190 | |||
191 | if (!helper->fb) { | ||
192 | ret = intelfb_create(ifbdev, sizes); | ||
193 | if (ret) | ||
194 | return ret; | ||
195 | new_fb = 1; | ||
196 | } | ||
197 | return new_fb; | ||
198 | } | ||
199 | |||
200 | static struct drm_fb_helper_funcs intel_fb_helper_funcs = { | 185 | static struct drm_fb_helper_funcs intel_fb_helper_funcs = { |
201 | .gamma_set = intel_crtc_fb_gamma_set, | 186 | .gamma_set = intel_crtc_fb_gamma_set, |
202 | .gamma_get = intel_crtc_fb_gamma_get, | 187 | .gamma_get = intel_crtc_fb_gamma_get, |
203 | .fb_probe = intel_fb_find_or_create_single, | 188 | .fb_probe = intelfb_create, |
204 | }; | 189 | }; |
205 | 190 | ||
206 | static void intel_fbdev_destroy(struct drm_device *dev, | 191 | static void intel_fbdev_destroy(struct drm_device *dev, |
diff --git a/drivers/gpu/drm/mgag200/mgag200_fb.c b/drivers/gpu/drm/mgag200/mgag200_fb.c index 5bded5b74eaf..d2253f639481 100644 --- a/drivers/gpu/drm/mgag200/mgag200_fb.c +++ b/drivers/gpu/drm/mgag200/mgag200_fb.c | |||
@@ -121,9 +121,10 @@ static int mgag200fb_create_object(struct mga_fbdev *afbdev, | |||
121 | return ret; | 121 | return ret; |
122 | } | 122 | } |
123 | 123 | ||
124 | static int mgag200fb_create(struct mga_fbdev *mfbdev, | 124 | static int mgag200fb_create(struct drm_fb_helper *helper, |
125 | struct drm_fb_helper_surface_size *sizes) | 125 | struct drm_fb_helper_surface_size *sizes) |
126 | { | 126 | { |
127 | struct mga_fbdev *mfbdev = (struct mga_fbdev *)helper; | ||
127 | struct drm_device *dev = mfbdev->helper.dev; | 128 | struct drm_device *dev = mfbdev->helper.dev; |
128 | struct drm_mode_fb_cmd2 mode_cmd; | 129 | struct drm_mode_fb_cmd2 mode_cmd; |
129 | struct mga_device *mdev = dev->dev_private; | 130 | struct mga_device *mdev = dev->dev_private; |
@@ -210,23 +211,6 @@ out: | |||
210 | return ret; | 211 | return ret; |
211 | } | 212 | } |
212 | 213 | ||
213 | static int mga_fb_find_or_create_single(struct drm_fb_helper *helper, | ||
214 | struct drm_fb_helper_surface_size | ||
215 | *sizes) | ||
216 | { | ||
217 | struct mga_fbdev *mfbdev = (struct mga_fbdev *)helper; | ||
218 | int new_fb = 0; | ||
219 | int ret; | ||
220 | |||
221 | if (!helper->fb) { | ||
222 | ret = mgag200fb_create(mfbdev, sizes); | ||
223 | if (ret) | ||
224 | return ret; | ||
225 | new_fb = 1; | ||
226 | } | ||
227 | return new_fb; | ||
228 | } | ||
229 | |||
230 | static int mga_fbdev_destroy(struct drm_device *dev, | 214 | static int mga_fbdev_destroy(struct drm_device *dev, |
231 | struct mga_fbdev *mfbdev) | 215 | struct mga_fbdev *mfbdev) |
232 | { | 216 | { |
@@ -257,7 +241,7 @@ static int mga_fbdev_destroy(struct drm_device *dev, | |||
257 | static struct drm_fb_helper_funcs mga_fb_helper_funcs = { | 241 | static struct drm_fb_helper_funcs mga_fb_helper_funcs = { |
258 | .gamma_set = mga_crtc_fb_gamma_set, | 242 | .gamma_set = mga_crtc_fb_gamma_set, |
259 | .gamma_get = mga_crtc_fb_gamma_get, | 243 | .gamma_get = mga_crtc_fb_gamma_get, |
260 | .fb_probe = mga_fb_find_or_create_single, | 244 | .fb_probe = mgag200fb_create, |
261 | }; | 245 | }; |
262 | 246 | ||
263 | int mgag200_fbdev_init(struct mga_device *mdev) | 247 | int mgag200_fbdev_init(struct mga_device *mdev) |
diff --git a/drivers/gpu/drm/nouveau/nouveau_fbcon.c b/drivers/gpu/drm/nouveau/nouveau_fbcon.c index b1ebfe30f912..b03531781580 100644 --- a/drivers/gpu/drm/nouveau/nouveau_fbcon.c +++ b/drivers/gpu/drm/nouveau/nouveau_fbcon.c | |||
@@ -251,9 +251,10 @@ nouveau_fbcon_zfill(struct drm_device *dev, struct nouveau_fbdev *fbcon) | |||
251 | } | 251 | } |
252 | 252 | ||
253 | static int | 253 | static int |
254 | nouveau_fbcon_create(struct nouveau_fbdev *fbcon, | 254 | nouveau_fbcon_create(struct drm_fb_helper *helper, |
255 | struct drm_fb_helper_surface_size *sizes) | 255 | struct drm_fb_helper_surface_size *sizes) |
256 | { | 256 | { |
257 | struct nouveau_fbdev *fbcon = (struct nouveau_fbdev *)helper; | ||
257 | struct drm_device *dev = fbcon->dev; | 258 | struct drm_device *dev = fbcon->dev; |
258 | struct nouveau_drm *drm = nouveau_drm(dev); | 259 | struct nouveau_drm *drm = nouveau_drm(dev); |
259 | struct nouveau_device *device = nv_device(drm->device); | 260 | struct nouveau_device *device = nv_device(drm->device); |
@@ -388,23 +389,6 @@ out: | |||
388 | return ret; | 389 | return ret; |
389 | } | 390 | } |
390 | 391 | ||
391 | static int | ||
392 | nouveau_fbcon_find_or_create_single(struct drm_fb_helper *helper, | ||
393 | struct drm_fb_helper_surface_size *sizes) | ||
394 | { | ||
395 | struct nouveau_fbdev *fbcon = (struct nouveau_fbdev *)helper; | ||
396 | int new_fb = 0; | ||
397 | int ret; | ||
398 | |||
399 | if (!helper->fb) { | ||
400 | ret = nouveau_fbcon_create(fbcon, sizes); | ||
401 | if (ret) | ||
402 | return ret; | ||
403 | new_fb = 1; | ||
404 | } | ||
405 | return new_fb; | ||
406 | } | ||
407 | |||
408 | void | 392 | void |
409 | nouveau_fbcon_output_poll_changed(struct drm_device *dev) | 393 | nouveau_fbcon_output_poll_changed(struct drm_device *dev) |
410 | { | 394 | { |
@@ -450,7 +434,7 @@ void nouveau_fbcon_gpu_lockup(struct fb_info *info) | |||
450 | static struct drm_fb_helper_funcs nouveau_fbcon_helper_funcs = { | 434 | static struct drm_fb_helper_funcs nouveau_fbcon_helper_funcs = { |
451 | .gamma_set = nouveau_fbcon_gamma_set, | 435 | .gamma_set = nouveau_fbcon_gamma_set, |
452 | .gamma_get = nouveau_fbcon_gamma_get, | 436 | .gamma_get = nouveau_fbcon_gamma_get, |
453 | .fb_probe = nouveau_fbcon_find_or_create_single, | 437 | .fb_probe = nouveau_fbcon_create, |
454 | }; | 438 | }; |
455 | 439 | ||
456 | 440 | ||
diff --git a/drivers/gpu/drm/radeon/radeon_fb.c b/drivers/gpu/drm/radeon/radeon_fb.c index b48d1c8cf9eb..b1746741bc59 100644 --- a/drivers/gpu/drm/radeon/radeon_fb.c +++ b/drivers/gpu/drm/radeon/radeon_fb.c | |||
@@ -187,9 +187,10 @@ out_unref: | |||
187 | return ret; | 187 | return ret; |
188 | } | 188 | } |
189 | 189 | ||
190 | static int radeonfb_create(struct radeon_fbdev *rfbdev, | 190 | static int radeonfb_create(struct drm_fb_helper *helper, |
191 | struct drm_fb_helper_surface_size *sizes) | 191 | struct drm_fb_helper_surface_size *sizes) |
192 | { | 192 | { |
193 | struct radeon_fbdev *rfbdev = (struct radeon_fbdev *)helper; | ||
193 | struct radeon_device *rdev = rfbdev->rdev; | 194 | struct radeon_device *rdev = rfbdev->rdev; |
194 | struct fb_info *info; | 195 | struct fb_info *info; |
195 | struct drm_framebuffer *fb = NULL; | 196 | struct drm_framebuffer *fb = NULL; |
@@ -300,22 +301,6 @@ out_unref: | |||
300 | return ret; | 301 | return ret; |
301 | } | 302 | } |
302 | 303 | ||
303 | static int radeon_fb_find_or_create_single(struct drm_fb_helper *helper, | ||
304 | struct drm_fb_helper_surface_size *sizes) | ||
305 | { | ||
306 | struct radeon_fbdev *rfbdev = (struct radeon_fbdev *)helper; | ||
307 | int new_fb = 0; | ||
308 | int ret; | ||
309 | |||
310 | if (!helper->fb) { | ||
311 | ret = radeonfb_create(rfbdev, sizes); | ||
312 | if (ret) | ||
313 | return ret; | ||
314 | new_fb = 1; | ||
315 | } | ||
316 | return new_fb; | ||
317 | } | ||
318 | |||
319 | void radeon_fb_output_poll_changed(struct radeon_device *rdev) | 304 | void radeon_fb_output_poll_changed(struct radeon_device *rdev) |
320 | { | 305 | { |
321 | drm_fb_helper_hotplug_event(&rdev->mode_info.rfbdev->helper); | 306 | drm_fb_helper_hotplug_event(&rdev->mode_info.rfbdev->helper); |
@@ -349,7 +334,7 @@ static int radeon_fbdev_destroy(struct drm_device *dev, struct radeon_fbdev *rfb | |||
349 | static struct drm_fb_helper_funcs radeon_fb_helper_funcs = { | 334 | static struct drm_fb_helper_funcs radeon_fb_helper_funcs = { |
350 | .gamma_set = radeon_crtc_fb_gamma_set, | 335 | .gamma_set = radeon_crtc_fb_gamma_set, |
351 | .gamma_get = radeon_crtc_fb_gamma_get, | 336 | .gamma_get = radeon_crtc_fb_gamma_get, |
352 | .fb_probe = radeon_fb_find_or_create_single, | 337 | .fb_probe = radeonfb_create, |
353 | }; | 338 | }; |
354 | 339 | ||
355 | int radeon_fbdev_init(struct radeon_device *rdev) | 340 | int radeon_fbdev_init(struct radeon_device *rdev) |
diff --git a/drivers/gpu/drm/udl/udl_fb.c b/drivers/gpu/drm/udl/udl_fb.c index cf5d05a0d955..9f4be3d4a02e 100644 --- a/drivers/gpu/drm/udl/udl_fb.c +++ b/drivers/gpu/drm/udl/udl_fb.c | |||
@@ -476,9 +476,10 @@ udl_framebuffer_init(struct drm_device *dev, | |||
476 | } | 476 | } |
477 | 477 | ||
478 | 478 | ||
479 | static int udlfb_create(struct udl_fbdev *ufbdev, | 479 | static int udlfb_create(struct drm_fb_helper *helper, |
480 | struct drm_fb_helper_surface_size *sizes) | 480 | struct drm_fb_helper_surface_size *sizes) |
481 | { | 481 | { |
482 | struct udl_fbdev *ufbdev = (struct udl_fbdev *)helper; | ||
482 | struct drm_device *dev = ufbdev->helper.dev; | 483 | struct drm_device *dev = ufbdev->helper.dev; |
483 | struct fb_info *info; | 484 | struct fb_info *info; |
484 | struct device *device = &dev->usbdev->dev; | 485 | struct device *device = &dev->usbdev->dev; |
@@ -556,27 +557,10 @@ out: | |||
556 | return ret; | 557 | return ret; |
557 | } | 558 | } |
558 | 559 | ||
559 | static int udl_fb_find_or_create_single(struct drm_fb_helper *helper, | ||
560 | struct drm_fb_helper_surface_size *sizes) | ||
561 | { | ||
562 | struct udl_fbdev *ufbdev = (struct udl_fbdev *)helper; | ||
563 | int new_fb = 0; | ||
564 | int ret; | ||
565 | |||
566 | if (!helper->fb) { | ||
567 | ret = udlfb_create(ufbdev, sizes); | ||
568 | if (ret) | ||
569 | return ret; | ||
570 | |||
571 | new_fb = 1; | ||
572 | } | ||
573 | return new_fb; | ||
574 | } | ||
575 | |||
576 | static struct drm_fb_helper_funcs udl_fb_helper_funcs = { | 560 | static struct drm_fb_helper_funcs udl_fb_helper_funcs = { |
577 | .gamma_set = udl_crtc_fb_gamma_set, | 561 | .gamma_set = udl_crtc_fb_gamma_set, |
578 | .gamma_get = udl_crtc_fb_gamma_get, | 562 | .gamma_get = udl_crtc_fb_gamma_get, |
579 | .fb_probe = udl_fb_find_or_create_single, | 563 | .fb_probe = udlfb_create, |
580 | }; | 564 | }; |
581 | 565 | ||
582 | static void udl_fbdev_destroy(struct drm_device *dev, | 566 | static void udl_fbdev_destroy(struct drm_device *dev, |
diff --git a/drivers/staging/omapdrm/omap_fbdev.c b/drivers/staging/omapdrm/omap_fbdev.c index 7e66eb138315..caefdf9430f8 100644 --- a/drivers/staging/omapdrm/omap_fbdev.c +++ b/drivers/staging/omapdrm/omap_fbdev.c | |||
@@ -296,25 +296,10 @@ static void omap_crtc_fb_gamma_get(struct drm_crtc *crtc, | |||
296 | DBG("fbdev: get gamma"); | 296 | DBG("fbdev: get gamma"); |
297 | } | 297 | } |
298 | 298 | ||
299 | static int omap_fbdev_probe(struct drm_fb_helper *helper, | ||
300 | struct drm_fb_helper_surface_size *sizes) | ||
301 | { | ||
302 | int new_fb = 0; | ||
303 | int ret; | ||
304 | |||
305 | if (!helper->fb) { | ||
306 | ret = omap_fbdev_create(helper, sizes); | ||
307 | if (ret) | ||
308 | return ret; | ||
309 | new_fb = 1; | ||
310 | } | ||
311 | return new_fb; | ||
312 | } | ||
313 | |||
314 | static struct drm_fb_helper_funcs omap_fb_helper_funcs = { | 299 | static struct drm_fb_helper_funcs omap_fb_helper_funcs = { |
315 | .gamma_set = omap_crtc_fb_gamma_set, | 300 | .gamma_set = omap_crtc_fb_gamma_set, |
316 | .gamma_get = omap_crtc_fb_gamma_get, | 301 | .gamma_get = omap_crtc_fb_gamma_get, |
317 | .fb_probe = omap_fbdev_probe, | 302 | .fb_probe = omap_fbdev_create, |
318 | }; | 303 | }; |
319 | 304 | ||
320 | static struct drm_fb_helper *get_fb(struct fb_info *fbi) | 305 | static struct drm_fb_helper *get_fb(struct fb_info *fbi) |