mirror of
https://github.com/torvalds/linux.git
synced 2026-05-22 22:22:08 +02:00
drm/i915/display: Configure the second scaler
Both sharpness and panel fitter use pipe scaler,
but only one can be enabled at a time. Furthermore
sharpness uses second scaler. So for CASF, check if
second scaler is available and make sure that only
either of panel fitter or sharpness is enabled at
a time.
v2: Add the panel fitting check before enabling sharpness
v3: Reframe commit message[Arun]
v4: Replace string based comparison with plane_state[Jani]
v5: Rebase
v6: Fix build issue
v7: Remove scaler id from verify_crtc_state[Ankit]
v8: Change the patch title. Add code comment.
Move the config part in patch#6. [Ankit]
v9: Refactor the patch[Ankit]
v10: Modify the header of patch[Ankit]
Signed-off-by: Nemesa Garg <nemesa.garg@intel.com>
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Link: https://patch.msgid.link/20251028120747.3027332-8-ankit.k.nautiyal@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
This commit is contained in:
parent
82860cba5f
commit
0672cf9828
|
|
@ -156,6 +156,14 @@ void intel_casf_sharpness_get_config(struct intel_crtc_state *crtc_state)
|
|||
}
|
||||
}
|
||||
|
||||
bool intel_casf_needs_scaler(const struct intel_crtc_state *crtc_state)
|
||||
{
|
||||
if (crtc_state->hw.casf_params.casf_enable)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static int casf_coeff_tap(int i)
|
||||
{
|
||||
return i % SCALER_FILTER_NUM_TAPS;
|
||||
|
|
|
|||
|
|
@ -16,5 +16,6 @@ void intel_casf_sharpness_get_config(struct intel_crtc_state *crtc_state);
|
|||
void intel_casf_enable(struct intel_crtc_state *crtc_state);
|
||||
void intel_casf_disable(const struct intel_crtc_state *crtc_state);
|
||||
void intel_casf_scaler_compute_config(struct intel_crtc_state *crtc_state);
|
||||
bool intel_casf_needs_scaler(const struct intel_crtc_state *crtc_state);
|
||||
|
||||
#endif /* __INTEL_CASF_H__ */
|
||||
|
|
|
|||
|
|
@ -60,6 +60,7 @@
|
|||
#include "intel_audio.h"
|
||||
#include "intel_bo.h"
|
||||
#include "intel_bw.h"
|
||||
#include "intel_casf.h"
|
||||
#include "intel_cdclk.h"
|
||||
#include "intel_clock_gating.h"
|
||||
#include "intel_color.h"
|
||||
|
|
@ -4229,7 +4230,8 @@ static int intel_crtc_atomic_check(struct intel_atomic_state *state,
|
|||
|
||||
if (DISPLAY_VER(display) >= 9) {
|
||||
if (intel_crtc_needs_modeset(crtc_state) ||
|
||||
intel_crtc_needs_fastset(crtc_state)) {
|
||||
intel_crtc_needs_fastset(crtc_state) ||
|
||||
intel_casf_needs_scaler(crtc_state)) {
|
||||
ret = skl_update_scaler_crtc(crtc_state);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
#include <drm/drm_print.h>
|
||||
|
||||
#include "i915_utils.h"
|
||||
#include "intel_casf.h"
|
||||
#include "intel_casf_regs.h"
|
||||
#include "intel_de.h"
|
||||
#include "intel_display_regs.h"
|
||||
|
|
@ -283,7 +284,8 @@ int skl_update_scaler_crtc(struct intel_crtc_state *crtc_state)
|
|||
drm_rect_width(&crtc_state->pipe_src),
|
||||
drm_rect_height(&crtc_state->pipe_src),
|
||||
width, height, NULL, 0,
|
||||
crtc_state->pch_pfit.enabled);
|
||||
crtc_state->pch_pfit.enabled ||
|
||||
intel_casf_needs_scaler(crtc_state));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -322,7 +324,9 @@ int skl_update_scaler_plane(struct intel_crtc_state *crtc_state,
|
|||
}
|
||||
|
||||
static int intel_allocate_scaler(struct intel_crtc_scaler_state *scaler_state,
|
||||
struct intel_crtc *crtc)
|
||||
struct intel_crtc *crtc,
|
||||
struct intel_plane_state *plane_state,
|
||||
bool casf_scaler)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
|
@ -330,6 +334,10 @@ static int intel_allocate_scaler(struct intel_crtc_scaler_state *scaler_state,
|
|||
if (scaler_state->scalers[i].in_use)
|
||||
continue;
|
||||
|
||||
/* CASF needs second scaler */
|
||||
if (!plane_state && casf_scaler && i != 1)
|
||||
continue;
|
||||
|
||||
scaler_state->scalers[i].in_use = true;
|
||||
|
||||
return i;
|
||||
|
|
@ -380,7 +388,7 @@ static int intel_atomic_setup_scaler(struct intel_crtc_state *crtc_state,
|
|||
int num_scalers_need, struct intel_crtc *crtc,
|
||||
const char *name, int idx,
|
||||
struct intel_plane_state *plane_state,
|
||||
int *scaler_id)
|
||||
int *scaler_id, bool casf_scaler)
|
||||
{
|
||||
struct intel_display *display = to_intel_display(crtc);
|
||||
struct intel_crtc_scaler_state *scaler_state = &crtc_state->scaler_state;
|
||||
|
|
@ -389,7 +397,7 @@ static int intel_atomic_setup_scaler(struct intel_crtc_state *crtc_state,
|
|||
int vscale = 0;
|
||||
|
||||
if (*scaler_id < 0)
|
||||
*scaler_id = intel_allocate_scaler(scaler_state, crtc);
|
||||
*scaler_id = intel_allocate_scaler(scaler_state, crtc, plane_state, casf_scaler);
|
||||
|
||||
if (drm_WARN(display->drm, *scaler_id < 0,
|
||||
"Cannot find scaler for %s:%d\n", name, idx))
|
||||
|
|
@ -521,10 +529,14 @@ static int setup_crtc_scaler(struct intel_atomic_state *state,
|
|||
struct intel_crtc_scaler_state *scaler_state =
|
||||
&crtc_state->scaler_state;
|
||||
|
||||
if (intel_casf_needs_scaler(crtc_state) && crtc_state->pch_pfit.enabled)
|
||||
return -EINVAL;
|
||||
|
||||
return intel_atomic_setup_scaler(crtc_state,
|
||||
hweight32(scaler_state->scaler_users),
|
||||
crtc, "CRTC", crtc->base.base.id,
|
||||
NULL, &scaler_state->scaler_id);
|
||||
NULL, &scaler_state->scaler_id,
|
||||
intel_casf_needs_scaler(crtc_state));
|
||||
}
|
||||
|
||||
static int setup_plane_scaler(struct intel_atomic_state *state,
|
||||
|
|
@ -559,7 +571,8 @@ static int setup_plane_scaler(struct intel_atomic_state *state,
|
|||
return intel_atomic_setup_scaler(crtc_state,
|
||||
hweight32(scaler_state->scaler_users),
|
||||
crtc, "PLANE", plane->base.base.id,
|
||||
plane_state, &plane_state->scaler_id);
|
||||
plane_state, &plane_state->scaler_id,
|
||||
false);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user