• Maarten Lankhorst's avatar
    drm/i915/gen11: Link nv12 Y and UV planes in the atomic state, v5. · 1ab554b0
    Maarten Lankhorst authored
    To make NV12 working on icl, we need to update 2 planes simultaneously.
    I've chosen to do this in the CRTC step after plane validation is done,
    so we know what planes are (in)visible. The linked Y plane will get
    updated in intel_plane_update_planes_on_crtc(), by the call to
    update_slave, which gets the master's plane_state as argument.
    
    The link requires both planes for atomic_update to work,
    so make sure skl_ddb_add_affected_planes() adds both states.
    
    Changes since v1:
    - Introduce icl_is_nv12_y_plane(), instead of hardcoding sprite numbers.
    - Put all the state updating login in intel_plane_atomic_check_with_state().
    - Clean up changes in intel_plane_atomic_check().
    Changes since v2:
    - Fix intel_atomic_get_old_plane_state() to actually return old state.
    - Move visibility changes to preparation patch.
    - Only try to find a Y plane on gen11, earlier platforms only require
      a single plane.
    Changes since v3:
    - Fix checkpatch warning about to_intel_crtc() usage.
    - Add affected planes from icl_add_linked_planes() before check_planes(),
      it's a cleaner way to do this. (Ville)
    Changes since v4:
    - Clear plane links in icl_check_nv12_planes() for clarity.
    - Only pass crtc_state to icl_check_nv12_planes().
    - Use for_each_new_intel_plane_in_state() in icl_check_nv12_planes.
    - Rename aux to linked. (Ville)
    Signed-off-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
    Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20181022135152.15324-1-maarten.lankhorst@linux.intel.com
    [mlankhorst: Change bool slave to u32, to satisfy checkpatch]
    [mlankhorst: Add WARN_ON's based on Ville's suggestion]
    1ab554b0
intel_pm.c 279 KB