Commit fdf17f10 authored by Rodrigo Siqueira's avatar Rodrigo Siqueira Committed by Alex Deucher

drm/amd/display: Add basic kernel doc to CRC code under DC

Reviewed-by: default avatarHarry Wentland <Harry.Wentland@amd.com>
Acked-by: default avatarTom Chung <chiahsuan.chung@amd.com>
Signed-off-by: default avatarRodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Tested-by: default avatarDaniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 60c93531
...@@ -638,14 +638,17 @@ bool dc_stream_configure_crc(struct dc *dc, struct dc_stream_state *stream, ...@@ -638,14 +638,17 @@ bool dc_stream_configure_crc(struct dc *dc, struct dc_stream_state *stream,
/** /**
* dc_stream_get_crc() - Get CRC values for the given stream. * dc_stream_get_crc() - Get CRC values for the given stream.
* @dc: DC object *
* @dc: DC object.
* @stream: The DC stream state of the stream to get CRCs from. * @stream: The DC stream state of the stream to get CRCs from.
* @r_cr: CRC value for the first of the 3 channels stored here. * @r_cr: CRC value for the red component.
* @g_y: CRC value for the second of the 3 channels stored here. * @g_y: CRC value for the green component.
* @b_cb: CRC value for the third of the 3 channels stored here. * @b_cb: CRC value for the blue component.
* *
* dc_stream_configure_crc needs to be called beforehand to enable CRCs. * dc_stream_configure_crc needs to be called beforehand to enable CRCs.
* Return false if stream is not found, or if CRCs are not enabled. *
* Return:
* false if stream is not found, or if CRCs are not enabled.
*/ */
bool dc_stream_get_crc(struct dc *dc, struct dc_stream_state *stream, bool dc_stream_get_crc(struct dc *dc, struct dc_stream_state *stream,
uint32_t *r_cr, uint32_t *g_y, uint32_t *b_cb) uint32_t *r_cr, uint32_t *g_y, uint32_t *b_cb)
......
...@@ -1498,6 +1498,21 @@ bool optc1_configure_crc(struct timing_generator *optc, ...@@ -1498,6 +1498,21 @@ bool optc1_configure_crc(struct timing_generator *optc,
return true; return true;
} }
/**
* optc1_get_crc - Capture CRC result per component
*
* @optc: timing_generator instance.
* @r_cr: 16-bit primary CRC signature for red data.
* @g_y: 16-bit primary CRC signature for green data.
* @b_cb: 16-bit primary CRC signature for blue data.
*
* This function reads the CRC signature from the OPTC registers. Notice that
* we have three registers to keep the CRC result per color component (RGB).
*
* Returns:
* If CRC is disabled, return false; otherwise, return true, and the CRC
* results in the parameters.
*/
bool optc1_get_crc(struct timing_generator *optc, bool optc1_get_crc(struct timing_generator *optc,
uint32_t *r_cr, uint32_t *g_y, uint32_t *b_cb) uint32_t *r_cr, uint32_t *g_y, uint32_t *b_cb)
{ {
...@@ -1510,10 +1525,12 @@ bool optc1_get_crc(struct timing_generator *optc, ...@@ -1510,10 +1525,12 @@ bool optc1_get_crc(struct timing_generator *optc,
if (!field) if (!field)
return false; return false;
/* OTG_CRC0_DATA_RG has the CRC16 results for the red and green component */
REG_GET_2(OTG_CRC0_DATA_RG, REG_GET_2(OTG_CRC0_DATA_RG,
CRC0_R_CR, r_cr, CRC0_R_CR, r_cr,
CRC0_G_Y, g_y); CRC0_G_Y, g_y);
/* OTG_CRC0_DATA_B has the CRC16 results for the blue component */
REG_GET(OTG_CRC0_DATA_B, REG_GET(OTG_CRC0_DATA_B,
CRC0_B_CB, b_cb); CRC0_B_CB, b_cb);
......
...@@ -399,6 +399,10 @@ struct pipe_ctx { ...@@ -399,6 +399,10 @@ struct pipe_ctx {
struct dc_stream_state *stream; struct dc_stream_state *stream;
struct plane_resource plane_res; struct plane_resource plane_res;
/**
* @stream_res: Reference to DCN resource components such OPP and DSC.
*/
struct stream_resource stream_res; struct stream_resource stream_res;
struct link_resource link_res; struct link_resource link_res;
......
...@@ -137,7 +137,13 @@ struct crc_params { ...@@ -137,7 +137,13 @@ struct crc_params {
bool enable; bool enable;
}; };
/**
* struct timing_generator - Entry point to Output Timing Generator feature.
*/
struct timing_generator { struct timing_generator {
/**
* @funcs: Timing generator control functions
*/
const struct timing_generator_funcs *funcs; const struct timing_generator_funcs *funcs;
struct dc_bios *bp; struct dc_bios *bp;
struct dc_context *ctx; struct dc_context *ctx;
...@@ -148,7 +154,9 @@ struct dc_crtc_timing; ...@@ -148,7 +154,9 @@ struct dc_crtc_timing;
struct drr_params; struct drr_params;
/**
* struct timing_generator_funcs - Control timing generator on a given device.
*/
struct timing_generator_funcs { struct timing_generator_funcs {
bool (*validate_timing)(struct timing_generator *tg, bool (*validate_timing)(struct timing_generator *tg,
const struct dc_crtc_timing *timing); const struct dc_crtc_timing *timing);
...@@ -273,8 +281,8 @@ struct timing_generator_funcs { ...@@ -273,8 +281,8 @@ struct timing_generator_funcs {
const struct crc_params *params); const struct crc_params *params);
/** /**
* Get CRCs for the given timing generator. Return false if CRCs are * @get_crc: Get CRCs for the given timing generator. Return false if
* not enabled (via configure_crc). * CRCs are not enabled (via configure_crc).
*/ */
bool (*get_crc)(struct timing_generator *tg, bool (*get_crc)(struct timing_generator *tg,
uint32_t *r_cr, uint32_t *g_y, uint32_t *b_cb); uint32_t *r_cr, uint32_t *g_y, uint32_t *b_cb);
......
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