fthd: Use more of the defines

Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
This commit is contained in:
Patrik Jakobsson
2016-10-21 22:31:00 +02:00
parent 8bd05c560c
commit fe103720f4
3 changed files with 13 additions and 12 deletions

View File

@@ -126,7 +126,7 @@ int fthd_buffer_init(struct fthd_private *dev_priv)
{
int i;
for (i = 0; i < 0x1000; i++)
for (i = 0; i < S2_PAGE_SIZE; i++)
FTHD_S2_REG_WRITE(0, S2_IOMMU_BASE_ADDR + i * 4);
return iommu_allocator_init(dev_priv);

View File

@@ -21,6 +21,7 @@
#define FTHD_BUFFER_H
#include <linux/scatterlist.h>
#include "fthd_drv.h"
#include "fthd_buffer.h"
enum fthd_buffer_state {
@@ -45,7 +46,7 @@ struct dma_descriptor {
struct dma_descriptor_list {
u32 field0;
u32 count;
struct dma_descriptor desc[4];
struct dma_descriptor desc[FTHD_NUM_BUFS];
char unknown[216];
} __attribute__((packed));
@@ -66,7 +67,7 @@ struct fthd_plane {
struct h2t_buf_ctx {
enum fthd_buffer_state state;
struct vb2_buffer *vb;
struct iommu_obj *plane[4];
struct iommu_obj *plane[FTHD_NUM_BUFS];
struct isp_mem_obj *dma_desc_obj;
struct dma_descriptor_list dma_desc_list;
/* waitqueue for signaling buffer completion */

View File

@@ -21,6 +21,15 @@
#ifndef _FTHD_DRV_H
#define _FTHD_DRV_H
#define FTHD_PCI_S2_IO 0
#define FTHD_PCI_S2_MEM 2
#define FTHD_PCI_ISP_IO 4
#define FTHD_NUM_BUFS 4
#define S2_PAGE_SIZE 4096
#define S2_PAGE_SHIFT 12
#include <linux/pci.h>
#include <linux/spinlock.h>
#include <linux/wait.h>
@@ -33,15 +42,6 @@
#include "fthd_buffer.h"
#include "fthd_v4l2.h"
#define FTHD_PCI_S2_IO 0
#define FTHD_PCI_S2_MEM 2
#define FTHD_PCI_ISP_IO 4
#define FTHD_NUM_BUFS 4
#define S2_PAGE_SIZE 4096
#define S2_PAGE_SHIFT 12
enum FW_CHAN_TYPE {
FW_CHAN_TYPE_OUT=0,
FW_CHAN_TYPE_IN=1,