Commit 9aa94a31 authored by Dmitry Osipenko's avatar Dmitry Osipenko Committed by Mauro Carvalho Chehab

media: staging: tegra-vde: Factor out H.264 code

Factor out H.264 hardware programming code into separate source file in a
preparation to support V4L API by the Tegra video decoder driver.
Signed-off-by: default avatarDmitry Osipenko <digetx@gmail.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent 96ba61ee
# SPDX-License-Identifier: GPL-2.0
tegra-vde-y := vde.o iommu.o dmabuf-cache.o
tegra-vde-y := vde.o iommu.o dmabuf-cache.o h264.o
obj-$(CONFIG_TEGRA_VDE) += tegra-vde.o
This diff is collapsed.
This diff is collapsed.
......@@ -16,6 +16,15 @@
#include <linux/mutex.h>
#include <linux/types.h>
#define ICMDQUE_WR 0x00
#define CMDQUE_CONTROL 0x08
#define INTR_STATUS 0x18
#define BSE_INT_ENB 0x40
#define BSE_CONFIG 0x44
#define BSE_ICMDQUE_EMPTY BIT(3)
#define BSE_DMA_BUSY BIT(23)
struct clk;
struct dma_buf;
struct gen_pool;
......@@ -23,6 +32,21 @@ struct iommu_group;
struct iommu_domain;
struct reset_control;
struct dma_buf_attachment;
struct tegra_vde_h264_frame;
struct tegra_vde_h264_decoder_ctx;
struct tegra_video_frame {
struct dma_buf_attachment *y_dmabuf_attachment;
struct dma_buf_attachment *cb_dmabuf_attachment;
struct dma_buf_attachment *cr_dmabuf_attachment;
struct dma_buf_attachment *aux_dmabuf_attachment;
dma_addr_t y_addr;
dma_addr_t cb_addr;
dma_addr_t cr_addr;
dma_addr_t aux_addr;
u32 frame_num;
u32 flags;
};
struct tegra_vde_soc {
bool supports_ref_pic_marking;
......@@ -50,6 +74,7 @@ struct tegra_vde {
void __iomem *ppb;
void __iomem *vdma;
void __iomem *frameid;
struct device *dev;
struct mutex lock;
struct mutex map_lock;
struct list_head map_list;
......@@ -66,10 +91,27 @@ struct tegra_vde {
struct iova *iova_resv_last_page;
const struct tegra_vde_soc *soc;
struct tegra_vde_bo *secure_bo;
dma_addr_t bitstream_data_addr;
dma_addr_t iram_lists_addr;
u32 *iram;
};
void tegra_vde_writel(struct tegra_vde *vde, u32 value, void __iomem *base,
u32 offset);
u32 tegra_vde_readl(struct tegra_vde *vde, void __iomem *base, u32 offset);
void tegra_vde_set_bits(struct tegra_vde *vde, u32 mask, void __iomem *base,
u32 offset);
int tegra_vde_validate_h264_frame(struct device *dev,
struct tegra_vde_h264_frame *frame);
int tegra_vde_validate_h264_ctx(struct device *dev,
struct tegra_vde_h264_decoder_ctx *ctx);
int tegra_vde_decode_h264(struct tegra_vde *vde,
struct tegra_vde_h264_decoder_ctx *ctx,
struct tegra_video_frame *dpb_frames,
dma_addr_t bitstream_data_addr,
size_t bitstream_data_size);
int tegra_vde_iommu_init(struct tegra_vde *vde);
void tegra_vde_iommu_deinit(struct tegra_vde *vde);
int tegra_vde_iommu_map(struct tegra_vde *vde,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment