diff options
author | Daniel Stone <daniels@collabora.com> | 2018-03-30 10:11:37 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2018-04-11 14:07:56 -0400 |
commit | 9a0f0c9d0c9de76324807571694f8c89b433e3f1 (patch) | |
tree | f65d6fcba5b448ab0a2d4fcf72259095e2125c19 /drivers | |
parent | a110dfe3ab28fd4c52f785a7b80131ef5e8b61fb (diff) |
drm/radeon: radeon_framebuffer -> drm_framebuffer
Since drm_framebuffer can now store GEM objects directly, place them
there rather than in our own subclass. As this makes the framebuffer
create_handle and destroy functions the same as the GEM framebuffer
helper, we can reuse those.
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Daniel Stone <daniels@collabora.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: Christian König <christian.koenig@amd.com>
Cc: David (ChunMing) Zhou <David1.Zhou@amd.com>
Cc: amd-gfx@lists.freedesktop.org
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/radeon/atombios_crtc.c | 32 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_device.c | 6 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_display.c | 30 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_fb.c | 20 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_legacy_crtc.c | 11 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_mode.h | 7 |
6 files changed, 39 insertions, 67 deletions
diff --git a/drivers/gpu/drm/radeon/atombios_crtc.c b/drivers/gpu/drm/radeon/atombios_crtc.c index 028a811c1462..efbd5816082d 100644 --- a/drivers/gpu/drm/radeon/atombios_crtc.c +++ b/drivers/gpu/drm/radeon/atombios_crtc.c | |||
@@ -1145,7 +1145,6 @@ static int dce4_crtc_do_set_base(struct drm_crtc *crtc, | |||
1145 | struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); | 1145 | struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); |
1146 | struct drm_device *dev = crtc->dev; | 1146 | struct drm_device *dev = crtc->dev; |
1147 | struct radeon_device *rdev = dev->dev_private; | 1147 | struct radeon_device *rdev = dev->dev_private; |
1148 | struct radeon_framebuffer *radeon_fb; | ||
1149 | struct drm_framebuffer *target_fb; | 1148 | struct drm_framebuffer *target_fb; |
1150 | struct drm_gem_object *obj; | 1149 | struct drm_gem_object *obj; |
1151 | struct radeon_bo *rbo; | 1150 | struct radeon_bo *rbo; |
@@ -1164,19 +1163,15 @@ static int dce4_crtc_do_set_base(struct drm_crtc *crtc, | |||
1164 | return 0; | 1163 | return 0; |
1165 | } | 1164 | } |
1166 | 1165 | ||
1167 | if (atomic) { | 1166 | if (atomic) |
1168 | radeon_fb = to_radeon_framebuffer(fb); | ||
1169 | target_fb = fb; | 1167 | target_fb = fb; |
1170 | } | 1168 | else |
1171 | else { | ||
1172 | radeon_fb = to_radeon_framebuffer(crtc->primary->fb); | ||
1173 | target_fb = crtc->primary->fb; | 1169 | target_fb = crtc->primary->fb; |
1174 | } | ||
1175 | 1170 | ||
1176 | /* If atomic, assume fb object is pinned & idle & fenced and | 1171 | /* If atomic, assume fb object is pinned & idle & fenced and |
1177 | * just update base pointers | 1172 | * just update base pointers |
1178 | */ | 1173 | */ |
1179 | obj = radeon_fb->base.obj[0]; | 1174 | obj = target_fb->obj[0]; |
1180 | rbo = gem_to_radeon_bo(obj); | 1175 | rbo = gem_to_radeon_bo(obj); |
1181 | r = radeon_bo_reserve(rbo, false); | 1176 | r = radeon_bo_reserve(rbo, false); |
1182 | if (unlikely(r != 0)) | 1177 | if (unlikely(r != 0)) |
@@ -1441,8 +1436,7 @@ static int dce4_crtc_do_set_base(struct drm_crtc *crtc, | |||
1441 | WREG32(EVERGREEN_MASTER_UPDATE_MODE + radeon_crtc->crtc_offset, 0); | 1436 | WREG32(EVERGREEN_MASTER_UPDATE_MODE + radeon_crtc->crtc_offset, 0); |
1442 | 1437 | ||
1443 | if (!atomic && fb && fb != crtc->primary->fb) { | 1438 | if (!atomic && fb && fb != crtc->primary->fb) { |
1444 | radeon_fb = to_radeon_framebuffer(fb); | 1439 | rbo = gem_to_radeon_bo(fb->obj[0]); |
1445 | rbo = gem_to_radeon_bo(radeon_fb->base.obj[0]); | ||
1446 | r = radeon_bo_reserve(rbo, false); | 1440 | r = radeon_bo_reserve(rbo, false); |
1447 | if (unlikely(r != 0)) | 1441 | if (unlikely(r != 0)) |
1448 | return r; | 1442 | return r; |
@@ -1463,7 +1457,6 @@ static int avivo_crtc_do_set_base(struct drm_crtc *crtc, | |||
1463 | struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); | 1457 | struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); |
1464 | struct drm_device *dev = crtc->dev; | 1458 | struct drm_device *dev = crtc->dev; |
1465 | struct radeon_device *rdev = dev->dev_private; | 1459 | struct radeon_device *rdev = dev->dev_private; |
1466 | struct radeon_framebuffer *radeon_fb; | ||
1467 | struct drm_gem_object *obj; | 1460 | struct drm_gem_object *obj; |
1468 | struct radeon_bo *rbo; | 1461 | struct radeon_bo *rbo; |
1469 | struct drm_framebuffer *target_fb; | 1462 | struct drm_framebuffer *target_fb; |
@@ -1481,16 +1474,12 @@ static int avivo_crtc_do_set_base(struct drm_crtc *crtc, | |||
1481 | return 0; | 1474 | return 0; |
1482 | } | 1475 | } |
1483 | 1476 | ||
1484 | if (atomic) { | 1477 | if (atomic) |
1485 | radeon_fb = to_radeon_framebuffer(fb); | ||
1486 | target_fb = fb; | 1478 | target_fb = fb; |
1487 | } | 1479 | else |
1488 | else { | ||
1489 | radeon_fb = to_radeon_framebuffer(crtc->primary->fb); | ||
1490 | target_fb = crtc->primary->fb; | 1480 | target_fb = crtc->primary->fb; |
1491 | } | ||
1492 | 1481 | ||
1493 | obj = radeon_fb->base.obj[0]; | 1482 | obj = target_fb->obj[0]; |
1494 | rbo = gem_to_radeon_bo(obj); | 1483 | rbo = gem_to_radeon_bo(obj); |
1495 | r = radeon_bo_reserve(rbo, false); | 1484 | r = radeon_bo_reserve(rbo, false); |
1496 | if (unlikely(r != 0)) | 1485 | if (unlikely(r != 0)) |
@@ -1641,8 +1630,7 @@ static int avivo_crtc_do_set_base(struct drm_crtc *crtc, | |||
1641 | WREG32(AVIVO_D1MODE_MASTER_UPDATE_MODE + radeon_crtc->crtc_offset, 3); | 1630 | WREG32(AVIVO_D1MODE_MASTER_UPDATE_MODE + radeon_crtc->crtc_offset, 3); |
1642 | 1631 | ||
1643 | if (!atomic && fb && fb != crtc->primary->fb) { | 1632 | if (!atomic && fb && fb != crtc->primary->fb) { |
1644 | radeon_fb = to_radeon_framebuffer(fb); | 1633 | rbo = gem_to_radeon_bo(fb->obj[0]); |
1645 | rbo = gem_to_radeon_bo(radeon_fb->base.obj[0]); | ||
1646 | r = radeon_bo_reserve(rbo, false); | 1634 | r = radeon_bo_reserve(rbo, false); |
1647 | if (unlikely(r != 0)) | 1635 | if (unlikely(r != 0)) |
1648 | return r; | 1636 | return r; |
@@ -2149,11 +2137,9 @@ static void atombios_crtc_disable(struct drm_crtc *crtc) | |||
2149 | atombios_crtc_dpms(crtc, DRM_MODE_DPMS_OFF); | 2137 | atombios_crtc_dpms(crtc, DRM_MODE_DPMS_OFF); |
2150 | if (crtc->primary->fb) { | 2138 | if (crtc->primary->fb) { |
2151 | int r; | 2139 | int r; |
2152 | struct radeon_framebuffer *radeon_fb; | ||
2153 | struct radeon_bo *rbo; | 2140 | struct radeon_bo *rbo; |
2154 | 2141 | ||
2155 | radeon_fb = to_radeon_framebuffer(crtc->primary->fb); | 2142 | rbo = gem_to_radeon_bo(crtc->primary->fb->obj[0]); |
2156 | rbo = gem_to_radeon_bo(radeon_fb->base.obj[0]); | ||
2157 | r = radeon_bo_reserve(rbo, false); | 2143 | r = radeon_bo_reserve(rbo, false); |
2158 | if (unlikely(r)) | 2144 | if (unlikely(r)) |
2159 | DRM_ERROR("failed to reserve rbo before unpin\n"); | 2145 | DRM_ERROR("failed to reserve rbo before unpin\n"); |
diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c index 30c5bc20a60b..90e17e29e12a 100644 --- a/drivers/gpu/drm/radeon/radeon_device.c +++ b/drivers/gpu/drm/radeon/radeon_device.c | |||
@@ -1587,7 +1587,7 @@ int radeon_suspend_kms(struct drm_device *dev, bool suspend, | |||
1587 | /* unpin the front buffers and cursors */ | 1587 | /* unpin the front buffers and cursors */ |
1588 | list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { | 1588 | list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { |
1589 | struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); | 1589 | struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); |
1590 | struct radeon_framebuffer *rfb = to_radeon_framebuffer(crtc->primary->fb); | 1590 | struct drm_framebuffer *fb = crtc->primary->fb; |
1591 | struct radeon_bo *robj; | 1591 | struct radeon_bo *robj; |
1592 | 1592 | ||
1593 | if (radeon_crtc->cursor_bo) { | 1593 | if (radeon_crtc->cursor_bo) { |
@@ -1599,10 +1599,10 @@ int radeon_suspend_kms(struct drm_device *dev, bool suspend, | |||
1599 | } | 1599 | } |
1600 | } | 1600 | } |
1601 | 1601 | ||
1602 | if (rfb == NULL || rfb->base.obj[0] == NULL) { | 1602 | if (fb == NULL || fb->obj[0] == NULL) { |
1603 | continue; | 1603 | continue; |
1604 | } | 1604 | } |
1605 | robj = gem_to_radeon_bo(rfb->base.obj[0]); | 1605 | robj = gem_to_radeon_bo(fb->obj[0]); |
1606 | /* don't unpin kernel fb objects */ | 1606 | /* don't unpin kernel fb objects */ |
1607 | if (!radeon_fbdev_robj_is_fb(rdev, robj)) { | 1607 | if (!radeon_fbdev_robj_is_fb(rdev, robj)) { |
1608 | r = radeon_bo_reserve(robj, false); | 1608 | r = radeon_bo_reserve(robj, false); |
diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c index dc300128283d..9d3ac8b981da 100644 --- a/drivers/gpu/drm/radeon/radeon_display.c +++ b/drivers/gpu/drm/radeon/radeon_display.c | |||
@@ -479,8 +479,6 @@ static int radeon_crtc_page_flip_target(struct drm_crtc *crtc, | |||
479 | struct drm_device *dev = crtc->dev; | 479 | struct drm_device *dev = crtc->dev; |
480 | struct radeon_device *rdev = dev->dev_private; | 480 | struct radeon_device *rdev = dev->dev_private; |
481 | struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); | 481 | struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); |
482 | struct radeon_framebuffer *old_radeon_fb; | ||
483 | struct radeon_framebuffer *new_radeon_fb; | ||
484 | struct drm_gem_object *obj; | 482 | struct drm_gem_object *obj; |
485 | struct radeon_flip_work *work; | 483 | struct radeon_flip_work *work; |
486 | struct radeon_bo *new_rbo; | 484 | struct radeon_bo *new_rbo; |
@@ -502,15 +500,13 @@ static int radeon_crtc_page_flip_target(struct drm_crtc *crtc, | |||
502 | work->async = (page_flip_flags & DRM_MODE_PAGE_FLIP_ASYNC) != 0; | 500 | work->async = (page_flip_flags & DRM_MODE_PAGE_FLIP_ASYNC) != 0; |
503 | 501 | ||
504 | /* schedule unpin of the old buffer */ | 502 | /* schedule unpin of the old buffer */ |
505 | old_radeon_fb = to_radeon_framebuffer(crtc->primary->fb); | 503 | obj = crtc->primary->fb->obj[0]; |
506 | obj = old_radeon_fb->base.obj[0]; | ||
507 | 504 | ||
508 | /* take a reference to the old object */ | 505 | /* take a reference to the old object */ |
509 | drm_gem_object_get(obj); | 506 | drm_gem_object_get(obj); |
510 | work->old_rbo = gem_to_radeon_bo(obj); | 507 | work->old_rbo = gem_to_radeon_bo(obj); |
511 | 508 | ||
512 | new_radeon_fb = to_radeon_framebuffer(fb); | 509 | obj = fb->obj[0]; |
513 | obj = new_radeon_fb->base.obj[0]; | ||
514 | new_rbo = gem_to_radeon_bo(obj); | 510 | new_rbo = gem_to_radeon_bo(obj); |
515 | 511 | ||
516 | /* pin the new buffer */ | 512 | /* pin the new buffer */ |
@@ -1293,16 +1289,16 @@ static const struct drm_framebuffer_funcs radeon_fb_funcs = { | |||
1293 | 1289 | ||
1294 | int | 1290 | int |
1295 | radeon_framebuffer_init(struct drm_device *dev, | 1291 | radeon_framebuffer_init(struct drm_device *dev, |
1296 | struct radeon_framebuffer *rfb, | 1292 | struct drm_framebuffer *fb, |
1297 | const struct drm_mode_fb_cmd2 *mode_cmd, | 1293 | const struct drm_mode_fb_cmd2 *mode_cmd, |
1298 | struct drm_gem_object *obj) | 1294 | struct drm_gem_object *obj) |
1299 | { | 1295 | { |
1300 | int ret; | 1296 | int ret; |
1301 | rfb->base.obj[0] = obj; | 1297 | fb->obj[0] = obj; |
1302 | drm_helper_mode_fill_fb_struct(dev, &rfb->base, mode_cmd); | 1298 | drm_helper_mode_fill_fb_struct(dev, fb, mode_cmd); |
1303 | ret = drm_framebuffer_init(dev, &rfb->base, &radeon_fb_funcs); | 1299 | ret = drm_framebuffer_init(dev, fb, &radeon_fb_funcs); |
1304 | if (ret) { | 1300 | if (ret) { |
1305 | rfb->base.obj[0] = NULL; | 1301 | fb->obj[0] = NULL; |
1306 | return ret; | 1302 | return ret; |
1307 | } | 1303 | } |
1308 | return 0; | 1304 | return 0; |
@@ -1314,7 +1310,7 @@ radeon_user_framebuffer_create(struct drm_device *dev, | |||
1314 | const struct drm_mode_fb_cmd2 *mode_cmd) | 1310 | const struct drm_mode_fb_cmd2 *mode_cmd) |
1315 | { | 1311 | { |
1316 | struct drm_gem_object *obj; | 1312 | struct drm_gem_object *obj; |
1317 | struct radeon_framebuffer *radeon_fb; | 1313 | struct drm_framebuffer *fb; |
1318 | int ret; | 1314 | int ret; |
1319 | 1315 | ||
1320 | obj = drm_gem_object_lookup(file_priv, mode_cmd->handles[0]); | 1316 | obj = drm_gem_object_lookup(file_priv, mode_cmd->handles[0]); |
@@ -1330,20 +1326,20 @@ radeon_user_framebuffer_create(struct drm_device *dev, | |||
1330 | return ERR_PTR(-EINVAL); | 1326 | return ERR_PTR(-EINVAL); |
1331 | } | 1327 | } |
1332 | 1328 | ||
1333 | radeon_fb = kzalloc(sizeof(*radeon_fb), GFP_KERNEL); | 1329 | fb = kzalloc(sizeof(*fb), GFP_KERNEL); |
1334 | if (radeon_fb == NULL) { | 1330 | if (fb == NULL) { |
1335 | drm_gem_object_put_unlocked(obj); | 1331 | drm_gem_object_put_unlocked(obj); |
1336 | return ERR_PTR(-ENOMEM); | 1332 | return ERR_PTR(-ENOMEM); |
1337 | } | 1333 | } |
1338 | 1334 | ||
1339 | ret = radeon_framebuffer_init(dev, radeon_fb, mode_cmd, obj); | 1335 | ret = radeon_framebuffer_init(dev, fb, mode_cmd, obj); |
1340 | if (ret) { | 1336 | if (ret) { |
1341 | kfree(radeon_fb); | 1337 | kfree(fb); |
1342 | drm_gem_object_put_unlocked(obj); | 1338 | drm_gem_object_put_unlocked(obj); |
1343 | return ERR_PTR(ret); | 1339 | return ERR_PTR(ret); |
1344 | } | 1340 | } |
1345 | 1341 | ||
1346 | return &radeon_fb->base; | 1342 | return fb; |
1347 | } | 1343 | } |
1348 | 1344 | ||
1349 | static const struct drm_mode_config_funcs radeon_mode_funcs = { | 1345 | static const struct drm_mode_config_funcs radeon_mode_funcs = { |
diff --git a/drivers/gpu/drm/radeon/radeon_fb.c b/drivers/gpu/drm/radeon/radeon_fb.c index 6cd99f6a4305..1179034024ae 100644 --- a/drivers/gpu/drm/radeon/radeon_fb.c +++ b/drivers/gpu/drm/radeon/radeon_fb.c | |||
@@ -43,7 +43,7 @@ | |||
43 | */ | 43 | */ |
44 | struct radeon_fbdev { | 44 | struct radeon_fbdev { |
45 | struct drm_fb_helper helper; | 45 | struct drm_fb_helper helper; |
46 | struct radeon_framebuffer rfb; | 46 | struct drm_framebuffer fb; |
47 | struct radeon_device *rdev; | 47 | struct radeon_device *rdev; |
48 | }; | 48 | }; |
49 | 49 | ||
@@ -246,13 +246,13 @@ static int radeonfb_create(struct drm_fb_helper *helper, | |||
246 | 246 | ||
247 | info->par = rfbdev; | 247 | info->par = rfbdev; |
248 | 248 | ||
249 | ret = radeon_framebuffer_init(rdev->ddev, &rfbdev->rfb, &mode_cmd, gobj); | 249 | ret = radeon_framebuffer_init(rdev->ddev, &rfbdev->fb, &mode_cmd, gobj); |
250 | if (ret) { | 250 | if (ret) { |
251 | DRM_ERROR("failed to initialize framebuffer %d\n", ret); | 251 | DRM_ERROR("failed to initialize framebuffer %d\n", ret); |
252 | goto out; | 252 | goto out; |
253 | } | 253 | } |
254 | 254 | ||
255 | fb = &rfbdev->rfb.base; | 255 | fb = &rfbdev->fb; |
256 | 256 | ||
257 | /* setup helper */ | 257 | /* setup helper */ |
258 | rfbdev->helper.fb = fb; | 258 | rfbdev->helper.fb = fb; |
@@ -308,15 +308,15 @@ out: | |||
308 | 308 | ||
309 | static int radeon_fbdev_destroy(struct drm_device *dev, struct radeon_fbdev *rfbdev) | 309 | static int radeon_fbdev_destroy(struct drm_device *dev, struct radeon_fbdev *rfbdev) |
310 | { | 310 | { |
311 | struct radeon_framebuffer *rfb = &rfbdev->rfb; | 311 | struct drm_framebuffer *fb = &rfbdev->fb; |
312 | 312 | ||
313 | drm_fb_helper_unregister_fbi(&rfbdev->helper); | 313 | drm_fb_helper_unregister_fbi(&rfbdev->helper); |
314 | 314 | ||
315 | if (rfb->base.obj[0]) { | 315 | if (fb->obj[0]) { |
316 | radeonfb_destroy_pinned_object(rfb->base.obj[0]); | 316 | radeonfb_destroy_pinned_object(fb->obj[0]); |
317 | rfb->base.obj[0] = NULL; | 317 | fb->obj[0] = NULL; |
318 | drm_framebuffer_unregister_private(&rfb->base); | 318 | drm_framebuffer_unregister_private(fb); |
319 | drm_framebuffer_cleanup(&rfb->base); | 319 | drm_framebuffer_cleanup(fb); |
320 | } | 320 | } |
321 | drm_fb_helper_fini(&rfbdev->helper); | 321 | drm_fb_helper_fini(&rfbdev->helper); |
322 | 322 | ||
@@ -400,7 +400,7 @@ bool radeon_fbdev_robj_is_fb(struct radeon_device *rdev, struct radeon_bo *robj) | |||
400 | if (!rdev->mode_info.rfbdev) | 400 | if (!rdev->mode_info.rfbdev) |
401 | return false; | 401 | return false; |
402 | 402 | ||
403 | if (robj == gem_to_radeon_bo(rdev->mode_info.rfbdev->rfb.base.obj[0])) | 403 | if (robj == gem_to_radeon_bo(rdev->mode_info.rfbdev->fb.obj[0])) |
404 | return true; | 404 | return true; |
405 | return false; | 405 | return false; |
406 | } | 406 | } |
diff --git a/drivers/gpu/drm/radeon/radeon_legacy_crtc.c b/drivers/gpu/drm/radeon/radeon_legacy_crtc.c index 50b3f556845a..35a205ae4318 100644 --- a/drivers/gpu/drm/radeon/radeon_legacy_crtc.c +++ b/drivers/gpu/drm/radeon/radeon_legacy_crtc.c | |||
@@ -374,7 +374,6 @@ int radeon_crtc_do_set_base(struct drm_crtc *crtc, | |||
374 | struct drm_device *dev = crtc->dev; | 374 | struct drm_device *dev = crtc->dev; |
375 | struct radeon_device *rdev = dev->dev_private; | 375 | struct radeon_device *rdev = dev->dev_private; |
376 | struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); | 376 | struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); |
377 | struct radeon_framebuffer *radeon_fb; | ||
378 | struct drm_framebuffer *target_fb; | 377 | struct drm_framebuffer *target_fb; |
379 | struct drm_gem_object *obj; | 378 | struct drm_gem_object *obj; |
380 | struct radeon_bo *rbo; | 379 | struct radeon_bo *rbo; |
@@ -393,14 +392,10 @@ int radeon_crtc_do_set_base(struct drm_crtc *crtc, | |||
393 | return 0; | 392 | return 0; |
394 | } | 393 | } |
395 | 394 | ||
396 | if (atomic) { | 395 | if (atomic) |
397 | radeon_fb = to_radeon_framebuffer(fb); | ||
398 | target_fb = fb; | 396 | target_fb = fb; |
399 | } | 397 | else |
400 | else { | ||
401 | radeon_fb = to_radeon_framebuffer(crtc->primary->fb); | ||
402 | target_fb = crtc->primary->fb; | 398 | target_fb = crtc->primary->fb; |
403 | } | ||
404 | 399 | ||
405 | switch (target_fb->format->cpp[0] * 8) { | 400 | switch (target_fb->format->cpp[0] * 8) { |
406 | case 8: | 401 | case 8: |
@@ -423,7 +418,7 @@ int radeon_crtc_do_set_base(struct drm_crtc *crtc, | |||
423 | } | 418 | } |
424 | 419 | ||
425 | /* Pin framebuffer & get tilling informations */ | 420 | /* Pin framebuffer & get tilling informations */ |
426 | obj = radeon_fb->base.obj[0]; | 421 | obj = target_fb->obj[0]; |
427 | rbo = gem_to_radeon_bo(obj); | 422 | rbo = gem_to_radeon_bo(obj); |
428 | retry: | 423 | retry: |
429 | r = radeon_bo_reserve(rbo, false); | 424 | r = radeon_bo_reserve(rbo, false); |
diff --git a/drivers/gpu/drm/radeon/radeon_mode.h b/drivers/gpu/drm/radeon/radeon_mode.h index cd93c80332f7..fd470d6bf3f4 100644 --- a/drivers/gpu/drm/radeon/radeon_mode.h +++ b/drivers/gpu/drm/radeon/radeon_mode.h | |||
@@ -46,7 +46,6 @@ struct radeon_device; | |||
46 | #define to_radeon_crtc(x) container_of(x, struct radeon_crtc, base) | 46 | #define to_radeon_crtc(x) container_of(x, struct radeon_crtc, base) |
47 | #define to_radeon_connector(x) container_of(x, struct radeon_connector, base) | 47 | #define to_radeon_connector(x) container_of(x, struct radeon_connector, base) |
48 | #define to_radeon_encoder(x) container_of(x, struct radeon_encoder, base) | 48 | #define to_radeon_encoder(x) container_of(x, struct radeon_encoder, base) |
49 | #define to_radeon_framebuffer(x) container_of(x, struct radeon_framebuffer, base) | ||
50 | 49 | ||
51 | #define RADEON_MAX_HPD_PINS 7 | 50 | #define RADEON_MAX_HPD_PINS 7 |
52 | #define RADEON_MAX_CRTCS 6 | 51 | #define RADEON_MAX_CRTCS 6 |
@@ -574,10 +573,6 @@ struct radeon_connector { | |||
574 | int enabled_attribs; | 573 | int enabled_attribs; |
575 | }; | 574 | }; |
576 | 575 | ||
577 | struct radeon_framebuffer { | ||
578 | struct drm_framebuffer base; | ||
579 | }; | ||
580 | |||
581 | #define ENCODER_MODE_IS_DP(em) (((em) == ATOM_ENCODER_MODE_DP) || \ | 576 | #define ENCODER_MODE_IS_DP(em) (((em) == ATOM_ENCODER_MODE_DP) || \ |
582 | ((em) == ATOM_ENCODER_MODE_DP_MST)) | 577 | ((em) == ATOM_ENCODER_MODE_DP_MST)) |
583 | 578 | ||
@@ -931,7 +926,7 @@ radeon_combios_encoder_crtc_scratch_regs(struct drm_encoder *encoder, int crtc); | |||
931 | extern void | 926 | extern void |
932 | radeon_combios_encoder_dpms_scratch_regs(struct drm_encoder *encoder, bool on); | 927 | radeon_combios_encoder_dpms_scratch_regs(struct drm_encoder *encoder, bool on); |
933 | int radeon_framebuffer_init(struct drm_device *dev, | 928 | int radeon_framebuffer_init(struct drm_device *dev, |
934 | struct radeon_framebuffer *rfb, | 929 | struct drm_framebuffer *rfb, |
935 | const struct drm_mode_fb_cmd2 *mode_cmd, | 930 | const struct drm_mode_fb_cmd2 *mode_cmd, |
936 | struct drm_gem_object *obj); | 931 | struct drm_gem_object *obj); |
937 | 932 | ||