int win_size;
intel_de_rmw(display, SHARPNESS_CTL(crtc->pipe), FILTER_STRENGTH_MASK,
- FILTER_STRENGTH(crtc_state->hw.casf_params.strength));
+ FILTER_STRENGTH(crtc_state->pch_pfit.casf.strength));
win_size = intel_de_read(display, SKL_PS_WIN_SZ(crtc->pipe, 1));
u32 total_pixels = mode->hdisplay * mode->vdisplay;
if (total_pixels <= MAX_PIXELS_FOR_3_TAP_FILTER)
- crtc_state->hw.casf_params.win_size = SHARPNESS_FILTER_SIZE_3X3;
+ crtc_state->pch_pfit.casf.win_size = SHARPNESS_FILTER_SIZE_3X3;
else if (total_pixels <= MAX_PIXELS_FOR_5_TAP_FILTER)
- crtc_state->hw.casf_params.win_size = SHARPNESS_FILTER_SIZE_5X5;
+ crtc_state->pch_pfit.casf.win_size = SHARPNESS_FILTER_SIZE_5X5;
else
- crtc_state->hw.casf_params.win_size = SHARPNESS_FILTER_SIZE_7X7;
+ crtc_state->pch_pfit.casf.win_size = SHARPNESS_FILTER_SIZE_7X7;
}
int intel_casf_compute_config(struct intel_crtc_state *crtc_state)
return 0;
if (crtc_state->hw.sharpness_strength == 0) {
- crtc_state->hw.casf_params.enable = false;
- crtc_state->hw.casf_params.strength = 0;
+ crtc_state->pch_pfit.casf.enable = false;
+ crtc_state->pch_pfit.casf.strength = 0;
return 0;
}
return -EINVAL;
}
- crtc_state->hw.casf_params.enable = true;
+ crtc_state->pch_pfit.casf.enable = true;
/*
* HW takes a value in form (1.0 + strength) in 4.4 fixed format.
* 6.3125 in 4.4 format is b01100101 which is equal to 101.
* Also 85 + 16 = 101.
*/
- crtc_state->hw.casf_params.strength =
+ crtc_state->pch_pfit.casf.strength =
min(crtc_state->hw.sharpness_strength, 0xEF) + 0x10;
intel_casf_compute_win_size(crtc_state);
if (sharp & FILTER_EN) {
if (drm_WARN_ON(display->drm,
REG_FIELD_GET(FILTER_STRENGTH_MASK, sharp) < 16))
- crtc_state->hw.casf_params.strength = 0;
+ crtc_state->pch_pfit.casf.strength = 0;
else
- crtc_state->hw.casf_params.strength =
+ crtc_state->pch_pfit.casf.strength =
REG_FIELD_GET(FILTER_STRENGTH_MASK, sharp);
- crtc_state->hw.casf_params.enable = true;
- crtc_state->hw.casf_params.win_size =
+ crtc_state->pch_pfit.casf.enable = true;
+ crtc_state->pch_pfit.casf.win_size =
REG_FIELD_GET(FILTER_SIZE_MASK, sharp);
}
}
bool intel_casf_needs_scaler(const struct intel_crtc_state *crtc_state)
{
- if (crtc_state->hw.casf_params.enable)
+ if (crtc_state->pch_pfit.casf.enable)
return true;
return false;
struct scaler_filter_coeff value;
u32 coeff;
- value = crtc_state->hw.casf_params.coeff[t];
+ value = crtc_state->pch_pfit.casf.coeff[t];
value.sign = 0;
coeff = value.sign << 15 | value.exp << 12 | value.mantissa << 3;
/*
* 17 phase of 7 taps requires 119 coefficients in 60 dwords per set.
* To enable casf: program scaler coefficients with the coeffients
- * that are calculated and stored in hw.casf_params.coeff as per
+ * that are calculated and stored in pch_pfit.casf.coeff as per
* SCALER_COEFFICIENT_FORMAT
*/
static void intel_casf_write_coeff(struct intel_crtc_state *crtc_state)
u16 sumcoeff = 0;
int i;
- if (crtc_state->hw.casf_params.win_size == 0)
+ if (crtc_state->pch_pfit.casf.win_size == 0)
filtercoeff = filtercoeff_1;
- else if (crtc_state->hw.casf_params.win_size == 1)
+ else if (crtc_state->pch_pfit.casf.win_size == 1)
filtercoeff = filtercoeff_2;
else
filtercoeff = filtercoeff_3;
for (i = 0; i < SCALER_FILTER_NUM_TAPS; i++) {
filter_coeff[i] = (*(filtercoeff + i) * 100 / sumcoeff);
- convert_sharpness_coef_binary(&crtc_state->hw.casf_params.coeff[i],
+ convert_sharpness_coef_binary(&crtc_state->pch_pfit.casf.coeff[i],
filter_coeff[i]);
}
}
intel_casf_write_coeff(crtc_state);
- sharpness_ctl = FILTER_EN | FILTER_STRENGTH(crtc_state->hw.casf_params.strength);
+ sharpness_ctl = FILTER_EN | FILTER_STRENGTH(crtc_state->pch_pfit.casf.strength);
- sharpness_ctl |= crtc_state->hw.casf_params.win_size;
+ sharpness_ctl |= crtc_state->pch_pfit.casf.win_size;
intel_de_write(display, SHARPNESS_CTL(crtc->pipe), sharpness_ctl);
if (!new_crtc_state->hw.active)
return false;
- return is_enabling(hw.casf_params.enable, old_crtc_state, new_crtc_state);
+ return is_enabling(pch_pfit.casf.enable, old_crtc_state, new_crtc_state);
}
static bool intel_casf_disabling(const struct intel_crtc_state *old_crtc_state,
if (!new_crtc_state->hw.active)
return false;
- return is_disabling(hw.casf_params.enable, old_crtc_state, new_crtc_state);
+ return is_disabling(pch_pfit.casf.enable, old_crtc_state, new_crtc_state);
}
static bool intel_crtc_lobf_enabling(const struct intel_crtc_state *old_crtc_state,
PIPE_CONF_CHECK_BOOL(pch_pfit.enabled);
PIPE_CONF_CHECK_RECT(pch_pfit.dst);
+ PIPE_CONF_CHECK_BOOL(pch_pfit.casf.enable);
+ PIPE_CONF_CHECK_I(pch_pfit.casf.win_size);
+ PIPE_CONF_CHECK_I(pch_pfit.casf.strength);
PIPE_CONF_CHECK_I(scaler_state.scaler_id);
PIPE_CONF_CHECK_I(pixel_rate);
- PIPE_CONF_CHECK_BOOL(hw.casf_params.enable);
- PIPE_CONF_CHECK_I(hw.casf_params.win_size);
- PIPE_CONF_CHECK_I(hw.casf_params.strength);
PIPE_CONF_CHECK_X(gamma_mode);
if (display->platform.cherryview)
if (intel_casf_enabling(new_crtc_state, old_crtc_state))
intel_casf_enable(new_crtc_state);
- else if (new_crtc_state->hw.casf_params.strength != old_crtc_state->hw.casf_params.strength)
+ else if (new_crtc_state->pch_pfit.casf.strength != old_crtc_state->pch_pfit.casf.strength)
intel_casf_update_strength(new_crtc_state);
intel_fbc_update(state, crtc);