mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Neil Armstrong <neil.armstrong@linaro.org>
To: Akhil P Oommen <akhilpo@oss.qualcomm.com>
Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org,
	freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	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>
Subject: Re: [PATCH RFC RFT] drm/msm: adreno: attach the GMU device to a driver
Date: Fri, 31 Oct 2025 09:38:15 +0100	[thread overview]
Message-ID: <f5041496-ee83-479a-995f-79b6952bcafe@linaro.org> (raw)
In-Reply-To: <c8058713-b126-461b-8ae6-19c4574a8105@oss.qualcomm.com>

Hi,

On 10/30/25 22:29, Akhil P Oommen wrote:
> On 10/22/2025 6:14 PM, Neil Armstrong wrote:
>> Due to the sync_state is enabled by default in pmdomain & CCF since v6.17,
>> the GCC and GPUCC sync_state would stay pending, leaving the resources in
>> full performance:
>> gcc-x1e80100 100000.clock-controller: sync_state() pending due to 3d6a000.gmu
>> gpucc-x1e80100 3d90000.clock-controller: sync_state() pending due to 3d6a000.gmu
>>
>> In order to fix this state and allow the GMU to be properly
>> probed, let's add a proper driver for the GMU and add it to
>> the MSM driver components.
>>
>> Only the proper GMU has been tested since I don't have
>> access to hardware with a GMU wrapper.
>>
>> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
>> ---
>>   drivers/gpu/drm/msm/adreno/a6xx_gmu.c      | 354 ++++++++++++++---------------
>>   drivers/gpu/drm/msm/adreno/a6xx_gpu.c      |   6 -
>>   drivers/gpu/drm/msm/adreno/a6xx_gpu.h      |   3 -
>>   drivers/gpu/drm/msm/adreno/adreno_device.c |   4 +
>>   drivers/gpu/drm/msm/adreno/adreno_gpu.h    |   4 +
>>   drivers/gpu/drm/msm/msm_drv.c              |  16 +-
>>   6 files changed, 192 insertions(+), 195 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
>> index fc62fef2fed8..6e7c3e627509 100644
>> --- a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
>> +++ b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
>> @@ -1859,11 +1859,14 @@ void a6xx_gmu_sysprof_setup(struct msm_gpu *gpu)
>>   	pm_runtime_put(&gpu->pdev->dev);
>>   }
>>   
>> -void a6xx_gmu_remove(struct a6xx_gpu *a6xx_gpu)
>> +static void a6xx_gmu_unbind(struct device *dev, struct device *master, void *data)
>>   {
> 
> I feel we should keep gmu and gmu_wrapper implementations separate. It
> is already overloaded. How about adding a separate gmu_wrapper_bind_ops
> and keep it in the match data?

Good idea, will try something like that.

> 
>> -	struct adreno_gpu *adreno_gpu = &a6xx_gpu->base;
>> +	struct platform_device *pdev = to_platform_device(dev);
>> +	struct msm_drm_private *priv = dev_get_drvdata(master);
>> +	struct msm_gpu *gpu = priv->gpu;
> 
> << snip >>
> 
>>   static inline uint32_t get_wptr(struct msm_ringbuffer *ring)
>>   {
>> diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c
>> index 7e977fec4100..0618da7e8b40 100644
>> --- a/drivers/gpu/drm/msm/msm_drv.c
>> +++ b/drivers/gpu/drm/msm/msm_drv.c
>> @@ -998,18 +998,30 @@ static const struct of_device_id msm_gpu_match[] = {
>>   	{ },
>>   };
>>   
>> +static const struct of_device_id msm_gmu_match[] = {
>> +	{ .compatible = "qcom,adreno-gmu" },
>> +	{ .compatible = "qcom,adreno-gmu-wrapper" },
>> +	{ },
>> +};
>> +
>>   static int add_gpu_components(struct device *dev,
>>   			      struct component_match **matchptr)
>>   {
>> -	struct device_node *np;
>> +	struct device_node *np, *gmu;
>>   
>>   	np = of_find_matching_node(NULL, msm_gpu_match);
>>   	if (!np)
>>   		return 0;
>>   
>> -	if (of_device_is_available(np) && adreno_has_gpu(np))
>> +	if (of_device_is_available(np) && adreno_has_gpu(np)) {
>>   		drm_of_component_match_add(dev, matchptr, component_compare_of, np);
>>   
>> +		gmu = of_find_matching_node(NULL, msm_gmu_match);
> 
> Instead of this, we can probably use the gmu phandle from "qcom,gmu"
> property? That is quicker and also doesn't assume that there is only a
> single GPU.

Ack you're right, let's do this since we have the GPU node already.

> 
>> +		if (of_device_is_available(gmu))
>> +			drm_of_component_match_add(dev, matchptr, component_compare_of, gmu);
>> +		of_node_put(gmu);
> I think you missed the recently added headless support. Please check
> separate_gpu_kms modparam and msm_gpu_probe().

I saw it but seems I probably forgot the check if it's still functional,
will double check.

Thanks,
Neil

> 
> -Akhil
> 
>> +	}
>> +
>>   	of_node_put(np);
>>   
>>   	return 0;
>>
>> ---
>> base-commit: 211ddde0823f1442e4ad052a2f30f050145ccada
>> change-id: 20251022-topic-adreno-attach-gmu-to-driver-e47025fd7ebb
>>
>> Best regards,


  reply	other threads:[~2025-10-31  8:38 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-22 12:44 Neil Armstrong
2025-10-22 17:09 ` Konrad Dybcio
2025-10-23  8:27   ` Neil Armstrong
2025-10-24  8:55     ` Konrad Dybcio
2025-10-24  9:11       ` Neil Armstrong
2025-10-30  9:52         ` Konrad Dybcio
2025-10-30 10:02           ` Neil Armstrong
2025-10-26  1:31 ` Jens Reidel
2025-10-29 10:25   ` Neil Armstrong
2025-11-04  1:30     ` Jens Reidel
2025-11-04 12:43       ` Neil Armstrong
2025-10-30 21:29 ` Akhil P Oommen
2025-10-31  8:38   ` Neil Armstrong [this message]
2026-01-14  6:37 ` Akhil P Oommen
2026-01-14  8:45   ` 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=f5041496-ee83-479a-995f-79b6952bcafe@linaro.org \
    --to=neil.armstrong@linaro.org \
    --cc=abhinav.kumar@linux.dev \
    --cc=airlied@gmail.com \
    --cc=akhilpo@oss.qualcomm.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=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®