Re: [PATCH] drm/komeda: Add event handling for EMPTY/FULL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi James,

On Thursday, 12 December 2019 07:27:55 GMT james qian wang (Arm Technology China) wrote:
> EMPTY/FULL are HW input/output FIFO condition identifer, which are
> useful information for addressing the problem, so expose them.
> 
> Signed-off-by: james qian wang (Arm Technology China) <james.qian.wang@xxxxxxx>
> ---
>  drivers/gpu/drm/arm/display/komeda/d71/d71_dev.c  | 13 ++++++++++++-
>  drivers/gpu/drm/arm/display/komeda/d71/d71_regs.h |  3 +++
>  drivers/gpu/drm/arm/display/komeda/komeda_dev.h   |  5 ++++-
>  drivers/gpu/drm/arm/display/komeda/komeda_event.c |  2 ++
>  4 files changed, 21 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/arm/display/komeda/d71/d71_dev.c b/drivers/gpu/drm/arm/display/komeda/d71/d71_dev.c
> index dd1ecf4276d3..00fa56c29b3e 100644
> --- a/drivers/gpu/drm/arm/display/komeda/d71/d71_dev.c
> +++ b/drivers/gpu/drm/arm/display/komeda/d71/d71_dev.c
> @@ -20,8 +20,10 @@ static u64 get_lpu_event(struct d71_pipeline *d71_pipeline)
>  		evts |= KOMEDA_EVENT_IBSY;
>  	if (raw_status & LPU_IRQ_EOW)
>  		evts |= KOMEDA_EVENT_EOW;
> +	if (raw_status & LPU_IRQ_OVR)
> +		evts |= KOMEDA_EVENT_OVR;
>  
> -	if (raw_status & (LPU_IRQ_ERR | LPU_IRQ_IBSY)) {
> +	if (raw_status & (LPU_IRQ_ERR | LPU_IRQ_IBSY | LPU_IRQ_OVR)) {
>  		u32 restore = 0, tbu_status;
>  		/* Check error of LPU status */
>  		status = malidp_read32(reg, BLK_STATUS);
> @@ -45,6 +47,15 @@ static u64 get_lpu_event(struct d71_pipeline *d71_pipeline)
>  			restore |= LPU_STATUS_ACE3;
>  			evts |= KOMEDA_ERR_ACE3;
>  		}
> +		if (status & LPU_STATUS_FEMPTY) {
> +			restore |= LPU_STATUS_FEMPTY;
> +			evts |= KOMEDA_EVENT_EMPTY;
> +		}
> +		if (status & LPU_STATUS_FFULL) {
> +			restore |= LPU_STATUS_FFULL;
> +			evts |= KOMEDA_EVENT_FULL;
> +		}
> +
>  		if (restore != 0)
>  			malidp_write32_mask(reg, BLK_STATUS, restore, 0);
>  
> diff --git a/drivers/gpu/drm/arm/display/komeda/d71/d71_regs.h b/drivers/gpu/drm/arm/display/komeda/d71/d71_regs.h
> index 81de6a23e7f3..e80172a0b320 100644
> --- a/drivers/gpu/drm/arm/display/komeda/d71/d71_regs.h
> +++ b/drivers/gpu/drm/arm/display/komeda/d71/d71_regs.h
> @@ -175,6 +175,7 @@
>  #define TBU_DOUTSTDCAPB_MASK	0x3F
>  
>  /* LPU_IRQ_BITS */
> +#define LPU_IRQ_OVR		BIT(9)
>  #define LPU_IRQ_IBSY		BIT(10)
>  #define LPU_IRQ_ERR		BIT(11)
>  #define LPU_IRQ_EOW		BIT(12)
> @@ -185,6 +186,8 @@
>  #define LPU_STATUS_AXIE		BIT(4)
>  #define LPU_STATUS_AXIRP	BIT(5)
>  #define LPU_STATUS_AXIWP	BIT(6)
> +#define LPU_STATUS_FEMPTY	BIT(11)
> +#define LPU_STATUS_FFULL	BIT(14)
>  #define LPU_STATUS_ACE0		BIT(16)
>  #define LPU_STATUS_ACE1		BIT(17)
>  #define LPU_STATUS_ACE2		BIT(18)
> diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_dev.h b/drivers/gpu/drm/arm/display/komeda/komeda_dev.h
> index 4a67a80d5fcf..ce27f2f27c24 100644
> --- a/drivers/gpu/drm/arm/display/komeda/komeda_dev.h
> +++ b/drivers/gpu/drm/arm/display/komeda/komeda_dev.h
> @@ -20,6 +20,8 @@
>  #define KOMEDA_EVENT_OVR		BIT_ULL(4)
>  #define KOMEDA_EVENT_EOW		BIT_ULL(5)
>  #define KOMEDA_EVENT_MODE		BIT_ULL(6)
> +#define KOMEDA_EVENT_FULL		BIT_ULL(7)
> +#define KOMEDA_EVENT_EMPTY		BIT_ULL(8)
>  
>  #define KOMEDA_ERR_TETO			BIT_ULL(14)
>  #define KOMEDA_ERR_TEMR			BIT_ULL(15)
> @@ -49,7 +51,8 @@
>  	KOMEDA_ERR_ZME		| KOMEDA_ERR_MERR	| KOMEDA_ERR_TCF |\
>  	KOMEDA_ERR_TTNG		| KOMEDA_ERR_TTF)
>  
> -#define KOMEDA_WARN_EVENTS	KOMEDA_ERR_CSCE
> +#define KOMEDA_WARN_EVENTS	\
> +	(KOMEDA_ERR_CSCE | KOMEDA_EVENT_FULL | KOMEDA_EVENT_EMPTY)
>  
>  #define KOMEDA_INFO_EVENTS (0 \
>  			    | KOMEDA_EVENT_VSYNC \
> diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_event.c b/drivers/gpu/drm/arm/display/komeda/komeda_event.c
> index 977c38d516da..53f944e66dfc 100644
> --- a/drivers/gpu/drm/arm/display/komeda/komeda_event.c
> +++ b/drivers/gpu/drm/arm/display/komeda/komeda_event.c
> @@ -78,6 +78,8 @@ static void evt_str(struct komeda_str *str, u64 events)
>  
>  	/* LPU errors or events */
>  	evt_sprintf(str, events & KOMEDA_EVENT_IBSY, "IBSY|");
> +	evt_sprintf(str, events & KOMEDA_EVENT_EMPTY, "EMPTY|");
> +	evt_sprintf(str, events & KOMEDA_EVENT_FULL, "FULL|");
>  	evt_sprintf(str, events & KOMEDA_ERR_AXIE, "AXIE|");
>  	evt_sprintf(str, events & KOMEDA_ERR_ACE0, "ACE0|");
>  	evt_sprintf(str, events & KOMEDA_ERR_ACE1, "ACE1|");
> 

Thanks for the patch,

Reviewed-by: Mihail Atanassov <mihail.atanassov@xxxxxxx>

-- 
Mihail



_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel



[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux