From: Alvin Lee <[email protected]>

[Description]
Add new interface for notifying OS of cursor support changes

Reviewed-by: Aric Cyr <[email protected]>
Acked-by: Aurabindo Pillai <[email protected]>
Signed-off-by: Alvin Lee <[email protected]>
---
 drivers/gpu/drm/amd/display/dc/core/dc.c | 14 ++++++++++++++
 drivers/gpu/drm/amd/display/dc/dc.h      | 10 ++++++++++
 2 files changed, 24 insertions(+)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c 
b/drivers/gpu/drm/amd/display/dc/core/dc.c
index 7cac14f493f6..dfd31b169412 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
@@ -5337,3 +5337,17 @@ bool dc_abm_save_restore(
        return false;
 }
 
+void dc_query_current_properties(struct dc *dc, struct dc_current_properties 
*properties)
+{
+       unsigned int i;
+       bool subvp_in_use = false;
+
+       for (i = 0; i < dc->current_state->stream_count; i++) {
+               if (dc->current_state->streams[i]->mall_stream_config.type != 
SUBVP_NONE) {
+                       subvp_in_use = true;
+                       break;
+               }
+       }
+       properties->cursor_size_limit = subvp_in_use ? 64 : 
dc->caps.max_cursor_size;
+}
+
diff --git a/drivers/gpu/drm/amd/display/dc/dc.h 
b/drivers/gpu/drm/amd/display/dc/dc.h
index eadb53853131..0b704f1a32a6 100644
--- a/drivers/gpu/drm/amd/display/dc/dc.h
+++ b/drivers/gpu/drm/amd/display/dc/dc.h
@@ -908,6 +908,14 @@ struct dc_debug_options {
 };
 
 struct gpu_info_soc_bounding_box_v1_0;
+
+/* Generic structure that can be used to query properties of DC. More fields
+ * can be added as required.
+ */
+struct dc_current_properties {
+       unsigned int cursor_size_limit;
+};
+
 struct dc {
        struct dc_debug_options debug;
        struct dc_versions versions;
@@ -2276,6 +2284,8 @@ void dc_process_dmub_dpia_hpd_int_enable(const struct dc 
*dc,
 
 void dc_print_dmub_diagnostic_data(const struct dc *dc);
 
+void dc_query_current_properties(struct dc *dc, struct dc_current_properties 
*properties);
+
 /* DSC Interfaces */
 #include "dc_dsc.h"
 
-- 
2.41.0

Reply via email to