• Mitul Golani's avatar
    drm/i915: Compute CMRR and calculate vtotal · 1676ecd3
    Mitul Golani authored
    
    
    Compute Fixed Average Vtotal/CMRR with resepect to
    userspace VRR enablement. Also calculate required
    parameters in case of CMRR is  enabled. During
    intel_vrr_compute_config, CMRR is getting enabled
    based on userspace has enabled Variable refresh mode
    with VRR timing generator or not. Make CMRR as small subset of
    FAVT mode, when Panel is running on Fixed refresh rate
    and on VRR framework then only enable CMRR to match with
    actual refresh rate.
    
    --v2:
    - Update is_cmrr_frac_required function return as bool, not int. [Jani]
    - Use signed int math instead of unsigned in cmrr_get_vtotal2. [Jani]
    - Fix typo and usage of camel case in cmrr_get_vtotal. [Jani]
    - Use do_div in cmrr_get_vtotalwhile calculating cmrr_m. [ Jani]
    - Simplify cmrr and vrr compute config in intel_vrr_compute_config. [Jani]
    - Correct valiable name usage in is_cmrr_frac_required. [Ville]
    
    --v3:
    - Removing RFC tag.
    
    --v4:
    - Added edp check to address edp usecase for now. (ville)
    - Updated is_cmrr_fraction_required to more simplified calculation.
    - on longterm goal to be worked upon uapi as suggestion from ville.
    
    --v5:
    - Correct vtotal paramas accuracy and add 2 digit precision.
    - Avoid using DIV_ROUND_UP and improve scanline precision.
    
    --v6:
    - Make CMRR a small subset of FAVT mode.
    
    --v7:
    - Update commit message to avoid confusion with Legacy VRR (Ankit).
    - Add cmrr.enable in last, so remove from this patch.
    
    --v8:
    - Set cmrr.enable in current patch instead of separate patch (Ankit).
    - Since vrr.enable and cmrr.enable are not mutually exclusive,
    handle accordingly (Ankit).
    - is_edp is not required inside is_cmrr_frac_required function (Ankit).
    - Add video_mode_required flag for future enhancement.
    - Correct cmrr_m/cmrr_n calculation.
    
    --v9:
    - Move patch to last and set other bits before computing
    cmrr.enable.(Ankit)
    - Add TODO: for to address target refresh rate precision as future
    enhancement.
    Signed-off-by: default avatarMitul Golani <mitulkumar.ajitkumar.golani@intel.com>
    Reviewed-by: default avatarAnkit Nautiyal <ankit.k.nautiyal@intel.com>
    Signed-off-by: default avatarSuraj Kandpal <suraj.kandpal@intel.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20240610072203.24956-10-mitulkumar.ajitkumar.golani@intel.com
    1676ecd3
intel_vrr.c 13.9 KB