summaryrefslogtreecommitdiff
path: root/drivers/media/platform/ti-vpe/vpdma.c
diff options
context:
space:
mode:
authorBenoit Parrot <bparrot@ti.com>2016-11-18 21:20:13 -0200
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2016-11-22 06:27:01 -0200
commit3f43554c0a3c2a311f484b9131a7b9edf183f6e0 (patch)
treedc4ea39721570315d10e43571265032cb14b5764 /drivers/media/platform/ti-vpe/vpdma.c
parent2f88703a0bfd1a4e88e1a7cf2542880ef72fdcc0 (diff)
[media] media: ti-vpe: vpdma: Add helper to set a background color
Add a helper to set the background color during vpdma transfer. This is needed when VPDMA is generating 32 bits RGB format to have the Alpha channel set to an appropriate value. Signed-off-by: Benoit Parrot <bparrot@ti.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/platform/ti-vpe/vpdma.c')
-rw-r--r--drivers/media/platform/ti-vpe/vpdma.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/media/platform/ti-vpe/vpdma.c b/drivers/media/platform/ti-vpe/vpdma.c
index 2b094016b470..133154628543 100644
--- a/drivers/media/platform/ti-vpe/vpdma.c
+++ b/drivers/media/platform/ti-vpe/vpdma.c
@@ -867,6 +867,16 @@ void vpdma_clear_list_stat(struct vpdma_data *vpdma, int irq_num)
}
EXPORT_SYMBOL(vpdma_clear_list_stat);
+void vpdma_set_bg_color(struct vpdma_data *vpdma,
+ struct vpdma_data_format *fmt, u32 color)
+{
+ if (fmt->type == VPDMA_DATA_FMT_TYPE_RGB)
+ write_reg(vpdma, VPDMA_BG_RGB, color);
+ else if (fmt->type == VPDMA_DATA_FMT_TYPE_YUV)
+ write_reg(vpdma, VPDMA_BG_YUV, color);
+}
+EXPORT_SYMBOL(vpdma_set_bg_color);
+
/*
* configures the output mode of the line buffer for the given client, the
* line buffer content can either be mirrored(each line repeated twice) or