aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_crtc_helper.c
diff options
context:
space:
mode:
authorMatt Roper <matthew.d.roper@intel.com>2014-04-01 18:22:40 -0400
committerRob Clark <robdclark@gmail.com>2014-04-01 20:18:28 -0400
commitf4510a2752b75ad5847b7935b68c233cab497f97 (patch)
tree0104efe442302d22b705f34605070a009cc633c9 /drivers/gpu/drm/drm_crtc_helper.c
parent2d82d188b2cb11b6b221eb84dda2344ef3cd1bb4 (diff)
drm: Replace crtc fb with primary plane fb (v3)
Now that CRTC's have a primary plane, there's no need to track the framebuffer in the CRTC. Replace all references to the CRTC fb with the primary plane's fb. This patch was generated by the Coccinelle semantic patching tool using the following rules: @@ struct drm_crtc C; @@ - (C).fb + C.primary->fb @@ struct drm_crtc *C; @@ - (C)->fb + C->primary->fb v3: Generate patch via coccinelle. Actual removal of crtc->fb has been moved to a subsequent patch. v2: Fixup several lingering crtc->fb instances that were missed in the first patch iteration. [Rob Clark] Signed-off-by: Matt Roper <matthew.d.roper@intel.com> Reviewed-by: Rob Clark <robdclark@gmail.com>
Diffstat (limited to 'drivers/gpu/drm/drm_crtc_helper.c')
-rw-r--r--drivers/gpu/drm/drm_crtc_helper.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c
index c0f2d6266070..2dd806b9bcd2 100644
--- a/drivers/gpu/drm/drm_crtc_helper.c
+++ b/drivers/gpu/drm/drm_crtc_helper.c
@@ -309,7 +309,7 @@ static void __drm_helper_disable_unused_functions(struct drm_device *dev)
309 (*crtc_funcs->disable)(crtc); 309 (*crtc_funcs->disable)(crtc);
310 else 310 else
311 (*crtc_funcs->dpms)(crtc, DRM_MODE_DPMS_OFF); 311 (*crtc_funcs->dpms)(crtc, DRM_MODE_DPMS_OFF);
312 crtc->fb = NULL; 312 crtc->primary->fb = NULL;
313 } 313 }
314 } 314 }
315} 315}
@@ -653,19 +653,19 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set)
653 save_set.mode = &set->crtc->mode; 653 save_set.mode = &set->crtc->mode;
654 save_set.x = set->crtc->x; 654 save_set.x = set->crtc->x;
655 save_set.y = set->crtc->y; 655 save_set.y = set->crtc->y;
656 save_set.fb = set->crtc->fb; 656 save_set.fb = set->crtc->primary->fb;
657 657
658 /* We should be able to check here if the fb has the same properties 658 /* We should be able to check here if the fb has the same properties
659 * and then just flip_or_move it */ 659 * and then just flip_or_move it */
660 if (set->crtc->fb != set->fb) { 660 if (set->crtc->primary->fb != set->fb) {
661 /* If we have no fb then treat it as a full mode set */ 661 /* If we have no fb then treat it as a full mode set */
662 if (set->crtc->fb == NULL) { 662 if (set->crtc->primary->fb == NULL) {
663 DRM_DEBUG_KMS("crtc has no fb, full mode set\n"); 663 DRM_DEBUG_KMS("crtc has no fb, full mode set\n");
664 mode_changed = true; 664 mode_changed = true;
665 } else if (set->fb == NULL) { 665 } else if (set->fb == NULL) {
666 mode_changed = true; 666 mode_changed = true;
667 } else if (set->fb->pixel_format != 667 } else if (set->fb->pixel_format !=
668 set->crtc->fb->pixel_format) { 668 set->crtc->primary->fb->pixel_format) {
669 mode_changed = true; 669 mode_changed = true;
670 } else 670 } else
671 fb_changed = true; 671 fb_changed = true;
@@ -766,13 +766,13 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set)
766 DRM_DEBUG_KMS("attempting to set mode from" 766 DRM_DEBUG_KMS("attempting to set mode from"
767 " userspace\n"); 767 " userspace\n");
768 drm_mode_debug_printmodeline(set->mode); 768 drm_mode_debug_printmodeline(set->mode);
769 set->crtc->fb = set->fb; 769 set->crtc->primary->fb = set->fb;
770 if (!drm_crtc_helper_set_mode(set->crtc, set->mode, 770 if (!drm_crtc_helper_set_mode(set->crtc, set->mode,
771 set->x, set->y, 771 set->x, set->y,
772 save_set.fb)) { 772 save_set.fb)) {
773 DRM_ERROR("failed to set mode on [CRTC:%d]\n", 773 DRM_ERROR("failed to set mode on [CRTC:%d]\n",
774 set->crtc->base.id); 774 set->crtc->base.id);
775 set->crtc->fb = save_set.fb; 775 set->crtc->primary->fb = save_set.fb;
776 ret = -EINVAL; 776 ret = -EINVAL;
777 goto fail; 777 goto fail;
778 } 778 }
@@ -787,13 +787,13 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set)
787 } else if (fb_changed) { 787 } else if (fb_changed) {
788 set->crtc->x = set->x; 788 set->crtc->x = set->x;
789 set->crtc->y = set->y; 789 set->crtc->y = set->y;
790 set->crtc->fb = set->fb; 790 set->crtc->primary->fb = set->fb;
791 ret = crtc_funcs->mode_set_base(set->crtc, 791 ret = crtc_funcs->mode_set_base(set->crtc,
792 set->x, set->y, save_set.fb); 792 set->x, set->y, save_set.fb);
793 if (ret != 0) { 793 if (ret != 0) {
794 set->crtc->x = save_set.x; 794 set->crtc->x = save_set.x;
795 set->crtc->y = save_set.y; 795 set->crtc->y = save_set.y;
796 set->crtc->fb = save_set.fb; 796 set->crtc->primary->fb = save_set.fb;
797 goto fail; 797 goto fail;
798 } 798 }
799 } 799 }
@@ -990,7 +990,7 @@ void drm_helper_resume_force_mode(struct drm_device *dev)
990 continue; 990 continue;
991 991
992 ret = drm_crtc_helper_set_mode(crtc, &crtc->mode, 992 ret = drm_crtc_helper_set_mode(crtc, &crtc->mode,
993 crtc->x, crtc->y, crtc->fb); 993 crtc->x, crtc->y, crtc->primary->fb);
994 994
995 /* Restoring the old config should never fail! */ 995 /* Restoring the old config should never fail! */
996 if (ret == false) 996 if (ret == false)