• Ville Syrjälä's avatar
    drm/i915: Introduce intel_crtc_is_bigjoiner_{slave,master}() · df529053
    Ville Syrjälä authored
    Introduce helpers to query whether the crtc is the slave/master
    for bigjoiner. This decouples most places from the exact
    state layout we use to track this relationship, allowing us
    to change and extend it more easily.
    
    Performed with cocci:
    @@
    expression S, E;
    @@
    (
      S->bigjoiner_slave = E;
    |
    - S->bigjoiner_slave
    + intel_crtc_is_bigjoiner_slave(S)
    )
    
    @@
    expression S, E;
    @@
    (
    - E && S->bigjoiner && !intel_crtc_is_bigjoiner_slave(S)
    + E && intel_crtc_is_bigjoiner_master(S)
    |
    - S->bigjoiner && !intel_crtc_is_bigjoiner_slave(S)
    + intel_crtc_is_bigjoiner_master(S)
    )
    
    @@
    expression S;
    @@
    - (intel_crtc_is_bigjoiner_master(S))
    + intel_crtc_is_bigjoiner_master(S)
    
    @@
    expression S, E1, E2, E3;
    @@
    - intel_crtc_is_bigjoiner_slave(S) ? E1 : S->bigjoiner ? E2 : E3
    + intel_crtc_is_bigjoiner_slave(S) ? E1 : intel_crtc_is_bigjoiner_master(S) ? E2 : E3
    
    @@
    typedef bool;
    @@
    + bool intel_crtc_is_bigjoiner_slave(const struct intel_crtc_state *crtc_state)
    + {
    + 	return crtc_state->bigjoiner_slave;
    + }
    +
      intel_master_crtc(...) {...}
    
    @@
    typedef bool;
    @@
    + bool intel_crtc_is_bigjoiner_master(const struct intel_crtc_state *crtc_state)
    + {
    + 	return crtc_state->bigjoiner && !crtc_state->bigjoiner_slave;
    + }
    +
      intel_master_crtc(...) {...}
    
    @@
    typedef bool;
    identifier S;
    @@
    - bool is_trans_port_sync_mode(const struct intel_crtc_state *S);
    + bool is_trans_port_sync_mode(const struct intel_crtc_state *state);
    + bool intel_crtc_is_bigjoiner_slave(const struct intel_crtc_state *crtc_state);
    + bool intel_crtc_is_bigjoiner_master(const struct intel_crtc_state *crtc_state);
    Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20220203183823.22890-7-ville.syrjala@linux.intel.comReviewed-by: default avatarAnkit Nautiyal <ankit.k.nautiyal@intel.com>
    df529053
intel_atomic_plane.c 25.7 KB