All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
To: David Heidelberg <david@ixit.cz>,
	Jonathan Marek <jonathan@marek.ca>,
	robdclark <robdclark@chromium.org>
Cc: linux-arm-msm@vger.kernel.org
Subject: Re: [PATCH 1/2] drm/msm/mdp4: refactor HW revision detection into read_mdp_hw_revision
Date: Thu, 5 Aug 2021 12:04:59 +0300	[thread overview]
Message-ID: <270d29a8-484f-3580-edc8-37402d029cd2@linaro.org> (raw)
In-Reply-To: <20210705231641.315804-1-david@ixit.cz>

On 06/07/2021 02:16, David Heidelberg wrote:
> Inspired by MDP5 code.
> Also use DRM_DEV_INFO for MDP version as MDP5 does.
> 
> Cosmetic change: uint32_t -> u32 - checkpatch suggestion.
> 
> Signed-off-by: David Heidelberg <david@ixit.cz>

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

> ---
>   drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c | 27 ++++++++++++++++--------
>   1 file changed, 18 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c b/drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c
> index 4a5b518288b0..3a7a01d801aa 100644
> --- a/drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c
> +++ b/drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c
> @@ -19,20 +19,13 @@ static int mdp4_hw_init(struct msm_kms *kms)
>   {
>   	struct mdp4_kms *mdp4_kms = to_mdp4_kms(to_mdp_kms(kms));
>   	struct drm_device *dev = mdp4_kms->dev;
> -	uint32_t version, major, minor, dmap_cfg, vg_cfg;
> +	u32 major, minor, dmap_cfg, vg_cfg;
>   	unsigned long clk;
>   	int ret = 0;
>   
>   	pm_runtime_get_sync(dev->dev);
>   
> -	mdp4_enable(mdp4_kms);
> -	version = mdp4_read(mdp4_kms, REG_MDP4_VERSION);
> -	mdp4_disable(mdp4_kms);
> -
> -	major = FIELD(version, MDP4_VERSION_MAJOR);
> -	minor = FIELD(version, MDP4_VERSION_MINOR);
> -
> -	DBG("found MDP4 version v%d.%d", major, minor);
> +	read_mdp_hw_revision(mdp4_kms, &major, &minor);
>   
>   	if (major != 4) {
>   		DRM_DEV_ERROR(dev->dev, "unexpected MDP version: v%d.%d\n",
> @@ -411,6 +404,22 @@ static int modeset_init(struct mdp4_kms *mdp4_kms)
>   	return ret;
>   }
>   
> +static void read_mdp_hw_revision(struct mdp4_kms *mdp4_kms,
> +				 u32 *major, u32 *minor)
> +{
> +	struct drm_device *dev = mdp4_kms->dev;
> +	u32 version;
> +
> +	mdp4_enable(mdp4_kms);
> +	version = mdp4_read(mdp4_kms, REG_MDP4_VERSION);
> +	mdp4_disable(mdp4_kms);
> +
> +	*major = FIELD(version, MDP4_VERSION_MAJOR);
> +	*minor = FIELD(version, MDP4_VERSION_MINOR);
> +
> +	DRM_DEV_INFO(dev->dev, "MDP4 version v%d.%d", *major, *minor);
> +}
> +
>   struct msm_kms *mdp4_kms_init(struct drm_device *dev)
>   {
>   	struct platform_device *pdev = to_platform_device(dev->dev);
> 


-- 
With best wishes
Dmitry

      parent reply	other threads:[~2021-08-05  9:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-05 23:16 [PATCH 1/2] drm/msm/mdp4: refactor HW revision detection into read_mdp_hw_revision David Heidelberg
2021-07-05 23:16 ` [PATCH 2/2] drm/msm/mdp4: move HW revision detection to earlier phase David Heidelberg
2021-08-05  9:05   ` Dmitry Baryshkov
2021-08-05  9:04 ` Dmitry Baryshkov [this message]

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=270d29a8-484f-3580-edc8-37402d029cd2@linaro.org \
    --to=dmitry.baryshkov@linaro.org \
    --cc=david@ixit.cz \
    --cc=jonathan@marek.ca \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=robdclark@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.