1*97fb5e8dSThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-only */ 214be3200SRob Clark /* 314be3200SRob Clark * Copyright (c) 2014 The Linux Foundation. All rights reserved. 414be3200SRob Clark */ 514be3200SRob Clark 614be3200SRob Clark #ifndef __MDP5_CTL_H__ 714be3200SRob Clark #define __MDP5_CTL_H__ 814be3200SRob Clark 914be3200SRob Clark #include "msm_drv.h" 1014be3200SRob Clark 1114be3200SRob Clark /* 1214be3200SRob Clark * CTL Manager prototypes: 1314be3200SRob Clark * mdp5_ctlm_init() returns a ctlm (CTL Manager) handler, 1414be3200SRob Clark * which is then used to call the other mdp5_ctlm_*(ctlm, ...) functions. 1514be3200SRob Clark */ 1614be3200SRob Clark struct mdp5_ctl_manager; 1714be3200SRob Clark struct mdp5_ctl_manager *mdp5_ctlm_init(struct drm_device *dev, 1814be3200SRob Clark void __iomem *mmio_base, struct mdp5_cfg_handler *cfg_hnd); 1914be3200SRob Clark void mdp5_ctlm_hw_reset(struct mdp5_ctl_manager *ctlm); 2014be3200SRob Clark void mdp5_ctlm_destroy(struct mdp5_ctl_manager *ctlm); 2114be3200SRob Clark 2214be3200SRob Clark /* 2314be3200SRob Clark * CTL prototypes: 2414be3200SRob Clark * mdp5_ctl_request(ctlm, ...) returns a ctl (CTL resource) handler, 2514be3200SRob Clark * which is then used to call the other mdp5_ctl_*(ctl, ...) functions. 2614be3200SRob Clark */ 2714be3200SRob Clark struct mdp5_ctl *mdp5_ctlm_request(struct mdp5_ctl_manager *ctlm, int intf_num); 2814be3200SRob Clark 2914be3200SRob Clark int mdp5_ctl_get_ctl_id(struct mdp5_ctl *ctl); 3014be3200SRob Clark 3114be3200SRob Clark struct mdp5_interface; 3214be3200SRob Clark struct mdp5_pipeline; 3314be3200SRob Clark int mdp5_ctl_set_pipeline(struct mdp5_ctl *ctl, struct mdp5_pipeline *p); 3414be3200SRob Clark int mdp5_ctl_set_encoder_state(struct mdp5_ctl *ctl, struct mdp5_pipeline *p, 3514be3200SRob Clark bool enabled); 3614be3200SRob Clark 3714be3200SRob Clark int mdp5_ctl_set_cursor(struct mdp5_ctl *ctl, struct mdp5_pipeline *pipeline, 3814be3200SRob Clark int cursor_id, bool enable); 3914be3200SRob Clark int mdp5_ctl_pair(struct mdp5_ctl *ctlx, struct mdp5_ctl *ctly, bool enable); 4014be3200SRob Clark 4114be3200SRob Clark #define MAX_PIPE_STAGE 2 4214be3200SRob Clark 4314be3200SRob Clark /* 4414be3200SRob Clark * mdp5_ctl_blend() - Blend multiple layers on a Layer Mixer (LM) 4514be3200SRob Clark * 4614be3200SRob Clark * @stage: array to contain the pipe num for each stage 4714be3200SRob Clark * @stage_cnt: valid stage number in stage array 4814be3200SRob Clark * @ctl_blend_op_flags: blender operation mode flags 4914be3200SRob Clark * 5014be3200SRob Clark * Note: 5114be3200SRob Clark * CTL registers need to be flushed after calling this function 5214be3200SRob Clark * (call mdp5_ctl_commit() with mdp_ctl_flush_mask_ctl() mask) 5314be3200SRob Clark */ 5414be3200SRob Clark #define MDP5_CTL_BLEND_OP_FLAG_BORDER_OUT BIT(0) 5514be3200SRob Clark int mdp5_ctl_blend(struct mdp5_ctl *ctl, struct mdp5_pipeline *pipeline, 5614be3200SRob Clark enum mdp5_pipe stage[][MAX_PIPE_STAGE], 5714be3200SRob Clark enum mdp5_pipe r_stage[][MAX_PIPE_STAGE], 5814be3200SRob Clark u32 stage_cnt, u32 ctl_blend_op_flags); 5914be3200SRob Clark 6014be3200SRob Clark /** 6114be3200SRob Clark * mdp_ctl_flush_mask...() - Register FLUSH masks 6214be3200SRob Clark * 6314be3200SRob Clark * These masks are used to specify which block(s) need to be flushed 6414be3200SRob Clark * through @flush_mask parameter in mdp5_ctl_commit(.., flush_mask). 6514be3200SRob Clark */ 6614be3200SRob Clark u32 mdp_ctl_flush_mask_lm(int lm); 6714be3200SRob Clark u32 mdp_ctl_flush_mask_pipe(enum mdp5_pipe pipe); 6814be3200SRob Clark u32 mdp_ctl_flush_mask_cursor(int cursor_id); 6914be3200SRob Clark u32 mdp_ctl_flush_mask_encoder(struct mdp5_interface *intf); 7014be3200SRob Clark 7114be3200SRob Clark /* @flush_mask: see CTL flush masks definitions below */ 7214be3200SRob Clark u32 mdp5_ctl_commit(struct mdp5_ctl *ctl, struct mdp5_pipeline *pipeline, 73f9cb8d8dSRob Clark u32 flush_mask, bool start); 7414be3200SRob Clark u32 mdp5_ctl_get_commit_status(struct mdp5_ctl *ctl); 7514be3200SRob Clark 7614be3200SRob Clark 7714be3200SRob Clark 7814be3200SRob Clark #endif /* __MDP5_CTL_H__ */ 79