diff options
| -rw-r--r-- | drivers/gpu/ipu-v3/ipu-common.c | 28 | ||||
| -rw-r--r-- | include/video/imx-ipu-v3.h | 1 |
2 files changed, 29 insertions, 0 deletions
diff --git a/drivers/gpu/ipu-v3/ipu-common.c b/drivers/gpu/ipu-v3/ipu-common.c index fec72c0d18ba..773a2fc8fed4 100644 --- a/drivers/gpu/ipu-v3/ipu-common.c +++ b/drivers/gpu/ipu-v3/ipu-common.c | |||
| @@ -357,6 +357,34 @@ void ipu_idmac_select_buffer(struct ipuv3_channel *channel, u32 buf_num) | |||
| 357 | } | 357 | } |
| 358 | EXPORT_SYMBOL_GPL(ipu_idmac_select_buffer); | 358 | EXPORT_SYMBOL_GPL(ipu_idmac_select_buffer); |
| 359 | 359 | ||
| 360 | void ipu_idmac_clear_buffer(struct ipuv3_channel *channel, u32 buf_num) | ||
| 361 | { | ||
| 362 | struct ipu_soc *ipu = channel->ipu; | ||
| 363 | unsigned int chno = channel->num; | ||
| 364 | unsigned long flags; | ||
| 365 | |||
| 366 | spin_lock_irqsave(&ipu->lock, flags); | ||
| 367 | |||
| 368 | ipu_cm_write(ipu, 0xF0300000, IPU_GPR); /* write one to clear */ | ||
| 369 | switch (buf_num) { | ||
| 370 | case 0: | ||
| 371 | ipu_cm_write(ipu, idma_mask(chno), IPU_CHA_BUF0_RDY(chno)); | ||
| 372 | break; | ||
| 373 | case 1: | ||
| 374 | ipu_cm_write(ipu, idma_mask(chno), IPU_CHA_BUF1_RDY(chno)); | ||
| 375 | break; | ||
| 376 | case 2: | ||
| 377 | ipu_cm_write(ipu, idma_mask(chno), IPU_CHA_BUF2_RDY(chno)); | ||
| 378 | break; | ||
| 379 | default: | ||
| 380 | break; | ||
| 381 | } | ||
| 382 | ipu_cm_write(ipu, 0x0, IPU_GPR); /* write one to set */ | ||
| 383 | |||
| 384 | spin_unlock_irqrestore(&ipu->lock, flags); | ||
| 385 | } | ||
| 386 | EXPORT_SYMBOL_GPL(ipu_idmac_clear_buffer); | ||
| 387 | |||
| 360 | int ipu_idmac_enable_channel(struct ipuv3_channel *channel) | 388 | int ipu_idmac_enable_channel(struct ipuv3_channel *channel) |
| 361 | { | 389 | { |
| 362 | struct ipu_soc *ipu = channel->ipu; | 390 | struct ipu_soc *ipu = channel->ipu; |
diff --git a/include/video/imx-ipu-v3.h b/include/video/imx-ipu-v3.h index 10013378394e..ae44eb067f5b 100644 --- a/include/video/imx-ipu-v3.h +++ b/include/video/imx-ipu-v3.h | |||
| @@ -167,6 +167,7 @@ void ipu_idmac_set_double_buffer(struct ipuv3_channel *channel, | |||
| 167 | int ipu_idmac_get_current_buffer(struct ipuv3_channel *channel); | 167 | int ipu_idmac_get_current_buffer(struct ipuv3_channel *channel); |
| 168 | bool ipu_idmac_buffer_is_ready(struct ipuv3_channel *channel, u32 buf_num); | 168 | bool ipu_idmac_buffer_is_ready(struct ipuv3_channel *channel, u32 buf_num); |
| 169 | void ipu_idmac_select_buffer(struct ipuv3_channel *channel, u32 buf_num); | 169 | void ipu_idmac_select_buffer(struct ipuv3_channel *channel, u32 buf_num); |
| 170 | void ipu_idmac_clear_buffer(struct ipuv3_channel *channel, u32 buf_num); | ||
| 170 | 171 | ||
| 171 | /* | 172 | /* |
| 172 | * IPU Channel Parameter Memory (cpmem) functions | 173 | * IPU Channel Parameter Memory (cpmem) functions |
