revert "drm/amd/display: Add condition to sync eDP SW status and HW status"
authorEric Yang <Eric.Yang2@amd.com>
Fri, 11 Jan 2019 21:54:05 +0000 (16:54 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 25 Jan 2019 21:15:37 +0000 (16:15 -0500)
[Why]
This change causes regression for S4 resume where gamma is not
programmed. The change incorrectly updates the requested dpms_off
state.

This reverts commit d2b1d6bbc56afab8ebae9d52d7ca0ea3569bd600.

Signed-off-by: Eric Yang <Eric.Yang2@amd.com>
Reviewed-by: Yongqiang Sun <yongqiang.sun@amd.com>
Acked-by: Leo Li <sunpeng.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c
drivers/gpu/drm/amd/display/dc/bios/bios_parser_helper.c
drivers/gpu/drm/amd/display/dc/bios/bios_parser_helper.h
drivers/gpu/drm/amd/display/dc/dc_bios_types.h
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c

index c513ab6f38435b9281ec0f1799b044d3ed541115..190b8c4e7538e071f6d38cf077a70d9a38f1b838 100644 (file)
@@ -1899,8 +1899,6 @@ static const struct dc_vbios_funcs vbios_funcs = {
 
        .is_accelerated_mode = bios_parser_is_accelerated_mode,
 
-       .is_active_display = bios_is_active_display,
-
        .set_scratch_critical_state = bios_parser_set_scratch_critical_state,
 
 
index d8275ceb20c1a886909f3388d0c5be5f9529c94d..fce46ab54c5436e92bd8175835e9edca199f256b 100644 (file)
@@ -87,96 +87,3 @@ uint32_t bios_get_vga_enabled_displays(
        return active_disp;
 }
 
-bool bios_is_active_display(
-               struct dc_bios *bios,
-               enum signal_type signal,
-               const struct connector_device_tag_info *device_tag)
-{
-       uint32_t active = 0;
-       uint32_t connected = 0;
-       uint32_t bios_scratch_0 = 0;
-       uint32_t bios_scratch_3 = 0;
-
-       switch (signal) {
-       case SIGNAL_TYPE_DVI_SINGLE_LINK:
-       case SIGNAL_TYPE_DVI_DUAL_LINK:
-       case SIGNAL_TYPE_HDMI_TYPE_A:
-       case SIGNAL_TYPE_DISPLAY_PORT:
-       case SIGNAL_TYPE_DISPLAY_PORT_MST:
-               {
-                       if (device_tag->dev_id.device_type == DEVICE_TYPE_DFP) {
-                               switch (device_tag->dev_id.enum_id)     {
-                               case 1:
-                                       {
-                                               active    = ATOM_S3_DFP1_ACTIVE;
-                                               connected = 0x0008;     //ATOM_DISPLAY_DFP1_CONNECT
-                                       }
-                                       break;
-
-                               case 2:
-                                       {
-                                               active    = ATOM_S3_DFP2_ACTIVE;
-                                               connected = 0x0080; //ATOM_DISPLAY_DFP2_CONNECT
-                                       }
-                                       break;
-
-                               case 3:
-                                       {
-                                               active    = ATOM_S3_DFP3_ACTIVE;
-                                               connected = 0x0200; //ATOM_DISPLAY_DFP3_CONNECT
-                                       }
-                                       break;
-
-                               case 4:
-                                       {
-                                               active    = ATOM_S3_DFP4_ACTIVE;
-                                               connected = 0x0400;     //ATOM_DISPLAY_DFP4_CONNECT
-                                       }
-                                       break;
-
-                               case 5:
-                                       {
-                                               active    = ATOM_S3_DFP5_ACTIVE;
-                                               connected = 0x0800; //ATOM_DISPLAY_DFP5_CONNECT
-                                       }
-                                       break;
-
-                               case 6:
-                                       {
-                                               active    = ATOM_S3_DFP6_ACTIVE;
-                                               connected = 0x0040; //ATOM_DISPLAY_DFP6_CONNECT
-                                       }
-                                       break;
-
-                               default:
-                                       break;
-                               }
-                               }
-                       }
-                       break;
-
-       case SIGNAL_TYPE_LVDS:
-       case SIGNAL_TYPE_EDP:
-               {
-                       active    = ATOM_S3_LCD1_ACTIVE;
-                       connected = 0x0002;     //ATOM_DISPLAY_LCD1_CONNECT
-               }
-               break;
-
-       default:
-               break;
-       }
-
-
-       if (bios->regs->BIOS_SCRATCH_0) /*follow up with other asic, todo*/
-               bios_scratch_0 = REG_READ(BIOS_SCRATCH_0);
-       if (bios->regs->BIOS_SCRATCH_3) /*follow up with other asic, todo*/
-               bios_scratch_3 = REG_READ(BIOS_SCRATCH_3);
-
-       bios_scratch_3 &= ATOM_S3_DEVICE_ACTIVE_MASK;
-       if ((active & bios_scratch_3) && (connected & bios_scratch_0))
-               return true;
-
-       return false;
-}
-
index f33cac2147e32cc182d33aefabc09422be1af28b..75a29e68fb2782ad667f858b4f235aeccdcc8ace 100644 (file)
@@ -35,10 +35,6 @@ bool bios_is_accelerated_mode(struct dc_bios *bios);
 void bios_set_scratch_acc_mode_change(struct dc_bios *bios);
 void bios_set_scratch_critical_state(struct dc_bios *bios, bool state);
 uint32_t bios_get_vga_enabled_displays(struct dc_bios *bios);
-bool bios_is_active_display(
-       struct dc_bios *bios,
-       enum signal_type signal,
-       const struct connector_device_tag_info *device_tag);
 
 #define GET_IMAGE(type, offset) ((type *) bios_get_image(&bp->base, offset, sizeof(type)))
 
index a8b3cedf943171fbcdfbb9848f07e9edd5fa1875..8130b95ccc5349a18856cc0fd8b426444ef27ad0 100644 (file)
@@ -86,10 +86,6 @@ struct dc_vbios_funcs {
 
        bool (*is_accelerated_mode)(
                struct dc_bios *bios);
-       bool (*is_active_display)(
-               struct dc_bios *bios,
-               enum signal_type signal,
-               const struct connector_device_tag_info *device_tag);
        void (*set_scratch_critical_state)(
                struct dc_bios *bios,
                bool state);
@@ -145,7 +141,6 @@ struct dc_vbios_funcs {
 };
 
 struct bios_registers {
-       uint32_t BIOS_SCRATCH_0;
        uint32_t BIOS_SCRATCH_3;
        uint32_t BIOS_SCRATCH_6;
 };
index 144a1c8dca1d2ef7b6f443ef22f6757c6e5bdc21..97796fa2f6b66b5b399f6b775630eb969b39d087 100644 (file)
@@ -1557,7 +1557,6 @@ void dce110_enable_accelerated_mode(struct dc *dc, struct dc_state *context)
        int i;
        struct dc_link *edp_link_to_turnoff = NULL;
        struct dc_link *edp_link = get_link_for_edp(dc);
-       struct dc_bios *bios = dc->ctx->dc_bios;
        bool can_edp_fast_boot_optimize = false;
        bool apply_edp_fast_boot_optimization = false;
 
@@ -1584,20 +1583,6 @@ void dce110_enable_accelerated_mode(struct dc *dc, struct dc_state *context)
                        if (context->streams[i]->signal == SIGNAL_TYPE_EDP) {
                                context->streams[i]->apply_edp_fast_boot_optimization = true;
                                apply_edp_fast_boot_optimization = true;
-
-                               /* When after S4 and S5, vbios may post edp and previous dpms_off
-                                * doesn't make sense.
-                                * Update dpms_off state to align hw and sw state via check
-                                * vBios scratch register.
-                                */
-                               if (bios->funcs->is_active_display)     {
-                                       const struct connector_device_tag_info *device_tag = &(edp_link->device_tag);
-
-                                       if (bios->funcs->is_active_display(bios,
-                                                       context->streams[i]->signal,
-                                                       device_tag))
-                                               context->streams[i]->dpms_off = false;
-                               }
                        }
                }
        }
index 4f8cbe33ca293118b89d460ee686e9f7935813f6..09d74070a49b60e45ea3d5f2a9f1c2934026a0fa 100644 (file)
@@ -436,7 +436,6 @@ static const struct dcn_optc_mask tg_mask = {
 };
 
 static const struct bios_registers bios_regs = {
-               NBIO_SR(BIOS_SCRATCH_0),
                NBIO_SR(BIOS_SCRATCH_3),
                NBIO_SR(BIOS_SCRATCH_6)
 };