drm/amd/display: Call ipp_program_bias_and_scale only if available
authorEric Bernstein <eric.bernstein@amd.com>
Thu, 26 Oct 2017 22:13:36 +0000 (18:13 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 6 Dec 2017 17:47:25 +0000 (12:47 -0500)
Also move some register definitions to common DCN regs.

Signed-off-by: Eric Bernstein <eric.bernstein@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.h
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c

index 3a6ebd1..880e366 100644 (file)
@@ -73,6 +73,9 @@
        SRI(RECOUT_START, DSCL, id), \
        SRI(RECOUT_SIZE, DSCL, id), \
        SRI(OBUF_CONTROL, DSCL, id), \
+       SRI(CM_ICSC_CONTROL, CM, id), \
+       SRI(CM_ICSC_C11_C12, CM, id), \
+       SRI(CM_ICSC_C33_C34, CM, id), \
        SRI(CM_DGAM_RAMB_START_CNTL_B, CM, id), \
        SRI(CM_DGAM_RAMB_START_CNTL_G, CM, id), \
        SRI(CM_DGAM_RAMB_START_CNTL_R, CM, id), \
        SRI(CM_OCSC_CONTROL, CM, id), \
        SRI(CM_OCSC_C11_C12, CM, id), \
        SRI(CM_OCSC_C33_C34, CM, id), \
-       SRI(CM_ICSC_CONTROL, CM, id), \
-       SRI(CM_ICSC_C11_C12, CM, id), \
-       SRI(CM_ICSC_C33_C34, CM, id), \
        SRI(CM_BNS_VALUES_R, CM, id), \
        SRI(CM_BNS_VALUES_G, CM, id), \
        SRI(CM_BNS_VALUES_B, CM, id), \
        TF_SF(DSCL0_SCL_MODE, SCL_CHROMA_COEF_MODE, mask_sh),\
        TF_SF(DSCL0_SCL_MODE, SCL_COEF_RAM_SELECT_CURRENT, mask_sh), \
        TF_SF(DSCL0_OBUF_CONTROL, OBUF_BYPASS, mask_sh), \
+       TF_SF(CM0_CM_ICSC_CONTROL, CM_ICSC_MODE, mask_sh), \
+       TF_SF(CM0_CM_ICSC_C11_C12, CM_ICSC_C11, mask_sh), \
+       TF_SF(CM0_CM_ICSC_C11_C12, CM_ICSC_C12, mask_sh), \
+       TF_SF(CM0_CM_ICSC_C33_C34, CM_ICSC_C33, mask_sh), \
+       TF_SF(CM0_CM_ICSC_C33_C34, CM_ICSC_C34, mask_sh), \
        TF_SF(CM0_CM_DGAM_RAMB_START_CNTL_B, CM_DGAM_RAMB_EXP_REGION_START_B, mask_sh), \
        TF_SF(CM0_CM_DGAM_RAMB_START_CNTL_B, CM_DGAM_RAMB_EXP_REGION_START_SEGMENT_B, mask_sh), \
        TF_SF(CM0_CM_DGAM_RAMB_START_CNTL_G, CM_DGAM_RAMB_EXP_REGION_START_G, mask_sh), \
        TF_SF(CM0_CM_OCSC_C11_C12, CM_OCSC_C12, mask_sh), \
        TF_SF(CM0_CM_OCSC_C33_C34, CM_OCSC_C33, mask_sh), \
        TF_SF(CM0_CM_OCSC_C33_C34, CM_OCSC_C34, mask_sh), \
-       TF_SF(CM0_CM_ICSC_CONTROL, CM_ICSC_MODE, mask_sh), \
-       TF_SF(CM0_CM_ICSC_C11_C12, CM_ICSC_C11, mask_sh), \
-       TF_SF(CM0_CM_ICSC_C11_C12, CM_ICSC_C12, mask_sh), \
-       TF_SF(CM0_CM_ICSC_C33_C34, CM_ICSC_C33, mask_sh), \
-       TF_SF(CM0_CM_ICSC_C33_C34, CM_ICSC_C34, mask_sh), \
        TF_SF(CM0_CM_BNS_VALUES_R, CM_BNS_BIAS_R, mask_sh), \
        TF_SF(CM0_CM_BNS_VALUES_G, CM_BNS_BIAS_G, mask_sh), \
        TF_SF(CM0_CM_BNS_VALUES_B, CM_BNS_BIAS_B, mask_sh), \
index 90f1f54..75feb47 100644 (file)
@@ -1903,7 +1903,8 @@ static void update_dchubp_dpp(
 
        //set scale and bias registers
        build_prescale_params(&bns_params, plane_state);
-       dpp->funcs->ipp_program_bias_and_scale(dpp, &bns_params);
+       if (dpp->funcs->ipp_program_bias_and_scale)
+               dpp->funcs->ipp_program_bias_and_scale(dpp, &bns_params);
 
        mpcc_cfg.dpp_id = hubp->inst;
        mpcc_cfg.opp_id = pipe_ctx->stream_res.opp->inst;