All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
To: Abhinav Kumar <quic_abhinavk@quicinc.com>,
	freedreno@lists.freedesktop.org
Cc: markyacoub@chromium.org, liviu.dudau@arm.com,
	dri-devel@lists.freedesktop.org, swboyd@chromium.org,
	seanpaul@chromium.org, laurent.pinchart@ideasonboard.com,
	quic_jesszhan@quicinc.com, quic_aravindh@quicinc.com
Subject: Re: [PATCH v2 12/17] drm/msm/dpu: move _dpu_plane_get_qos_lut to dpu_hw_util file
Date: Wed, 20 Apr 2022 10:26:26 +0300	[thread overview]
Message-ID: <367c1856-305f-f6b9-cb71-6dcecad38b77@linaro.org> (raw)
In-Reply-To: <1650419169-13760-13-git-send-email-quic_abhinavk@quicinc.com>

On 20/04/2022 04:46, Abhinav Kumar wrote:
> _dpu_plane_get_qos_lut() is not specific to just dpu_plane.
> It can take any fill level and return the LUT matching it.
> This can be used even for other modules like dpu_writeback.
> 
> Move _dpu_plane_get_qos_lut() to the common dpu_hw_util file
> and rename it to _dpu_hw_get_qos_lut().
> 
> Signed-off-by: Abhinav Kumar <quic_abhinavk@quicinc.com>

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

> ---
>   drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.c | 25 +++++++++++++++++++++++++
>   drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.h |  4 ++++
>   drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c   | 27 +--------------------------
>   3 files changed, 30 insertions(+), 26 deletions(-)
> 
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.c
> index aad8511..512316f 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.c
> @@ -422,3 +422,28 @@ void dpu_hw_csc_setup(struct dpu_hw_blk_reg_map *c,
>   	DPU_REG_WRITE(c, csc_reg_off + 0x3c, data->csc_post_bv[1]);
>   	DPU_REG_WRITE(c, csc_reg_off + 0x40, data->csc_post_bv[2]);
>   }
> +
> +/**
> + * _dpu_hw_get_qos_lut - get LUT mapping based on fill level
> + * @tbl:		Pointer to LUT table
> + * @total_fl:		fill level
> + * Return: LUT setting corresponding to the fill level
> + */
> +u64 _dpu_hw_get_qos_lut(const struct dpu_qos_lut_tbl *tbl,
> +		u32 total_fl)
> +{
> +	int i;
> +
> +	if (!tbl || !tbl->nentry || !tbl->entries)
> +		return 0;
> +
> +	for (i = 0; i < tbl->nentry; i++)
> +		if (total_fl <= tbl->entries[i].fl)
> +			return tbl->entries[i].lut;
> +
> +	/* if last fl is zero, use as default */
> +	if (!tbl->entries[i-1].fl)
> +		return tbl->entries[i-1].lut;
> +
> +	return 0;
> +}
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.h
> index 3913475..529a6e0 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.h
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.h
> @@ -9,6 +9,7 @@
>   #include <linux/io.h>
>   #include <linux/slab.h>
>   #include "dpu_hw_mdss.h"
> +#include "dpu_hw_catalog.h"
>   
>   #define REG_MASK(n)                     ((BIT(n)) - 1)
>   
> @@ -324,4 +325,7 @@ void dpu_hw_csc_setup(struct dpu_hw_blk_reg_map  *c,
>   		u32 csc_reg_off,
>   		const struct dpu_csc_cfg *data, bool csc10);
>   
> +u64 _dpu_hw_get_qos_lut(const struct dpu_qos_lut_tbl *tbl,
> +		u32 total_fl);
> +
>   #endif /* _DPU_HW_UTIL_H */
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
> index c77c3d9d..730f0a3 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
> @@ -280,31 +280,6 @@ static int _dpu_plane_calc_fill_level(struct drm_plane *plane,
>   }
>   
>   /**
> - * _dpu_plane_get_qos_lut - get LUT mapping based on fill level
> - * @tbl:		Pointer to LUT table
> - * @total_fl:		fill level
> - * Return: LUT setting corresponding to the fill level
> - */
> -static u64 _dpu_plane_get_qos_lut(const struct dpu_qos_lut_tbl *tbl,
> -		u32 total_fl)
> -{
> -	int i;
> -
> -	if (!tbl || !tbl->nentry || !tbl->entries)
> -		return 0;
> -
> -	for (i = 0; i < tbl->nentry; i++)
> -		if (total_fl <= tbl->entries[i].fl)
> -			return tbl->entries[i].lut;
> -
> -	/* if last fl is zero, use as default */
> -	if (!tbl->entries[i-1].fl)
> -		return tbl->entries[i-1].lut;
> -
> -	return 0;
> -}
> -
> -/**
>    * _dpu_plane_set_qos_lut - set QoS LUT of the given plane
>    * @plane:		Pointer to drm plane
>    * @fb:			Pointer to framebuffer associated with the given plane
> @@ -333,7 +308,7 @@ static void _dpu_plane_set_qos_lut(struct drm_plane *plane,
>   			lut_usage = DPU_QOS_LUT_USAGE_MACROTILE;
>   	}
>   
> -	qos_lut = _dpu_plane_get_qos_lut(
> +	qos_lut = _dpu_hw_get_qos_lut(
>   			&pdpu->catalog->perf.qos_lut_tbl[lut_usage], total_fl);
>   
>   	trace_dpu_perf_set_qos_luts(pdpu->pipe - SSPP_VIG0,


-- 
With best wishes
Dmitry

  reply	other threads:[~2022-04-20  7:26 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-20  1:45 [PATCH v2 00/17] Add writeback block support for DPU Abhinav Kumar
2022-04-20  1:45 ` [PATCH v2 01/17] drm: allow passing possible_crtcs to drm_writeback_connector_init() Abhinav Kumar
2022-04-20  1:45 ` [PATCH v2 02/17] drm: introduce drm_writeback_connector_init_with_encoder() API Abhinav Kumar
2022-04-20  1:45 ` [PATCH v2 03/17] drm: allow real encoder to be passed for drm_writeback_connector Abhinav Kumar
2022-04-20  1:45 ` [PATCH v2 04/17] drm/msm/dpu: add writeback blocks to the sm8250 DPU catalog Abhinav Kumar
2022-04-21 12:16   ` Liviu Dudau
2022-04-22 23:08     ` Abhinav Kumar
2022-04-20  1:45 ` [PATCH v2 05/17] drm/msm/dpu: add reset_intf_cfg operation for dpu_hw_ctl Abhinav Kumar
2022-04-20  7:02   ` Dmitry Baryshkov
2022-04-20  1:45 ` [PATCH v2 06/17] drm/msm/dpu: add dpu_hw_wb abstraction for writeback blocks Abhinav Kumar
2022-04-20  7:20   ` Dmitry Baryshkov
2022-04-20 17:01     ` Abhinav Kumar
2022-04-20 17:49       ` Dmitry Baryshkov
2022-04-20 18:11         ` Abhinav Kumar
2022-04-20 18:49           ` Dmitry Baryshkov
2022-04-20  1:45 ` [PATCH v2 07/17] drm/msm/dpu: add writeback blocks to DPU RM Abhinav Kumar
2022-04-20  6:47   ` Dmitry Baryshkov
2022-04-20  1:46 ` [PATCH v2 08/17] drm/msm/dpu: add changes to support writeback in hw_ctl Abhinav Kumar
2022-04-20  6:59   ` Dmitry Baryshkov
2022-04-20 17:16     ` Abhinav Kumar
2022-04-20 18:48       ` Dmitry Baryshkov
2022-04-20  1:46 ` [PATCH v2 09/17] drm/msm/dpu: add an API to reset the encoder related hw blocks Abhinav Kumar
2022-04-20  7:23   ` Dmitry Baryshkov
2022-04-20 21:28     ` Abhinav Kumar
2022-04-20 22:42       ` Dmitry Baryshkov
2022-04-20  1:46 ` [PATCH v2 10/17] drm/msm/dpu: make changes to dpu_encoder to support virtual encoder Abhinav Kumar
2022-04-20  7:44   ` Dmitry Baryshkov
2022-04-20 17:41     ` Abhinav Kumar
2022-04-20 18:37       ` Dmitry Baryshkov
2022-04-20 18:46         ` [Freedreno] " Abhinav Kumar
2022-04-20 22:06           ` Abhinav Kumar
2022-04-20 22:38             ` Dmitry Baryshkov
2022-04-20  1:46 ` [PATCH v2 11/17] drm/msm/dpu: add encoder operations to prepare/cleanup wb job Abhinav Kumar
2022-04-20  1:46 ` [PATCH v2 12/17] drm/msm/dpu: move _dpu_plane_get_qos_lut to dpu_hw_util file Abhinav Kumar
2022-04-20  7:26   ` Dmitry Baryshkov [this message]
2022-04-20  1:46 ` [PATCH v2 13/17] drm/msm/dpu: introduce the dpu_encoder_phys_* for writeback Abhinav Kumar
2022-04-20  7:49   ` Dmitry Baryshkov
2022-04-20 18:17     ` Abhinav Kumar
2022-04-20 19:26       ` Dmitry Baryshkov
2022-04-20 19:36         ` Abhinav Kumar
2022-04-20 19:37           ` Dmitry Baryshkov
2022-04-20  1:46 ` [PATCH v2 14/17] drm/msm/dpu: add the writeback connector layer Abhinav Kumar
2022-04-20  7:52   ` Dmitry Baryshkov
2022-04-20 19:10     ` Abhinav Kumar
2022-04-20 19:26       ` Dmitry Baryshkov
2022-04-20 19:26   ` Dmitry Baryshkov
2022-04-20  1:46 ` [PATCH v2 15/17] drm/msm/dpu: initialize dpu encoder and connector for writeback Abhinav Kumar
2022-04-20  7:54   ` Dmitry Baryshkov
2022-04-20  1:46 ` [PATCH v2 16/17] drm/msm/dpu: gracefully handle null fb commits " Abhinav Kumar
2022-04-20  7:55   ` Dmitry Baryshkov
2022-04-20  1:46 ` [PATCH v2 17/17] drm/msm/dpu: add writeback blocks to the display snapshot Abhinav Kumar

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=367c1856-305f-f6b9-cb71-6dcecad38b77@linaro.org \
    --to=dmitry.baryshkov@linaro.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=freedreno@lists.freedesktop.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=liviu.dudau@arm.com \
    --cc=markyacoub@chromium.org \
    --cc=quic_abhinavk@quicinc.com \
    --cc=quic_aravindh@quicinc.com \
    --cc=quic_jesszhan@quicinc.com \
    --cc=seanpaul@chromium.org \
    --cc=swboyd@chromium.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.