aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/omapdrm/omap_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/omapdrm/omap_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/omapdrm/omap_crtc.c')
-rw-r--r--drivers/gpu/drm/omapdrm/omap_crtc.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/gpu/drm/omapdrm/omap_crtc.c b/drivers/gpu/drm/omapdrm/omap_crtc.c
index 4313bb0a49a6..355157e4f78d 100644
--- a/drivers/gpu/drm/omapdrm/omap_crtc.c
+++ b/drivers/gpu/drm/omapdrm/omap_crtc.c
@@ -245,7 +245,7 @@ static int omap_crtc_mode_set(struct drm_crtc *crtc,
245 copy_timings_drm_to_omap(&omap_crtc->timings, mode); 245 copy_timings_drm_to_omap(&omap_crtc->timings, mode);
246 omap_crtc->full_update = true; 246 omap_crtc->full_update = true;
247 247
248 return omap_plane_mode_set(omap_crtc->plane, crtc, crtc->fb, 248 return omap_plane_mode_set(omap_crtc->plane, crtc, crtc->primary->fb,
249 0, 0, mode->hdisplay, mode->vdisplay, 249 0, 0, mode->hdisplay, mode->vdisplay,
250 x << 16, y << 16, 250 x << 16, y << 16,
251 mode->hdisplay << 16, mode->vdisplay << 16, 251 mode->hdisplay << 16, mode->vdisplay << 16,
@@ -273,7 +273,7 @@ static int omap_crtc_mode_set_base(struct drm_crtc *crtc, int x, int y,
273 struct drm_plane *plane = omap_crtc->plane; 273 struct drm_plane *plane = omap_crtc->plane;
274 struct drm_display_mode *mode = &crtc->mode; 274 struct drm_display_mode *mode = &crtc->mode;
275 275
276 return omap_plane_mode_set(plane, crtc, crtc->fb, 276 return omap_plane_mode_set(plane, crtc, crtc->primary->fb,
277 0, 0, mode->hdisplay, mode->vdisplay, 277 0, 0, mode->hdisplay, mode->vdisplay,
278 x << 16, y << 16, 278 x << 16, y << 16,
279 mode->hdisplay << 16, mode->vdisplay << 16, 279 mode->hdisplay << 16, mode->vdisplay << 16,
@@ -308,14 +308,14 @@ static void page_flip_worker(struct work_struct *work)
308 struct drm_gem_object *bo; 308 struct drm_gem_object *bo;
309 309
310 mutex_lock(&crtc->mutex); 310 mutex_lock(&crtc->mutex);
311 omap_plane_mode_set(omap_crtc->plane, crtc, crtc->fb, 311 omap_plane_mode_set(omap_crtc->plane, crtc, crtc->primary->fb,
312 0, 0, mode->hdisplay, mode->vdisplay, 312 0, 0, mode->hdisplay, mode->vdisplay,
313 crtc->x << 16, crtc->y << 16, 313 crtc->x << 16, crtc->y << 16,
314 mode->hdisplay << 16, mode->vdisplay << 16, 314 mode->hdisplay << 16, mode->vdisplay << 16,
315 vblank_cb, crtc); 315 vblank_cb, crtc);
316 mutex_unlock(&crtc->mutex); 316 mutex_unlock(&crtc->mutex);
317 317
318 bo = omap_framebuffer_bo(crtc->fb, 0); 318 bo = omap_framebuffer_bo(crtc->primary->fb, 0);
319 drm_gem_object_unreference_unlocked(bo); 319 drm_gem_object_unreference_unlocked(bo);
320} 320}
321 321
@@ -336,9 +336,10 @@ static int omap_crtc_page_flip_locked(struct drm_crtc *crtc,
336{ 336{
337 struct drm_device *dev = crtc->dev; 337 struct drm_device *dev = crtc->dev;
338 struct omap_crtc *omap_crtc = to_omap_crtc(crtc); 338 struct omap_crtc *omap_crtc = to_omap_crtc(crtc);
339 struct drm_plane *primary = crtc->primary;
339 struct drm_gem_object *bo; 340 struct drm_gem_object *bo;
340 341
341 DBG("%d -> %d (event=%p)", crtc->fb ? crtc->fb->base.id : -1, 342 DBG("%d -> %d (event=%p)", primary->fb ? primary->fb->base.id : -1,
342 fb->base.id, event); 343 fb->base.id, event);
343 344
344 if (omap_crtc->old_fb) { 345 if (omap_crtc->old_fb) {
@@ -347,7 +348,7 @@ static int omap_crtc_page_flip_locked(struct drm_crtc *crtc,
347 } 348 }
348 349
349 omap_crtc->event = event; 350 omap_crtc->event = event;
350 crtc->fb = fb; 351 primary->fb = fb;
351 352
352 /* 353 /*
353 * Hold a reference temporarily until the crtc is updated 354 * Hold a reference temporarily until the crtc is updated