121 lines · c
1/* SPDX-License-Identifier: GPL-2.0-only */2/*3 * Copyright (c) 2015-2016 MediaTek Inc.4 * Author: Houlong Wei <houlong.wei@mediatek.com>5 * Ming Hsiu Tsai <minghsiu.tsai@mediatek.com>6 */7 8#ifndef __MTK_MDP_IPI_H__9#define __MTK_MDP_IPI_H__10 11#define MTK_MDP_MAX_NUM_PLANE 312 13enum mdp_ipi_msgid {14 AP_MDP_INIT = 0xd000,15 AP_MDP_DEINIT = 0xd001,16 AP_MDP_PROCESS = 0xd002,17 18 VPU_MDP_INIT_ACK = 0xe000,19 VPU_MDP_DEINIT_ACK = 0xe001,20 VPU_MDP_PROCESS_ACK = 0xe00221};22 23#pragma pack(push, 4)24 25/**26 * struct mdp_ipi_init - for AP_MDP_INIT27 * @msg_id : AP_MDP_INIT28 * @ipi_id : IPI_MDP29 * @ap_inst : AP mtk_mdp_vpu address30 */31struct mdp_ipi_init {32 uint32_t msg_id;33 uint32_t ipi_id;34 uint64_t ap_inst;35};36 37/**38 * struct mdp_ipi_comm - for AP_MDP_PROCESS, AP_MDP_DEINIT39 * @msg_id : AP_MDP_PROCESS, AP_MDP_DEINIT40 * @ipi_id : IPI_MDP41 * @ap_inst : AP mtk_mdp_vpu address42 * @vpu_inst_addr : VPU MDP instance address43 * @padding : Alignment padding44 */45struct mdp_ipi_comm {46 uint32_t msg_id;47 uint32_t ipi_id;48 uint64_t ap_inst;49 uint32_t vpu_inst_addr;50 uint32_t padding;51};52 53/**54 * struct mdp_ipi_comm_ack - for VPU_MDP_DEINIT_ACK, VPU_MDP_PROCESS_ACK55 * @msg_id : VPU_MDP_DEINIT_ACK, VPU_MDP_PROCESS_ACK56 * @ipi_id : IPI_MDP57 * @ap_inst : AP mtk_mdp_vpu address58 * @vpu_inst_addr : VPU MDP instance address59 * @status : VPU exeuction result60 */61struct mdp_ipi_comm_ack {62 uint32_t msg_id;63 uint32_t ipi_id;64 uint64_t ap_inst;65 uint32_t vpu_inst_addr;66 int32_t status;67};68 69/**70 * struct mdp_config - configured for source/destination image71 * @x : left72 * @y : top73 * @w : width74 * @h : height75 * @w_stride : bytes in horizontal76 * @h_stride : bytes in vertical77 * @crop_x : cropped left78 * @crop_y : cropped top79 * @crop_w : cropped width80 * @crop_h : cropped height81 * @format : color format82 */83struct mdp_config {84 int32_t x;85 int32_t y;86 int32_t w;87 int32_t h;88 int32_t w_stride;89 int32_t h_stride;90 int32_t crop_x;91 int32_t crop_y;92 int32_t crop_w;93 int32_t crop_h;94 int32_t format;95};96 97struct mdp_buffer {98 uint64_t addr_mva[MTK_MDP_MAX_NUM_PLANE];99 int32_t plane_size[MTK_MDP_MAX_NUM_PLANE];100 int32_t plane_num;101};102 103struct mdp_config_misc {104 int32_t orientation; /* 0, 90, 180, 270 */105 int32_t hflip; /* 1 will enable the flip */106 int32_t vflip; /* 1 will enable the flip */107 int32_t alpha; /* global alpha */108};109 110struct mdp_process_vsi {111 struct mdp_config src_config;112 struct mdp_buffer src_buffer;113 struct mdp_config dst_config;114 struct mdp_buffer dst_buffer;115 struct mdp_config_misc misc;116};117 118#pragma pack(pop)119 120#endif /* __MTK_MDP_IPI_H__ */121