Commit 91d3156a authored by Wayne Lin's avatar Wayne Lin Committed by Alex Deucher

drm/amd/display: Calculate CRC on specific frame region

[why]
Currently, we only support calculating CRC on whole frame.
We want to extend the capability to calculate CRC on
specific frame area.

[how]
Calculate CRC on specific area once it's specified from the
input parameter.
Signed-off-by: default avatarWayne Lin <Wayne.Lin@amd.com>
Reviewed-by: default avatarNicholas Kazlauskas <Nicholas.Kazlauskas@amd.com>
Reviewed-by: default avatarTony Cheng <Tony.Cheng@amd.com>
Acked-by: default avatarQingqing Zhuo <qingqing.zhuo@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent ad975f44
...@@ -115,7 +115,7 @@ int amdgpu_dm_crtc_configure_crc_source(struct drm_crtc *crtc, ...@@ -115,7 +115,7 @@ int amdgpu_dm_crtc_configure_crc_source(struct drm_crtc *crtc,
/* Enable CRTC CRC generation if necessary. */ /* Enable CRTC CRC generation if necessary. */
if (dm_is_crc_source_crtc(source)) { if (dm_is_crc_source_crtc(source)) {
if (!dc_stream_configure_crc(stream_state->ctx->dc, if (!dc_stream_configure_crc(stream_state->ctx->dc,
stream_state, enable, enable)) { stream_state, NULL, enable, enable)) {
ret = -EINVAL; ret = -EINVAL;
goto unlock; goto unlock;
} }
......
...@@ -346,7 +346,7 @@ bool dc_stream_get_crtc_position(struct dc *dc, ...@@ -346,7 +346,7 @@ bool dc_stream_get_crtc_position(struct dc *dc,
* calculate the crc. * calculate the crc.
*/ */
bool dc_stream_configure_crc(struct dc *dc, struct dc_stream_state *stream, bool dc_stream_configure_crc(struct dc *dc, struct dc_stream_state *stream,
bool enable, bool continuous) struct crc_params *crc_window, bool enable, bool continuous)
{ {
int i; int i;
struct pipe_ctx *pipe; struct pipe_ctx *pipe;
...@@ -362,7 +362,7 @@ bool dc_stream_configure_crc(struct dc *dc, struct dc_stream_state *stream, ...@@ -362,7 +362,7 @@ bool dc_stream_configure_crc(struct dc *dc, struct dc_stream_state *stream,
if (i == MAX_PIPES) if (i == MAX_PIPES)
return false; return false;
/* Always capture the full frame */ /* By default, capture the full frame */
param.windowa_x_start = 0; param.windowa_x_start = 0;
param.windowa_y_start = 0; param.windowa_y_start = 0;
param.windowa_x_end = pipe->stream->timing.h_addressable; param.windowa_x_end = pipe->stream->timing.h_addressable;
...@@ -372,6 +372,17 @@ bool dc_stream_configure_crc(struct dc *dc, struct dc_stream_state *stream, ...@@ -372,6 +372,17 @@ bool dc_stream_configure_crc(struct dc *dc, struct dc_stream_state *stream,
param.windowb_x_end = pipe->stream->timing.h_addressable; param.windowb_x_end = pipe->stream->timing.h_addressable;
param.windowb_y_end = pipe->stream->timing.v_addressable; param.windowb_y_end = pipe->stream->timing.v_addressable;
if (crc_window) {
param.windowa_x_start = crc_window->windowa_x_start;
param.windowa_y_start = crc_window->windowa_y_start;
param.windowa_x_end = crc_window->windowa_x_end;
param.windowa_y_end = crc_window->windowa_y_end;
param.windowb_x_start = crc_window->windowb_x_start;
param.windowb_y_start = crc_window->windowb_y_start;
param.windowb_x_end = crc_window->windowb_x_end;
param.windowb_y_end = crc_window->windowb_y_end;
}
param.dsc_mode = pipe->stream->timing.flags.DSC ? 1:0; param.dsc_mode = pipe->stream->timing.flags.DSC ? 1:0;
param.odm_mode = pipe->next_odm_pipe ? 1:0; param.odm_mode = pipe->next_odm_pipe ? 1:0;
......
...@@ -457,6 +457,7 @@ bool dc_stream_get_crtc_position(struct dc *dc, ...@@ -457,6 +457,7 @@ bool dc_stream_get_crtc_position(struct dc *dc,
bool dc_stream_configure_crc(struct dc *dc, bool dc_stream_configure_crc(struct dc *dc,
struct dc_stream_state *stream, struct dc_stream_state *stream,
struct crc_params *crc_window,
bool enable, bool enable,
bool continuous); bool continuous);
......
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