drm/amd/display: Split DMUB cmd type into type/subtype

[Why]
Commands will be considered a stable ABI between driver and firmware.

Commands are also split between DC commands, DAL feature commands,
and VBIOS commands.

Commands are currently not designated to a specific ID and the enum
does not provide a stable ABI.

We currently group all of these into a single command type of 8-bits.
With the stable ABI consideration in mind it's not unreasonable to
run out of command IDs.

For cleaner separation and versioning split the commands into a main
type and a subtype.

[How]
For commands where performance matters (like reg sequences) these
are still considered main commands.

Sub commands will be split by ownership/feature.

Update existing command sequences to reflect new changes.

Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Leo Li <sunpeng.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
Nicholas Kazlauskas
2019-11-12 15:33:37 -05:00
committed by Alex Deucher
parent 75441d9d35
commit d4bbcecb59
5 changed files with 112 additions and 34 deletions

View File

@@ -27,6 +27,8 @@
#define _DMUB_CMD_H_
#include "dmub_types.h"
#include "dmub_cmd_dal.h"
#include "dmub_cmd_vbios.h"
#include "atomfirmware.h"
#define DMUB_RB_CMD_SIZE 64
@@ -34,43 +36,29 @@
#define DMUB_RB_SIZE (DMUB_RB_CMD_SIZE * DMUB_RB_MAX_ENTRY)
#define REG_SET_MASK 0xFFFF
enum dmub_cmd_type {
DMUB_CMD__NULL,
DMUB_CMD__REG_SEQ_READ_MODIFY_WRITE,
DMUB_CMD__REG_SEQ_FIELD_UPDATE_SEQ,
DMUB_CMD__REG_SEQ_BURST_WRITE,
DMUB_CMD__REG_REG_WAIT,
DMUB_CMD__DIGX_ENCODER_CONTROL,
DMUB_CMD__SET_PIXEL_CLOCK,
DMUB_CMD__ENABLE_DISP_POWER_GATING,
DMUB_CMD__DPPHY_INIT,
DMUB_CMD__DIG1_TRANSMITTER_CONTROL,
DMUB_CMD__SETUP_DISPLAY_MODE,
DMUB_CMD__BLANK_CRTC,
DMUB_CMD__ENABLE_DISPPATH,
DMUB_CMD__DISABLE_DISPPATH,
DMUB_CMD__DISABLE_DISPPATH_OUTPUT,
DMUB_CMD__READ_DISPPATH_EDID,
DMUB_CMD__DP_PRE_LINKTRAINING,
DMUB_CMD__INIT_CONTROLLER,
DMUB_CMD__RESET_CONTROLLER,
DMUB_CMD__SET_BRI_LEVEL,
DMUB_CMD__LVTMA_CONTROL,
/*
* Command IDs should be treated as stable ABI.
* Do not reuse or modify IDs.
*/
// PSR
DMUB_CMD__PSR_ENABLE,
DMUB_CMD__PSR_DISABLE,
DMUB_CMD__PSR_COPY_SETTINGS,
DMUB_CMD__PSR_SET_LEVEL,
enum dmub_cmd_type {
DMUB_CMD__NULL = 0,
DMUB_CMD__REG_SEQ_READ_MODIFY_WRITE = 1,
DMUB_CMD__REG_SEQ_FIELD_UPDATE_SEQ = 2,
DMUB_CMD__REG_SEQ_BURST_WRITE = 3,
DMUB_CMD__REG_REG_WAIT = 4,
DMUB_CMD__PSR = 64,
DMUB_CMD__VBIOS = 128,
};
#pragma pack(push, 1)
struct dmub_cmd_header {
enum dmub_cmd_type type : 8;
unsigned int reserved0 : 16;
unsigned int type : 8;
unsigned int sub_type : 8;
unsigned int reserved0 : 8;
unsigned int payload_bytes : 6; /* up to 60 bytes */
unsigned int reserved : 2;
unsigned int reserved1 : 2;
};
/*

View File

@@ -0,0 +1,41 @@
/*
* Copyright 2019 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 _DMUB_CMD_DAL_H_
#define _DMUB_CMD_DAL_H_
/*
* Command IDs should be treated as stable ABI.
* Do not reuse or modify IDs.
*/
enum dmub_cmd_psr_type {
DMUB_CMD__PSR_ENABLE = 0,
DMUB_CMD__PSR_DISABLE = 1,
DMUB_CMD__PSR_COPY_SETTINGS = 2,
DMUB_CMD__PSR_SET_LEVEL = 3,
};
#endif /* _DMUB_CMD_DAL_H_ */

View File

@@ -0,0 +1,41 @@
/*
* Copyright 2019 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 _DMUB_CMD_VBIOS_H_
#define _DMUB_CMD_VBIOS_H_
/*
* Command IDs should be treated as stable ABI.
* Do not reuse or modify IDs.
*/
enum dmub_cmd_vbios_type {
DMUB_CMD__VBIOS_DIGX_ENCODER_CONTROL = 0,
DMUB_CMD__VBIOS_DIG1_TRANSMITTER_CONTROL = 1,
DMUB_CMD__VBIOS_SET_PIXEL_CLOCK = 2,
DMUB_CMD__VBIOS_ENABLE_DISP_POWER_GATING = 3,
};
#endif /* _DMUB_CMD_VBIOS_H_ */