Commit dea54d18 authored by Wenjing Liu's avatar Wenjing Liu Committed by Alex Deucher

drm/amd/display: add odm_slice_rect parameter in spl_in

[why]
OPP input rect aka odm slice rect is a hardware dependent parameter that
can't be determined by SPL software logic. Therefore we need to
explicitly pass odm slice rect in. So ODM slice rect calculation is
moved out of SPL.

[how]
add odm_slice_rect parameter in spl_in
Reviewed-by: default avatarRodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: default avatarWenjing Liu <wenjing.liu@amd.com>
Tested-by: default avatarDaniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 0caba87a
......@@ -70,6 +70,8 @@ void translate_SPL_in_params_from_pipe_ctx(struct pipe_ctx *pipe_ctx, struct spl
{
const struct dc_plane_state *plane_state = pipe_ctx->plane_state;
const struct dc_stream_state *stream = pipe_ctx->stream;
struct rect odm_slice_src = resource_get_odm_slice_src_rect(pipe_ctx);
// Assign the function to calculate the number of partitions in the line buffer
// This is used to determine the vtap support
switch (plane_state->ctx->dce_version) {
......@@ -112,7 +114,8 @@ void translate_SPL_in_params_from_pipe_ctx(struct pipe_ctx *pipe_ctx, struct spl
else
spl_in->basic_in.mpc_combine_v = resource_get_mpc_slice_index(pipe_ctx);
spl_in->basic_out.odm_combine_factor = resource_get_odm_slice_count(pipe_ctx);
populate_splrect_from_rect(&spl_in->basic_out.odm_slice_rect, &odm_slice_src);
spl_in->basic_out.odm_combine_factor = 0;
spl_in->odm_slice_index = resource_get_odm_slice_index(pipe_ctx);
// Make spl input basic out info output_size width point to stream h active
spl_in->basic_out.output_size.width =
......
......@@ -170,9 +170,15 @@ static struct spl_rect calculate_odm_slice_in_timing_active(struct spl_in *spl_i
bool is_last_odm_slice = (odm_slice_idx + 1) == odm_slice_count;
int h_active = spl_in->basic_out.output_size.width;
int v_active = spl_in->basic_out.output_size.height;
int odm_slice_width = h_active / odm_slice_count;
int odm_slice_width;
struct spl_rect odm_rec;
if (spl_in->basic_out.odm_combine_factor > 0) {
odm_slice_width = h_active / odm_slice_count;
/*
* deprecated, caller must pass in odm slice rect i.e OPP input
* rect in timing active for the new interface.
*/
if (spl_in->basic_out.use_two_pixels_per_container && (odm_slice_width % 2))
odm_slice_width++;
......@@ -186,6 +192,9 @@ static struct spl_rect calculate_odm_slice_in_timing_active(struct spl_in *spl_i
odm_rec.height = v_active;
return odm_rec;
}
return spl_in->basic_out.odm_slice_rect;
}
static void spl_calculate_recout(struct spl_in *spl_in, struct spl_out *spl_out)
......
......@@ -436,7 +436,8 @@ struct basic_out {
struct spl_size output_size; // Output Size
struct spl_rect dst_rect; // Destination Rect
struct spl_rect src_rect; // Source rect
int odm_combine_factor; // ODM Combine Factor determine by get_odm_splits
int odm_combine_factor; // deprecated
struct spl_rect odm_slice_rect; // OPP input rect in timing active
enum spl_view_3d view_format; // TODO: View format Check if it is chroma subsampling
bool always_scale; // Is always scale enabled? Required for getting SCL_MODE
int max_downscale_src_width; // Required to get optimal no of taps
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment