blob: 093d2fbad91bc4f0f90a5d3c3490f2225a56741f [file] [log] [blame]
Narendra Muppalla1b0b3352015-09-29 10:16:51 -07001/* 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"
Clarence Ipc475b082016-06-26 09:27:23 -040018#include "sde_hw_util.h"
Narendra Muppalla1b0b3352015-09-29 10:16:51 -070019
20struct sde_hw_wb;
21
22struct sde_hw_wb_cfg {
Lloyd Atkinsonfa2489c2016-05-25 15:16:03 -040023 struct sde_hw_fmt_layout dest;
Narendra Muppalla1b0b3352015-09-29 10:16:51 -070024};
25
26/**
27 *
28 * struct sde_hw_wb_ops : Interface to the wb Hw driver functions
29 * Assumption is these functions will be called after clocks are enabled
30 */
31struct sde_hw_wb_ops {
32 void (*setup_csc_data)(struct sde_hw_wb *ctx,
33 struct sde_csc_cfg *data);
34
35 void (*setup_outaddress)(struct sde_hw_wb *ctx,
36 struct sde_hw_wb_cfg *wb);
37
38 void (*setup_outformat)(struct sde_hw_wb *ctx,
39 struct sde_hw_wb_cfg *wb);
40
41 void (*setup_rotator)(struct sde_hw_wb *ctx,
42 struct sde_hw_wb_cfg *wb);
43
44 void (*setup_dither)(struct sde_hw_wb *ctx,
45 struct sde_hw_wb_cfg *wb);
46
47 void (*setup_cdwn)(struct sde_hw_wb *ctx,
48 struct sde_hw_wb_cfg *wb);
49
50 void (*setup_trafficshaper)(struct sde_hw_wb *ctx,
51 struct sde_hw_wb_cfg *wb);
52};
53
54/**
55 * struct sde_hw_wb : WB driver object
56 * @struct sde_hw_blk_reg_map *hw;
57 * @idx
58 * @wb_hw_caps
59 * @mixer_hw_caps
60 * @ops
61 */
62struct sde_hw_wb {
63 /* base */
64 struct sde_hw_blk_reg_map hw;
65
66 /* wb path */
67 int idx;
68 const struct sde_wb_cfg *caps;
69
70 /* ops */
71 struct sde_hw_wb_ops ops;
72};
73
74/**
75 * sde_hw_wb_init(): Initializes the wb_path hw driver object.
76 * should be called before accessing every mixer.
77 * @idx: wb_path index for which driver object is required
78 * @addr: mapped register io address of MDP
79 * @m : pointer to mdss catalog data
80 */
81struct sde_hw_wb *sde_hw_wb_init(enum sde_wb idx,
82 void __iomem *addr,
83 struct sde_mdss_cfg *m);
84
85#endif /*_SDE_HW_WB_H */