• Rodrigo Siqueira's avatar
    drm/amd/display: Ensure that planes are in the same order · bb46a6a9
    Rodrigo Siqueira authored
    The function dc_update_planes_and_stream handles multiple cases where DC
    needs to remove and add planes in the commit tail phase. After Linux
    started to use this function, some of the IGT kms_plane started to fail;
    one good example to illustrate why the new sequence regressed IGT is the
    subtest plane-position-hole which has the following diagram as a
    template:
    
     +--------------------+        +-----------------------+
     | +-----+            |        | +-----+               |
     | |     |            |        | | +-----+             |
     | |  +--+            | ==>    | | |   | |             |
     | |__|               |        | +-|---+ |             |
     |                    |        |   +-----+             |
     |                    |        |                       |
     +--------------------+        +-----------------------+
       (a) Final image                (b) Composed image
    
    IGT expects image (a) as the final result of two plane compositions as
    described in figure (b). After the migration to the new sequence, the
    last plane order is changed, and DC generates the following image:
    
    +---------------------+
    | +-----+             |
    | |     |             |
    | |     |             |
    | +-----+             |
    |                     |
    +---------------------+
    
    Notice that the generated image by DC is different because the small
    square that should be composed on top of the primary plane is below the
    primary plane. For this reason, the CRC will mismatch with the expected
    value. Since the function dc_add_all_planes_for_stream re-append all the
    new planes back to the dc_validation_set, this commit ensures that the
    original sequence is maintained. After this change, all CI tests in all
    ASICs start to pass again.
    Reviewed-by: default avatarHarry Wentland <Harry.Wentland@amd.com>
    Acked-by: default avatarQingqing Zhuo <qingqing.zhuo@amd.com>
    Suggested-by: default avatarMelissa Wen <mwen@igalia.com>
    Signed-off-by: default avatarRodrigo Siqueira <Rodrigo.Siqueira@amd.com>
    Tested-by: default avatarDaniel Wheeler <daniel.wheeler@amd.com>
    Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
    bb46a6a9
amdgpu_dm.c 312 KB