All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Deucher <alexdeucher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Rex Zhu <Rex.Zhu-5C7GfCeVMHo@public.gmane.org>
Cc: amd-gfx list <amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>
Subject: Re: [PATCH 1/5] drm/amd/display: Implement dm_pp_get_clock_levels_by_type_with_latency
Date: Mon, 18 Jun 2018 15:46:58 -0400	[thread overview]
Message-ID: <CADnq5_NK6RY6ApnEDmhtnDDTWs9dNTdRHZg+MsCRSZvpMp8u4Q@mail.gmail.com> (raw)
In-Reply-To: <1529320685-20342-1-git-send-email-Rex.Zhu-5C7GfCeVMHo@public.gmane.org>

On Mon, Jun 18, 2018 at 7:18 AM, Rex Zhu <Rex.Zhu@amd.com> wrote:
> Display component can get tru max_displ_clk_in_khz instand of hardcode

tru -> true
With that fixed:
Acked-by: Alex Deucher <alexander.deucher@amd.com>

>
> Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
> ---
>  .../drm/amd/display/amdgpu_dm/amdgpu_dm_services.c | 45 +++++++++++++++++++++-
>  1 file changed, 43 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_services.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_services.c
> index 5a33461..37f6a5f 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_services.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_services.c
> @@ -261,6 +261,33 @@ static void pp_to_dc_clock_levels_with_latency(
>         }
>  }
>
> +static void pp_to_dc_clock_levels_with_voltage(
> +               const struct pp_clock_levels_with_voltage *pp_clks,
> +               struct dm_pp_clock_levels_with_voltage *clk_level_info,
> +               enum dm_pp_clock_type dc_clk_type)
> +{
> +       uint32_t i;
> +
> +       if (pp_clks->num_levels > DM_PP_MAX_CLOCK_LEVELS) {
> +               DRM_INFO("DM_PPLIB: Warning: %s clock: number of levels %d exceeds maximum of %d!\n",
> +                               DC_DECODE_PP_CLOCK_TYPE(dc_clk_type),
> +                               pp_clks->num_levels,
> +                               DM_PP_MAX_CLOCK_LEVELS);
> +
> +               clk_level_info->num_levels = DM_PP_MAX_CLOCK_LEVELS;
> +       } else
> +               clk_level_info->num_levels = pp_clks->num_levels;
> +
> +       DRM_DEBUG("DM_PPLIB: values for %s clock\n",
> +                       DC_DECODE_PP_CLOCK_TYPE(dc_clk_type));
> +
> +       for (i = 0; i < clk_level_info->num_levels; i++) {
> +               DRM_DEBUG("DM_PPLIB:\t %d\n", pp_clks->data[i].clocks_in_khz);
> +               clk_level_info->data[i].clocks_in_khz = pp_clks->data[i].clocks_in_khz;
> +               clk_level_info->data[i].voltage_in_mv = pp_clks->data[i].voltage_in_mv;
> +       }
> +}
> +
>  bool dm_pp_get_clock_levels_by_type(
>                 const struct dc_context *ctx,
>                 enum dm_pp_clock_type clk_type,
> @@ -361,8 +388,22 @@ bool dm_pp_get_clock_levels_by_type_with_voltage(
>         enum dm_pp_clock_type clk_type,
>         struct dm_pp_clock_levels_with_voltage *clk_level_info)
>  {
> -       /* TODO: to be implemented */
> -       return false;
> +       struct amdgpu_device *adev = ctx->driver_context;
> +       void *pp_handle = adev->powerplay.pp_handle;
> +       struct pp_clock_levels_with_voltage pp_clks = { 0 };
> +       const struct amd_pm_funcs *pp_funcs = adev->powerplay.pp_funcs;
> +
> +       if (!pp_funcs || !pp_funcs->get_clock_by_type_with_voltage)
> +               return false;
> +
> +       if (pp_funcs->get_clock_by_type_with_voltage(pp_handle,
> +                                                    dc_to_pp_clock_type(clk_type),
> +                                                    &pp_clks))
> +               return false;
> +
> +       pp_to_dc_clock_levels_with_voltage(&pp_clks, clk_level_info, clk_type);
> +
> +       return true;
>  }
>
>  bool dm_pp_notify_wm_clock_changes(
> --
> 1.9.1
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  parent reply	other threads:[~2018-06-18 19:46 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-18 11:18 [PATCH 1/5] drm/amd/display: Implement dm_pp_get_clock_levels_by_type_with_latency Rex Zhu
     [not found] ` <1529320685-20342-1-git-send-email-Rex.Zhu-5C7GfCeVMHo@public.gmane.org>
2018-06-18 11:18   ` [PATCH 2/5] drm/amd/pp: Fix wrong clock-unit exported to Display Rex Zhu
     [not found]     ` <1529320685-20342-2-git-send-email-Rex.Zhu-5C7GfCeVMHo@public.gmane.org>
2018-06-18 19:50       ` Alex Deucher
2018-06-18 11:18   ` [PATCH 3/5] drm/amd/pp: Memory Latency is always 25us on Vega10 Rex Zhu
     [not found]     ` <1529320685-20342-3-git-send-email-Rex.Zhu-5C7GfCeVMHo@public.gmane.org>
2018-06-18 19:49       ` Alex Deucher
2018-06-18 11:18   ` [PATCH 4/5] drm/amd/display: Delete old implementation of bw_calcs_data_update_from_pplib Rex Zhu
     [not found]     ` <1529320685-20342-4-git-send-email-Rex.Zhu-5C7GfCeVMHo@public.gmane.org>
2018-06-18 19:50       ` Alex Deucher
2018-06-18 11:18   ` [PATCH 5/5] drm/amd/display: Refine the interface dm_pp_notify_wm_clock_changes Rex Zhu
     [not found]     ` <1529320685-20342-5-git-send-email-Rex.Zhu-5C7GfCeVMHo@public.gmane.org>
2018-06-18 19:52       ` Alex Deucher
2018-06-18 19:46   ` Alex Deucher [this message]
2018-06-18 23:53   ` [PATCH 1/5] drm/amd/display: Implement dm_pp_get_clock_levels_by_type_with_latency Harry Wentland
2018-06-19 21:17 [PATCH 0/5] Rex's pplib/dc changes rebased on latest DC Harry Wentland
     [not found] ` <20180619211732.10012-1-harry.wentland-5C7GfCeVMHo@public.gmane.org>
2018-06-19 21:17   ` [PATCH 1/5] drm/amd/display: Implement dm_pp_get_clock_levels_by_type_with_latency Harry Wentland

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CADnq5_NK6RY6ApnEDmhtnDDTWs9dNTdRHZg+MsCRSZvpMp8u4Q@mail.gmail.com \
    --to=alexdeucher-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=Rex.Zhu-5C7GfCeVMHo@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.