[PATCH 2/2] drm/amd/display: Read resource_straps from registers for DCE12

Harry Wentland harry.wentland at amd.com
Tue Oct 31 20:46:04 UTC 2017


On 2017-10-31 04:28 PM, sunpeng.li at amd.com wrote:
> From: "Leo (Sunpeng) Li" <sunpeng.li at amd.com>
> 
> Now that the registers exist, assign them to the resource_straps struct.
> 
> Signed-off-by: Leo (Sunpeng) Li <sunpeng.li at amd.com>
> ---
>  drivers/gpu/drm/amd/display/dc/dce120/dce120_resource.c | 15 +++++++++------
>  1 file changed, 9 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/display/dc/dce120/dce120_resource.c b/drivers/gpu/drm/amd/display/dc/dce120/dce120_resource.c
> index 3ed28a8..5023a03 100644
> --- a/drivers/gpu/drm/amd/display/dc/dce120/dce120_resource.c
> +++ b/drivers/gpu/drm/amd/display/dc/dce120/dce120_resource.c
> @@ -501,12 +501,15 @@ static void read_dce_straps(
>  	struct dc_context *ctx,
>  	struct resource_straps *straps)
>  {
> -	/* TODO: Registers are missing */
> -	/*REG_GET_2(CC_DC_HDMI_STRAPS,
> -			HDMI_DISABLE, &straps->hdmi_disable,
> -			AUDIO_STREAM_NUMBER, &straps->audio_stream_number);
> -
> -	REG_GET(DC_PINSTRAPS, DC_PINSTRAPS_AUDIO, &straps->dc_pinstraps_audio);*/
> +	uint32_t reg_val = dm_read_reg_soc15(ctx, mmCC_DC_MISC_STRAPS, 0);
> +	straps->audio_stream_number = get_reg_field_value(
> +			reg_val, CC_DC_MISC_STRAPS, AUDIO_STREAM_NUMBER);
> +	straps->hdmi_disable = get_reg_field_value(
> +				reg_val, CC_DC_MISC_STRAPS, HDMI_DISABLE);

The indentation looks wrong. I know we have the same in other parts of this code but let's try to consider this for new code.

In particular reg_val should be on the same line as the function call, the rest should be on new lines, aligned with tabs and spaces to reg_val.

> +
> +	reg_val = dm_read_reg_soc15(ctx, mmDC_PINSTRAPS, 0);
> +	straps->dc_pinstraps_audio = get_reg_field_value(
> +			reg_val, DC_PINSTRAPS, DC_PINSTRAPS_AUDIO);

Nitpick on indentation here as well.

With those nitpicks addressed the series is
Reviewed-by: Harry Wentland <harry.wentland at amd.com>

Harry

>  }
>  
>  static struct audio *create_audio(
> 


More information about the amd-gfx mailing list