diff options
author | Matt Roper <matthew.d.roper@intel.com> | 2014-04-01 18:22:40 -0400 |
---|---|---|
committer | Rob Clark <robdclark@gmail.com> | 2014-04-01 20:18:28 -0400 |
commit | f4510a2752b75ad5847b7935b68c233cab497f97 (patch) | |
tree | 0104efe442302d22b705f34605070a009cc633c9 /drivers/gpu/drm/nouveau/nv50_display.c | |
parent | 2d82d188b2cb11b6b221eb84dda2344ef3cd1bb4 (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/nouveau/nv50_display.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nv50_display.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/gpu/drm/nouveau/nv50_display.c b/drivers/gpu/drm/nouveau/nv50_display.c index 2dccafc6e9db..58af547b0b93 100644 --- a/drivers/gpu/drm/nouveau/nv50_display.c +++ b/drivers/gpu/drm/nouveau/nv50_display.c | |||
@@ -651,7 +651,7 @@ nv50_crtc_set_dither(struct nouveau_crtc *nv_crtc, bool update) | |||
651 | nv_connector = nouveau_crtc_connector_get(nv_crtc); | 651 | nv_connector = nouveau_crtc_connector_get(nv_crtc); |
652 | connector = &nv_connector->base; | 652 | connector = &nv_connector->base; |
653 | if (nv_connector->dithering_mode == DITHERING_MODE_AUTO) { | 653 | if (nv_connector->dithering_mode == DITHERING_MODE_AUTO) { |
654 | if (nv_crtc->base.fb->depth > connector->display_info.bpc * 3) | 654 | if (nv_crtc->base.primary->fb->depth > connector->display_info.bpc * 3) |
655 | mode = DITHERING_MODE_DYNAMIC2X2; | 655 | mode = DITHERING_MODE_DYNAMIC2X2; |
656 | } else { | 656 | } else { |
657 | mode = nv_connector->dithering_mode; | 657 | mode = nv_connector->dithering_mode; |
@@ -785,7 +785,8 @@ nv50_crtc_set_scale(struct nouveau_crtc *nv_crtc, bool update) | |||
785 | 785 | ||
786 | if (update) { | 786 | if (update) { |
787 | nv50_display_flip_stop(crtc); | 787 | nv50_display_flip_stop(crtc); |
788 | nv50_display_flip_next(crtc, crtc->fb, NULL, 1); | 788 | nv50_display_flip_next(crtc, crtc->primary->fb, |
789 | NULL, 1); | ||
789 | } | 790 | } |
790 | } | 791 | } |
791 | 792 | ||
@@ -1028,7 +1029,7 @@ nv50_crtc_commit(struct drm_crtc *crtc) | |||
1028 | } | 1029 | } |
1029 | 1030 | ||
1030 | nv50_crtc_cursor_show_hide(nv_crtc, nv_crtc->cursor.visible, true); | 1031 | nv50_crtc_cursor_show_hide(nv_crtc, nv_crtc->cursor.visible, true); |
1031 | nv50_display_flip_next(crtc, crtc->fb, NULL, 1); | 1032 | nv50_display_flip_next(crtc, crtc->primary->fb, NULL, 1); |
1032 | } | 1033 | } |
1033 | 1034 | ||
1034 | static bool | 1035 | static bool |
@@ -1042,7 +1043,7 @@ nv50_crtc_mode_fixup(struct drm_crtc *crtc, const struct drm_display_mode *mode, | |||
1042 | static int | 1043 | static int |
1043 | nv50_crtc_swap_fbs(struct drm_crtc *crtc, struct drm_framebuffer *old_fb) | 1044 | nv50_crtc_swap_fbs(struct drm_crtc *crtc, struct drm_framebuffer *old_fb) |
1044 | { | 1045 | { |
1045 | struct nouveau_framebuffer *nvfb = nouveau_framebuffer(crtc->fb); | 1046 | struct nouveau_framebuffer *nvfb = nouveau_framebuffer(crtc->primary->fb); |
1046 | struct nv50_head *head = nv50_head(crtc); | 1047 | struct nv50_head *head = nv50_head(crtc); |
1047 | int ret; | 1048 | int ret; |
1048 | 1049 | ||
@@ -1139,7 +1140,7 @@ nv50_crtc_mode_set(struct drm_crtc *crtc, struct drm_display_mode *umode, | |||
1139 | nv50_crtc_set_dither(nv_crtc, false); | 1140 | nv50_crtc_set_dither(nv_crtc, false); |
1140 | nv50_crtc_set_scale(nv_crtc, false); | 1141 | nv50_crtc_set_scale(nv_crtc, false); |
1141 | nv50_crtc_set_color_vibrance(nv_crtc, false); | 1142 | nv50_crtc_set_color_vibrance(nv_crtc, false); |
1142 | nv50_crtc_set_image(nv_crtc, crtc->fb, x, y, false); | 1143 | nv50_crtc_set_image(nv_crtc, crtc->primary->fb, x, y, false); |
1143 | return 0; | 1144 | return 0; |
1144 | } | 1145 | } |
1145 | 1146 | ||
@@ -1151,7 +1152,7 @@ nv50_crtc_mode_set_base(struct drm_crtc *crtc, int x, int y, | |||
1151 | struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); | 1152 | struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); |
1152 | int ret; | 1153 | int ret; |
1153 | 1154 | ||
1154 | if (!crtc->fb) { | 1155 | if (!crtc->primary->fb) { |
1155 | NV_DEBUG(drm, "No FB bound\n"); | 1156 | NV_DEBUG(drm, "No FB bound\n"); |
1156 | return 0; | 1157 | return 0; |
1157 | } | 1158 | } |
@@ -1161,8 +1162,8 @@ nv50_crtc_mode_set_base(struct drm_crtc *crtc, int x, int y, | |||
1161 | return ret; | 1162 | return ret; |
1162 | 1163 | ||
1163 | nv50_display_flip_stop(crtc); | 1164 | nv50_display_flip_stop(crtc); |
1164 | nv50_crtc_set_image(nv_crtc, crtc->fb, x, y, true); | 1165 | nv50_crtc_set_image(nv_crtc, crtc->primary->fb, x, y, true); |
1165 | nv50_display_flip_next(crtc, crtc->fb, NULL, 1); | 1166 | nv50_display_flip_next(crtc, crtc->primary->fb, NULL, 1); |
1166 | return 0; | 1167 | return 0; |
1167 | } | 1168 | } |
1168 | 1169 | ||