aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2014-10-01 05:27:01 -0400
committerDave Airlie <airlied@redhat.com>2014-10-01 05:27:01 -0400
commitc5939a7360a69fc415bcfff6b10ced5227495a48 (patch)
tree1b9c7796fbeeba17e0e184a755354482de976af7
parent1dadba87cba20989c5a5a56f2a86fe6672e37c30 (diff)
parent1b11629737ca5414b0310d35e01a125cfde1ba4d (diff)
Merge tag 'topic/core-stuff-2014-09-29' of git://anongit.freedesktop.org/drm-intel into drm-next
Ok, here's the update core-stuff pull request with the locking fixup patch fixed up with another patch. * tag 'topic/core-stuff-2014-09-29' of git://anongit.freedesktop.org/drm-intel: drm: Drop grab fpriv->fbs_lock in drm_fb_release drm/udl: use container_of to resolve udl_fbdev from drm_fb_helper drm/ast: use container_of to resolve ast_fbdev from drm_fb_helper drm/gma500: use container_of to resolve psb_fbdev from drm_fb_helper drm/qxl: use container_of to resolve qxl_fbdev from drm_fb_helper drm/nouveau: use container_of to resolve nouveau_plane from drm_plane drm/nouveau: use container_of to resolve nouveau_fbdev from drm_fb_helper drm/radeon: use container_of to resolve radeon_fbdev from drm_fb_helper drm/mgag200: use container_of to resolve mga_fbdev from drm_fb_helper drm/cirrus: use container_of to resolve cirrus_fbdev from drm_fb_helper drm: Improve debug output for drm_wait_one_vblank drm: Fixup locking for universal cursor planes drm: Don't update vblank timestamp when the counter didn't change
-rw-r--r--drivers/gpu/drm/ast/ast_fb.c3
-rw-r--r--drivers/gpu/drm/cirrus/cirrus_fbdev.c3
-rw-r--r--drivers/gpu/drm/drm_crtc.c63
-rw-r--r--drivers/gpu/drm/drm_irq.c7
-rw-r--r--drivers/gpu/drm/gma500/framebuffer.c3
-rw-r--r--drivers/gpu/drm/mgag200/mgag200_fb.c3
-rw-r--r--drivers/gpu/drm/nouveau/dispnv04/overlay.c15
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_fbcon.c3
-rw-r--r--drivers/gpu/drm/qxl/qxl_fb.c3
-rw-r--r--drivers/gpu/drm/radeon/radeon_fb.c3
-rw-r--r--drivers/gpu/drm/udl/udl_fb.c3
11 files changed, 75 insertions, 34 deletions
diff --git a/drivers/gpu/drm/ast/ast_fb.c b/drivers/gpu/drm/ast/ast_fb.c
index cba45c774552..5c60ae524c45 100644
--- a/drivers/gpu/drm/ast/ast_fb.c
+++ b/drivers/gpu/drm/ast/ast_fb.c
@@ -186,7 +186,8 @@ static int astfb_create_object(struct ast_fbdev *afbdev,
186static int astfb_create(struct drm_fb_helper *helper, 186static int astfb_create(struct drm_fb_helper *helper,
187 struct drm_fb_helper_surface_size *sizes) 187 struct drm_fb_helper_surface_size *sizes)
188{ 188{
189 struct ast_fbdev *afbdev = (struct ast_fbdev *)helper; 189 struct ast_fbdev *afbdev =
190 container_of(helper, struct ast_fbdev, helper);
190 struct drm_device *dev = afbdev->helper.dev; 191 struct drm_device *dev = afbdev->helper.dev;
191 struct drm_mode_fb_cmd2 mode_cmd; 192 struct drm_mode_fb_cmd2 mode_cmd;
192 struct drm_framebuffer *fb; 193 struct drm_framebuffer *fb;
diff --git a/drivers/gpu/drm/cirrus/cirrus_fbdev.c b/drivers/gpu/drm/cirrus/cirrus_fbdev.c
index 2a135f253e29..d231b1c317af 100644
--- a/drivers/gpu/drm/cirrus/cirrus_fbdev.c
+++ b/drivers/gpu/drm/cirrus/cirrus_fbdev.c
@@ -160,7 +160,8 @@ static int cirrusfb_create_object(struct cirrus_fbdev *afbdev,
160static int cirrusfb_create(struct drm_fb_helper *helper, 160static int cirrusfb_create(struct drm_fb_helper *helper,
161 struct drm_fb_helper_surface_size *sizes) 161 struct drm_fb_helper_surface_size *sizes)
162{ 162{
163 struct cirrus_fbdev *gfbdev = (struct cirrus_fbdev *)helper; 163 struct cirrus_fbdev *gfbdev =
164 container_of(helper, struct cirrus_fbdev, helper);
164 struct drm_device *dev = gfbdev->helper.dev; 165 struct drm_device *dev = gfbdev->helper.dev;
165 struct cirrus_device *cdev = gfbdev->helper.dev->dev_private; 166 struct cirrus_device *cdev = gfbdev->helper.dev->dev_private;
166 struct fb_info *info; 167 struct fb_info *info;
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
index ecd4e0b4c525..e79c8d3700d8 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -2263,21 +2263,19 @@ out:
2263 * 2263 *
2264 * src_{x,y,w,h} are provided in 16.16 fixed point format 2264 * src_{x,y,w,h} are provided in 16.16 fixed point format
2265 */ 2265 */
2266static int setplane_internal(struct drm_plane *plane, 2266static int __setplane_internal(struct drm_plane *plane,
2267 struct drm_crtc *crtc, 2267 struct drm_crtc *crtc,
2268 struct drm_framebuffer *fb, 2268 struct drm_framebuffer *fb,
2269 int32_t crtc_x, int32_t crtc_y, 2269 int32_t crtc_x, int32_t crtc_y,
2270 uint32_t crtc_w, uint32_t crtc_h, 2270 uint32_t crtc_w, uint32_t crtc_h,
2271 /* src_{x,y,w,h} values are 16.16 fixed point */ 2271 /* src_{x,y,w,h} values are 16.16 fixed point */
2272 uint32_t src_x, uint32_t src_y, 2272 uint32_t src_x, uint32_t src_y,
2273 uint32_t src_w, uint32_t src_h) 2273 uint32_t src_w, uint32_t src_h)
2274{ 2274{
2275 struct drm_device *dev = plane->dev;
2276 int ret = 0; 2275 int ret = 0;
2277 unsigned int fb_width, fb_height; 2276 unsigned int fb_width, fb_height;
2278 int i; 2277 int i;
2279 2278
2280 drm_modeset_lock_all(dev);
2281 /* No fb means shut it down */ 2279 /* No fb means shut it down */
2282 if (!fb) { 2280 if (!fb) {
2283 plane->old_fb = plane->fb; 2281 plane->old_fb = plane->fb;
@@ -2345,10 +2343,28 @@ out:
2345 if (plane->old_fb) 2343 if (plane->old_fb)
2346 drm_framebuffer_unreference(plane->old_fb); 2344 drm_framebuffer_unreference(plane->old_fb);
2347 plane->old_fb = NULL; 2345 plane->old_fb = NULL;
2348 drm_modeset_unlock_all(dev);
2349 2346
2350 return ret; 2347 return ret;
2348}
2349
2350static int setplane_internal(struct drm_plane *plane,
2351 struct drm_crtc *crtc,
2352 struct drm_framebuffer *fb,
2353 int32_t crtc_x, int32_t crtc_y,
2354 uint32_t crtc_w, uint32_t crtc_h,
2355 /* src_{x,y,w,h} values are 16.16 fixed point */
2356 uint32_t src_x, uint32_t src_y,
2357 uint32_t src_w, uint32_t src_h)
2358{
2359 int ret;
2360
2361 drm_modeset_lock_all(plane->dev);
2362 ret = __setplane_internal(plane, crtc, fb,
2363 crtc_x, crtc_y, crtc_w, crtc_h,
2364 src_x, src_y, src_w, src_h);
2365 drm_modeset_unlock_all(plane->dev);
2351 2366
2367 return ret;
2352} 2368}
2353 2369
2354/** 2370/**
@@ -2714,6 +2730,7 @@ static int drm_mode_cursor_universal(struct drm_crtc *crtc,
2714 int ret = 0; 2730 int ret = 0;
2715 2731
2716 BUG_ON(!crtc->cursor); 2732 BUG_ON(!crtc->cursor);
2733 WARN_ON(crtc->cursor->crtc != crtc && crtc->cursor->crtc != NULL);
2717 2734
2718 /* 2735 /*
2719 * Obtain fb we'll be using (either new or existing) and take an extra 2736 * Obtain fb we'll be using (either new or existing) and take an extra
@@ -2733,11 +2750,9 @@ static int drm_mode_cursor_universal(struct drm_crtc *crtc,
2733 fb = NULL; 2750 fb = NULL;
2734 } 2751 }
2735 } else { 2752 } else {
2736 mutex_lock(&dev->mode_config.mutex);
2737 fb = crtc->cursor->fb; 2753 fb = crtc->cursor->fb;
2738 if (fb) 2754 if (fb)
2739 drm_framebuffer_reference(fb); 2755 drm_framebuffer_reference(fb);
2740 mutex_unlock(&dev->mode_config.mutex);
2741 } 2756 }
2742 2757
2743 if (req->flags & DRM_MODE_CURSOR_MOVE) { 2758 if (req->flags & DRM_MODE_CURSOR_MOVE) {
@@ -2759,7 +2774,7 @@ static int drm_mode_cursor_universal(struct drm_crtc *crtc,
2759 * setplane_internal will take care of deref'ing either the old or new 2774 * setplane_internal will take care of deref'ing either the old or new
2760 * framebuffer depending on success. 2775 * framebuffer depending on success.
2761 */ 2776 */
2762 ret = setplane_internal(crtc->cursor, crtc, fb, 2777 ret = __setplane_internal(crtc->cursor, crtc, fb,
2763 crtc_x, crtc_y, crtc_w, crtc_h, 2778 crtc_x, crtc_y, crtc_w, crtc_h,
2764 0, 0, src_w, src_h); 2779 0, 0, src_w, src_h);
2765 2780
@@ -2795,10 +2810,12 @@ static int drm_mode_cursor_common(struct drm_device *dev,
2795 * If this crtc has a universal cursor plane, call that plane's update 2810 * If this crtc has a universal cursor plane, call that plane's update
2796 * handler rather than using legacy cursor handlers. 2811 * handler rather than using legacy cursor handlers.
2797 */ 2812 */
2798 if (crtc->cursor)
2799 return drm_mode_cursor_universal(crtc, req, file_priv);
2800
2801 drm_modeset_lock_crtc(crtc); 2813 drm_modeset_lock_crtc(crtc);
2814 if (crtc->cursor) {
2815 ret = drm_mode_cursor_universal(crtc, req, file_priv);
2816 goto out;
2817 }
2818
2802 if (req->flags & DRM_MODE_CURSOR_BO) { 2819 if (req->flags & DRM_MODE_CURSOR_BO) {
2803 if (!crtc->funcs->cursor_set && !crtc->funcs->cursor_set2) { 2820 if (!crtc->funcs->cursor_set && !crtc->funcs->cursor_set2) {
2804 ret = -ENXIO; 2821 ret = -ENXIO;
@@ -3383,7 +3400,16 @@ void drm_fb_release(struct drm_file *priv)
3383 struct drm_device *dev = priv->minor->dev; 3400 struct drm_device *dev = priv->minor->dev;
3384 struct drm_framebuffer *fb, *tfb; 3401 struct drm_framebuffer *fb, *tfb;
3385 3402
3386 mutex_lock(&priv->fbs_lock); 3403 /*
3404 * When the file gets released that means no one else can access the fb
3405 * list any more, so no need to grab fpriv->fbs_lock. And we need to to
3406 * avoid upsetting lockdep since the universal cursor code adds a
3407 * framebuffer while holding mutex locks.
3408 *
3409 * Note that a real deadlock between fpriv->fbs_lock and the modeset
3410 * locks is impossible here since no one else but this function can get
3411 * at it any more.
3412 */
3387 list_for_each_entry_safe(fb, tfb, &priv->fbs, filp_head) { 3413 list_for_each_entry_safe(fb, tfb, &priv->fbs, filp_head) {
3388 3414
3389 mutex_lock(&dev->mode_config.fb_lock); 3415 mutex_lock(&dev->mode_config.fb_lock);
@@ -3396,7 +3422,6 @@ void drm_fb_release(struct drm_file *priv)
3396 /* This will also drop the fpriv->fbs reference. */ 3422 /* This will also drop the fpriv->fbs reference. */
3397 drm_framebuffer_remove(fb); 3423 drm_framebuffer_remove(fb);
3398 } 3424 }
3399 mutex_unlock(&priv->fbs_lock);
3400} 3425}
3401 3426
3402/** 3427/**
diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
index 80ff94ada75e..5ef03c216a27 100644
--- a/drivers/gpu/drm/drm_irq.c
+++ b/drivers/gpu/drm/drm_irq.c
@@ -126,6 +126,9 @@ static void drm_update_vblank_count(struct drm_device *dev, int crtc)
126 DRM_DEBUG("updating vblank count on crtc %d, missed %d\n", 126 DRM_DEBUG("updating vblank count on crtc %d, missed %d\n",
127 crtc, diff); 127 crtc, diff);
128 128
129 if (diff == 0)
130 return;
131
129 /* Reinitialize corresponding vblank timestamp if high-precision query 132 /* Reinitialize corresponding vblank timestamp if high-precision query
130 * available. Skip this step if query unsupported or failed. Will 133 * available. Skip this step if query unsupported or failed. Will
131 * reinitialize delayed at next vblank interrupt in that case. 134 * reinitialize delayed at next vblank interrupt in that case.
@@ -1074,7 +1077,7 @@ void drm_wait_one_vblank(struct drm_device *dev, int crtc)
1074 u32 last; 1077 u32 last;
1075 1078
1076 ret = drm_vblank_get(dev, crtc); 1079 ret = drm_vblank_get(dev, crtc);
1077 if (WARN_ON(ret)) 1080 if (WARN(ret, "vblank not available on crtc %i, ret=%i\n", crtc, ret))
1078 return; 1081 return;
1079 1082
1080 last = drm_vblank_count(dev, crtc); 1083 last = drm_vblank_count(dev, crtc);
@@ -1083,7 +1086,7 @@ void drm_wait_one_vblank(struct drm_device *dev, int crtc)
1083 last != drm_vblank_count(dev, crtc), 1086 last != drm_vblank_count(dev, crtc),
1084 msecs_to_jiffies(100)); 1087 msecs_to_jiffies(100));
1085 1088
1086 WARN_ON(ret == 0); 1089 WARN(ret == 0, "vblank wait timed out on crtc %i\n", crtc);
1087 1090
1088 drm_vblank_put(dev, crtc); 1091 drm_vblank_put(dev, crtc);
1089} 1092}
diff --git a/drivers/gpu/drm/gma500/framebuffer.c b/drivers/gpu/drm/gma500/framebuffer.c
index d0dd3bea8aa5..ddd90ddbc200 100644
--- a/drivers/gpu/drm/gma500/framebuffer.c
+++ b/drivers/gpu/drm/gma500/framebuffer.c
@@ -540,7 +540,8 @@ static void psbfb_gamma_get(struct drm_crtc *crtc, u16 *red,
540static int psbfb_probe(struct drm_fb_helper *helper, 540static int psbfb_probe(struct drm_fb_helper *helper,
541 struct drm_fb_helper_surface_size *sizes) 541 struct drm_fb_helper_surface_size *sizes)
542{ 542{
543 struct psb_fbdev *psb_fbdev = (struct psb_fbdev *)helper; 543 struct psb_fbdev *psb_fbdev =
544 container_of(helper, struct psb_fbdev, psb_fb_helper);
544 struct drm_device *dev = psb_fbdev->psb_fb_helper.dev; 545 struct drm_device *dev = psb_fbdev->psb_fb_helper.dev;
545 struct drm_psb_private *dev_priv = dev->dev_private; 546 struct drm_psb_private *dev_priv = dev->dev_private;
546 int bytespp; 547 int bytespp;
diff --git a/drivers/gpu/drm/mgag200/mgag200_fb.c b/drivers/gpu/drm/mgag200/mgag200_fb.c
index 5451dc58eff1..4415af3666ab 100644
--- a/drivers/gpu/drm/mgag200/mgag200_fb.c
+++ b/drivers/gpu/drm/mgag200/mgag200_fb.c
@@ -158,7 +158,8 @@ static int mgag200fb_create_object(struct mga_fbdev *afbdev,
158static int mgag200fb_create(struct drm_fb_helper *helper, 158static int mgag200fb_create(struct drm_fb_helper *helper,
159 struct drm_fb_helper_surface_size *sizes) 159 struct drm_fb_helper_surface_size *sizes)
160{ 160{
161 struct mga_fbdev *mfbdev = (struct mga_fbdev *)helper; 161 struct mga_fbdev *mfbdev =
162 container_of(helper, struct mga_fbdev, helper);
162 struct drm_device *dev = mfbdev->helper.dev; 163 struct drm_device *dev = mfbdev->helper.dev;
163 struct drm_mode_fb_cmd2 mode_cmd; 164 struct drm_mode_fb_cmd2 mode_cmd;
164 struct mga_device *mdev = dev->dev_private; 165 struct mga_device *mdev = dev->dev_private;
diff --git a/drivers/gpu/drm/nouveau/dispnv04/overlay.c b/drivers/gpu/drm/nouveau/dispnv04/overlay.c
index b36afcbbc83f..1e9056a8df94 100644
--- a/drivers/gpu/drm/nouveau/dispnv04/overlay.c
+++ b/drivers/gpu/drm/nouveau/dispnv04/overlay.c
@@ -97,7 +97,8 @@ nv10_update_plane(struct drm_plane *plane, struct drm_crtc *crtc,
97 uint32_t src_w, uint32_t src_h) 97 uint32_t src_w, uint32_t src_h)
98{ 98{
99 struct nvif_device *dev = &nouveau_drm(plane->dev)->device; 99 struct nvif_device *dev = &nouveau_drm(plane->dev)->device;
100 struct nouveau_plane *nv_plane = (struct nouveau_plane *)plane; 100 struct nouveau_plane *nv_plane =
101 container_of(plane, struct nouveau_plane, base);
101 struct nouveau_framebuffer *nv_fb = nouveau_framebuffer(fb); 102 struct nouveau_framebuffer *nv_fb = nouveau_framebuffer(fb);
102 struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); 103 struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc);
103 struct nouveau_bo *cur = nv_plane->cur; 104 struct nouveau_bo *cur = nv_plane->cur;
@@ -173,7 +174,8 @@ static int
173nv10_disable_plane(struct drm_plane *plane) 174nv10_disable_plane(struct drm_plane *plane)
174{ 175{
175 struct nvif_device *dev = &nouveau_drm(plane->dev)->device; 176 struct nvif_device *dev = &nouveau_drm(plane->dev)->device;
176 struct nouveau_plane *nv_plane = (struct nouveau_plane *)plane; 177 struct nouveau_plane *nv_plane =
178 container_of(plane, struct nouveau_plane, base);
177 179
178 nvif_wr32(dev, NV_PVIDEO_STOP, 1); 180 nvif_wr32(dev, NV_PVIDEO_STOP, 1);
179 if (nv_plane->cur) { 181 if (nv_plane->cur) {
@@ -224,7 +226,8 @@ nv_set_property(struct drm_plane *plane,
224 struct drm_property *property, 226 struct drm_property *property,
225 uint64_t value) 227 uint64_t value)
226{ 228{
227 struct nouveau_plane *nv_plane = (struct nouveau_plane *)plane; 229 struct nouveau_plane *nv_plane =
230 container_of(plane, struct nouveau_plane, base);
228 231
229 if (property == nv_plane->props.colorkey) 232 if (property == nv_plane->props.colorkey)
230 nv_plane->colorkey = value; 233 nv_plane->colorkey = value;
@@ -344,7 +347,8 @@ nv04_update_plane(struct drm_plane *plane, struct drm_crtc *crtc,
344 uint32_t src_w, uint32_t src_h) 347 uint32_t src_w, uint32_t src_h)
345{ 348{
346 struct nvif_device *dev = &nouveau_drm(plane->dev)->device; 349 struct nvif_device *dev = &nouveau_drm(plane->dev)->device;
347 struct nouveau_plane *nv_plane = (struct nouveau_plane *)plane; 350 struct nouveau_plane *nv_plane =
351 container_of(plane, struct nouveau_plane, base);
348 struct nouveau_framebuffer *nv_fb = nouveau_framebuffer(fb); 352 struct nouveau_framebuffer *nv_fb = nouveau_framebuffer(fb);
349 struct nouveau_bo *cur = nv_plane->cur; 353 struct nouveau_bo *cur = nv_plane->cur;
350 uint32_t overlay = 1; 354 uint32_t overlay = 1;
@@ -423,7 +427,8 @@ static int
423nv04_disable_plane(struct drm_plane *plane) 427nv04_disable_plane(struct drm_plane *plane)
424{ 428{
425 struct nvif_device *dev = &nouveau_drm(plane->dev)->device; 429 struct nvif_device *dev = &nouveau_drm(plane->dev)->device;
426 struct nouveau_plane *nv_plane = (struct nouveau_plane *)plane; 430 struct nouveau_plane *nv_plane =
431 container_of(plane, struct nouveau_plane, base);
427 432
428 nvif_mask(dev, NV_PVIDEO_OVERLAY, 1, 0); 433 nvif_mask(dev, NV_PVIDEO_OVERLAY, 1, 0);
429 nvif_wr32(dev, NV_PVIDEO_OE_STATE, 0); 434 nvif_wr32(dev, NV_PVIDEO_OE_STATE, 0);
diff --git a/drivers/gpu/drm/nouveau/nouveau_fbcon.c b/drivers/gpu/drm/nouveau/nouveau_fbcon.c
index f0ae10ca3ba9..dc1753c368e3 100644
--- a/drivers/gpu/drm/nouveau/nouveau_fbcon.c
+++ b/drivers/gpu/drm/nouveau/nouveau_fbcon.c
@@ -308,7 +308,8 @@ static int
308nouveau_fbcon_create(struct drm_fb_helper *helper, 308nouveau_fbcon_create(struct drm_fb_helper *helper,
309 struct drm_fb_helper_surface_size *sizes) 309 struct drm_fb_helper_surface_size *sizes)
310{ 310{
311 struct nouveau_fbdev *fbcon = (struct nouveau_fbdev *)helper; 311 struct nouveau_fbdev *fbcon =
312 container_of(helper, struct nouveau_fbdev, helper);
312 struct drm_device *dev = fbcon->dev; 313 struct drm_device *dev = fbcon->dev;
313 struct nouveau_drm *drm = nouveau_drm(dev); 314 struct nouveau_drm *drm = nouveau_drm(dev);
314 struct nvif_device *device = &drm->device; 315 struct nvif_device *device = &drm->device;
diff --git a/drivers/gpu/drm/qxl/qxl_fb.c b/drivers/gpu/drm/qxl/qxl_fb.c
index df567888bb1e..3d7c1d00a424 100644
--- a/drivers/gpu/drm/qxl/qxl_fb.c
+++ b/drivers/gpu/drm/qxl/qxl_fb.c
@@ -625,7 +625,8 @@ static int qxl_fb_find_or_create_single(
625 struct drm_fb_helper *helper, 625 struct drm_fb_helper *helper,
626 struct drm_fb_helper_surface_size *sizes) 626 struct drm_fb_helper_surface_size *sizes)
627{ 627{
628 struct qxl_fbdev *qfbdev = (struct qxl_fbdev *)helper; 628 struct qxl_fbdev *qfbdev =
629 container_of(helper, struct qxl_fbdev, helper);
629 int new_fb = 0; 630 int new_fb = 0;
630 int ret; 631 int ret;
631 632
diff --git a/drivers/gpu/drm/radeon/radeon_fb.c b/drivers/gpu/drm/radeon/radeon_fb.c
index 94b0f2aa3d7c..0ea1db83d573 100644
--- a/drivers/gpu/drm/radeon/radeon_fb.c
+++ b/drivers/gpu/drm/radeon/radeon_fb.c
@@ -189,7 +189,8 @@ out_unref:
189static int radeonfb_create(struct drm_fb_helper *helper, 189static int radeonfb_create(struct drm_fb_helper *helper,
190 struct drm_fb_helper_surface_size *sizes) 190 struct drm_fb_helper_surface_size *sizes)
191{ 191{
192 struct radeon_fbdev *rfbdev = (struct radeon_fbdev *)helper; 192 struct radeon_fbdev *rfbdev =
193 container_of(helper, 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;
diff --git a/drivers/gpu/drm/udl/udl_fb.c b/drivers/gpu/drm/udl/udl_fb.c
index d1da339843ca..8cbcb4589bd3 100644
--- a/drivers/gpu/drm/udl/udl_fb.c
+++ b/drivers/gpu/drm/udl/udl_fb.c
@@ -472,7 +472,8 @@ udl_framebuffer_init(struct drm_device *dev,
472static int udlfb_create(struct drm_fb_helper *helper, 472static int udlfb_create(struct drm_fb_helper *helper,
473 struct drm_fb_helper_surface_size *sizes) 473 struct drm_fb_helper_surface_size *sizes)
474{ 474{
475 struct udl_fbdev *ufbdev = (struct udl_fbdev *)helper; 475 struct udl_fbdev *ufbdev =
476 container_of(helper, struct udl_fbdev, helper);
476 struct drm_device *dev = ufbdev->helper.dev; 477 struct drm_device *dev = ufbdev->helper.dev;
477 struct fb_info *info; 478 struct fb_info *info;
478 struct device *device = dev->dev; 479 struct device *device = dev->dev;