drm: Add drm_connector_for_each_possible_encoder()
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 28 Jun 2018 13:13:09 +0000 (16:13 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 5 Jul 2018 13:52:07 +0000 (16:52 +0300)
commit83aefbb887b59df0b3520965c3701e01deacfc52
tree2ae00e1b761979767560fd7e989070e27f4137c7
parent20431c05ae682ff2ad387945738fc129d9751d6e
drm: Add drm_connector_for_each_possible_encoder()

Add a convenience macro for iterating connector->encoder_ids[].
Isolates the users from the implementation details.

Note that we don't seem to pass the file_priv down to drm_encoder_find()
because encoders apparently don't get leased. No idea why
drm_encoder_finc() even takes the file_priv actually.

Also use ARRAY_SIZE() when populating the array to avoid spreading
knowledge about the array size all over.

v2: Hide the drm_encoder_find() in the macro, and
    rename the macro appropriately (Daniel)
v3: Fix kernel docs (Daniel)

Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180628131315.14156-4-ville.syrjala@linux.intel.com
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/drm_connector.c
drivers/gpu/drm/drm_fb_helper.c
drivers/gpu/drm/drm_probe_helper.c
include/drm/drm_connector.h