diff --git a/drivers/gpu/drm/amd/display/dc/Makefile b/drivers/gpu/drm/amd/display/dc/Makefile index 93d02956c5eb..e88a9cea8d88 100644 --- a/drivers/gpu/drm/amd/display/dc/Makefile +++ b/drivers/gpu/drm/amd/display/dc/Makefile @@ -63,7 +63,6 @@ include $(AMD_DC) FILES = FILES += dc_dmub_srv.o -FILES += dc_edid_parser.o FILES += dc_fused_io.o FILES += dc_helper.o FILES += core/dc.o diff --git a/drivers/gpu/drm/amd/display/dc/dc_edid_parser.c b/drivers/gpu/drm/amd/display/dc/dc_edid_parser.c deleted file mode 100644 index 0db5b49e9d5e..000000000000 --- a/drivers/gpu/drm/amd/display/dc/dc_edid_parser.c +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright 2021 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - * - * Authors: AMD - * - */ - -#include "dce/dce_dmcu.h" -#include "dc_edid_parser.h" - -bool dc_edid_parser_send_cea(struct dc *dc, - int offset, - int total_length, - uint8_t *data, - int length) -{ - struct dmcu *dmcu = dc->res_pool->dmcu; - - if (dmcu && - dmcu->funcs->is_dmcu_initialized(dmcu) && - dmcu->funcs->send_edid_cea) { - return dmcu->funcs->send_edid_cea(dmcu, - offset, - total_length, - data, - length); - } - - return false; -} - -bool dc_edid_parser_recv_cea_ack(struct dc *dc, int *offset) -{ - struct dmcu *dmcu = dc->res_pool->dmcu; - - if (dmcu && - dmcu->funcs->is_dmcu_initialized(dmcu) && - dmcu->funcs->recv_edid_cea_ack) { - return dmcu->funcs->recv_edid_cea_ack(dmcu, offset); - } - - return false; -} - -bool dc_edid_parser_recv_amd_vsdb(struct dc *dc, - int *version, - int *min_frame_rate, - int *max_frame_rate) -{ - struct dmcu *dmcu = dc->res_pool->dmcu; - - if (dmcu && - dmcu->funcs->is_dmcu_initialized(dmcu) && - dmcu->funcs->recv_amd_vsdb) { - return dmcu->funcs->recv_amd_vsdb(dmcu, - version, - min_frame_rate, - max_frame_rate); - } - - return false; -} diff --git a/drivers/gpu/drm/amd/display/dc/dc_edid_parser.h b/drivers/gpu/drm/amd/display/dc/dc_edid_parser.h deleted file mode 100644 index da67ec06f0a2..000000000000 --- a/drivers/gpu/drm/amd/display/dc/dc_edid_parser.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2021 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - * - * Authors: AMD - * - */ - -#ifndef _DC_EDID_PARSER_H_ -#define _DC_EDID_PARSER_H_ - -#include "core_types.h" - -bool dc_edid_parser_send_cea(struct dc *dc, - int offset, - int total_length, - uint8_t *data, - int length); - -bool dc_edid_parser_recv_cea_ack(struct dc *dc, int *offset); - -bool dc_edid_parser_recv_amd_vsdb(struct dc *dc, - int *version, - int *min_frame_rate, - int *max_frame_rate); - -#endif /* _DC_EDID_PARSER_H_ */ diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_dmcu.c b/drivers/gpu/drm/amd/display/dc/dce/dce_dmcu.c index 25ebd8a52ae4..23de1c793ec3 100644 --- a/drivers/gpu/drm/amd/display/dc/dce/dce_dmcu.c +++ b/drivers/gpu/drm/amd/display/dc/dce/dce_dmcu.c @@ -56,9 +56,6 @@ #define MCP_BL_SET_PWM_FRAC 0x6A /* Enable or disable Fractional PWM */ #define CRC_WIN_NOTIFY 0x92 #define CRC_STOP_UPDATE 0x93 -#define MCP_SEND_EDID_CEA 0xA0 -#define EDID_CEA_CMD_ACK 1 -#define EDID_CEA_CMD_NACK 2 #define MASTER_COMM_CNTL_REG__MASTER_COMM_INTERRUPT_MASK 0x00000001L // PSP FW version @@ -812,121 +809,6 @@ static bool dcn20_unlock_phy(struct dmcu *dmcu) return true; } -static bool dcn10_send_edid_cea(struct dmcu *dmcu, - int offset, - int total_length, - uint8_t *data, - int length) -{ - struct dce_dmcu *dmcu_dce = TO_DCE_DMCU(dmcu); - uint32_t header, data1, data2; - - /* If microcontroller is not running, do nothing */ - if (dmcu->dmcu_state != DMCU_RUNNING) - return false; - - if (length > 8 || length <= 0) - return false; - - header = ((uint32_t)offset & 0xFFFF) << 16 | (total_length & 0xFFFF); - data1 = (((uint32_t)data[0]) << 24) | (((uint32_t)data[1]) << 16) | - (((uint32_t)data[2]) << 8) | ((uint32_t)data[3]); - data2 = (((uint32_t)data[4]) << 24) | (((uint32_t)data[5]) << 16) | - (((uint32_t)data[6]) << 8) | ((uint32_t)data[7]); - - /* waitDMCUReadyForCmd */ - REG_WAIT(MASTER_COMM_CNTL_REG, MASTER_COMM_INTERRUPT, 0, 1, 10000); - - /* setDMCUParam_Cmd */ - REG_UPDATE(MASTER_COMM_CMD_REG, MASTER_COMM_CMD_REG_BYTE0, MCP_SEND_EDID_CEA); - - REG_WRITE(MASTER_COMM_DATA_REG1, header); - REG_WRITE(MASTER_COMM_DATA_REG2, data1); - REG_WRITE(MASTER_COMM_DATA_REG3, data2); - - /* notifyDMCUMsg */ - REG_UPDATE(MASTER_COMM_CNTL_REG, MASTER_COMM_INTERRUPT, 1); - - /* waitDMCUReadyForCmd */ - REG_WAIT(MASTER_COMM_CNTL_REG, MASTER_COMM_INTERRUPT, 0, 1, 10000); - - return true; -} - -static bool dcn10_get_scp_results(struct dmcu *dmcu, - uint32_t *cmd, - uint32_t *data1, - uint32_t *data2, - uint32_t *data3) -{ - struct dce_dmcu *dmcu_dce = TO_DCE_DMCU(dmcu); - - /* If microcontroller is not running, do nothing */ - if (dmcu->dmcu_state != DMCU_RUNNING) - return false; - - *cmd = REG_READ(SLAVE_COMM_CMD_REG); - *data1 = REG_READ(SLAVE_COMM_DATA_REG1); - *data2 = REG_READ(SLAVE_COMM_DATA_REG2); - *data3 = REG_READ(SLAVE_COMM_DATA_REG3); - - /* clear SCP interrupt */ - REG_UPDATE(SLAVE_COMM_CNTL_REG, SLAVE_COMM_INTERRUPT, 0); - - return true; -} - -static bool dcn10_recv_amd_vsdb(struct dmcu *dmcu, - int *version, - int *min_frame_rate, - int *max_frame_rate) -{ - uint32_t data[4]; - int cmd, ack, len; - - if (!dcn10_get_scp_results(dmcu, &data[0], &data[1], &data[2], &data[3])) - return false; - - cmd = data[0] & 0x3FF; - len = (data[0] >> 10) & 0x3F; - ack = data[1]; - - if (cmd != MCP_SEND_EDID_CEA || ack != EDID_CEA_CMD_ACK || len != 12) - return false; - - if ((data[2] & 0xFF)) { - *version = (data[2] >> 8) & 0xFF; - *min_frame_rate = (data[3] >> 16) & 0xFFFF; - *max_frame_rate = data[3] & 0xFFFF; - return true; - } - - return false; -} - -static bool dcn10_recv_edid_cea_ack(struct dmcu *dmcu, int *offset) -{ - uint32_t data[4]; - int cmd, ack; - - if (!dcn10_get_scp_results(dmcu, - &data[0], &data[1], &data[2], &data[3])) - return false; - - cmd = data[0] & 0x3FF; - ack = data[1]; - - if (cmd != MCP_SEND_EDID_CEA) - return false; - - if (ack == EDID_CEA_CMD_ACK) - return true; - - *offset = data[2]; /* nack */ - return false; -} - - #if defined(CONFIG_DRM_AMD_SECURE_DISPLAY) static void dcn10_forward_crc_window(struct dmcu *dmcu, struct rect *rect, @@ -1030,9 +912,6 @@ static const struct dmcu_funcs dcn10_funcs = { .get_psr_state = dcn10_get_dmcu_psr_state, .set_psr_wait_loop = dcn10_psr_wait_loop, .get_psr_wait_loop = dcn10_get_psr_wait_loop, - .send_edid_cea = dcn10_send_edid_cea, - .recv_amd_vsdb = dcn10_recv_amd_vsdb, - .recv_edid_cea_ack = dcn10_recv_edid_cea_ack, #if defined(CONFIG_DRM_AMD_SECURE_DISPLAY) .forward_crc_window = dcn10_forward_crc_window, .stop_crc_win_update = dcn10_stop_crc_win_update, diff --git a/drivers/gpu/drm/amd/display/dc/inc/hw/dmcu.h b/drivers/gpu/drm/amd/display/dc/inc/hw/dmcu.h index de3113ecbc77..eebfd177463d 100644 --- a/drivers/gpu/drm/amd/display/dc/inc/hw/dmcu.h +++ b/drivers/gpu/drm/amd/display/dc/inc/hw/dmcu.h @@ -74,16 +74,6 @@ struct dmcu_funcs { bool (*is_dmcu_initialized)(struct dmcu *dmcu); bool (*lock_phy)(struct dmcu *dmcu); bool (*unlock_phy)(struct dmcu *dmcu); - bool (*send_edid_cea)(struct dmcu *dmcu, - int offset, - int total_length, - uint8_t *data, - int length); - bool (*recv_amd_vsdb)(struct dmcu *dmcu, - int *version, - int *min_frame_rate, - int *max_frame_rate); - bool (*recv_edid_cea_ack)(struct dmcu *dmcu, int *offset); #if defined(CONFIG_DRM_AMD_SECURE_DISPLAY) void (*forward_crc_window)(struct dmcu *dmcu, struct rect *rect, diff --git a/drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h b/drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h index e7879bd81f83..0ca4ff82ea1f 100644 --- a/drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h +++ b/drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h @@ -1887,10 +1887,6 @@ enum dmub_cmd_type { * Command type used for interfacing with DPIA. */ DMUB_CMD__DPIA = 77, - /** - * Command type used for EDID CEA parsing - */ - DMUB_CMD__EDID_CEA = 79, /** * Command type used for getting usbc cable ID */ @@ -6665,69 +6661,6 @@ struct dmub_rb_cmd_transmitter_set_phy_fsm { struct dmub_rb_cmd_transmitter_set_phy_fsm_data data; /**< payload */ }; -/** - * Maximum number of bytes a chunk sent to DMUB for parsing - */ -#define DMUB_EDID_CEA_DATA_CHUNK_BYTES 8 - -/** - * Represent a chunk of CEA blocks sent to DMUB for parsing - */ -struct dmub_cmd_send_edid_cea { - uint16_t offset; /**< offset into the CEA block */ - uint8_t length; /**< number of bytes in payload to copy as part of CEA block */ - uint16_t cea_total_length; /**< total length of the CEA block */ - uint8_t payload[DMUB_EDID_CEA_DATA_CHUNK_BYTES]; /**< data chunk of the CEA block */ - uint8_t pad[3]; /**< padding and for future expansion */ -}; - -/** - * Result of VSDB parsing from CEA block - */ -struct dmub_cmd_edid_cea_amd_vsdb { - uint8_t vsdb_found; /**< 1 if parsing has found valid AMD VSDB */ - uint8_t freesync_supported; /**< 1 if Freesync is supported */ - uint16_t amd_vsdb_version; /**< AMD VSDB version */ - uint16_t min_frame_rate; /**< Maximum frame rate */ - uint16_t max_frame_rate; /**< Minimum frame rate */ - uint8_t freesync_mccs_vcp_code; /**< Freesync MCCS VCP code */ -}; - -/** - * Result of sending a CEA chunk - */ -struct dmub_cmd_edid_cea_ack { - uint16_t offset; /**< offset of the chunk into the CEA block */ - uint8_t success; /**< 1 if this sending of chunk succeeded */ - uint8_t pad; /**< padding and for future expansion */ -}; - -/** - * Specify whether the result is an ACK/NACK or the parsing has finished - */ -enum dmub_cmd_edid_cea_reply_type { - DMUB_CMD__EDID_CEA_AMD_VSDB = 1, /**< VSDB parsing has finished */ - DMUB_CMD__EDID_CEA_ACK = 2, /**< acknowledges the CEA sending is OK or failing */ -}; - -/** - * Definition of a DMUB_CMD__EDID_CEA command. - */ -struct dmub_rb_cmd_edid_cea { - struct dmub_cmd_header header; /**< Command header */ - union dmub_cmd_edid_cea_data { - struct dmub_cmd_send_edid_cea input; /**< input to send CEA chunks */ - struct dmub_cmd_edid_cea_output { /**< output with results */ - uint8_t type; /**< dmub_cmd_edid_cea_reply_type */ - union { - struct dmub_cmd_edid_cea_amd_vsdb amd_vsdb; - struct dmub_cmd_edid_cea_ack ack; - }; - } output; /**< output to retrieve ACK/NACK or VSDB parsing results */ - } data; /**< Command data */ - -}; - /** * struct dmub_cmd_cable_id_input - Defines the input of DMUB_CMD_GET_USBC_CABLE_ID command. */ @@ -7579,10 +7512,6 @@ union dmub_rb_cmd { * Definition of a DMUB_CMD__DPIA_SET_TPS_NOTIFICATION command. */ struct dmub_rb_cmd_set_tps_notification set_tps_notification; - /** - * Definition of a DMUB_CMD__EDID_CEA command. - */ - struct dmub_rb_cmd_edid_cea edid_cea; /** * Definition of a DMUB_CMD_GET_USBC_CABLE_ID command. */