Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 1 | /* Copyright (c) 2015-2016, The Linux Foundation. All rights reserved. |
| 2 | * |
| 3 | * This program is free software; you can redistribute it and/or modify |
| 4 | * it under the terms of the GNU General Public License version 2 and |
| 5 | * only version 2 as published by the Free Software Foundation. |
| 6 | * |
| 7 | * This program is distributed in the hope that it will be useful, |
| 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 10 | * GNU General Public License for more details. |
| 11 | */ |
| 12 | |
| 13 | #ifndef _SDE_HW_WB_H |
| 14 | #define _SDE_HW_WB_H |
| 15 | |
| 16 | #include "sde_hw_catalog.h" |
| 17 | #include "sde_hw_mdss.h" |
Alan Kwong | 3232ca5 | 2016-07-29 02:27:47 -0400 | [diff] [blame] | 18 | #include "sde_hw_top.h" |
Clarence Ip | c475b08 | 2016-06-26 09:27:23 -0400 | [diff] [blame] | 19 | #include "sde_hw_util.h" |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 20 | |
| 21 | struct sde_hw_wb; |
| 22 | |
| 23 | struct sde_hw_wb_cfg { |
Lloyd Atkinson | fa2489c | 2016-05-25 15:16:03 -0400 | [diff] [blame] | 24 | struct sde_hw_fmt_layout dest; |
Alan Kwong | 3232ca5 | 2016-07-29 02:27:47 -0400 | [diff] [blame] | 25 | enum sde_intf_mode intf_mode; |
| 26 | struct traffic_shaper_cfg ts_cfg; |
abeykun | f1539f7 | 2016-08-24 16:08:03 -0400 | [diff] [blame^] | 27 | struct sde_rect roi; |
Alan Kwong | 3232ca5 | 2016-07-29 02:27:47 -0400 | [diff] [blame] | 28 | bool is_secure; |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 29 | }; |
| 30 | |
| 31 | /** |
| 32 | * |
| 33 | * struct sde_hw_wb_ops : Interface to the wb Hw driver functions |
| 34 | * Assumption is these functions will be called after clocks are enabled |
| 35 | */ |
| 36 | struct sde_hw_wb_ops { |
| 37 | void (*setup_csc_data)(struct sde_hw_wb *ctx, |
| 38 | struct sde_csc_cfg *data); |
| 39 | |
| 40 | void (*setup_outaddress)(struct sde_hw_wb *ctx, |
| 41 | struct sde_hw_wb_cfg *wb); |
| 42 | |
| 43 | void (*setup_outformat)(struct sde_hw_wb *ctx, |
| 44 | struct sde_hw_wb_cfg *wb); |
| 45 | |
| 46 | void (*setup_rotator)(struct sde_hw_wb *ctx, |
| 47 | struct sde_hw_wb_cfg *wb); |
| 48 | |
| 49 | void (*setup_dither)(struct sde_hw_wb *ctx, |
| 50 | struct sde_hw_wb_cfg *wb); |
| 51 | |
| 52 | void (*setup_cdwn)(struct sde_hw_wb *ctx, |
| 53 | struct sde_hw_wb_cfg *wb); |
| 54 | |
| 55 | void (*setup_trafficshaper)(struct sde_hw_wb *ctx, |
| 56 | struct sde_hw_wb_cfg *wb); |
abeykun | f1539f7 | 2016-08-24 16:08:03 -0400 | [diff] [blame^] | 57 | |
| 58 | void (*setup_roi)(struct sde_hw_wb *ctx, |
| 59 | struct sde_hw_wb_cfg *wb); |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 60 | }; |
| 61 | |
| 62 | /** |
| 63 | * struct sde_hw_wb : WB driver object |
| 64 | * @struct sde_hw_blk_reg_map *hw; |
| 65 | * @idx |
| 66 | * @wb_hw_caps |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 67 | * @ops |
Alan Kwong | 3232ca5 | 2016-07-29 02:27:47 -0400 | [diff] [blame] | 68 | * @highest_bank_bit: GPU highest memory bank bit used |
| 69 | * @hw_mdp: MDP top level hardware block |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 70 | */ |
| 71 | struct sde_hw_wb { |
| 72 | /* base */ |
| 73 | struct sde_hw_blk_reg_map hw; |
| 74 | |
| 75 | /* wb path */ |
| 76 | int idx; |
| 77 | const struct sde_wb_cfg *caps; |
| 78 | |
| 79 | /* ops */ |
| 80 | struct sde_hw_wb_ops ops; |
Alan Kwong | 3232ca5 | 2016-07-29 02:27:47 -0400 | [diff] [blame] | 81 | |
| 82 | u32 highest_bank_bit; |
| 83 | |
| 84 | struct sde_hw_mdp *hw_mdp; |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 85 | }; |
| 86 | |
| 87 | /** |
Alan Kwong | 3232ca5 | 2016-07-29 02:27:47 -0400 | [diff] [blame] | 88 | * sde_hw_wb_init(): Initializes and return writeback hw driver object. |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 89 | * @idx: wb_path index for which driver object is required |
| 90 | * @addr: mapped register io address of MDP |
| 91 | * @m : pointer to mdss catalog data |
Alan Kwong | 3232ca5 | 2016-07-29 02:27:47 -0400 | [diff] [blame] | 92 | * @hw_mdp: pointer to mdp top hw driver object |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 93 | */ |
| 94 | struct sde_hw_wb *sde_hw_wb_init(enum sde_wb idx, |
| 95 | void __iomem *addr, |
Alan Kwong | 3232ca5 | 2016-07-29 02:27:47 -0400 | [diff] [blame] | 96 | struct sde_mdss_cfg *m, |
| 97 | struct sde_hw_mdp *hw_mdp); |
| 98 | |
| 99 | /** |
| 100 | * sde_hw_wb_destroy(): Destroy writeback hw driver object. |
| 101 | * @hw_wb: Pointer to writeback hw driver object |
| 102 | */ |
| 103 | void sde_hw_wb_destroy(struct sde_hw_wb *hw_wb); |
Narendra Muppalla | 1b0b335 | 2015-09-29 10:16:51 -0700 | [diff] [blame] | 104 | |
| 105 | #endif /*_SDE_HW_WB_H */ |