Skip to content

Commit dc8a497

Browse files
Krishna Manikandanrobclark
authored andcommitted
drm/msm/disp/dpu1: add flags to indicate obsolete irqs
Some irqs which are applicable for sdm845 target are no longer applicable for sc7180 and sc7280 targets. Add a flag to indicate the irqs which are obsolete for a particular target so that these irqs are skipped while checking for matching irq lookup index. Signed-off-by: Krishna Manikandan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Rob Clark <[email protected]>
1 parent 7e4526d commit dc8a497

File tree

5 files changed

+26
-7
lines changed

5 files changed

+26
-7
lines changed

drivers/gpu/drm/msm/disp/dpu1/dpu_core_irq.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ int dpu_core_irq_idx_lookup(struct dpu_kms *dpu_kms,
5858
if (!dpu_kms->hw_intr || !dpu_kms->hw_intr->ops.irq_idx_lookup)
5959
return -EINVAL;
6060

61-
return dpu_kms->hw_intr->ops.irq_idx_lookup(intr_type,
62-
instance_idx);
61+
return dpu_kms->hw_intr->ops.irq_idx_lookup(dpu_kms->hw_intr,
62+
intr_type, instance_idx);
6363
}
6464

6565
/**

drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,13 @@
5656

5757
#define INTF_SC7280_MASK INTF_SC7180_MASK | BIT(DPU_DATA_HCTL_EN)
5858

59+
#define INTR_SC7180_MASK \
60+
(BIT(DPU_IRQ_TYPE_PING_PONG_RD_PTR) |\
61+
BIT(DPU_IRQ_TYPE_PING_PONG_WR_PTR) |\
62+
BIT(DPU_IRQ_TYPE_PING_PONG_AUTO_REF) |\
63+
BIT(DPU_IRQ_TYPE_PING_PONG_TEAR_CHECK) |\
64+
BIT(DPU_IRQ_TYPE_PING_PONG_TE_CHECK))
65+
5966
#define DEFAULT_PIXEL_RAM_SIZE (50 * 1024)
6067
#define DEFAULT_DPU_LINE_WIDTH 2048
6168
#define DEFAULT_DPU_OUTPUT_LINE_WIDTH 2560
@@ -1085,6 +1092,7 @@ static void sc7180_cfg_init(struct dpu_mdss_cfg *dpu_cfg)
10851092
.dma_cfg = sdm845_regdma,
10861093
.perf = sc7180_perf_data,
10871094
.mdss_irqs = 0x3f,
1095+
.obsolete_irq = INTR_SC7180_MASK,
10881096
};
10891097
}
10901098

@@ -1174,6 +1182,7 @@ static void sc7280_cfg_init(struct dpu_mdss_cfg *dpu_cfg)
11741182
.vbif = sdm845_vbif,
11751183
.perf = sc7280_perf_data,
11761184
.mdss_irqs = 0x1c07,
1185+
.obsolete_irq = INTR_SC7180_MASK,
11771186
};
11781187
}
11791188

drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -723,6 +723,7 @@ struct dpu_perf_cfg {
723723
* @cursor_formats Supported formats for cursor pipe
724724
* @vig_formats Supported formats for vig pipe
725725
* @mdss_irqs: Bitmap with the irqs supported by the target
726+
* @obsolete_irq: Irq types that are obsolete for a particular target
726727
*/
727728
struct dpu_mdss_cfg {
728729
u32 hwversion;
@@ -769,6 +770,7 @@ struct dpu_mdss_cfg {
769770
const struct dpu_format_extended *vig_formats;
770771

771772
unsigned long mdss_irqs;
773+
unsigned long obsolete_irq;
772774
};
773775

774776
struct dpu_mdss_hw_cfg_handler {

drivers/gpu/drm/msm/disp/dpu1/dpu_hw_interrupts.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1345,14 +1345,15 @@ static const struct dpu_irq_type dpu_irq_map[] = {
13451345
{ DPU_IRQ_TYPE_RESERVED, 0, 0, 12},
13461346
};
13471347

1348-
static int dpu_hw_intr_irqidx_lookup(enum dpu_intr_type intr_type,
1349-
u32 instance_idx)
1348+
static int dpu_hw_intr_irqidx_lookup(struct dpu_hw_intr *intr,
1349+
enum dpu_intr_type intr_type, u32 instance_idx)
13501350
{
13511351
int i;
13521352

13531353
for (i = 0; i < ARRAY_SIZE(dpu_irq_map); i++) {
13541354
if (intr_type == dpu_irq_map[i].intr_type &&
1355-
instance_idx == dpu_irq_map[i].instance_idx)
1355+
instance_idx == dpu_irq_map[i].instance_idx &&
1356+
!(intr->obsolete_irq & BIT(dpu_irq_map[i].intr_type)))
13561357
return i;
13571358
}
13581359

@@ -1404,7 +1405,9 @@ static void dpu_hw_intr_dispatch_irq(struct dpu_hw_intr *intr,
14041405
(irq_idx < end_idx) && irq_status;
14051406
irq_idx++)
14061407
if ((irq_status & dpu_irq_map[irq_idx].irq_mask) &&
1407-
(dpu_irq_map[irq_idx].reg_idx == reg_idx)) {
1408+
(dpu_irq_map[irq_idx].reg_idx == reg_idx) &&
1409+
!(intr->obsolete_irq &
1410+
BIT(dpu_irq_map[irq_idx].intr_type))) {
14081411
/*
14091412
* Once a match on irq mask, perform a callback
14101413
* to the given cbfunc. cbfunc will take care
@@ -1716,6 +1719,8 @@ struct dpu_hw_intr *dpu_hw_intr_init(void __iomem *addr,
17161719
}
17171720

17181721
intr->irq_mask = m->mdss_irqs;
1722+
intr->obsolete_irq = m->obsolete_irq;
1723+
17191724
spin_lock_init(&intr->irq_lock);
17201725

17211726
return intr;

drivers/gpu/drm/msm/disp/dpu1/dpu_hw_interrupts.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,12 @@ struct dpu_hw_intr_ops {
8383
/**
8484
* irq_idx_lookup - Lookup IRQ index on the HW interrupt type
8585
* Used for all irq related ops
86+
* @intr: HW interrupt handle
8687
* @intr_type: Interrupt type defined in dpu_intr_type
8788
* @instance_idx: HW interrupt block instance
8889
* @return: irq_idx or -EINVAL for lookup fail
8990
*/
90-
int (*irq_idx_lookup)(
91+
int (*irq_idx_lookup)(struct dpu_hw_intr *intr,
9192
enum dpu_intr_type intr_type,
9293
u32 instance_idx);
9394

@@ -179,6 +180,7 @@ struct dpu_hw_intr_ops {
179180
* @save_irq_status: array of IRQ status reg storage created during init
180181
* @irq_idx_tbl_size: total number of irq_idx mapped in the hw_interrupts
181182
* @irq_lock: spinlock for accessing IRQ resources
183+
* @obsolete_irq: irq types that are obsolete for a particular target
182184
*/
183185
struct dpu_hw_intr {
184186
struct dpu_hw_blk_reg_map hw;
@@ -188,6 +190,7 @@ struct dpu_hw_intr {
188190
u32 irq_idx_tbl_size;
189191
spinlock_t irq_lock;
190192
unsigned long irq_mask;
193+
unsigned long obsolete_irq;
191194
};
192195

193196
/**

0 commit comments

Comments
 (0)