Skip to content

Commit

Permalink
msm: kgsl: Affine kgsl_3d0_irq and worker kthread to the big CPU cluster
Browse files Browse the repository at this point in the history
These are in the critical path for rendering frames to the display, so
mark them as performance-critical and affine them to the big CPU
cluster. They aren't placed onto the prime cluster because the
single-CPU prime cluster will be used to run the DRM IRQ and kthreads.
DRM is more latency-critical than KGSL and we need to have DRM and KGSL
running on separate CPUs for the best performance, so KGSL gets the big
cluster.

Note that since there are other IRQs requested via kgsl_request_irq(),
we must specify that the IRQ to be made perf-critical is kgsl_3d0_irq.

Change-Id: Ia86a553e41632789aae5bf8ebaeb7d969b67e4ae
Signed-off-by: wHo-EM-i <ehteshammalik18998@gmail.com>
Signed-off-by: Santhosh <santhosh.user.why.red@gmail.com>
  • Loading branch information
kerneltoast authored and user-why-red committed Jun 12, 2024
1 parent 388d308 commit 4be3d3d
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions drivers/gpu/msm/kgsl.c
Original file line number Diff line number Diff line change
Expand Up @@ -5283,12 +5283,15 @@ int kgsl_request_irq(struct platform_device *pdev, const char *name,
irq_handler_t handler, void *data)
{
int ret, num = platform_get_irq_byname(pdev, name);
unsigned long irqflags = IRQF_TRIGGER_HIGH;

if (num < 0)
return num;

ret = devm_request_irq(&pdev->dev, num, handler, IRQF_TRIGGER_HIGH,
name, data);
if (!strcmp(name, "kgsl_3d0_irq"))
irqflags |= IRQF_PERF_AFFINE;

ret = devm_request_irq(&pdev->dev, num, handler, irqflags, name, data);

if (ret)
dev_err(&pdev->dev, "Unable to get interrupt %s: %d\n",
Expand Down Expand Up @@ -5574,8 +5577,8 @@ static int __init kgsl_core_init(void)

kthread_init_worker(&kgsl_driver.worker);

kgsl_driver.worker_thread = kthread_run(kthread_worker_fn,
&kgsl_driver.worker, "kgsl_worker_thread");
kgsl_driver.worker_thread = kthread_run_perf_critical(cpu_perf_mask,
kthread_worker_fn, &kgsl_driver.worker, "kgsl_worker_thread");

if (IS_ERR(kgsl_driver.worker_thread)) {
pr_err("kgsl: unable to start kgsl thread\n");
Expand Down

0 comments on commit 4be3d3d

Please sign in to comment.