disp: msm: debugfs interface for sde connector to do DSI read

This change implements a new feature to read the cmds response
of the panel from sde connector interface. Sde connector opens
debugfs interface for all the connectors those have support for
cmd receive operation.

Sde connector init module creates rx_cmd debugfs file at
/<debugfs-root>/dri/0/DSI-1/ for DSI-1 connector.
Format for DSI command transfer:
echo "command bytes" > /<debugfs-root/dri/0/DSI-1/rx_cmd
byte-0: the length of received buffer
byte-1: data-type
byte-2: last command. always 0x01
byte-3: channel number
byte-4: flags. MIPI_DSI_MSG_*, must be set to 0xa
byte-5: 0x00
byte-6 and byte-7: command payload length
byte-8 to byte-[8+payload length]: command payload
Example:
echo "0x01 0x06 0x01 0x00 0x0a 0x00 0x00 0x01 0x0a" > rx_cmd
The command receive operations are allowed only if controller
(ex. DSI controller) is in active state.
Read the value of panel response:
cat /<debugfs-root>/dri/0/DSI-1/rx_cmd
returns the value of this command.
nothing - failure, xx xx - success.

Change-Id: I912b65d606e248c7a886d219f4363bf7766ee7b6
Signed-off-by: Yuan Zhao <yzhao@codeaurora.org>
This commit is contained in:
Yuan Zhao
2020-05-12 14:44:03 +08:00
committato da Gerrit - the friendly Code Review server
parent 4fbdcba865
commit 5bba78331d
5 ha cambiato i file con 327 aggiunte e 18 eliminazioni

Vedi File

@@ -18,6 +18,7 @@
#define SDE_CONNECTOR_NAME_SIZE 16
#define SDE_CONNECTOR_DHDR_MEMPOOL_MAX_SIZE SZ_32
#define MAX_CMD_RECEIVE_SIZE 256
struct sde_connector;
struct sde_connector_state;
@@ -263,6 +264,18 @@ struct sde_connector_ops {
int (*cmd_transfer)(struct drm_connector *connector,
void *display, const char *cmd_buf,
u32 cmd_buf_len);
/**
* cmd_receive - Receive the response from the connected display panel
* @display: Pointer to private display handle
* @cmd_buf: Command buffer
* @cmd_buf_len: Command buffer length in bytes
* @recv_buf: rx buffer
* @recv_buf_len: rx buffer length
* Returns: number of bytes read, if successful, negative for failure
*/
int (*cmd_receive)(void *display, const char *cmd_buf,
u32 cmd_buf_len, u8 *recv_buf, u32 recv_buf_len);
/**
* config_hdr - configure HDR
@@ -433,7 +446,8 @@ struct sde_connector_dyn_hdr_metadata {
* @colorspace_updated: Colorspace property was updated
* @last_cmd_tx_sts: status of the last command transfer
* @hdr_capable: external hdr support present
* @core_clk_rate: MDP core clk rate used for dynamic HDR packet calculation
* @cmd_rx_buf: the return buffer of response of command transfer
* @rx_len: the length of dcs command received buffer
*/
struct sde_connector {
struct drm_connector base;
@@ -498,6 +512,9 @@ struct sde_connector {
bool last_cmd_tx_sts;
bool hdr_capable;
u8 cmd_rx_buf[MAX_CMD_RECEIVE_SIZE];
int rx_len;
};
/**