diff options
author | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2020-02-11 17:22:06 +0100 |
---|---|---|
committer | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2020-03-18 17:38:27 +0100 |
commit | 74d2aacbe84042d89f572a3112a146fca05bfcb1 (patch) | |
tree | baed562789bef296e1e712398ab2b2ffec35f532 /include/drm | |
parent | drm/imx: Remove the bogus possible_clones setup (diff) | |
download | linux-74d2aacbe84042d89f572a3112a146fca05bfcb1.tar.xz linux-74d2aacbe84042d89f572a3112a146fca05bfcb1.zip |
drm: Validate encoder->possible_clones
Many drivers are populating encoder->possible_clones wrong. Let's
persuade them to get it right by adding some loud WARNs.
We'll cross check the bits between any two encoders. So either
both encoders can clone with the other, or neither can.
We'll also complain about effectively empty possible_clones, and
possible_clones containing bits for encoders that don't exist.
v2: encoder->possible_clones now includes the encoder itelf
v3: Move to drm_mode_config_validate() (Daniel)
Document that you get a WARN when this is wrong (Daniel)
Extract full_encoder_mask()
v4: !! instead of ! (Daniel)
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200211162208.16224-6-ville.syrjala@linux.intel.com
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'include/drm')
-rw-r--r-- | include/drm/drm_encoder.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/drm/drm_encoder.h b/include/drm/drm_encoder.h index 34b7213bfab6..9d11cbe22f34 100644 --- a/include/drm/drm_encoder.h +++ b/include/drm/drm_encoder.h @@ -163,6 +163,8 @@ struct drm_encoder { * any cloning it can leave @possible_clones set to 0. The core will * automagically fix this up by setting the bit for the encoder itself. * + * You will get a WARN if you get this wrong in the driver. + * * Note that since encoder objects can't be hotplugged the assigned indices * are stable and hence known before registering all objects. */ |