treewide: remove redundant IS_ERR() before error code check
[linux/fpc-iii.git] / drivers / gpu / drm / amd / display / dc / dce112 / dce112_compressor.h
blobf1227133f6df6e1e839e519919f4300f1b5df17a
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.
21 * Authors: AMD
25 #ifndef __DC_COMPRESSOR_DCE112_H__
26 #define __DC_COMPRESSOR_DCE112_H__
28 #include "../inc/compressor.h"
30 #define TO_DCE112_COMPRESSOR(compressor)\
31 container_of(compressor, struct dce112_compressor, base)
33 struct dce112_compressor_reg_offsets {
34 uint32_t dcp_offset;
35 uint32_t dmif_offset;
38 struct dce112_compressor {
39 struct compressor base;
40 struct dce112_compressor_reg_offsets offsets;
43 struct compressor *dce112_compressor_create(struct dc_context *ctx);
45 void dce112_compressor_construct(struct dce112_compressor *cp110,
46 struct dc_context *ctx);
48 void dce112_compressor_destroy(struct compressor **cp);
50 /* FBC RELATED */
51 void dce112_compressor_power_up_fbc(struct compressor *cp);
53 void dce112_compressor_enable_fbc(struct compressor *cp, uint32_t paths_num,
54 struct compr_addr_and_pitch_params *params);
56 void dce112_compressor_disable_fbc(struct compressor *cp);
58 void dce112_compressor_set_fbc_invalidation_triggers(struct compressor *cp,
59 uint32_t fbc_trigger);
61 void dce112_compressor_program_compressed_surface_address_and_pitch(
62 struct compressor *cp,
63 struct compr_addr_and_pitch_params *params);
65 bool dce112_compressor_is_fbc_enabled_in_hw(struct compressor *cp,
66 uint32_t *fbc_mapped_crtc_id);
68 /* LPT RELATED */
69 void dce112_compressor_enable_lpt(struct compressor *cp);
71 void dce112_compressor_disable_lpt(struct compressor *cp);
73 void dce112_compressor_program_lpt_control(struct compressor *cp,
74 struct compr_addr_and_pitch_params *params);
76 bool dce112_compressor_is_lpt_enabled_in_hw(struct compressor *cp);
78 #endif