drm/amd/display/dc: add DCE_VERSION for DCE8 APUs
authorAlex Deucher <alexdeucher@gmail.com>
Thu, 10 Aug 2017 18:39:50 +0000 (14:39 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 26 Sep 2017 22:16:32 +0000 (18:16 -0400)
DCE 8.1 = Kaveri
DCE 8.3 = Kabini/Mullins

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/bios/command_table_helper.c
drivers/gpu/drm/amd/display/dc/bios/command_table_helper2.c
drivers/gpu/drm/amd/display/dc/core/dc_resource.c
drivers/gpu/drm/amd/display/dc/dce/dce_clock_source.c
drivers/gpu/drm/amd/display/dc/gpio/hw_factory.c
drivers/gpu/drm/amd/display/dc/gpio/hw_translate.c
drivers/gpu/drm/amd/display/dc/i2caux/i2caux.c
drivers/gpu/drm/amd/display/include/dal_types.h

index 40d9a9921c45c92ac550ece2c7654eb61f8a692b..2979358c6a55c27be5e64728dbdae6500abd1c2b 100644 (file)
@@ -37,6 +37,8 @@ bool dal_bios_parser_init_cmd_tbl_helper(
 {
        switch (dce) {
        case DCE_VERSION_8_0:
+       case DCE_VERSION_8_1:
+       case DCE_VERSION_8_3:
                *h = dal_cmd_tbl_helper_dce80_get_table();
                return true;
 
index 9084a32aab796bef9f46a4753dff18cfdb821bc6..35c3f3a8e4938d1e803d997f99ae37dc20e967d2 100644 (file)
@@ -39,6 +39,8 @@ bool dal_bios_parser_init_cmd_tbl_helper2(
 {
        switch (dce) {
        case DCE_VERSION_8_0:
+       case DCE_VERSION_8_1:
+       case DCE_VERSION_8_3:
                *h = dal_cmd_tbl_helper_dce80_get_table();
                return true;
 
index 30237f049c9973640977229a3103fa6818a24f2d..ee7a393b2b001f7db6eb8cdd34a811d76da4b65e 100644 (file)
@@ -50,9 +50,16 @@ enum dce_version resource_parse_asic_id(struct hw_asic_id asic_id)
        switch (asic_id.chip_family) {
 
        case FAMILY_CI:
-       case FAMILY_KV:
                dc_version = DCE_VERSION_8_0;
                break;
+       case FAMILY_KV:
+               if (ASIC_REV_IS_KALINDI(asic_id.hw_internal_rev) ||
+                   ASIC_REV_IS_BHAVANI(asic_id.hw_internal_rev) ||
+                   ASIC_REV_IS_GODAVARI(asic_id.hw_internal_rev))
+                       dc_version = DCE_VERSION_8_3;
+               else
+                       dc_version = DCE_VERSION_8_1;
+               break;
        case FAMILY_CZ:
                dc_version = DCE_VERSION_11_0;
                break;
@@ -94,6 +101,8 @@ struct resource_pool *dc_create_resource_pool(
 
        switch (dc_version) {
        case DCE_VERSION_8_0:
+       case DCE_VERSION_8_1:
+       case DCE_VERSION_8_3:
                res_pool = dce80_create_resource_pool(
                        num_virtual_links, dc);
                break;
index dd7e1dd6263684e2d980ab76d4d4da7014b930f7..88e266ac6dd3cd8df8209e045caa537a5d9e7b4a 100644 (file)
@@ -578,6 +578,8 @@ static uint32_t dce110_get_pix_clk_dividers(
 
        switch (cs->ctx->dce_version) {
        case DCE_VERSION_8_0:
+       case DCE_VERSION_8_1:
+       case DCE_VERSION_8_3:
        case DCE_VERSION_10_0:
        case DCE_VERSION_11_0:
                pll_calc_error =
@@ -862,6 +864,8 @@ static bool dce110_program_pix_clk(
 
        switch (clock_source->ctx->dce_version) {
        case DCE_VERSION_8_0:
+       case DCE_VERSION_8_1:
+       case DCE_VERSION_8_3:
        case DCE_VERSION_10_0:
        case DCE_VERSION_11_0:
                bp_pc_params.reference_divider = pll_settings->reference_divider;
@@ -1209,6 +1213,8 @@ bool dce110_clk_src_construct(
 
        switch (clk_src->base.ctx->dce_version) {
        case DCE_VERSION_8_0:
+       case DCE_VERSION_8_1:
+       case DCE_VERSION_8_3:
        case DCE_VERSION_10_0:
        case DCE_VERSION_11_0:
 
index 425f1c4fa891df878fd1a4495f79be50c1df0efe..25f6f9103c443157edd12cc82dd58b3eb404d664 100644 (file)
@@ -66,6 +66,8 @@ bool dal_hw_factory_init(
 
        switch (dce_version) {
        case DCE_VERSION_8_0:
+       case DCE_VERSION_8_1:
+       case DCE_VERSION_8_3:
                dal_hw_factory_dce80_init(factory);
                return true;
 
index 3b55d45b6775244f8a68efd388cee925827ba2c1..0ae8ace257391310cf5aa234fd2d03acf43a2bb4 100644 (file)
@@ -65,6 +65,8 @@ bool dal_hw_translate_init(
 
        switch (dce_version) {
        case DCE_VERSION_8_0:
+       case DCE_VERSION_8_1:
+       case DCE_VERSION_8_3:
                dal_hw_translate_dce80_init(translate);
                return true;
        case DCE_VERSION_10_0:
index 4035caf47d31a9c9a248abe281d5b4c156db5fea..9b115e1e2f1a0e59b1f47fe42de99364983b2862 100644 (file)
@@ -79,6 +79,8 @@ struct i2caux *dal_i2caux_create(
 
        switch (ctx->dce_version) {
        case DCE_VERSION_8_0:
+       case DCE_VERSION_8_1:
+       case DCE_VERSION_8_3:
                return dal_i2caux_dce80_create(ctx);
        case DCE_VERSION_11_2:
                return dal_i2caux_dce112_create(ctx);
index 1bfc191574aae2088b3cb3214694950e34aec0c8..fa543965feb51b373e1c5f6a44ec7f6452547b1f 100644 (file)
@@ -35,6 +35,8 @@ struct dc_bios;
 enum dce_version {
        DCE_VERSION_UNKNOWN = (-1),
        DCE_VERSION_8_0,
+       DCE_VERSION_8_1,
+       DCE_VERSION_8_3,
        DCE_VERSION_10_0,
        DCE_VERSION_11_0,
        DCE_VERSION_11_2,