xref: /linux/drivers/gpu/drm/amd/display/dc/dce112/dce112_compressor.h (revision 664b0bae0b87f69bc9deb098f5e0158b9cf18e04)
14562236bSHarry Wentland /* Copyright 2012-15 Advanced Micro Devices, Inc.
24562236bSHarry Wentland  *
34562236bSHarry Wentland  * Permission is hereby granted, free of charge, to any person obtaining a
44562236bSHarry Wentland  * copy of this software and associated documentation files (the "Software"),
54562236bSHarry Wentland  * to deal in the Software without restriction, including without limitation
64562236bSHarry Wentland  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
74562236bSHarry Wentland  * and/or sell copies of the Software, and to permit persons to whom the
84562236bSHarry Wentland  * Software is furnished to do so, subject to the following conditions:
94562236bSHarry Wentland  *
104562236bSHarry Wentland  * The above copyright notice and this permission notice shall be included in
114562236bSHarry Wentland  * all copies or substantial portions of the Software.
124562236bSHarry Wentland  *
134562236bSHarry Wentland  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
144562236bSHarry Wentland  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
154562236bSHarry Wentland  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
164562236bSHarry Wentland  * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
174562236bSHarry Wentland  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
184562236bSHarry Wentland  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
194562236bSHarry Wentland  * OTHER DEALINGS IN THE SOFTWARE.
204562236bSHarry Wentland  *
214562236bSHarry Wentland  * Authors: AMD
224562236bSHarry Wentland  *
234562236bSHarry Wentland  */
244562236bSHarry Wentland 
254562236bSHarry Wentland #ifndef __DC_COMPRESSOR_DCE112_H__
264562236bSHarry Wentland #define __DC_COMPRESSOR_DCE112_H__
274562236bSHarry Wentland 
284562236bSHarry Wentland #include "../inc/compressor.h"
294562236bSHarry Wentland 
304562236bSHarry Wentland #define TO_DCE112_COMPRESSOR(compressor)\
314562236bSHarry Wentland 	container_of(compressor, struct dce112_compressor, base)
324562236bSHarry Wentland 
334562236bSHarry Wentland struct dce112_compressor_reg_offsets {
344562236bSHarry Wentland 	uint32_t dcp_offset;
354562236bSHarry Wentland 	uint32_t dmif_offset;
364562236bSHarry Wentland };
374562236bSHarry Wentland 
384562236bSHarry Wentland struct dce112_compressor {
394562236bSHarry Wentland 	struct compressor base;
404562236bSHarry Wentland 	struct dce112_compressor_reg_offsets offsets;
414562236bSHarry Wentland };
424562236bSHarry Wentland 
434562236bSHarry Wentland struct compressor *dce112_compressor_create(struct dc_context *ctx);
444562236bSHarry Wentland 
45*c13b408bSDave Airlie void dce112_compressor_construct(struct dce112_compressor *cp110,
464562236bSHarry Wentland 	struct dc_context *ctx);
474562236bSHarry Wentland 
484562236bSHarry Wentland void dce112_compressor_destroy(struct compressor **cp);
494562236bSHarry Wentland 
504562236bSHarry Wentland /* FBC RELATED */
514562236bSHarry Wentland void dce112_compressor_power_up_fbc(struct compressor *cp);
524562236bSHarry Wentland 
534562236bSHarry Wentland void dce112_compressor_enable_fbc(struct compressor *cp, uint32_t paths_num,
544562236bSHarry Wentland 	struct compr_addr_and_pitch_params *params);
554562236bSHarry Wentland 
564562236bSHarry Wentland void dce112_compressor_disable_fbc(struct compressor *cp);
574562236bSHarry Wentland 
584562236bSHarry Wentland void dce112_compressor_set_fbc_invalidation_triggers(struct compressor *cp,
594562236bSHarry Wentland 	uint32_t fbc_trigger);
604562236bSHarry Wentland 
614562236bSHarry Wentland void dce112_compressor_program_compressed_surface_address_and_pitch(
624562236bSHarry Wentland 	struct compressor *cp,
634562236bSHarry Wentland 	struct compr_addr_and_pitch_params *params);
644562236bSHarry Wentland 
654562236bSHarry Wentland bool dce112_compressor_is_fbc_enabled_in_hw(struct compressor *cp,
664562236bSHarry Wentland 	uint32_t *fbc_mapped_crtc_id);
674562236bSHarry Wentland 
684562236bSHarry Wentland /* LPT RELATED */
694562236bSHarry Wentland void dce112_compressor_enable_lpt(struct compressor *cp);
704562236bSHarry Wentland 
714562236bSHarry Wentland void dce112_compressor_disable_lpt(struct compressor *cp);
724562236bSHarry Wentland 
734562236bSHarry Wentland void dce112_compressor_program_lpt_control(struct compressor *cp,
744562236bSHarry Wentland 	struct compr_addr_and_pitch_params *params);
754562236bSHarry Wentland 
764562236bSHarry Wentland bool dce112_compressor_is_lpt_enabled_in_hw(struct compressor *cp);
774562236bSHarry Wentland 
784562236bSHarry Wentland #endif
79