aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.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/msm/mdp/mdp5/mdp5_crtc.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/msm/mdp/mdp5/mdp5_crtc.c')
-rw-r--r--drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c
index 54afdb2fc32e..6ea10bdb6e8f 100644
--- a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c
+++ b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c
@@ -102,7 +102,7 @@ static void update_fb(struct drm_crtc *crtc, struct drm_framebuffer *new_fb)
102 102
103 /* grab reference to incoming scanout fb: */ 103 /* grab reference to incoming scanout fb: */
104 drm_framebuffer_reference(new_fb); 104 drm_framebuffer_reference(new_fb);
105 mdp5_crtc->base.fb = new_fb; 105 mdp5_crtc->base.primary->fb = new_fb;
106 mdp5_crtc->fb = new_fb; 106 mdp5_crtc->fb = new_fb;
107 107
108 if (old_fb) 108 if (old_fb)
@@ -289,14 +289,14 @@ static int mdp5_crtc_mode_set(struct drm_crtc *crtc,
289 mode->type, mode->flags); 289 mode->type, mode->flags);
290 290
291 /* grab extra ref for update_scanout() */ 291 /* grab extra ref for update_scanout() */
292 drm_framebuffer_reference(crtc->fb); 292 drm_framebuffer_reference(crtc->primary->fb);
293 293
294 ret = mdp5_plane_mode_set(mdp5_crtc->plane, crtc, crtc->fb, 294 ret = mdp5_plane_mode_set(mdp5_crtc->plane, crtc, crtc->primary->fb,
295 0, 0, mode->hdisplay, mode->vdisplay, 295 0, 0, mode->hdisplay, mode->vdisplay,
296 x << 16, y << 16, 296 x << 16, y << 16,
297 mode->hdisplay << 16, mode->vdisplay << 16); 297 mode->hdisplay << 16, mode->vdisplay << 16);
298 if (ret) { 298 if (ret) {
299 drm_framebuffer_unreference(crtc->fb); 299 drm_framebuffer_unreference(crtc->primary->fb);
300 dev_err(crtc->dev->dev, "%s: failed to set mode on plane: %d\n", 300 dev_err(crtc->dev->dev, "%s: failed to set mode on plane: %d\n",
301 mdp5_crtc->name, ret); 301 mdp5_crtc->name, ret);
302 return ret; 302 return ret;
@@ -306,8 +306,8 @@ static int mdp5_crtc_mode_set(struct drm_crtc *crtc,
306 MDP5_LM_OUT_SIZE_WIDTH(mode->hdisplay) | 306 MDP5_LM_OUT_SIZE_WIDTH(mode->hdisplay) |
307 MDP5_LM_OUT_SIZE_HEIGHT(mode->vdisplay)); 307 MDP5_LM_OUT_SIZE_HEIGHT(mode->vdisplay));
308 308
309 update_fb(crtc, crtc->fb); 309 update_fb(crtc, crtc->primary->fb);
310 update_scanout(crtc, crtc->fb); 310 update_scanout(crtc, crtc->primary->fb);
311 311
312 return 0; 312 return 0;
313} 313}
@@ -338,19 +338,19 @@ static int mdp5_crtc_mode_set_base(struct drm_crtc *crtc, int x, int y,
338 int ret; 338 int ret;
339 339
340 /* grab extra ref for update_scanout() */ 340 /* grab extra ref for update_scanout() */
341 drm_framebuffer_reference(crtc->fb); 341 drm_framebuffer_reference(crtc->primary->fb);
342 342
343 ret = mdp5_plane_mode_set(plane, crtc, crtc->fb, 343 ret = mdp5_plane_mode_set(plane, crtc, crtc->primary->fb,
344 0, 0, mode->hdisplay, mode->vdisplay, 344 0, 0, mode->hdisplay, mode->vdisplay,
345 x << 16, y << 16, 345 x << 16, y << 16,
346 mode->hdisplay << 16, mode->vdisplay << 16); 346 mode->hdisplay << 16, mode->vdisplay << 16);
347 if (ret) { 347 if (ret) {
348 drm_framebuffer_unreference(crtc->fb); 348 drm_framebuffer_unreference(crtc->primary->fb);
349 return ret; 349 return ret;
350 } 350 }
351 351
352 update_fb(crtc, crtc->fb); 352 update_fb(crtc, crtc->primary->fb);
353 update_scanout(crtc, crtc->fb); 353 update_scanout(crtc, crtc->primary->fb);
354 354
355 return 0; 355 return 0;
356} 356}