1 /* Copyright 2012-15 Advanced Micro Devices, Inc.
3 * Permission is hereby granted, free of charge, to any person obtaining a
4 * copy of this software and associated documentation files (the "Software"),
5 * to deal in the Software without restriction, including without limitation
6 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 * and/or sell copies of the Software, and to permit persons to whom the
8 * Software is furnished to do so, subject to the following conditions:
10 * The above copyright notice and this permission notice shall be included in
11 * all copies or substantial portions of the Software.
13 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
16 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
17 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
18 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
19 * OTHER DEALINGS IN THE SOFTWARE.
25 #ifndef __DC_COMPRESSOR_DCE110_H__
26 #define __DC_COMPRESSOR_DCE110_H__
28 #include "../inc/compressor.h"
30 #define TO_DCE110_COMPRESSOR(compressor)\
31 container_of(compressor, struct dce110_compressor, base)
33 struct dce110_compressor_reg_offsets
{
38 struct dce110_compressor
{
39 struct compressor base
;
40 struct dce110_compressor_reg_offsets offsets
;
43 struct compressor
*dce110_compressor_create(struct dc_context
*ctx
);
45 void dce110_compressor_construct(struct dce110_compressor
*cp110
,
46 struct dc_context
*ctx
);
48 void dce110_compressor_destroy(struct compressor
**cp
);
51 void dce110_compressor_power_up_fbc(struct compressor
*cp
);
53 void dce110_compressor_enable_fbc(struct compressor
*cp
,
54 struct compr_addr_and_pitch_params
*params
);
56 void dce110_compressor_disable_fbc(struct compressor
*cp
);
58 void dce110_compressor_set_fbc_invalidation_triggers(struct compressor
*cp
,
59 uint32_t fbc_trigger
);
61 void dce110_compressor_program_compressed_surface_address_and_pitch(
62 struct compressor
*cp
,
63 struct compr_addr_and_pitch_params
*params
);
65 bool dce110_compressor_is_fbc_enabled_in_hw(struct compressor
*cp
,
66 uint32_t *fbc_mapped_crtc_id
);
69 void dce110_compressor_enable_lpt(struct compressor
*cp
);
71 void dce110_compressor_disable_lpt(struct compressor
*cp
);
73 void dce110_compressor_program_lpt_control(struct compressor
*cp
,
74 struct compr_addr_and_pitch_params
*params
);
76 bool dce110_compressor_is_lpt_enabled_in_hw(struct compressor
*cp
);
78 void get_max_support_fbc_buffersize(unsigned int *max_x
, unsigned int *max_y
);