diff options
author | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2018-06-26 21:47:10 +0200 |
---|---|---|
committer | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2018-07-02 17:45:55 +0200 |
commit | 737057321f3c2d30b98fa8006b7af1869c32a68b (patch) | |
tree | 722e3691ac62bb601d7f5412f0a6aa2b324813e9 /include/drm/drm_connector.h | |
parent | drm: Add drm_encoder_mask() (diff) | |
download | linux-737057321f3c2d30b98fa8006b7af1869c32a68b.tar.xz linux-737057321f3c2d30b98fa8006b7af1869c32a68b.zip |
drm: Add drm_connector_mask()
Add drm_connector_mask() which returns the 1<<index for the connector.
We already have an identical drm_crtc_mask() for crtcs.
Mostly performed with coccinelle:
@@
@@
- (1<<drm_connector_index(
+ drm_connector_mask(
...)
- )
@@
@@
- 1<<drm_connector_index(
+ drm_connector_mask(
...)
@@
@@
- BIT(drm_connector_index(
+ drm_connector_mask(
...)
- )
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180626194716.12522-4-ville.syrjala@linux.intel.com
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Diffstat (limited to 'include/drm/drm_connector.h')
-rw-r--r-- | include/drm/drm_connector.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h index 14ab58ade87f..bf0f0f0786d3 100644 --- a/include/drm/drm_connector.h +++ b/include/drm/drm_connector.h @@ -1030,11 +1030,17 @@ int drm_mode_connector_attach_encoder(struct drm_connector *connector, struct drm_encoder *encoder); void drm_connector_cleanup(struct drm_connector *connector); -static inline unsigned drm_connector_index(struct drm_connector *connector) + +static inline unsigned int drm_connector_index(const struct drm_connector *connector) { return connector->index; } +static inline u32 drm_connector_mask(const struct drm_connector *connector) +{ + return 1 << connector->index; +} + /** * drm_connector_lookup - lookup connector object * @dev: DRM device |