aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/vmwgfx
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/vmwgfx
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/vmwgfx')
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_kms.c14
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c8
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c8
3 files changed, 15 insertions, 15 deletions
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
index 159af7ee111f..a2dde5ad8138 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
@@ -468,7 +468,7 @@ static int do_surface_dirty_sou(struct vmw_private *dev_priv,
468 num_units = 0; 468 num_units = 0;
469 list_for_each_entry(crtc, &dev_priv->dev->mode_config.crtc_list, 469 list_for_each_entry(crtc, &dev_priv->dev->mode_config.crtc_list,
470 head) { 470 head) {
471 if (crtc->fb != &framebuffer->base) 471 if (crtc->primary->fb != &framebuffer->base)
472 continue; 472 continue;
473 units[num_units++] = vmw_crtc_to_du(crtc); 473 units[num_units++] = vmw_crtc_to_du(crtc);
474 } 474 }
@@ -882,7 +882,7 @@ static int do_dmabuf_dirty_sou(struct drm_file *file_priv,
882 882
883 num_units = 0; 883 num_units = 0;
884 list_for_each_entry(crtc, &dev_priv->dev->mode_config.crtc_list, head) { 884 list_for_each_entry(crtc, &dev_priv->dev->mode_config.crtc_list, head) {
885 if (crtc->fb != &framebuffer->base) 885 if (crtc->primary->fb != &framebuffer->base)
886 continue; 886 continue;
887 units[num_units++] = vmw_crtc_to_du(crtc); 887 units[num_units++] = vmw_crtc_to_du(crtc);
888 } 888 }
@@ -1243,7 +1243,7 @@ int vmw_kms_present(struct vmw_private *dev_priv,
1243 1243
1244 num_units = 0; 1244 num_units = 0;
1245 list_for_each_entry(crtc, &dev_priv->dev->mode_config.crtc_list, head) { 1245 list_for_each_entry(crtc, &dev_priv->dev->mode_config.crtc_list, head) {
1246 if (crtc->fb != &vfb->base) 1246 if (crtc->primary->fb != &vfb->base)
1247 continue; 1247 continue;
1248 units[num_units++] = vmw_crtc_to_du(crtc); 1248 units[num_units++] = vmw_crtc_to_du(crtc);
1249 } 1249 }
@@ -1380,7 +1380,7 @@ int vmw_kms_readback(struct vmw_private *dev_priv,
1380 1380
1381 num_units = 0; 1381 num_units = 0;
1382 list_for_each_entry(crtc, &dev_priv->dev->mode_config.crtc_list, head) { 1382 list_for_each_entry(crtc, &dev_priv->dev->mode_config.crtc_list, head) {
1383 if (crtc->fb != &vfb->base) 1383 if (crtc->primary->fb != &vfb->base)
1384 continue; 1384 continue;
1385 units[num_units++] = vmw_crtc_to_du(crtc); 1385 units[num_units++] = vmw_crtc_to_du(crtc);
1386 } 1386 }
@@ -1723,7 +1723,7 @@ int vmw_du_page_flip(struct drm_crtc *crtc,
1723 uint32_t page_flip_flags) 1723 uint32_t page_flip_flags)
1724{ 1724{
1725 struct vmw_private *dev_priv = vmw_priv(crtc->dev); 1725 struct vmw_private *dev_priv = vmw_priv(crtc->dev);
1726 struct drm_framebuffer *old_fb = crtc->fb; 1726 struct drm_framebuffer *old_fb = crtc->primary->fb;
1727 struct vmw_framebuffer *vfb = vmw_framebuffer_to_vfb(fb); 1727 struct vmw_framebuffer *vfb = vmw_framebuffer_to_vfb(fb);
1728 struct drm_file *file_priv ; 1728 struct drm_file *file_priv ;
1729 struct vmw_fence_obj *fence = NULL; 1729 struct vmw_fence_obj *fence = NULL;
@@ -1741,7 +1741,7 @@ int vmw_du_page_flip(struct drm_crtc *crtc,
1741 if (!vmw_kms_screen_object_flippable(dev_priv, crtc)) 1741 if (!vmw_kms_screen_object_flippable(dev_priv, crtc))
1742 return -EINVAL; 1742 return -EINVAL;
1743 1743
1744 crtc->fb = fb; 1744 crtc->primary->fb = fb;
1745 1745
1746 /* do a full screen dirty update */ 1746 /* do a full screen dirty update */
1747 clips.x1 = clips.y1 = 0; 1747 clips.x1 = clips.y1 = 0;
@@ -1781,7 +1781,7 @@ int vmw_du_page_flip(struct drm_crtc *crtc,
1781 return ret; 1781 return ret;
1782 1782
1783out_no_fence: 1783out_no_fence:
1784 crtc->fb = old_fb; 1784 crtc->primary->fb = old_fb;
1785 return ret; 1785 return ret;
1786} 1786}
1787 1787
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c b/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c
index a055a26819c2..b2b9bd23aeee 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c
@@ -93,7 +93,7 @@ static int vmw_ldu_commit_list(struct vmw_private *dev_priv)
93 93
94 if (crtc == NULL) 94 if (crtc == NULL)
95 return 0; 95 return 0;
96 fb = entry->base.crtc.fb; 96 fb = entry->base.crtc.primary->fb;
97 97
98 return vmw_kms_write_svga(dev_priv, w, h, fb->pitches[0], 98 return vmw_kms_write_svga(dev_priv, w, h, fb->pitches[0],
99 fb->bits_per_pixel, fb->depth); 99 fb->bits_per_pixel, fb->depth);
@@ -101,7 +101,7 @@ static int vmw_ldu_commit_list(struct vmw_private *dev_priv)
101 101
102 if (!list_empty(&lds->active)) { 102 if (!list_empty(&lds->active)) {
103 entry = list_entry(lds->active.next, typeof(*entry), active); 103 entry = list_entry(lds->active.next, typeof(*entry), active);
104 fb = entry->base.crtc.fb; 104 fb = entry->base.crtc.primary->fb;
105 105
106 vmw_kms_write_svga(dev_priv, fb->width, fb->height, fb->pitches[0], 106 vmw_kms_write_svga(dev_priv, fb->width, fb->height, fb->pitches[0],
107 fb->bits_per_pixel, fb->depth); 107 fb->bits_per_pixel, fb->depth);
@@ -259,7 +259,7 @@ static int vmw_ldu_crtc_set_config(struct drm_mode_set *set)
259 259
260 connector->encoder = NULL; 260 connector->encoder = NULL;
261 encoder->crtc = NULL; 261 encoder->crtc = NULL;
262 crtc->fb = NULL; 262 crtc->primary->fb = NULL;
263 crtc->enabled = false; 263 crtc->enabled = false;
264 264
265 vmw_ldu_del_active(dev_priv, ldu); 265 vmw_ldu_del_active(dev_priv, ldu);
@@ -280,7 +280,7 @@ static int vmw_ldu_crtc_set_config(struct drm_mode_set *set)
280 280
281 vmw_fb_off(dev_priv); 281 vmw_fb_off(dev_priv);
282 282
283 crtc->fb = fb; 283 crtc->primary->fb = fb;
284 encoder->crtc = crtc; 284 encoder->crtc = crtc;
285 connector->encoder = encoder; 285 connector->encoder = encoder;
286 crtc->x = set->x; 286 crtc->x = set->x;
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c b/drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c
index 22406c8651ea..a95d3a0cabe4 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c
@@ -307,7 +307,7 @@ static int vmw_sou_crtc_set_config(struct drm_mode_set *set)
307 307
308 connector->encoder = NULL; 308 connector->encoder = NULL;
309 encoder->crtc = NULL; 309 encoder->crtc = NULL;
310 crtc->fb = NULL; 310 crtc->primary->fb = NULL;
311 crtc->x = 0; 311 crtc->x = 0;
312 crtc->y = 0; 312 crtc->y = 0;
313 crtc->enabled = false; 313 crtc->enabled = false;
@@ -368,7 +368,7 @@ static int vmw_sou_crtc_set_config(struct drm_mode_set *set)
368 368
369 connector->encoder = NULL; 369 connector->encoder = NULL;
370 encoder->crtc = NULL; 370 encoder->crtc = NULL;
371 crtc->fb = NULL; 371 crtc->primary->fb = NULL;
372 crtc->x = 0; 372 crtc->x = 0;
373 crtc->y = 0; 373 crtc->y = 0;
374 crtc->enabled = false; 374 crtc->enabled = false;
@@ -381,7 +381,7 @@ static int vmw_sou_crtc_set_config(struct drm_mode_set *set)
381 connector->encoder = encoder; 381 connector->encoder = encoder;
382 encoder->crtc = crtc; 382 encoder->crtc = crtc;
383 crtc->mode = *mode; 383 crtc->mode = *mode;
384 crtc->fb = fb; 384 crtc->primary->fb = fb;
385 crtc->x = set->x; 385 crtc->x = set->x;
386 crtc->y = set->y; 386 crtc->y = set->y;
387 crtc->enabled = true; 387 crtc->enabled = true;
@@ -572,5 +572,5 @@ void vmw_kms_screen_object_update_implicit_fb(struct vmw_private *dev_priv,
572 BUG_ON(!sou->base.is_implicit); 572 BUG_ON(!sou->base.is_implicit);
573 573
574 dev_priv->sou_priv->implicit_fb = 574 dev_priv->sou_priv->implicit_fb =
575 vmw_framebuffer_to_vfb(sou->base.crtc.fb); 575 vmw_framebuffer_to_vfb(sou->base.crtc.primary->fb);
576} 576}