Skip to content

Commit

Permalink
drm/amd/display: DCN401 cusor code update
Browse files Browse the repository at this point in the history
Scaling and rotation changes for cursor.

Reviewed-by: Ariel Bernstein <eric.bernstein@amd.com>
Reviewed-by: Nevenko Stupar <nevenko.stupar@amd.com>
Acked-by: Zaeem Mohamed <zaeem.mohamed@amd.com>
Signed-off-by: Sridevi Arvindekar <sarvinde@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
  • Loading branch information
Sridevi Arvindekar authored and Alex Deucher committed Jun 14, 2024
1 parent 3df528b commit ed79ab5
Showing 1 changed file with 5 additions and 17 deletions.
22 changes: 5 additions & 17 deletions drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c
Original file line number Diff line number Diff line change
Expand Up @@ -1124,14 +1124,10 @@ void dcn401_set_cursor_position(struct pipe_ctx *pipe_ctx)
* pipe to make sure each pipe enabling cursor on its part of the
* screen.
*/

if (param.rotation == ROTATION_ANGLE_90 || param.rotation == ROTATION_ANGLE_270) {
} else {
x_pos = pipe_ctx->stream->dst.x + x_pos * pipe_ctx->stream->dst.width /
pipe_ctx->stream->src.width;
y_pos = pipe_ctx->stream->dst.y + y_pos * pipe_ctx->stream->dst.height /
pipe_ctx->stream->src.height;
}
x_pos = pipe_ctx->stream->dst.x + x_pos * pipe_ctx->stream->dst.width /
pipe_ctx->stream->src.width;
y_pos = pipe_ctx->stream->dst.y + y_pos * pipe_ctx->stream->dst.height /
pipe_ctx->stream->src.height;

/**
* If the cursor's source viewport is clipped then we need to
Expand Down Expand Up @@ -1297,18 +1293,10 @@ void dcn401_set_cursor_position(struct pipe_ctx *pipe_ctx)
pos_cpy.x = temp_x + recout_width;
}
}
} else {
}

}

/**
* Display groups that are 1xnY, have pos_cpy.y > recout.height
* Calculation:
* delta_from_bottom = recout.y + recout.height - pos_cpy.y
* pos_cpy.y_new = recout.y + delta_from_bottom
* Simplify it as:
* pos_cpy.y = recout.y * 2 + recout.height - pos_cpy.y
*/
}

hubp->funcs->set_cursor_position(hubp, &pos_cpy, &param);
Expand Down

0 comments on commit ed79ab5

Please sign in to comment.