linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Boyd <sboyd@codeaurora.org>
To: Jordan Crouse <jcrouse@codeaurora.org>, freedreno@lists.freedesktop.org
Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 3/3] drm/msm: gpu Add new gpu register read/write functions
Date: Wed, 23 Nov 2016 11:34:55 -0800	[thread overview]
Message-ID: <f456dc94-7ae2-1b64-c90b-bfb8311be592@codeaurora.org> (raw)
In-Reply-To: <1479829657-23698-4-git-send-email-jcrouse@codeaurora.org>

On 11/22/2016 07:47 AM, Jordan Crouse wrote:
> Add some new functions to manipulate GPU registers.  gpu_read64 and
> gpu_write64 can read/write a 64 bit value to two 32 bit registers.
> For 4XX and older these are normally perfcounter registers, but
> future targets will use 64 bit addressing so there will be many
> more spots where a 64 bit read and write are needed.
>
> gpu_rmw() does a read/modify/write on a 32 bit register given a mask
> and bits to OR in.
>
> Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
> ---
>  drivers/gpu/drm/msm/adreno/a4xx_gpu.c | 12 ++---------
>  drivers/gpu/drm/msm/msm_gpu.h         | 39 +++++++++++++++++++++++++++++++++++
>  2 files changed, 41 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/gpu/drm/msm/adreno/a4xx_gpu.c b/drivers/gpu/drm/msm/adreno/a4xx_gpu.c
> index ba16507..b82210c 100644
> --- a/drivers/gpu/drm/msm/adreno/a4xx_gpu.c
> +++ b/drivers/gpu/drm/msm/adreno/a4xx_gpu.c
> @@ -513,16 +513,8 @@ static int a4xx_pm_suspend(struct msm_gpu *gpu) {
>  
>  static int a4xx_get_timestamp(struct msm_gpu *gpu, uint64_t *value)
>  {
> -	uint32_t hi, lo, tmp;
> -
> -	tmp = gpu_read(gpu, REG_A4XX_RBBM_PERFCTR_CP_0_HI);
> -	do {
> -		hi = tmp;
> -		lo = gpu_read(gpu, REG_A4XX_RBBM_PERFCTR_CP_0_LO);
> -		tmp = gpu_read(gpu, REG_A4XX_RBBM_PERFCTR_CP_0_HI);
> -	} while (tmp != hi);
> -
> -	*value = (((uint64_t)hi) << 32) | lo;
> +	*value = gpu_read64(gpu, REG_A4XX_RBBM_PERFCTR_CP_0_LO,
> +		REG_A4XX_RBBM_PERFCTR_CP_0_HI);

Did we stop caring about the case where the high bits changed while the
low bits were read? gpu_read64 (pretty poor name by the way considering
how many GPUs there are supported in the kernel) doesn't look to check
for or handle that case.

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

  reply	other threads:[~2016-11-23 19:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-22 15:47 [PATCH 0/3] drm/msm cleanups Jordan Crouse
     [not found] ` <1479829657-23698-1-git-send-email-jcrouse-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2016-11-22 15:47   ` [PATCH 1/3] drm/msm: gpu: Cut down the list of "generic" registers to the ones we use Jordan Crouse
2016-11-22 15:47   ` [PATCH 2/3] drm/msm: gpu: Return error on hw_init failure Jordan Crouse
2016-11-22 15:47   ` [PATCH 3/3] drm/msm: gpu Add new gpu register read/write functions Jordan Crouse
2016-11-23 19:34     ` Stephen Boyd [this message]
     [not found]       ` <f456dc94-7ae2-1b64-c90b-bfb8311be592-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2016-11-23 19:46         ` Rob Clark
     [not found]           ` <CAF6AEGvwZ9NAwfd40SsvS1C8av1n2rGmULtmHjSYurR7-JEwCg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-11-23 19:55             ` Stephen Boyd

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=f456dc94-7ae2-1b64-c90b-bfb8311be592@codeaurora.org \
    --to=sboyd@codeaurora.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=freedreno@lists.freedesktop.org \
    --cc=jcrouse@codeaurora.org \
    --cc=linux-arm-msm@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).