mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Young-Jun Hong <nirvanah@nirvanahyj.com>
Cc: "Boris Brezillon" <boris.brezillon@collabora.com>,
	"Rob Herring" <robh@kernel.org>,
	"Steven Price" <steven.price@arm.com>,
	"Adrián Larumbe" <adrian.larumbe@collabora.com>,
	"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
	"Maxime Ripard" <mripard@kernel.org>,
	"Thomas Zimmermann" <tzimmermann@suse.de>,
	"David Airlie" <airlied@gmail.com>,
	"Simona Vetter" <simona@ffwll.ch>,
	"Alexey Sheplyakov" <asheplyakov@basealt.ru>,
	"Vadim V. Vlasov" <vadim.vlasov@elpitech.ru>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: [PATCH 3/4] drm/panfrost: only put powered shader cores in the job affinity
Date: Fri,  6 Nov 2026 14:41:50 +0900	[thread overview]
Message-ID: <20261106054210.2893230-4-nirvanah@nirvanahyj.com> (raw)
In-Reply-To: <20261106054210.2893230-1-nirvanah@nirvanahyj.com>

On GPUs with more than one L2 (core group), panfrost powers only the
first core group (panfrost_get_core_mask()), but the job affinity is
written from shader_present, i.e. it also names the cores of the second,
unpowered group (Mali-T628 MP6 on Exynos 5422: l2_present 0x11, 4+2
cores, affinity 0x3f while only 0x0f is powered).

Write the affinity from the same mask that was powered, so a job never
names cores that are off.

Tested on Samsung ARTIK 10 (Exynos 5422), Mali-T628 MP6.

The analysis, the code and this changelog were produced with Claude
Code (Anthropic), a coding assistant.

Fixes: 6e55d273708b ("drm/panfrost: initial dual core group GPUs support")
Signed-off-by: Young-Jun Hong <nirvanah@nirvanahyj.com>
---
 drivers/gpu/drm/panfrost/panfrost_gpu.c | 6 ++++++
 drivers/gpu/drm/panfrost/panfrost_gpu.h | 1 +
 drivers/gpu/drm/panfrost/panfrost_job.c | 2 +-
 3 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/panfrost/panfrost_gpu.c b/drivers/gpu/drm/panfrost/panfrost_gpu.c
index 6081b27829e1..420d224276a5 100644
--- a/drivers/gpu/drm/panfrost/panfrost_gpu.c
+++ b/drivers/gpu/drm/panfrost/panfrost_gpu.c
@@ -452,6 +452,12 @@ static u64 panfrost_get_core_mask(struct panfrost_device *pfdev)
 	return core_mask;
 }
 
+/* cores that panfrost_gpu_power_on() powers */
+u64 panfrost_powered_core_mask(struct panfrost_device *pfdev)
+{
+	return pfdev->features.shader_present & panfrost_get_core_mask(pfdev);
+}
+
 void panfrost_gpu_power_on(struct panfrost_device *pfdev)
 {
 	int ret;
diff --git a/drivers/gpu/drm/panfrost/panfrost_gpu.h b/drivers/gpu/drm/panfrost/panfrost_gpu.h
index b4fef11211d5..78a6270b7fcb 100644
--- a/drivers/gpu/drm/panfrost/panfrost_gpu.h
+++ b/drivers/gpu/drm/panfrost/panfrost_gpu.h
@@ -13,6 +13,7 @@ void panfrost_gpu_fini(struct panfrost_device *pfdev);
 u32 panfrost_gpu_get_latest_flush_id(struct panfrost_device *pfdev);
 
 int panfrost_gpu_soft_reset(struct panfrost_device *pfdev);
+u64 panfrost_powered_core_mask(struct panfrost_device *pfdev);
 void panfrost_gpu_power_on(struct panfrost_device *pfdev);
 void panfrost_gpu_power_off(struct panfrost_device *pfdev);
 void panfrost_gpu_suspend_irq(struct panfrost_device *pfdev);
diff --git a/drivers/gpu/drm/panfrost/panfrost_job.c b/drivers/gpu/drm/panfrost/panfrost_job.c
index 4ddf4b722ddf..33da86587db7 100644
--- a/drivers/gpu/drm/panfrost/panfrost_job.c
+++ b/drivers/gpu/drm/panfrost/panfrost_job.c
@@ -143,7 +143,7 @@ static void panfrost_job_write_affinity(struct panfrost_device *pfdev,
 	 * Eventually we may need to support tiler only jobs and h/w with
 	 * multiple (2) coherent core groups
 	 */
-	affinity = pfdev->features.shader_present;
+	affinity = panfrost_powered_core_mask(pfdev);
 
 	job_write(pfdev, JS_AFFINITY_NEXT_LO(js), lower_32_bits(affinity));
 	job_write(pfdev, JS_AFFINITY_NEXT_HI(js), upper_32_bits(affinity));
-- 
2.47.3


  parent reply	other threads:[~2026-11-06  5:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-06  5:41 [PATCH 0/4] Exynos 5422: Mali-T628 GPU compute fixes Young-Jun Hong
2026-11-06  5:41 ` [PATCH 1/4] iommu/io-pgtable-arm: use inner shareable for Mali LPAE on a non-coherent GPU Young-Jun Hong
2026-11-06  5:41 ` [PATCH 2/4] clk: samsung: exynos5420: add VPLL rates for 650, 700 and 750 MHz Young-Jun Hong
2026-11-06  5:41 ` Young-Jun Hong [this message]
2026-11-06  5:41 ` [PATCH 4/4] drm/panfrost: let jobs opt in to all core groups Young-Jun Hong

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=20261106054210.2893230-4-nirvanah@nirvanahyj.com \
    --to=nirvanah@nirvanahyj.com \
    --cc=adrian.larumbe@collabora.com \
    --cc=airlied@gmail.com \
    --cc=asheplyakov@basealt.ru \
    --cc=boris.brezillon@collabora.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=robh@kernel.org \
    --cc=simona@ffwll.ch \
    --cc=steven.price@arm.com \
    --cc=tzimmermann@suse.de \
    --cc=vadim.vlasov@elpitech.ru \
    /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®