[Intel-gfx] [PATCH 04/10] drm/i915: Use use the drm_for_each_connector in i915_debugfs.c
Daniel Vetter
daniel.vetter at ffwll.ch
Tue Jun 21 09:10:29 UTC 2016
I noticed that we don't have any locking. drm_for_each_connector will
soon encapsulate late, so just roll that macro out as prep work.
Signed-off-by: Daniel Vetter <daniel.vetter at intel.com>
---
drivers/gpu/drm/i915/i915_debugfs.c | 22 ++++++++--------------
1 file changed, 8 insertions(+), 14 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 5b7526697838..ea0e6cf2dc07 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -4364,14 +4364,12 @@ static ssize_t i915_displayport_test_active_write(struct file *file,
int status = 0;
struct drm_device *dev;
struct drm_connector *connector;
- struct list_head *connector_list;
+ struct drm_connector_iter iter;
struct intel_dp *intel_dp;
int val = 0;
dev = ((struct seq_file *)file->private_data)->private;
- connector_list = &dev->mode_config.connector_list;
-
if (len == 0)
return 0;
@@ -4387,8 +4385,7 @@ static ssize_t i915_displayport_test_active_write(struct file *file,
input_buffer[len] = '\0';
DRM_DEBUG_DRIVER("Copied %d bytes from user\n", (unsigned int)len);
- list_for_each_entry(connector, connector_list, head) {
-
+ drm_for_each_connector(connector, dev, iter) {
if (connector->connector_type !=
DRM_MODE_CONNECTOR_DisplayPort)
continue;
@@ -4422,11 +4419,10 @@ static int i915_displayport_test_active_show(struct seq_file *m, void *data)
{
struct drm_device *dev = m->private;
struct drm_connector *connector;
- struct list_head *connector_list = &dev->mode_config.connector_list;
struct intel_dp *intel_dp;
+ struct drm_connector_iter iter;
- list_for_each_entry(connector, connector_list, head) {
-
+ drm_for_each_connector(connector, dev, iter) {
if (connector->connector_type !=
DRM_MODE_CONNECTOR_DisplayPort)
continue;
@@ -4466,11 +4462,10 @@ static int i915_displayport_test_data_show(struct seq_file *m, void *data)
{
struct drm_device *dev = m->private;
struct drm_connector *connector;
- struct list_head *connector_list = &dev->mode_config.connector_list;
+ struct drm_connector_iter iter;
struct intel_dp *intel_dp;
- list_for_each_entry(connector, connector_list, head) {
-
+ drm_for_each_connector(connector, dev, iter) {
if (connector->connector_type !=
DRM_MODE_CONNECTOR_DisplayPort)
continue;
@@ -4505,11 +4500,10 @@ static int i915_displayport_test_type_show(struct seq_file *m, void *data)
{
struct drm_device *dev = m->private;
struct drm_connector *connector;
- struct list_head *connector_list = &dev->mode_config.connector_list;
struct intel_dp *intel_dp;
+ struct drm_connector_iter iter;
- list_for_each_entry(connector, connector_list, head) {
-
+ drm_for_each_connector(connector, dev, iter) {
if (connector->connector_type !=
DRM_MODE_CONNECTOR_DisplayPort)
continue;
--
2.8.1
More information about the Intel-gfx
mailing list