Skip to content

Commit 2bcf577

Browse files
slongerbeampH5
authored andcommitted
gpu: ipu-v3: Add ipu_idmac_enable_watermark()
Adds the function ipu_idmac_enable_watermark(), which enables or disables watermarking in the IDMAC channel. Enabling watermarking can increase a channel's AXI bus arbitration priority. Signed-off-by: Steve Longerbeam <steve_longerbeam@mentor.com> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
1 parent 6930afd commit 2bcf577

2 files changed

Lines changed: 26 additions & 0 deletions

File tree

‎drivers/gpu/ipu-v3/ipu-common.c‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,31 @@ int ipu_idmac_disable_channel(struct ipuv3_channel *channel)
536536
}
537537
EXPORT_SYMBOL_GPL(ipu_idmac_disable_channel);
538538

539+
/*
540+
* The imx6 rev. D TRM says that enabling the WM feature will increase
541+
* a channel's priority. Refer to Table 36-8 Calculated priority value.
542+
* The sub-module that is the sink or source for the channel must enable
543+
* watermark signal for this to take effect (SMFC_WM for instance).
544+
*/
545+
void ipu_idmac_enable_watermark(struct ipuv3_channel *channel, bool enable)
546+
{
547+
struct ipu_soc *ipu = channel->ipu;
548+
unsigned long flags;
549+
u32 val;
550+
551+
spin_lock_irqsave(&ipu->lock, flags);
552+
553+
val = ipu_idmac_read(ipu, IDMAC_WM_EN(channel->num));
554+
if (enable)
555+
val |= 1 << (channel->num % 32);
556+
else
557+
val &= ~(1 << (channel->num % 32));
558+
ipu_idmac_write(ipu, val, IDMAC_WM_EN(channel->num));
559+
560+
spin_unlock_irqrestore(&ipu->lock, flags);
561+
}
562+
EXPORT_SYMBOL_GPL(ipu_idmac_enable_watermark);
563+
539564
static int ipu_memory_reset(struct ipu_soc *ipu)
540565
{
541566
unsigned long timeout;

‎include/video/imx-ipu-v3.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ void ipu_idmac_put(struct ipuv3_channel *);
160160

161161
int ipu_idmac_enable_channel(struct ipuv3_channel *channel);
162162
int ipu_idmac_disable_channel(struct ipuv3_channel *channel);
163+
void ipu_idmac_enable_watermark(struct ipuv3_channel *channel, bool enable);
163164
int ipu_idmac_wait_busy(struct ipuv3_channel *channel, int ms);
164165

165166
void ipu_idmac_set_double_buffer(struct ipuv3_channel *channel,

0 commit comments

Comments
 (0)