aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/gma500
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/gma500
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/gma500')
-rw-r--r--drivers/gpu/drm/gma500/cdv_intel_display.c2
-rw-r--r--drivers/gpu/drm/gma500/cdv_intel_dp.c2
-rw-r--r--drivers/gpu/drm/gma500/cdv_intel_hdmi.c2
-rw-r--r--drivers/gpu/drm/gma500/cdv_intel_lvds.c2
-rw-r--r--drivers/gpu/drm/gma500/gma_display.c16
-rw-r--r--drivers/gpu/drm/gma500/mdfld_dsi_output.c2
-rw-r--r--drivers/gpu/drm/gma500/mdfld_intel_display.c16
-rw-r--r--drivers/gpu/drm/gma500/oaktrail_crtc.c12
-rw-r--r--drivers/gpu/drm/gma500/psb_intel_display.c2
-rw-r--r--drivers/gpu/drm/gma500/psb_intel_lvds.c2
-rw-r--r--drivers/gpu/drm/gma500/psb_intel_sdvo.c2
11 files changed, 30 insertions, 30 deletions
diff --git a/drivers/gpu/drm/gma500/cdv_intel_display.c b/drivers/gpu/drm/gma500/cdv_intel_display.c
index 7ff91ce3b12a..66727328832d 100644
--- a/drivers/gpu/drm/gma500/cdv_intel_display.c
+++ b/drivers/gpu/drm/gma500/cdv_intel_display.c
@@ -469,7 +469,7 @@ static bool cdv_intel_pipe_enabled(struct drm_device *dev, int pipe)
469 crtc = dev_priv->pipe_to_crtc_mapping[pipe]; 469 crtc = dev_priv->pipe_to_crtc_mapping[pipe];
470 gma_crtc = to_gma_crtc(crtc); 470 gma_crtc = to_gma_crtc(crtc);
471 471
472 if (crtc->fb == NULL || !gma_crtc->active) 472 if (crtc->primary->fb == NULL || !gma_crtc->active)
473 return false; 473 return false;
474 return true; 474 return true;
475} 475}
diff --git a/drivers/gpu/drm/gma500/cdv_intel_dp.c b/drivers/gpu/drm/gma500/cdv_intel_dp.c
index 0490ce36b53f..9ff30c2efadb 100644
--- a/drivers/gpu/drm/gma500/cdv_intel_dp.c
+++ b/drivers/gpu/drm/gma500/cdv_intel_dp.c
@@ -1693,7 +1693,7 @@ done:
1693 struct drm_crtc *crtc = encoder->base.crtc; 1693 struct drm_crtc *crtc = encoder->base.crtc;
1694 drm_crtc_helper_set_mode(crtc, &crtc->mode, 1694 drm_crtc_helper_set_mode(crtc, &crtc->mode,
1695 crtc->x, crtc->y, 1695 crtc->x, crtc->y,
1696 crtc->fb); 1696 crtc->primary->fb);
1697 } 1697 }
1698 1698
1699 return 0; 1699 return 0;
diff --git a/drivers/gpu/drm/gma500/cdv_intel_hdmi.c b/drivers/gpu/drm/gma500/cdv_intel_hdmi.c
index 968b42a5a32b..b99084b3f706 100644
--- a/drivers/gpu/drm/gma500/cdv_intel_hdmi.c
+++ b/drivers/gpu/drm/gma500/cdv_intel_hdmi.c
@@ -192,7 +192,7 @@ static int cdv_hdmi_set_property(struct drm_connector *connector,
192 crtc->saved_mode.vdisplay != 0) { 192 crtc->saved_mode.vdisplay != 0) {
193 if (centre) { 193 if (centre) {
194 if (!drm_crtc_helper_set_mode(encoder->crtc, &crtc->saved_mode, 194 if (!drm_crtc_helper_set_mode(encoder->crtc, &crtc->saved_mode,
195 encoder->crtc->x, encoder->crtc->y, encoder->crtc->fb)) 195 encoder->crtc->x, encoder->crtc->y, encoder->crtc->primary->fb))
196 return -1; 196 return -1;
197 } else { 197 } else {
198 struct drm_encoder_helper_funcs *helpers 198 struct drm_encoder_helper_funcs *helpers
diff --git a/drivers/gpu/drm/gma500/cdv_intel_lvds.c b/drivers/gpu/drm/gma500/cdv_intel_lvds.c
index 66a41c026834..8ecc920fc26d 100644
--- a/drivers/gpu/drm/gma500/cdv_intel_lvds.c
+++ b/drivers/gpu/drm/gma500/cdv_intel_lvds.c
@@ -494,7 +494,7 @@ static int cdv_intel_lvds_set_property(struct drm_connector *connector,
494 &crtc->saved_mode, 494 &crtc->saved_mode,
495 encoder->crtc->x, 495 encoder->crtc->x,
496 encoder->crtc->y, 496 encoder->crtc->y,
497 encoder->crtc->fb)) 497 encoder->crtc->primary->fb))
498 return -1; 498 return -1;
499 } 499 }
500 } else if (!strcmp(property->name, "backlight") && encoder) { 500 } else if (!strcmp(property->name, "backlight") && encoder) {
diff --git a/drivers/gpu/drm/gma500/gma_display.c b/drivers/gpu/drm/gma500/gma_display.c
index d45476b72aad..9bb9bddd881a 100644
--- a/drivers/gpu/drm/gma500/gma_display.c
+++ b/drivers/gpu/drm/gma500/gma_display.c
@@ -59,7 +59,7 @@ int gma_pipe_set_base(struct drm_crtc *crtc, int x, int y,
59 struct drm_device *dev = crtc->dev; 59 struct drm_device *dev = crtc->dev;
60 struct drm_psb_private *dev_priv = dev->dev_private; 60 struct drm_psb_private *dev_priv = dev->dev_private;
61 struct gma_crtc *gma_crtc = to_gma_crtc(crtc); 61 struct gma_crtc *gma_crtc = to_gma_crtc(crtc);
62 struct psb_framebuffer *psbfb = to_psb_fb(crtc->fb); 62 struct psb_framebuffer *psbfb = to_psb_fb(crtc->primary->fb);
63 int pipe = gma_crtc->pipe; 63 int pipe = gma_crtc->pipe;
64 const struct psb_offset *map = &dev_priv->regmap[pipe]; 64 const struct psb_offset *map = &dev_priv->regmap[pipe];
65 unsigned long start, offset; 65 unsigned long start, offset;
@@ -70,7 +70,7 @@ int gma_pipe_set_base(struct drm_crtc *crtc, int x, int y,
70 return 0; 70 return 0;
71 71
72 /* no fb bound */ 72 /* no fb bound */
73 if (!crtc->fb) { 73 if (!crtc->primary->fb) {
74 dev_err(dev->dev, "No FB bound\n"); 74 dev_err(dev->dev, "No FB bound\n");
75 goto gma_pipe_cleaner; 75 goto gma_pipe_cleaner;
76 } 76 }
@@ -81,19 +81,19 @@ int gma_pipe_set_base(struct drm_crtc *crtc, int x, int y,
81 if (ret < 0) 81 if (ret < 0)
82 goto gma_pipe_set_base_exit; 82 goto gma_pipe_set_base_exit;
83 start = psbfb->gtt->offset; 83 start = psbfb->gtt->offset;
84 offset = y * crtc->fb->pitches[0] + x * (crtc->fb->bits_per_pixel / 8); 84 offset = y * crtc->primary->fb->pitches[0] + x * (crtc->primary->fb->bits_per_pixel / 8);
85 85
86 REG_WRITE(map->stride, crtc->fb->pitches[0]); 86 REG_WRITE(map->stride, crtc->primary->fb->pitches[0]);
87 87
88 dspcntr = REG_READ(map->cntr); 88 dspcntr = REG_READ(map->cntr);
89 dspcntr &= ~DISPPLANE_PIXFORMAT_MASK; 89 dspcntr &= ~DISPPLANE_PIXFORMAT_MASK;
90 90
91 switch (crtc->fb->bits_per_pixel) { 91 switch (crtc->primary->fb->bits_per_pixel) {
92 case 8: 92 case 8:
93 dspcntr |= DISPPLANE_8BPP; 93 dspcntr |= DISPPLANE_8BPP;
94 break; 94 break;
95 case 16: 95 case 16:
96 if (crtc->fb->depth == 15) 96 if (crtc->primary->fb->depth == 15)
97 dspcntr |= DISPPLANE_15_16BPP; 97 dspcntr |= DISPPLANE_15_16BPP;
98 else 98 else
99 dspcntr |= DISPPLANE_16BPP; 99 dspcntr |= DISPPLANE_16BPP;
@@ -518,8 +518,8 @@ void gma_crtc_disable(struct drm_crtc *crtc)
518 518
519 crtc_funcs->dpms(crtc, DRM_MODE_DPMS_OFF); 519 crtc_funcs->dpms(crtc, DRM_MODE_DPMS_OFF);
520 520
521 if (crtc->fb) { 521 if (crtc->primary->fb) {
522 gt = to_psb_fb(crtc->fb)->gtt; 522 gt = to_psb_fb(crtc->primary->fb)->gtt;
523 psb_gtt_unpin(gt); 523 psb_gtt_unpin(gt);
524 } 524 }
525} 525}
diff --git a/drivers/gpu/drm/gma500/mdfld_dsi_output.c b/drivers/gpu/drm/gma500/mdfld_dsi_output.c
index 860a4ee9baaf..6e91b20ce2e5 100644
--- a/drivers/gpu/drm/gma500/mdfld_dsi_output.c
+++ b/drivers/gpu/drm/gma500/mdfld_dsi_output.c
@@ -287,7 +287,7 @@ static int mdfld_dsi_connector_set_property(struct drm_connector *connector,
287 &gma_crtc->saved_mode, 287 &gma_crtc->saved_mode,
288 encoder->crtc->x, 288 encoder->crtc->x,
289 encoder->crtc->y, 289 encoder->crtc->y,
290 encoder->crtc->fb)) 290 encoder->crtc->primary->fb))
291 goto set_prop_error; 291 goto set_prop_error;
292 } else { 292 } else {
293 struct drm_encoder_helper_funcs *funcs = 293 struct drm_encoder_helper_funcs *funcs =
diff --git a/drivers/gpu/drm/gma500/mdfld_intel_display.c b/drivers/gpu/drm/gma500/mdfld_intel_display.c
index 321c00a944e9..8cc8a5abbc7b 100644
--- a/drivers/gpu/drm/gma500/mdfld_intel_display.c
+++ b/drivers/gpu/drm/gma500/mdfld_intel_display.c
@@ -166,7 +166,7 @@ static int mdfld__intel_pipe_set_base(struct drm_crtc *crtc, int x, int y,
166 struct drm_device *dev = crtc->dev; 166 struct drm_device *dev = crtc->dev;
167 struct drm_psb_private *dev_priv = dev->dev_private; 167 struct drm_psb_private *dev_priv = dev->dev_private;
168 struct gma_crtc *gma_crtc = to_gma_crtc(crtc); 168 struct gma_crtc *gma_crtc = to_gma_crtc(crtc);
169 struct psb_framebuffer *psbfb = to_psb_fb(crtc->fb); 169 struct psb_framebuffer *psbfb = to_psb_fb(crtc->primary->fb);
170 int pipe = gma_crtc->pipe; 170 int pipe = gma_crtc->pipe;
171 const struct psb_offset *map = &dev_priv->regmap[pipe]; 171 const struct psb_offset *map = &dev_priv->regmap[pipe];
172 unsigned long start, offset; 172 unsigned long start, offset;
@@ -178,12 +178,12 @@ static int mdfld__intel_pipe_set_base(struct drm_crtc *crtc, int x, int y,
178 dev_dbg(dev->dev, "pipe = 0x%x.\n", pipe); 178 dev_dbg(dev->dev, "pipe = 0x%x.\n", pipe);
179 179
180 /* no fb bound */ 180 /* no fb bound */
181 if (!crtc->fb) { 181 if (!crtc->primary->fb) {
182 dev_dbg(dev->dev, "No FB bound\n"); 182 dev_dbg(dev->dev, "No FB bound\n");
183 return 0; 183 return 0;
184 } 184 }
185 185
186 ret = check_fb(crtc->fb); 186 ret = check_fb(crtc->primary->fb);
187 if (ret) 187 if (ret)
188 return ret; 188 return ret;
189 189
@@ -196,18 +196,18 @@ static int mdfld__intel_pipe_set_base(struct drm_crtc *crtc, int x, int y,
196 return 0; 196 return 0;
197 197
198 start = psbfb->gtt->offset; 198 start = psbfb->gtt->offset;
199 offset = y * crtc->fb->pitches[0] + x * (crtc->fb->bits_per_pixel / 8); 199 offset = y * crtc->primary->fb->pitches[0] + x * (crtc->primary->fb->bits_per_pixel / 8);
200 200
201 REG_WRITE(map->stride, crtc->fb->pitches[0]); 201 REG_WRITE(map->stride, crtc->primary->fb->pitches[0]);
202 dspcntr = REG_READ(map->cntr); 202 dspcntr = REG_READ(map->cntr);
203 dspcntr &= ~DISPPLANE_PIXFORMAT_MASK; 203 dspcntr &= ~DISPPLANE_PIXFORMAT_MASK;
204 204
205 switch (crtc->fb->bits_per_pixel) { 205 switch (crtc->primary->fb->bits_per_pixel) {
206 case 8: 206 case 8:
207 dspcntr |= DISPPLANE_8BPP; 207 dspcntr |= DISPPLANE_8BPP;
208 break; 208 break;
209 case 16: 209 case 16:
210 if (crtc->fb->depth == 15) 210 if (crtc->primary->fb->depth == 15)
211 dspcntr |= DISPPLANE_15_16BPP; 211 dspcntr |= DISPPLANE_15_16BPP;
212 else 212 else
213 dspcntr |= DISPPLANE_16BPP; 213 dspcntr |= DISPPLANE_16BPP;
@@ -700,7 +700,7 @@ static int mdfld_crtc_mode_set(struct drm_crtc *crtc,
700 } 700 }
701#endif 701#endif
702 702
703 ret = check_fb(crtc->fb); 703 ret = check_fb(crtc->primary->fb);
704 if (ret) 704 if (ret)
705 return ret; 705 return ret;
706 706
diff --git a/drivers/gpu/drm/gma500/oaktrail_crtc.c b/drivers/gpu/drm/gma500/oaktrail_crtc.c
index 8195e8592107..2de216c2374f 100644
--- a/drivers/gpu/drm/gma500/oaktrail_crtc.c
+++ b/drivers/gpu/drm/gma500/oaktrail_crtc.c
@@ -599,7 +599,7 @@ static int oaktrail_pipe_set_base(struct drm_crtc *crtc,
599 struct drm_device *dev = crtc->dev; 599 struct drm_device *dev = crtc->dev;
600 struct drm_psb_private *dev_priv = dev->dev_private; 600 struct drm_psb_private *dev_priv = dev->dev_private;
601 struct gma_crtc *gma_crtc = to_gma_crtc(crtc); 601 struct gma_crtc *gma_crtc = to_gma_crtc(crtc);
602 struct psb_framebuffer *psbfb = to_psb_fb(crtc->fb); 602 struct psb_framebuffer *psbfb = to_psb_fb(crtc->primary->fb);
603 int pipe = gma_crtc->pipe; 603 int pipe = gma_crtc->pipe;
604 const struct psb_offset *map = &dev_priv->regmap[pipe]; 604 const struct psb_offset *map = &dev_priv->regmap[pipe];
605 unsigned long start, offset; 605 unsigned long start, offset;
@@ -608,7 +608,7 @@ static int oaktrail_pipe_set_base(struct drm_crtc *crtc,
608 int ret = 0; 608 int ret = 0;
609 609
610 /* no fb bound */ 610 /* no fb bound */
611 if (!crtc->fb) { 611 if (!crtc->primary->fb) {
612 dev_dbg(dev->dev, "No FB bound\n"); 612 dev_dbg(dev->dev, "No FB bound\n");
613 return 0; 613 return 0;
614 } 614 }
@@ -617,19 +617,19 @@ static int oaktrail_pipe_set_base(struct drm_crtc *crtc,
617 return 0; 617 return 0;
618 618
619 start = psbfb->gtt->offset; 619 start = psbfb->gtt->offset;
620 offset = y * crtc->fb->pitches[0] + x * (crtc->fb->bits_per_pixel / 8); 620 offset = y * crtc->primary->fb->pitches[0] + x * (crtc->primary->fb->bits_per_pixel / 8);
621 621
622 REG_WRITE(map->stride, crtc->fb->pitches[0]); 622 REG_WRITE(map->stride, crtc->primary->fb->pitches[0]);
623 623
624 dspcntr = REG_READ(map->cntr); 624 dspcntr = REG_READ(map->cntr);
625 dspcntr &= ~DISPPLANE_PIXFORMAT_MASK; 625 dspcntr &= ~DISPPLANE_PIXFORMAT_MASK;
626 626
627 switch (crtc->fb->bits_per_pixel) { 627 switch (crtc->primary->fb->bits_per_pixel) {
628 case 8: 628 case 8:
629 dspcntr |= DISPPLANE_8BPP; 629 dspcntr |= DISPPLANE_8BPP;
630 break; 630 break;
631 case 16: 631 case 16:
632 if (crtc->fb->depth == 15) 632 if (crtc->primary->fb->depth == 15)
633 dspcntr |= DISPPLANE_15_16BPP; 633 dspcntr |= DISPPLANE_15_16BPP;
634 else 634 else
635 dspcntr |= DISPPLANE_16BPP; 635 dspcntr |= DISPPLANE_16BPP;
diff --git a/drivers/gpu/drm/gma500/psb_intel_display.c b/drivers/gpu/drm/gma500/psb_intel_display.c
index 21aed85eb96e..87b50ba64ed4 100644
--- a/drivers/gpu/drm/gma500/psb_intel_display.c
+++ b/drivers/gpu/drm/gma500/psb_intel_display.c
@@ -120,7 +120,7 @@ static int psb_intel_crtc_mode_set(struct drm_crtc *crtc,
120 const struct gma_limit_t *limit; 120 const struct gma_limit_t *limit;
121 121
122 /* No scan out no play */ 122 /* No scan out no play */
123 if (crtc->fb == NULL) { 123 if (crtc->primary->fb == NULL) {
124 crtc_funcs->mode_set_base(crtc, x, y, old_fb); 124 crtc_funcs->mode_set_base(crtc, x, y, old_fb);
125 return 0; 125 return 0;
126 } 126 }
diff --git a/drivers/gpu/drm/gma500/psb_intel_lvds.c b/drivers/gpu/drm/gma500/psb_intel_lvds.c
index 891a028a0826..d7778d0472c1 100644
--- a/drivers/gpu/drm/gma500/psb_intel_lvds.c
+++ b/drivers/gpu/drm/gma500/psb_intel_lvds.c
@@ -614,7 +614,7 @@ int psb_intel_lvds_set_property(struct drm_connector *connector,
614 &crtc->saved_mode, 614 &crtc->saved_mode,
615 encoder->crtc->x, 615 encoder->crtc->x,
616 encoder->crtc->y, 616 encoder->crtc->y,
617 encoder->crtc->fb)) 617 encoder->crtc->primary->fb))
618 goto set_prop_error; 618 goto set_prop_error;
619 } 619 }
620 } else if (!strcmp(property->name, "backlight")) { 620 } else if (!strcmp(property->name, "backlight")) {
diff --git a/drivers/gpu/drm/gma500/psb_intel_sdvo.c b/drivers/gpu/drm/gma500/psb_intel_sdvo.c
index 681efecb718b..deeb0829b129 100644
--- a/drivers/gpu/drm/gma500/psb_intel_sdvo.c
+++ b/drivers/gpu/drm/gma500/psb_intel_sdvo.c
@@ -1844,7 +1844,7 @@ done:
1844 if (psb_intel_sdvo->base.base.crtc) { 1844 if (psb_intel_sdvo->base.base.crtc) {
1845 struct drm_crtc *crtc = psb_intel_sdvo->base.base.crtc; 1845 struct drm_crtc *crtc = psb_intel_sdvo->base.base.crtc;
1846 drm_crtc_helper_set_mode(crtc, &crtc->mode, crtc->x, 1846 drm_crtc_helper_set_mode(crtc, &crtc->mode, crtc->x,
1847 crtc->y, crtc->fb); 1847 crtc->y, crtc->primary->fb);
1848 } 1848 }
1849 1849
1850 return 0; 1850 return 0;