]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
drm/amd/display: Apply clock for voltage request
authorMikita Lipski <mikita.lipski@amd.com>
Mon, 9 Apr 2018 17:40:00 +0000 (13:40 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 5 Jul 2018 21:38:29 +0000 (16:38 -0500)
Translate dm_pp tructure to pp type
Call PP lib to apply clock voltage request for display

Signed-off-by: Mikita Lipski <mikita.lipski@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>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_services.c

index bc15ee692d3773f60289564335d3ab29406ea6d6..2eef154accf9ea7b4eca31fe27c3684668eb235d 100644 (file)
@@ -416,8 +416,35 @@ bool dm_pp_apply_clock_for_voltage_request(
        const struct dc_context *ctx,
        struct dm_pp_clock_for_voltage_req *clock_for_voltage_req)
 {
-       /* TODO: to be implemented */
-       return false;
+       struct amdgpu_device *adev = ctx->driver_context;
+       struct pp_display_clock_request *pp_clock_request = {0};
+       int ret = 0;
+       switch (clock_for_voltage_req->clk_type) {
+       case DM_PP_CLOCK_TYPE_DISPLAY_CLK:
+               pp_clock_request->clock_type = amd_pp_disp_clock;
+               break;
+
+       case DM_PP_CLOCK_TYPE_DCEFCLK:
+               pp_clock_request->clock_type = amd_pp_dcef_clock;
+               break;
+
+       case DM_PP_CLOCK_TYPE_PIXELCLK:
+               pp_clock_request->clock_type = amd_pp_pixel_clock;
+               break;
+
+       default:
+               return false;
+       }
+
+       pp_clock_request->clock_freq_in_khz = clock_for_voltage_req->clocks_in_khz;
+
+       if (adev->powerplay.pp_funcs->display_clock_voltage_request)
+               ret = adev->powerplay.pp_funcs->display_clock_voltage_request(
+                       adev->powerplay.pp_handle,
+                       pp_clock_request);
+       if (ret)
+               return false;
+       return true;
 }
 
 bool dm_pp_get_static_clocks(