mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
To: Akhil P Oommen <akhilpo@oss.qualcomm.com>,
	Rob Clark <robin.clark@oss.qualcomm.com>,
	Sean Paul <sean@poorly.run>,
	Konrad Dybcio <konradybcio@kernel.org>,
	Dmitry Baryshkov <lumag@kernel.org>,
	Abhinav Kumar <abhinav.kumar@linux.dev>,
	Jessica Zhang <jessica.zhang@oss.qualcomm.com>,
	Marijn Suijten <marijn.suijten@somainline.org>,
	David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
	Antonino Maniscalco <antomani103@gmail.com>,
	Neil Armstrong <neil.armstrong@linaro.org>
Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org,
	freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 07/16] drm/msm/adreno: Add fenced regwrite support
Date: Mon, 8 Sep 2025 17:37:59 +0200	[thread overview]
Message-ID: <59ac7827-6258-4268-8b71-4cbcbad859db@oss.qualcomm.com> (raw)
In-Reply-To: <20250908-ifpc-support-v2-7-631b1080bf91@oss.qualcomm.com>

On 9/8/25 10:27 AM, Akhil P Oommen wrote:
> There are some special registers which are accessible even when GX power
> domain is collapsed during an IFPC sleep. Accessing these registers
> wakes up GPU from power collapse and allow programming these registers
> without additional handshake with GMU. This patch adds support for this
> special register write sequence.
> 
> Signed-off-by: Akhil P Oommen <akhilpo@oss.qualcomm.com>
> ---
>  drivers/gpu/drm/msm/adreno/a6xx_gpu.c     | 80 ++++++++++++++++++++++++++++++-
>  drivers/gpu/drm/msm/adreno/a6xx_gpu.h     |  1 +
>  drivers/gpu/drm/msm/adreno/a6xx_preempt.c | 20 ++++----
>  3 files changed, 90 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
> index 45dd5fd1c2bfcb0a01b71a326c7d95b0f9496d99..a63dad80ef461da45d5c41a042ed4f19d8282ef5 100644
> --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
> +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
> @@ -16,6 +16,84 @@
>  
>  #define GPU_PAS_ID 13
>  
> +static bool fence_status_check(struct msm_gpu *gpu, u32 offset, u32 value, u32 status, u32 mask)
> +{
> +	/* Success if !writedropped0/1 */
> +	if (!(status & mask))
> +		return true;
> +
> +	udelay(10);
> +
> +	/* Try to update fenced register again */
> +	gpu_write(gpu, offset, value);
> +
> +	/* We can't do a posted write here because the power domain could be
> +	 * in collapse state. So use the heaviest barrier instead
> +	 */
> +	mb();
> +	return false;
> +}
> +
> +static int fenced_write(struct a6xx_gpu *a6xx_gpu, u32 offset, u32 value, u32 mask)
> +{
> +	struct adreno_gpu *adreno_gpu = &a6xx_gpu->base;
> +	struct msm_gpu *gpu = &adreno_gpu->base;
> +	struct a6xx_gmu *gmu = &a6xx_gpu->gmu;
> +	u32 status;
> +
> +	gpu_write(gpu, offset, value);
> +
> +	/* Nothing else to be done in the case of no-GMU */
> +	if (adreno_has_gmu_wrapper(adreno_gpu))
> +		return 0;
> +
> +	/* We can't do a posted write here because the power domain could be
> +	 * in collapse state. So use the heaviest barrier instead
> +	 */

I'm not sure I follow - what's the relationship between the write being
posted and the power domain being collapsed (i.e. the hw not being
powered on)?

Are you trying to get rid of the delay that could happen between this
write leaving the CPU and arriving at the GPU (which would then be
woken up), so that the 1ms poll below has greater chance to succeed
because of how these "special registers" work?

Konrad

  reply	other threads:[~2025-09-08 15:38 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-08  8:26 [PATCH v2 00/16] drm/msm: Support for Inter Frame Power Collapse (IFPC) feature Akhil P Oommen
2025-09-08  8:26 ` [PATCH v2 01/16] drm/msm: Update GMU register xml Akhil P Oommen
2025-09-08  8:26 ` [PATCH v2 02/16] drm/msm: a6xx: Fix gx_is_on check for a7x family Akhil P Oommen
2025-09-08  8:26 ` [PATCH v2 03/16] drm/msm/a6xx: Poll additional DRV status Akhil P Oommen
2025-09-08 15:18   ` Konrad Dybcio
2025-09-08 16:49     ` Akhil P Oommen
2025-09-08  8:26 ` [PATCH v2 04/16] drm/msm/a6xx: Fix PDC sleep sequence Akhil P Oommen
2025-09-08  8:26 ` [PATCH v2 05/16] drm/msm: a6xx: Refactor a6xx_sptprac_enable() Akhil P Oommen
2025-09-08 15:21   ` Konrad Dybcio
2025-09-08  8:26 ` [PATCH v2 06/16] drm/msm: Add an ftrace for gpu register access Akhil P Oommen
2025-09-08  8:27 ` [PATCH v2 07/16] drm/msm/adreno: Add fenced regwrite support Akhil P Oommen
2025-09-08 15:37   ` Konrad Dybcio [this message]
2025-09-08 16:15     ` Akhil P Oommen
2025-09-08 15:54   ` Connor Abbott
2025-09-08 16:46     ` Akhil P Oommen
2025-09-08  8:27 ` [PATCH v2 08/16] drm/msm/a6xx: Set Keep-alive votes to block IFPC Akhil P Oommen
2025-09-08  8:27 ` [PATCH v2 09/16] drm/msm/a6xx: Switch to GMU AO counter Akhil P Oommen
2025-09-08  8:27 ` [PATCH v2 10/16] drm/msm/a6xx: Poll AHB fence status in GPU IRQ handler Akhil P Oommen
2025-09-08  8:27 ` [PATCH v2 11/16] drm/msm: Add support for IFPC Akhil P Oommen
2025-09-08  8:27 ` [PATCH v2 12/16] drm/msm/a6xx: Fix hangcheck " Akhil P Oommen
2025-09-08  8:27 ` [PATCH v2 13/16] drm/msm/adreno: Disable IFPC when sysprof is active Akhil P Oommen
2025-09-08  8:27 ` [PATCH v2 14/16] drm/msm/a6xx: Make crashstate capture IFPC safe Akhil P Oommen
2025-09-08  8:27 ` [PATCH v2 15/16] drm/msm/a6xx: Enable IFPC on Adreno X1-85 Akhil P Oommen
2025-09-08 15:24   ` Konrad Dybcio
2025-10-31 23:43   ` Chia-I Wu
2025-11-01 12:57     ` Rob Clark
2025-11-01 19:52       ` Akhil P Oommen
2025-11-02 17:55         ` Chia-I Wu
2025-11-03 15:11           ` Akhil P Oommen
2025-09-08  8:27 ` [PATCH v2 16/16] drm/msm/a6xx: Enable IFPC on A750 GPU Akhil P Oommen
2025-09-08 17:11 ` [PATCH v2 00/16] drm/msm: Support for Inter Frame Power Collapse (IFPC) feature Neil Armstrong

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=59ac7827-6258-4268-8b71-4cbcbad859db@oss.qualcomm.com \
    --to=konrad.dybcio@oss.qualcomm.com \
    --cc=abhinav.kumar@linux.dev \
    --cc=airlied@gmail.com \
    --cc=akhilpo@oss.qualcomm.com \
    --cc=antomani103@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=freedreno@lists.freedesktop.org \
    --cc=jessica.zhang@oss.qualcomm.com \
    --cc=konradybcio@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lumag@kernel.org \
    --cc=marijn.suijten@somainline.org \
    --cc=neil.armstrong@linaro.org \
    --cc=robin.clark@oss.qualcomm.com \
    --cc=sean@poorly.run \
    --cc=simona@ffwll.ch \
    /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

all inboxes | Powered by JetHome®