]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
drm/amd/display: restyle display clock calls part 2
authorDmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
Wed, 30 Nov 2016 16:03:37 +0000 (11:03 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 26 Sep 2017 21:02:48 +0000 (17:02 -0400)
Signed-off-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
13 files changed:
drivers/gpu/drm/amd/display/dc/core/dc_link.c
drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.c
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c
drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c
drivers/gpu/drm/amd/display/dc/dce112/dce112_resource.c
drivers/gpu/drm/amd/display/dc/dce80/dce80_resource.c
drivers/gpu/drm/amd/display/dc/gpu/Makefile
drivers/gpu/drm/amd/display/dc/gpu/dce110/display_clock_dce110.h
drivers/gpu/drm/amd/display/dc/gpu/dce112/display_clock_dce112.h
drivers/gpu/drm/amd/display/dc/gpu/dce80/display_clock_dce80.h
drivers/gpu/drm/amd/display/dc/gpu/display_clock.c [deleted file]
drivers/gpu/drm/amd/display/dc/gpu/display_clock.h [deleted file]
drivers/gpu/drm/amd/display/include/display_clock_interface.h

index 70a25546de1efa6932137f29df187ff21dd2cd19..ab4efde2d030214368b54eb8636401288b76779a 100644 (file)
@@ -1223,12 +1223,13 @@ static enum dc_status enable_link_dp(struct pipe_ctx *pipe_ctx)
        if (link_settings.link_rate == max_link_rate) {
                cur_min_clock_state = CLOCKS_STATE_INVALID;
 
-               if (dal_display_clock_get_min_clocks_state(
-                               pipe_ctx->dis_clk, &cur_min_clock_state)) {
+               if (pipe_ctx->dis_clk->funcs->get_min_clocks_state) {
+                       cur_min_clock_state =
+                               pipe_ctx->dis_clk->funcs->get_min_clocks_state(
+                                                       pipe_ctx->dis_clk);
                        if (cur_min_clock_state < CLOCKS_STATE_NOMINAL)
-                               dal_display_clock_set_min_clocks_state(
-                                               pipe_ctx->dis_clk,
-                                               CLOCKS_STATE_NOMINAL);
+                               pipe_ctx->dis_clk->funcs->set_min_clocks_state(
+                                       pipe_ctx->dis_clk, CLOCKS_STATE_NOMINAL);
                } else {
                }
        }
index 8f18a9403525025fd016e4add0a82b9aa9656fe8..fa88eb163ab8f2b0ab933cfb5d0ae9da87e889be 100644 (file)
@@ -717,7 +717,9 @@ static void destruct(struct dce110_resource_pool *pool)
        }
 
        if (pool->base.display_clock != NULL)
-               dal_display_clock_destroy(&pool->base.display_clock);
+               pool->base.display_clock->funcs->destroy(
+                               &pool->base.display_clock);
+               pool->base.display_clock = NULL;
 
        if (pool->base.irqs != NULL)
                dal_irq_service_destroy(&pool->base.irqs);
index 16ee49dba97b9a33c6936a0cf63fae9a9986eb45..ca71509af74db0f00346210801a54533b3973a56 100644 (file)
@@ -1099,9 +1099,11 @@ static void apply_min_clocks(
 
        if (!pre_mode_set) {
                /* set clock_state without verification */
-               if (dal_display_clock_set_min_clocks_state(
-                               pipe_ctx->dis_clk, *clocks_state))
+               if (pipe_ctx->dis_clk->funcs->set_min_clocks_state) {
+                       pipe_ctx->dis_clk->funcs->set_min_clocks_state(
+                                               pipe_ctx->dis_clk, *clocks_state);
                        return;
+               }
 
                /* TODOFPGA */
        }
@@ -1114,9 +1116,10 @@ static void apply_min_clocks(
        req_clocks.pixel_clk_khz = get_max_pixel_clock_for_all_paths(
                        dc, context, true);
 
-       if (dal_display_clock_get_required_clocks_state(
-                               pipe_ctx->dis_clk, &req_clocks, clocks_state)) {
-               dal_display_clock_set_min_clocks_state(
+       if (pipe_ctx->dis_clk->funcs->get_required_clocks_state) {
+               *clocks_state = pipe_ctx->dis_clk->funcs->get_required_clocks_state(
+                               pipe_ctx->dis_clk, &req_clocks);
+               pipe_ctx->dis_clk->funcs->set_min_clocks_state(
                        pipe_ctx->dis_clk, *clocks_state);
        } else {
        }
index a63112b2bd36d57bc1559a53316c4bca3c4fe038..6c713396e6bace4ebed127879754f0b6a5dacc3d 100644 (file)
@@ -700,7 +700,9 @@ static void destruct(struct dce110_resource_pool *pool)
        }
 
        if (pool->base.display_clock != NULL) {
-               dal_display_clock_destroy(&pool->base.display_clock);
+               pool->base.display_clock->funcs->destroy(
+                               &pool->base.display_clock);
+               pool->base.display_clock = NULL;
        }
 
        if (pool->base.irqs != NULL) {
index 70616019ae47db5d29e567cf851f2be916ff2706..8792c4ed6e65a3e901fccfff99a271a430ecfdad 100644 (file)
@@ -734,7 +734,9 @@ static void destruct(struct dce110_resource_pool *pool)
        }
 
        if (pool->base.display_clock != NULL) {
-               dal_display_clock_destroy(&pool->base.display_clock);
+               pool->base.display_clock->funcs->destroy(
+                               &pool->base.display_clock);
+               pool->base.display_clock = NULL;
        }
 
        if (pool->base.irqs != NULL) {
index dfff2bfff13d287af80070ea884664ca77191ad7..1e829f805d42b41a7d4466174084fb71decf8fd1 100644 (file)
@@ -657,7 +657,9 @@ static void destruct(struct dce110_resource_pool *pool)
        }
 
        if (pool->base.display_clock != NULL) {
-               dal_display_clock_destroy(&pool->base.display_clock);
+               pool->base.display_clock->funcs->destroy(
+                               &pool->base.display_clock);
+               pool->base.display_clock = NULL;
        }
 
        if (pool->base.irqs != NULL) {
index fd17af1ce88e7c802e67b78abd848442b42f1c84..0b99a747495010e11b70767b4566d50f8db42f2c 100644 (file)
@@ -3,7 +3,7 @@
 # It provides the control and status of HW adapter resources,
 # that are global for the ASIC and sharable between pipes.
 
-GPU = display_clock.o divider_range.o
+GPU = divider_range.o
 
 AMD_DAL_GPU = $(addprefix $(AMDDALPATH)/dc/gpu/,$(GPU))
 
index 88b4bdd75e56246dffd8ffbd624859b6702e274d..703cd656b5b08626711a37a3c7d28e4efdde007a 100644 (file)
@@ -25,7 +25,7 @@
 #ifndef __DAL_DISPLAY_CLOCK_DCE110_H__
 #define __DAL_DISPLAY_CLOCK_DCE110_H__
 
-#include "gpu/display_clock.h"
+#include "display_clock_interface.h"
 
 struct display_clock_dce110 {
        struct display_clock disp_clk_base;
index 47a149709d91f578c3d4d793eda3600db7956dee..34afff9a00bc7525ff21775f04ac63c5d86ce95a 100644 (file)
@@ -25,7 +25,7 @@
 #ifndef __DAL_DISPLAY_CLOCK_DCE112_H__
 #define __DAL_DISPLAY_CLOCK_DCE112_H__
 
-#include "gpu/display_clock.h"
+#include "display_clock_interface.h"
 
 struct display_clock_dce112 {
        struct display_clock disp_clk_base;
index c675f1e30870e928c594b872f35cd0cf4a2fc7df..273a5d9028400e6f81b7e527bded5ec190dfdb76 100644 (file)
@@ -25,7 +25,7 @@
 #ifndef __DAL_DISPLAY_CLOCK_DCE80_H__
 #define __DAL_DISPLAY_CLOCK_DCE80_H__
 
-#include "gpu/display_clock.h"
+#include "display_clock_interface.h"
 
 struct display_clock_dce80 {
        struct display_clock disp_clk;
diff --git a/drivers/gpu/drm/amd/display/dc/gpu/display_clock.c b/drivers/gpu/drm/amd/display/dc/gpu/display_clock.c
deleted file mode 100644 (file)
index c70c6b2..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright 2012-15 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
- *
- */
-
-#include "dm_services.h"
-#include "display_clock.h"
-
-void dal_display_clock_destroy(struct display_clock **disp_clk)
-{
-       if (!disp_clk || !*disp_clk) {
-               BREAK_TO_DEBUGGER();
-               return;
-       }
-
-       (*disp_clk)->funcs->destroy(disp_clk);
-
-       *disp_clk = NULL;
-}
-
-bool dal_display_clock_get_min_clocks_state(
-       struct display_clock *disp_clk,
-       enum clocks_state *clocks_state)
-{
-       if (!disp_clk->funcs->get_min_clocks_state)
-               return false;
-
-       *clocks_state = disp_clk->funcs->get_min_clocks_state(disp_clk);
-       return true;
-}
-
-bool dal_display_clock_get_required_clocks_state(
-       struct display_clock *disp_clk,
-       struct state_dependent_clocks *req_clocks,
-       enum clocks_state *clocks_state)
-{
-       if (!disp_clk->funcs->get_required_clocks_state)
-               return false;
-
-       *clocks_state = disp_clk->funcs->get_required_clocks_state(
-                       disp_clk, req_clocks);
-       return true;
-}
-
-bool dal_display_clock_set_min_clocks_state(
-       struct display_clock *disp_clk,
-       enum clocks_state clocks_state)
-{
-       if (!disp_clk->funcs->set_min_clocks_state)
-               return false;
-
-       disp_clk->funcs->set_min_clocks_state(disp_clk, clocks_state);
-       return true;
-}
-
diff --git a/drivers/gpu/drm/amd/display/dc/gpu/display_clock.h b/drivers/gpu/drm/amd/display/dc/gpu/display_clock.h
deleted file mode 100644 (file)
index 68d2ab0..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright 2012-15 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 __DAL_DISPLAY_CLOCK_H__
-#define __DAL_DISPLAY_CLOCK_H__
-
-#include "include/display_clock_interface.h"
-
-#endif /* __DAL_DISPLAY_CLOCK_H__*/
index f49253714b1e115258e5ed6d3261d4c4e409d583..a46ceebe2452586cd6e6c0426888bc8de223069b 100644 (file)
@@ -93,15 +93,4 @@ struct display_clock *dal_display_clock_dce80_create(
 
 void dal_display_clock_destroy(struct display_clock **to_destroy);
 
-bool dal_display_clock_get_min_clocks_state(
-       struct display_clock *disp_clk,
-       enum clocks_state *clocks_state);
-bool dal_display_clock_get_required_clocks_state(
-       struct display_clock *disp_clk,
-       struct state_dependent_clocks *req_clocks,
-       enum clocks_state *clocks_state);
-bool dal_display_clock_set_min_clocks_state(
-       struct display_clock *disp_clk,
-       enum clocks_state clocks_state);
-
 #endif /* __DISPLAY_CLOCK_INTERFACE_H__ */