summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/display/modules/inc
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/amd/display/modules/inc')
-rw-r--r--drivers/gpu/drm/amd/display/modules/inc/mod_color.h179
-rw-r--r--drivers/gpu/drm/amd/display/modules/inc/mod_freesync.h149
-rw-r--r--drivers/gpu/drm/amd/display/modules/inc/mod_power.h112
3 files changed, 440 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/display/modules/inc/mod_color.h b/drivers/gpu/drm/amd/display/modules/inc/mod_color.h
new file mode 100644
index 000000000000..e54fe2cb8611
--- /dev/null
+++ b/drivers/gpu/drm/amd/display/modules/inc/mod_color.h
@@ -0,0 +1,179 @@
+/*
+ * Copyright 2016 Advanced Micro Devices, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Authors: AMD
+ *
+ */
+
+
+#ifndef MOD_COLOR_H_
+#define MOD_COLOR_H_
+
+#include "dm_services.h"
+
+struct mod_color {
+ int dummy;
+};
+
+struct color_space_coordinates {
+ unsigned int redX;
+ unsigned int redY;
+ unsigned int greenX;
+ unsigned int greenY;
+ unsigned int blueX;
+ unsigned int blueY;
+ unsigned int whiteX;
+ unsigned int whiteY;
+};
+
+struct gamut_space_coordinates {
+ unsigned int redX;
+ unsigned int redY;
+ unsigned int greenX;
+ unsigned int greenY;
+ unsigned int blueX;
+ unsigned int blueY;
+};
+
+struct gamut_space_entry {
+ unsigned int index;
+ unsigned int redX;
+ unsigned int redY;
+ unsigned int greenX;
+ unsigned int greenY;
+ unsigned int blueX;
+ unsigned int blueY;
+
+ int a0;
+ int a1;
+ int a2;
+ int a3;
+ int gamma;
+};
+
+struct white_point_coodinates {
+ unsigned int whiteX;
+ unsigned int whiteY;
+};
+
+struct white_point_coodinates_entry {
+ unsigned int index;
+ unsigned int whiteX;
+ unsigned int whiteY;
+};
+
+struct color_range {
+ int current;
+ int min;
+ int max;
+};
+
+struct mod_color *mod_color_create(struct dc *dc);
+
+void mod_color_destroy(struct mod_color *mod_color);
+
+bool mod_color_add_sink(struct mod_color *mod_color,
+ const struct dc_sink *sink);
+
+bool mod_color_remove_sink(struct mod_color *mod_color,
+ const struct dc_sink *sink);
+
+bool mod_color_update_gamut_to_stream(struct mod_color *mod_color,
+ const struct dc_stream **streams, int num_streams);
+
+bool mod_color_set_white_point(struct mod_color *mod_color,
+ const struct dc_stream **streams, int num_streams,
+ struct white_point_coodinates *white_point);
+
+bool mod_color_adjust_source_gamut(struct mod_color *mod_color,
+ const struct dc_stream **streams, int num_streams,
+ struct gamut_space_coordinates *input_gamut_coordinates,
+ struct white_point_coodinates *input_white_point_coordinates);
+
+bool mod_color_adjust_destination_gamut(struct mod_color *mod_color,
+ const struct dc_stream **streams, int num_streams,
+ struct gamut_space_coordinates *input_gamut_coordinates,
+ struct white_point_coodinates *input_white_point_coordinates);
+
+bool mod_color_get_user_enable(struct mod_color *mod_color,
+ const struct dc_sink *sink,
+ bool *user_enable);
+
+bool mod_color_set_user_enable(struct mod_color *mod_color,
+ const struct dc_stream **streams, int num_streams,
+ bool user_enable);
+
+bool mod_color_get_custom_color_temperature(struct mod_color *mod_color,
+ const struct dc_sink *sink,
+ int *color_temperature);
+
+bool mod_color_set_custom_color_temperature(struct mod_color *mod_color,
+ const struct dc_stream **streams, int num_streams,
+ int color_temperature);
+
+bool mod_color_get_color_saturation(struct mod_color *mod_color,
+ const struct dc_sink *sink,
+ struct color_range *color_saturation);
+
+bool mod_color_get_color_contrast(struct mod_color *mod_color,
+ const struct dc_sink *sink,
+ struct color_range *color_contrast);
+
+bool mod_color_get_color_brightness(struct mod_color *mod_color,
+ const struct dc_sink *sink,
+ struct color_range *color_brightness);
+
+bool mod_color_get_color_hue(struct mod_color *mod_color,
+ const struct dc_sink *sink,
+ struct color_range *color_hue);
+
+bool mod_color_get_source_gamut(struct mod_color *mod_color,
+ const struct dc_sink *sink,
+ struct color_space_coordinates *source_gamut);
+
+bool mod_color_notify_mode_change(struct mod_color *mod_color,
+ const struct dc_stream **streams, int num_streams);
+
+bool mod_color_set_brightness(struct mod_color *mod_color,
+ const struct dc_stream **streams, int num_streams,
+ int brightness_value);
+
+bool mod_color_set_contrast(struct mod_color *mod_color,
+ const struct dc_stream **streams, int num_streams,
+ int contrast_value);
+
+bool mod_color_set_hue(struct mod_color *mod_color,
+ const struct dc_stream **streams, int num_streams,
+ int hue_value);
+
+bool mod_color_set_saturation(struct mod_color *mod_color,
+ const struct dc_stream **streams, int num_streams,
+ int saturation_value);
+
+bool mod_color_set_preferred_quantization_range(struct mod_color *mod_color,
+ const struct dc_sink *sink,
+ enum dc_quantization_range quantization_range);
+
+bool mod_color_get_preferred_quantization_range(struct mod_color *mod_color,
+ const struct dc_sink *sink,
+ enum dc_quantization_range *quantization_range);
+
+#endif /* MOD_COLOR_H_ */
diff --git a/drivers/gpu/drm/amd/display/modules/inc/mod_freesync.h b/drivers/gpu/drm/amd/display/modules/inc/mod_freesync.h
new file mode 100644
index 000000000000..7abfe34dc2d9
--- /dev/null
+++ b/drivers/gpu/drm/amd/display/modules/inc/mod_freesync.h
@@ -0,0 +1,149 @@
+/*
+ * Copyright 2016 Advanced Micro Devices, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Authors: AMD
+ *
+ */
+
+
+
+
+/*
+ * Copyright 2016 Advanced Micro Devices, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Authors: AMD
+ *
+ */
+
+#ifndef MOD_FREESYNC_H_
+#define MOD_FREESYNC_H_
+
+#include "dm_services.h"
+
+struct mod_freesync *mod_freesync_create(struct dc *dc);
+void mod_freesync_destroy(struct mod_freesync *mod_freesync);
+
+struct mod_freesync {
+ int dummy;
+};
+
+enum mod_freesync_state {
+ FREESYNC_STATE_NONE,
+ FREESYNC_STATE_FULLSCREEN,
+ FREESYNC_STATE_STATIC_SCREEN,
+ FREESYNC_STATE_VIDEO
+};
+
+enum mod_freesync_user_enable_mask {
+ FREESYNC_USER_ENABLE_STATIC = 0x1,
+ FREESYNC_USER_ENABLE_VIDEO = 0x2,
+ FREESYNC_USER_ENABLE_GAMING = 0x4
+};
+
+struct mod_freesync_user_enable {
+ bool enable_for_static;
+ bool enable_for_video;
+ bool enable_for_gaming;
+};
+
+struct mod_freesync_caps {
+ bool supported;
+ unsigned int min_refresh_in_micro_hz;
+ unsigned int max_refresh_in_micro_hz;
+
+ bool btr_supported;
+};
+
+struct mod_freesync_params {
+ enum mod_freesync_state state;
+ bool enable;
+ unsigned int update_duration_in_ns;
+ bool windowed_fullscreen;
+};
+
+/*
+ * Add stream to be tracked by module
+ */
+bool mod_freesync_add_stream(struct mod_freesync *mod_freesync,
+ const struct dc_stream *stream, struct mod_freesync_caps *caps);
+
+/*
+ * Remove stream to be tracked by module
+ */
+bool mod_freesync_remove_stream(struct mod_freesync *mod_freesync,
+ const struct dc_stream *stream);
+
+/*
+ * Build additional parameters for dc_stream when creating stream for
+ * sink to support freesync
+ */
+void mod_freesync_update_stream(struct mod_freesync *mod_freesync,
+ struct dc_stream *stream);
+
+/*
+ * Update the freesync state flags for each display and program
+ * freesync accordingly
+ */
+void mod_freesync_update_state(struct mod_freesync *mod_freesync,
+ const struct dc_stream **streams, int num_streams,
+ struct mod_freesync_params *freesync_params);
+
+bool mod_freesync_get_state(struct mod_freesync *mod_freesync,
+ const struct dc_stream *stream,
+ struct mod_freesync_params *freesync_params);
+
+bool mod_freesync_set_user_enable(struct mod_freesync *mod_freesync,
+ const struct dc_stream **streams, int num_streams,
+ struct mod_freesync_user_enable *user_enable);
+
+bool mod_freesync_get_user_enable(struct mod_freesync *mod_freesync,
+ const struct dc_stream *stream,
+ struct mod_freesync_user_enable *user_enable);
+
+void mod_freesync_handle_v_update(struct mod_freesync *mod_freesync,
+ const struct dc_stream **streams, int num_streams);
+
+void mod_freesync_notify_mode_change(struct mod_freesync *mod_freesync,
+ const struct dc_stream **streams, int num_streams);
+
+void mod_freesync_pre_update_plane_addresses(struct mod_freesync *mod_freesync,
+ const struct dc_stream **streams, int num_streams,
+ unsigned int curr_time_stamp);
+
+#endif
diff --git a/drivers/gpu/drm/amd/display/modules/inc/mod_power.h b/drivers/gpu/drm/amd/display/modules/inc/mod_power.h
new file mode 100644
index 000000000000..a204e8d6cd23
--- /dev/null
+++ b/drivers/gpu/drm/amd/display/modules/inc/mod_power.h
@@ -0,0 +1,112 @@
+/*
+ * Copyright 2016 Advanced Micro Devices, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Authors: AMD
+ *
+ */
+
+#ifndef MODULES_INC_MOD_POWER_H_
+#define MODULES_INC_MOD_POWER_H_
+
+#include "dm_services.h"
+
+struct mod_power {
+ int dummy;
+};
+
+/* VariBright related commands */
+enum varibright_command {
+ VariBright_Cmd__SetVBLevel = 0,
+ VariBright_Cmd__UserEnable,
+ VariBright_Cmd__PreDisplayConfigChange,
+ VariBright_Cmd__PostDisplayConfigChange,
+ VariBright_Cmd__SuspendABM,
+ VariBright_Cmd__ResumeABM,
+
+ VariBright_Cmd__Unknown,
+};
+
+/* VariBright settings structure */
+struct varibright_info {
+ enum varibright_command cmd;
+
+ unsigned int level;
+ bool enable;
+ bool activate;
+};
+
+enum dmcu_block_psr_reason {
+ /* This is a bitfield mask */
+ dmcu_block_psr_reason_invalid = 0x0,
+ dmcu_block_psr_reason_vsync_int = 0x1,
+ dmcu_block_psr_reason_shared_primary = 0x2,
+ dmcu_block_psr_reason_unsupported_link_rate = 0x4
+};
+
+struct mod_power *mod_power_create(struct dc *dc);
+
+void mod_power_destroy(struct mod_power *mod_power);
+
+bool mod_power_add_sink(struct mod_power *mod_power,
+ const struct dc_sink *sink);
+
+bool mod_power_remove_sink(struct mod_power *mod_power,
+ const struct dc_sink *sink);
+
+bool mod_power_set_backlight(struct mod_power *mod_power,
+ const struct dc_stream **streams, int num_streams,
+ unsigned int backlight_8bit);
+
+bool mod_power_get_backlight(struct mod_power *mod_power,
+ const struct dc_sink *sink,
+ unsigned int *backlight_8bit);
+
+void mod_power_initialize_backlight_caps
+ (struct mod_power *mod_power);
+
+unsigned int mod_power_backlight_level_percentage_to_signal
+ (struct mod_power *mod_power, unsigned int percentage);
+
+unsigned int mod_power_backlight_level_signal_to_percentage
+ (struct mod_power *mod_power, unsigned int signalLevel8bit);
+
+bool mod_power_get_panel_backlight_boundaries
+ (struct mod_power *mod_power,
+ unsigned int *min_backlight,
+ unsigned int *max_backlight,
+ unsigned int *output_ac_level_percentage,
+ unsigned int *output_dc_level_percentage);
+
+bool mod_power_set_smooth_brightness(struct mod_power *mod_power,
+ const struct dc_sink *sink, bool enable_brightness);
+
+bool mod_power_notify_mode_change(struct mod_power *mod_power,
+ const struct dc_stream *stream);
+
+bool mod_power_varibright_control(struct mod_power *mod_power,
+ struct varibright_info *input_varibright_info);
+
+bool mod_power_block_psr(bool block_enable, enum dmcu_block_psr_reason reason);
+
+bool mod_power_set_psr_enable(struct mod_power *mod_power,
+ bool psr_enable);
+
+#endif /* MODULES_INC_MOD_POWER_H_ */