Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/panfrost: Don't rework job IRQ enable mask in the enable path

Up until now, panfrost_job_enable_interrupts() would always recalculate the
same job IRQ enablement mask, which is effectively a constant.

Replace it with a compile-time constant value, and also in another couple
places where an equivalent expression was being used.

Reviewed-by: Steven Price <steven.price@arm.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Adrián Larumbe <adrian.larumbe@collabora.com>
Link: https://lore.kernel.org/r/20251019145225.3621989-8-adrian.larumbe@collabora.com
Signed-off-by: Steven Price <steven.price@arm.com>

authored by

Adrián Larumbe and committed by
Steven Price
fc237ec8 4da352cf

+8 -15
+4
drivers/gpu/drm/panfrost/panfrost_device.h
··· 26 26 27 27 #define MAX_PM_DOMAINS 5 28 28 29 + #define ALL_JS_INT_MASK \ 30 + (GENMASK(16 + NUM_JOB_SLOTS - 1, 16) | \ 31 + GENMASK(NUM_JOB_SLOTS - 1, 0)) 32 + 29 33 enum panfrost_drv_comp_bits { 30 34 PANFROST_COMP_BIT_GPU, 31 35 PANFROST_COMP_BIT_JOB,
+4 -15
drivers/gpu/drm/panfrost/panfrost_job.c
··· 432 432 433 433 void panfrost_job_enable_interrupts(struct panfrost_device *pfdev) 434 434 { 435 - int j; 436 - u32 irq_mask = 0; 437 - 438 435 clear_bit(PANFROST_COMP_BIT_JOB, pfdev->is_suspended); 439 436 440 - for (j = 0; j < NUM_JOB_SLOTS; j++) { 441 - irq_mask |= MK_JS_MASK(j); 442 - } 443 - 444 - job_write(pfdev, JOB_INT_CLEAR, irq_mask); 445 - job_write(pfdev, JOB_INT_MASK, irq_mask); 437 + job_write(pfdev, JOB_INT_CLEAR, ALL_JS_INT_MASK); 438 + job_write(pfdev, JOB_INT_MASK, ALL_JS_INT_MASK); 446 439 } 447 440 448 441 void panfrost_job_suspend_irq(struct panfrost_device *pfdev) ··· 754 761 drm_sched_start(&pfdev->js->queue[i].sched, 0); 755 762 756 763 /* Re-enable job interrupts now that everything has been restarted. */ 757 - job_write(pfdev, JOB_INT_MASK, 758 - GENMASK(16 + NUM_JOB_SLOTS - 1, 16) | 759 - GENMASK(NUM_JOB_SLOTS - 1, 0)); 764 + job_write(pfdev, JOB_INT_MASK, ALL_JS_INT_MASK); 760 765 761 766 dma_fence_end_signalling(cookie); 762 767 } ··· 827 836 828 837 /* Enable interrupts only if we're not about to get suspended */ 829 838 if (!test_bit(PANFROST_COMP_BIT_JOB, pfdev->is_suspended)) 830 - job_write(pfdev, JOB_INT_MASK, 831 - GENMASK(16 + NUM_JOB_SLOTS - 1, 16) | 832 - GENMASK(NUM_JOB_SLOTS - 1, 0)); 839 + job_write(pfdev, JOB_INT_MASK, ALL_JS_INT_MASK); 833 840 834 841 return IRQ_HANDLED; 835 842 }