diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2015-07-09 17:44:35 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2015-07-22 11:29:37 -0400 |
commit | e4f62546325724168e0b7ee7180762cb07859ca7 (patch) | |
tree | 8f864b5c58ffaeec97f10f947b96e67c5eaf915d /drivers/gpu/drm/drm_crtc.c | |
parent | 9e75c0ef1428ae8a6bfb340ba2402471752c4af5 (diff) |
drm: Roll out drm_for_each_{plane,crtc,encoder}
Remaining manual work in the drm core&helpers. Nothing special here,
no surprises.
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Diffstat (limited to 'drivers/gpu/drm/drm_crtc.c')
-rw-r--r-- | drivers/gpu/drm/drm_crtc.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index d928bf7ef221..138ef22078d9 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c | |||
@@ -736,7 +736,7 @@ unsigned int drm_crtc_index(struct drm_crtc *crtc) | |||
736 | unsigned int index = 0; | 736 | unsigned int index = 0; |
737 | struct drm_crtc *tmp; | 737 | struct drm_crtc *tmp; |
738 | 738 | ||
739 | list_for_each_entry(tmp, &crtc->dev->mode_config.crtc_list, head) { | 739 | drm_for_each_crtc(tmp, crtc->dev) { |
740 | if (tmp == crtc) | 740 | if (tmp == crtc) |
741 | return index; | 741 | return index; |
742 | 742 | ||
@@ -1280,7 +1280,7 @@ unsigned int drm_plane_index(struct drm_plane *plane) | |||
1280 | unsigned int index = 0; | 1280 | unsigned int index = 0; |
1281 | struct drm_plane *tmp; | 1281 | struct drm_plane *tmp; |
1282 | 1282 | ||
1283 | list_for_each_entry(tmp, &plane->dev->mode_config.plane_list, head) { | 1283 | drm_for_each_plane(tmp, plane->dev) { |
1284 | if (tmp == plane) | 1284 | if (tmp == plane) |
1285 | return index; | 1285 | return index; |
1286 | 1286 | ||
@@ -1719,10 +1719,10 @@ int drm_mode_group_init_legacy_group(struct drm_device *dev, | |||
1719 | if (ret) | 1719 | if (ret) |
1720 | return ret; | 1720 | return ret; |
1721 | 1721 | ||
1722 | list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) | 1722 | drm_for_each_crtc(crtc, dev) |
1723 | group->id_list[group->num_crtcs++] = crtc->base.id; | 1723 | group->id_list[group->num_crtcs++] = crtc->base.id; |
1724 | 1724 | ||
1725 | list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) | 1725 | drm_for_each_encoder(encoder, dev) |
1726 | group->id_list[group->num_crtcs + group->num_encoders++] = | 1726 | group->id_list[group->num_crtcs + group->num_encoders++] = |
1727 | encoder->base.id; | 1727 | encoder->base.id; |
1728 | 1728 | ||
@@ -1811,15 +1811,17 @@ int drm_mode_getresources(struct drm_device *dev, void *data, | |||
1811 | mutex_lock(&dev->mode_config.mutex); | 1811 | mutex_lock(&dev->mode_config.mutex); |
1812 | if (!drm_is_primary_client(file_priv)) { | 1812 | if (!drm_is_primary_client(file_priv)) { |
1813 | struct drm_connector *connector; | 1813 | struct drm_connector *connector; |
1814 | struct drm_encoder *encoder; | ||
1815 | struct drm_crtc *crtc; | ||
1814 | 1816 | ||
1815 | mode_group = NULL; | 1817 | mode_group = NULL; |
1816 | list_for_each(lh, &dev->mode_config.crtc_list) | 1818 | drm_for_each_crtc(crtc, dev) |
1817 | crtc_count++; | 1819 | crtc_count++; |
1818 | 1820 | ||
1819 | drm_for_each_connector(connector, dev) | 1821 | drm_for_each_connector(connector, dev) |
1820 | connector_count++; | 1822 | connector_count++; |
1821 | 1823 | ||
1822 | list_for_each(lh, &dev->mode_config.encoder_list) | 1824 | drm_for_each_encoder(encoder, dev) |
1823 | encoder_count++; | 1825 | encoder_count++; |
1824 | } else { | 1826 | } else { |
1825 | 1827 | ||
@@ -2287,7 +2289,7 @@ int drm_mode_getplane_res(struct drm_device *dev, void *data, | |||
2287 | plane_ptr = (uint32_t __user *)(unsigned long)plane_resp->plane_id_ptr; | 2289 | plane_ptr = (uint32_t __user *)(unsigned long)plane_resp->plane_id_ptr; |
2288 | 2290 | ||
2289 | /* Plane lists are invariant, no locking needed. */ | 2291 | /* Plane lists are invariant, no locking needed. */ |
2290 | list_for_each_entry(plane, &config->plane_list, head) { | 2292 | drm_for_each_plane(plane, dev) { |
2291 | /* | 2293 | /* |
2292 | * Unless userspace set the 'universal planes' | 2294 | * Unless userspace set the 'universal planes' |
2293 | * capability bit, only advertise overlays. | 2295 | * capability bit, only advertise overlays. |
@@ -2592,7 +2594,7 @@ int drm_mode_set_config_internal(struct drm_mode_set *set) | |||
2592 | * connectors from it), hence we need to refcount the fbs across all | 2594 | * connectors from it), hence we need to refcount the fbs across all |
2593 | * crtcs. Atomic modeset will have saner semantics ... | 2595 | * crtcs. Atomic modeset will have saner semantics ... |
2594 | */ | 2596 | */ |
2595 | list_for_each_entry(tmp, &crtc->dev->mode_config.crtc_list, head) | 2597 | drm_for_each_crtc(tmp, crtc->dev) |
2596 | tmp->primary->old_fb = tmp->primary->fb; | 2598 | tmp->primary->old_fb = tmp->primary->fb; |
2597 | 2599 | ||
2598 | fb = set->fb; | 2600 | fb = set->fb; |
@@ -2603,7 +2605,7 @@ int drm_mode_set_config_internal(struct drm_mode_set *set) | |||
2603 | crtc->primary->fb = fb; | 2605 | crtc->primary->fb = fb; |
2604 | } | 2606 | } |
2605 | 2607 | ||
2606 | list_for_each_entry(tmp, &crtc->dev->mode_config.crtc_list, head) { | 2608 | drm_for_each_crtc(tmp, crtc->dev) { |
2607 | if (tmp->primary->fb) | 2609 | if (tmp->primary->fb) |
2608 | drm_framebuffer_reference(tmp->primary->fb); | 2610 | drm_framebuffer_reference(tmp->primary->fb); |
2609 | if (tmp->primary->old_fb) | 2611 | if (tmp->primary->old_fb) |
@@ -5377,15 +5379,15 @@ void drm_mode_config_reset(struct drm_device *dev) | |||
5377 | struct drm_encoder *encoder; | 5379 | struct drm_encoder *encoder; |
5378 | struct drm_connector *connector; | 5380 | struct drm_connector *connector; |
5379 | 5381 | ||
5380 | list_for_each_entry(plane, &dev->mode_config.plane_list, head) | 5382 | drm_for_each_plane(plane, dev) |
5381 | if (plane->funcs->reset) | 5383 | if (plane->funcs->reset) |
5382 | plane->funcs->reset(plane); | 5384 | plane->funcs->reset(plane); |
5383 | 5385 | ||
5384 | list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) | 5386 | drm_for_each_crtc(crtc, dev) |
5385 | if (crtc->funcs->reset) | 5387 | if (crtc->funcs->reset) |
5386 | crtc->funcs->reset(crtc); | 5388 | crtc->funcs->reset(crtc); |
5387 | 5389 | ||
5388 | list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) | 5390 | drm_for_each_encoder(encoder, dev) |
5389 | if (encoder->funcs->reset) | 5391 | if (encoder->funcs->reset) |
5390 | encoder->funcs->reset(encoder); | 5392 | encoder->funcs->reset(encoder); |
5391 | 5393 | ||