@@ -2584,6 +2584,46 @@ static irqreturn_t gen11_irq_handler(int irq, void *arg)
2584
2584
gen11_master_intr_enable );
2585
2585
}
2586
2586
2587
+ static u32 dg1_master_intr_disable_and_ack (void __iomem * const regs )
2588
+ {
2589
+ u32 val ;
2590
+
2591
+ /* First disable interrupts */
2592
+ raw_reg_write (regs , DG1_MSTR_UNIT_INTR , 0 );
2593
+
2594
+ /* Get the indication levels and ack the master unit */
2595
+ val = raw_reg_read (regs , DG1_MSTR_UNIT_INTR );
2596
+ if (unlikely (!val ))
2597
+ return 0 ;
2598
+
2599
+ raw_reg_write (regs , DG1_MSTR_UNIT_INTR , val );
2600
+
2601
+ /*
2602
+ * Now with master disabled, get a sample of level indications
2603
+ * for this interrupt and ack them right away - we keep GEN11_MASTER_IRQ
2604
+ * out as this bit doesn't exist anymore for DG1
2605
+ */
2606
+ val = raw_reg_read (regs , GEN11_GFX_MSTR_IRQ ) & ~GEN11_MASTER_IRQ ;
2607
+ if (unlikely (!val ))
2608
+ return 0 ;
2609
+
2610
+ raw_reg_write (regs , GEN11_GFX_MSTR_IRQ , val );
2611
+
2612
+ return val ;
2613
+ }
2614
+
2615
+ static inline void dg1_master_intr_enable (void __iomem * const regs )
2616
+ {
2617
+ raw_reg_write (regs , DG1_MSTR_UNIT_INTR , DG1_MSTR_IRQ );
2618
+ }
2619
+
2620
+ static irqreturn_t dg1_irq_handler (int irq , void * arg )
2621
+ {
2622
+ return __gen11_irq_handler (arg ,
2623
+ dg1_master_intr_disable_and_ack ,
2624
+ dg1_master_intr_enable );
2625
+ }
2626
+
2587
2627
/* Called from drm generic code, passed 'crtc' which
2588
2628
* we use as a pipe index
2589
2629
*/
@@ -2920,7 +2960,10 @@ static void gen11_irq_reset(struct drm_i915_private *dev_priv)
2920
2960
{
2921
2961
struct intel_uncore * uncore = & dev_priv -> uncore ;
2922
2962
2923
- gen11_master_intr_disable (dev_priv -> uncore .regs );
2963
+ if (HAS_MASTER_UNIT_IRQ (dev_priv ))
2964
+ dg1_master_intr_disable_and_ack (dev_priv -> uncore .regs );
2965
+ else
2966
+ gen11_master_intr_disable (dev_priv -> uncore .regs );
2924
2967
2925
2968
gen11_gt_irq_reset (& dev_priv -> gt );
2926
2969
gen11_display_irq_reset (dev_priv );
@@ -3517,8 +3560,13 @@ static void gen11_irq_postinstall(struct drm_i915_private *dev_priv)
3517
3560
3518
3561
I915_WRITE (GEN11_DISPLAY_INT_CTL , GEN11_DISPLAY_IRQ_ENABLE );
3519
3562
3520
- gen11_master_intr_enable (uncore -> regs );
3521
- POSTING_READ (GEN11_GFX_MSTR_IRQ );
3563
+ if (HAS_MASTER_UNIT_IRQ (dev_priv )) {
3564
+ dg1_master_intr_enable (uncore -> regs );
3565
+ POSTING_READ (DG1_MSTR_UNIT_INTR );
3566
+ } else {
3567
+ gen11_master_intr_enable (uncore -> regs );
3568
+ POSTING_READ (GEN11_GFX_MSTR_IRQ );
3569
+ }
3522
3570
}
3523
3571
3524
3572
static void cherryview_irq_postinstall (struct drm_i915_private * dev_priv )
@@ -4043,6 +4091,8 @@ static irq_handler_t intel_irq_handler(struct drm_i915_private *dev_priv)
4043
4091
else
4044
4092
return i8xx_irq_handler ;
4045
4093
} else {
4094
+ if (HAS_MASTER_UNIT_IRQ (dev_priv ))
4095
+ return dg1_irq_handler ;
4046
4096
if (INTEL_GEN (dev_priv ) >= 11 )
4047
4097
return gen11_irq_handler ;
4048
4098
else if (INTEL_GEN (dev_priv ) >= 8 )
0 commit comments