OSDN Git Service

drm: Validate encoder->possible_clones
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Tue, 11 Feb 2020 16:22:06 +0000 (18:22 +0200)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Wed, 18 Mar 2020 16:38:27 +0000 (18:38 +0200)
commit74d2aacbe84042d89f572a3112a146fca05bfcb1
treebaed562789bef296e1e712398ab2b2ffec35f532
parent9cb6a97621ae35fd84e93b6c8e4defcdc53161f2
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>
drivers/gpu/drm/drm_mode_config.c
include/drm/drm_encoder.h