mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-02-19 11:21:15 -05:00
drm/i915/dp: Return int from dsc_max/min_src_input_bpc helpers
Use ints for dsc_max/min_bpc instead of u8 in dsc_max/min_src_input_bpc helpers and their callers. This will also help replace min_t/max_t macros with min/max ones. Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com> Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20241217093244.3938132-7-ankit.k.nautiyal@intel.com
This commit is contained in:
@@ -1784,7 +1784,7 @@ intel_dp_compute_link_config_wide(struct intel_dp *intel_dp,
|
||||
}
|
||||
|
||||
static
|
||||
u8 intel_dp_dsc_max_src_input_bpc(struct intel_display *display)
|
||||
int intel_dp_dsc_max_src_input_bpc(struct intel_display *display)
|
||||
{
|
||||
/* Max DSC Input BPC for ICL is 10 and for TGL+ is 12 */
|
||||
if (DISPLAY_VER(display) >= 12)
|
||||
@@ -1801,14 +1801,14 @@ int intel_dp_dsc_compute_max_bpp(const struct intel_connector *connector,
|
||||
struct intel_display *display = to_intel_display(connector);
|
||||
int i, num_bpc;
|
||||
u8 dsc_bpc[3] = {};
|
||||
u8 dsc_max_bpc;
|
||||
int dsc_max_bpc;
|
||||
|
||||
dsc_max_bpc = intel_dp_dsc_max_src_input_bpc(display);
|
||||
|
||||
if (!dsc_max_bpc)
|
||||
return dsc_max_bpc;
|
||||
|
||||
dsc_max_bpc = min_t(u8, dsc_max_bpc, max_req_bpc);
|
||||
dsc_max_bpc = min(dsc_max_bpc, max_req_bpc);
|
||||
|
||||
num_bpc = drm_dp_dsc_sink_supported_input_bpcs(connector->dp.dsc_dpcd,
|
||||
dsc_bpc);
|
||||
@@ -2188,7 +2188,7 @@ static int dsc_compute_compressed_bpp(struct intel_dp *intel_dp,
|
||||
}
|
||||
|
||||
static
|
||||
u8 intel_dp_dsc_min_src_input_bpc(void)
|
||||
int intel_dp_dsc_min_src_input_bpc(void)
|
||||
{
|
||||
/* Min DSC Input BPC for ICL+ is 8 */
|
||||
return 8;
|
||||
@@ -2200,7 +2200,7 @@ bool is_dsc_pipe_bpp_sufficient(struct intel_display *display,
|
||||
struct link_config_limits *limits,
|
||||
int pipe_bpp)
|
||||
{
|
||||
u8 dsc_max_bpc, dsc_min_bpc, dsc_max_pipe_bpp, dsc_min_pipe_bpp;
|
||||
int dsc_max_bpc, dsc_min_bpc, dsc_max_pipe_bpp, dsc_min_pipe_bpp;
|
||||
|
||||
dsc_max_bpc = min(intel_dp_dsc_max_src_input_bpc(display), conn_state->max_requested_bpc);
|
||||
dsc_min_bpc = intel_dp_dsc_min_src_input_bpc();
|
||||
@@ -2247,9 +2247,9 @@ static int intel_dp_dsc_compute_pipe_bpp(struct intel_dp *intel_dp,
|
||||
struct intel_display *display = to_intel_display(intel_dp);
|
||||
const struct intel_connector *connector =
|
||||
to_intel_connector(conn_state->connector);
|
||||
u8 max_req_bpc = conn_state->max_requested_bpc;
|
||||
u8 dsc_max_bpc, dsc_max_bpp;
|
||||
u8 dsc_min_bpc, dsc_min_bpp;
|
||||
int max_req_bpc = conn_state->max_requested_bpc;
|
||||
int dsc_max_bpc, dsc_max_bpp;
|
||||
int dsc_min_bpc, dsc_min_bpp;
|
||||
u8 dsc_bpc[3] = {};
|
||||
int forced_bpp, pipe_bpp;
|
||||
int num_bpc, i, ret;
|
||||
@@ -2269,7 +2269,7 @@ static int intel_dp_dsc_compute_pipe_bpp(struct intel_dp *intel_dp,
|
||||
if (!dsc_max_bpc)
|
||||
return -EINVAL;
|
||||
|
||||
dsc_max_bpc = min_t(u8, dsc_max_bpc, max_req_bpc);
|
||||
dsc_max_bpc = min(dsc_max_bpc, max_req_bpc);
|
||||
dsc_max_bpp = min(dsc_max_bpc * 3, limits->pipe.max_bpp);
|
||||
|
||||
dsc_min_bpc = intel_dp_dsc_min_src_input_bpc();
|
||||
|
||||
Reference in New Issue
Block a user