drm_hwcomposer: Fix ValidateDisplay() when lowest z-order is nonzero
ValidateDisplay()'s algorithm for achieving minimal GPU load assumes that the lowest z-order is zero and that layers have sequential z-orders. CalcPixOps() and MarkValidated() are also written with the same assumption. However, there is no such guarantee provided by SurfaceFlinger and VTS tests like PRESENT_DISPLAY_NO_LAYER_STATE_CHANGES fail as they only have one layer with z-order of 10.
Remember the first and the last z-order value when building z_map, adjust CalcPixOps() and MarkValidated() to take a range of z-order values, and document the algorithm that tries to calculate the minimal GPU load.
Signed-off-by: Liviu Dudau liviu.dudau@arm.com Fixes commit b7b81cfb ("drm_hwcomposer: Choose client layer range to achieve minimal GPU load")