mirror of
https://github.com/torvalds/linux.git
synced 2026-05-05 06:52:34 -04:00
drm/i915: Use REG_BIT() & co for the pre-ilk pfit registers
Modernize the gmch pfit register definitions using REG_BIT/etc. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230418175528.13117-6-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula <jani.nikula@intel.com>
This commit is contained in:
@@ -935,21 +935,25 @@ static int check_overlay_possible_on_crtc(struct intel_overlay *overlay,
|
||||
static void update_pfit_vscale_ratio(struct intel_overlay *overlay)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = overlay->i915;
|
||||
u32 pfit_control = intel_de_read(dev_priv, PFIT_CONTROL);
|
||||
u32 ratio;
|
||||
|
||||
/* XXX: This is not the same logic as in the xorg driver, but more in
|
||||
* line with the intel documentation for the i965
|
||||
*/
|
||||
if (DISPLAY_VER(dev_priv) >= 4) {
|
||||
u32 tmp = intel_de_read(dev_priv, PFIT_PGM_RATIOS);
|
||||
|
||||
/* on i965 use the PGM reg to read out the autoscaler values */
|
||||
ratio = intel_de_read(dev_priv, PFIT_PGM_RATIOS) >> PFIT_VERT_SCALE_SHIFT_965;
|
||||
ratio = REG_FIELD_GET(PFIT_VERT_SCALE_MASK_965, tmp);
|
||||
} else {
|
||||
if (pfit_control & VERT_AUTO_SCALE)
|
||||
ratio = intel_de_read(dev_priv, PFIT_AUTO_RATIOS);
|
||||
u32 tmp;
|
||||
|
||||
if (intel_de_read(dev_priv, PFIT_CONTROL) & VERT_AUTO_SCALE)
|
||||
tmp = intel_de_read(dev_priv, PFIT_AUTO_RATIOS);
|
||||
else
|
||||
ratio = intel_de_read(dev_priv, PFIT_PGM_RATIOS);
|
||||
ratio >>= PFIT_VERT_SCALE_SHIFT;
|
||||
tmp = intel_de_read(dev_priv, PFIT_PGM_RATIOS);
|
||||
|
||||
ratio = REG_FIELD_GET(PFIT_VERT_SCALE_MASK, tmp);
|
||||
}
|
||||
|
||||
overlay->pfit_vscale_ratio = ratio;
|
||||
|
||||
Reference in New Issue
Block a user