summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorOle Ernst2015-07-31 20:14:09 +0200
committerOle Ernst2015-07-31 20:14:09 +0200
commit8169d10fdf96e06050584bbd0d031456c8896263 (patch)
treedd93300117f5845bba322c21c6e01b32ad002eae
parent6edffc5395ec38f687d580acf2a66ca4553b4716 (diff)
downloadaur-8169d10fdf96e06050584bbd0d031456c8896263.tar.gz
fix build against 4.1.x kernel, cleanup cont'd
-rw-r--r--.SRCINFO6
-rw-r--r--PKGBUILD9
-rw-r--r--add_c2800e.patch21
-rw-r--r--dma_buf_export.patch116
4 files changed, 135 insertions, 17 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 04029b1832c9..f93cbdc0b5db 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = media-build-dvbsky
pkgdesc = Driver for DVBSky cards/boxes
pkgver = 20150322
- pkgrel = 3
+ pkgrel = 4
url = http://www.dvbsky.net/Support_linux.html
install = media-build-dvbsky.install
arch = i686
@@ -14,8 +14,10 @@ pkgbase = media-build-dvbsky
replaces = dvbsky-dvb-drivers
source = http://dvbsky.net/download/linux/media_build-bst-150322.tar.gz
source = add_c2800e.patch
+ source = dma_buf_export.patch
sha256sums = fd4acd06d2a4a5d5987393d68979aaf8832f5b21ae828ea6a50baca998cd89c7
- sha256sums = 4a8b9dfc3e3d1a915c9f381dd8fdfbf9975586547a0ab553d0152b8aad11ae9b
+ sha256sums = bdb4cb06418cb2e36eb3219b4d4be329d5297db1704e6e3ef0c73dd6bb9721f1
+ sha256sums = da27997a54a1dd805c7177ccc930a86ae7d3042a46926f89109d2c692995329a
pkgname = media-build-dvbsky
diff --git a/PKGBUILD b/PKGBUILD
index 66c3d5e8d072..5fedeccad286 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,7 +1,7 @@
# Maintainer: Ole Ernst <olebowle[at]gmx[dot]com>
pkgname=media-build-dvbsky
pkgver=20150322
-pkgrel=3
+pkgrel=4
pkgdesc="Driver for DVBSky cards/boxes"
arch=('i686' 'x86_64')
url="http://www.dvbsky.net/Support_linux.html"
@@ -12,9 +12,11 @@ conflicts=('dvbsky-dvb-drivers')
replaces=('dvbsky-dvb-drivers')
install="$pkgname.install"
source=("http://dvbsky.net/download/linux/media_build-bst-150322.tar.gz"
- 'add_c2800e.patch')
+ 'add_c2800e.patch'
+ 'dma_buf_export.patch')
sha256sums=('fd4acd06d2a4a5d5987393d68979aaf8832f5b21ae828ea6a50baca998cd89c7'
- '4a8b9dfc3e3d1a915c9f381dd8fdfbf9975586547a0ab553d0152b8aad11ae9b')
+ 'bdb4cb06418cb2e36eb3219b4d4be329d5297db1704e6e3ef0c73dd6bb9721f1'
+ 'da27997a54a1dd805c7177ccc930a86ae7d3042a46926f89109d2c692995329a')
#server doesn't like curl user agent
DLAGENTS="$( IFS=$'\n'; echo "${DLAGENTS[*]}" | grep '^http::' ) --user-agent 'Mozilla/4.0'"
@@ -27,6 +29,7 @@ prepare() {
sed -i -e "s|/sbin/lsmod|$(which lsmod)|" -e 's|/sbin/depmod|#/sbin/depmod|' v4l/Makefile
sed -i 's|/sbin/depmod|#/sbin/depmod|' v4l/scripts/make_makefile.pl
patch -p1 -i ../add_c2800e.patch
+ patch -p1 -i ../dma_buf_export.patch
}
build() {
diff --git a/add_c2800e.patch b/add_c2800e.patch
index 9101bb0e59de..3121d714b4e9 100644
--- a/add_c2800e.patch
+++ b/add_c2800e.patch
@@ -12,7 +12,7 @@
};
const unsigned int cx23885_bcount = ARRAY_SIZE(cx23885_boards);
-@@ -989,7 +994,13 @@ struct cx23885_subid cx23885_subids[] =
+@@ -989,6 +994,10 @@ struct cx23885_subid cx23885_subids[] =
.subvendor = 0x4254,
.subdevice = 0x0982,
.card = CX23885_BOARD_DVBSKY_T982,
@@ -21,20 +21,17 @@
+ .subdevice = 0x2800,
+ .card = CX23885_BOARD_DVBSKY_C2800E_CI,
},
-+
-+
};
const unsigned int cx23885_idcount = ARRAY_SIZE(cx23885_subids);
-
-@@ -1595,6 +1606,7 @@ void cx23885_gpio_setup(struct cx23885_d
- break;
+@@ -1596,6 +1605,7 @@ void cx23885_gpio_setup(struct cx23885_d
case CX23885_BOARD_DVBSKY_T980C:
case CX23885_BOARD_DVBSKY_S950C:
-+ case CX23885_BOARD_DVBSKY_C2800E_CI:
case CX23885_BOARD_TT_CT2_4500_CI:
++ case CX23885_BOARD_DVBSKY_C2800E_CI:
/*
* GPIO-0 INTA from CiMax, input
-@@ -1719,6 +1731,7 @@ int cx23885_ir_init(struct cx23885_dev *
+ * GPIO-1 reset CiMax, output, high active
+@@ -1719,6 +1729,7 @@ int cx23885_ir_init(struct cx23885_dev *
case CX23885_BOARD_DVBSKY_S950:
case CX23885_BOARD_DVBSKY_S952:
case CX23885_BOARD_DVBSKY_T982:
@@ -42,7 +39,7 @@
if (!enable_885_ir)
break;
dev->sd_ir = cx23885_find_hw(dev, CX23885_HW_AV_CORE);
-@@ -1772,6 +1785,7 @@ void cx23885_ir_fini(struct cx23885_dev
+@@ -1772,6 +1783,7 @@ void cx23885_ir_fini(struct cx23885_dev
case CX23885_BOARD_DVBSKY_S950:
case CX23885_BOARD_DVBSKY_S952:
case CX23885_BOARD_DVBSKY_T982:
@@ -50,7 +47,7 @@
cx23885_irq_remove(dev, PCI_MSK_AV_CORE);
/* sd_ir is a duplicate pointer to the AV Core, just clear it */
dev->sd_ir = NULL;
-@@ -1826,6 +1840,7 @@ void cx23885_ir_pci_int_enable(struct cx
+@@ -1826,6 +1838,7 @@ void cx23885_ir_pci_int_enable(struct cx
case CX23885_BOARD_DVBSKY_S950:
case CX23885_BOARD_DVBSKY_S952:
case CX23885_BOARD_DVBSKY_T982:
@@ -58,7 +55,7 @@
if (dev->sd_ir)
cx23885_irq_add_enable(dev, PCI_MSK_AV_CORE);
break;
-@@ -1933,6 +1948,7 @@ void cx23885_card_setup(struct cx23885_d
+@@ -1933,6 +1946,7 @@ void cx23885_card_setup(struct cx23885_d
case CX23885_BOARD_DVBSKY_S950C:
case CX23885_BOARD_TT_CT2_4500_CI:
case CX23885_BOARD_DVBSKY_S950:
@@ -66,7 +63,7 @@
ts1->gen_ctrl_val = 0x5; /* Parallel */
ts1->ts_clk_en_val = 0x1; /* Enable TS_CLK */
ts1->src_sel_val = CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO;
-@@ -2066,6 +2082,7 @@ void cx23885_card_setup(struct cx23885_d
+@@ -2066,6 +2080,7 @@ void cx23885_card_setup(struct cx23885_d
case CX23885_BOARD_DVBSKY_S950:
case CX23885_BOARD_DVBSKY_S952:
case CX23885_BOARD_DVBSKY_T982:
diff --git a/dma_buf_export.patch b/dma_buf_export.patch
new file mode 100644
index 000000000000..5fb4f5490af7
--- /dev/null
+++ b/dma_buf_export.patch
@@ -0,0 +1,116 @@
+--- a/linux/include/linux/dma-buf.h
++++ b/linux/include/linux/dma-buf.h
+@@ -163,6 +163,33 @@ struct dma_buf_attachment {
+ };
+
+ /**
++ * struct dma_buf_export_info - holds information needed to export a dma_buf
++ * @exp_name: name of the exporting module - useful for debugging.
++ * @ops: Attach allocator-defined dma buf ops to the new buffer
++ * @size: Size of the buffer
++ * @flags: mode flags for the file
++ * @resv: reservation-object, NULL to allocate default one
++ * @priv: Attach private data of allocator to this buffer
++ *
++ * This structure holds the information required to export the buffer. Used
++ * with dma_buf_export() only.
++ */
++struct dma_buf_export_info {
++ const char *exp_name;
++ const struct dma_buf_ops *ops;
++ size_t size;
++ int flags;
++ struct reservation_object *resv;
++ void *priv;
++};
++
++/**
++ * helper macro for exporters; zeros and fills in most common values
++ */
++#define DEFINE_DMA_BUF_EXPORT_INFO(a) \
++ struct dma_buf_export_info a = { .exp_name = KBUILD_MODNAME }
++
++/**
+ * get_dma_buf - convenience wrapper for get_file.
+ * @dmabuf: [in] pointer to dma_buf
+ *
+@@ -181,12 +208,7 @@ struct dma_buf_attachment *dma_buf_attac
+ void dma_buf_detach(struct dma_buf *dmabuf,
+ struct dma_buf_attachment *dmabuf_attach);
+
+-struct dma_buf *dma_buf_export_named(void *priv, const struct dma_buf_ops *ops,
+- size_t size, int flags, const char *,
+- struct reservation_object *);
+-
+-#define dma_buf_export(priv, ops, size, flags, resv) \
+- dma_buf_export_named(priv, ops, size, flags, KBUILD_MODNAME, resv)
++struct dma_buf *dma_buf_export(const struct dma_buf_export_info *exp_info);
+
+ int dma_buf_fd(struct dma_buf *dmabuf, int flags);
+ struct dma_buf *dma_buf_get(int fd);
+--- a/linux/drivers/media/v4l2-core/videobuf2-dma-contig.c
++++ b/linux/drivers/media/v4l2-core/videobuf2-dma-contig.c
+@@ -402,6 +402,12 @@ static struct dma_buf *vb2_dc_get_dmabuf
+ {
+ struct vb2_dc_buf *buf = buf_priv;
+ struct dma_buf *dbuf;
++ DEFINE_DMA_BUF_EXPORT_INFO(exp_info);
++
++ exp_info.ops = &vb2_dc_dmabuf_ops;
++ exp_info.size = buf->size;
++ exp_info.flags = flags;
++ exp_info.priv = buf;
+
+ if (!buf->sgt_base)
+ buf->sgt_base = vb2_dc_get_base_sgt(buf);
+@@ -409,7 +415,7 @@ static struct dma_buf *vb2_dc_get_dmabuf
+ if (WARN_ON(!buf->sgt_base))
+ return NULL;
+
+- dbuf = dma_buf_export(buf, &vb2_dc_dmabuf_ops, buf->size, flags, NULL);
++ dbuf = dma_buf_export(&exp_info);
+ if (IS_ERR(dbuf))
+ return NULL;
+
+--- a/linux/drivers/media/v4l2-core/videobuf2-dma-sg.c
++++ b/linux/drivers/media/v4l2-core/videobuf2-dma-sg.c
+@@ -583,11 +583,17 @@ static struct dma_buf *vb2_dma_sg_get_dm
+ {
+ struct vb2_dma_sg_buf *buf = buf_priv;
+ struct dma_buf *dbuf;
++ DEFINE_DMA_BUF_EXPORT_INFO(exp_info);
++
++ exp_info.ops = &vb2_dma_sg_dmabuf_ops;
++ exp_info.size = buf->size;
++ exp_info.flags = flags;
++ exp_info.priv = buf;
+
+ if (WARN_ON(!buf->dma_sgt))
+ return NULL;
+
+- dbuf = dma_buf_export(buf, &vb2_dma_sg_dmabuf_ops, buf->size, flags, NULL);
++ dbuf = dma_buf_export(&exp_info);
+ if (IS_ERR(dbuf))
+ return NULL;
+
+--- a/linux/drivers/media/v4l2-core/videobuf2-vmalloc.c
++++ b/linux/drivers/media/v4l2-core/videobuf2-vmalloc.c
+@@ -367,11 +367,17 @@ static struct dma_buf *vb2_vmalloc_get_d
+ {
+ struct vb2_vmalloc_buf *buf = buf_priv;
+ struct dma_buf *dbuf;
++ DEFINE_DMA_BUF_EXPORT_INFO(exp_info);
++
++ exp_info.ops = &vb2_vmalloc_dmabuf_ops;
++ exp_info.size = buf->size;
++ exp_info.flags = flags;
++ exp_info.priv = buf;
+
+ if (WARN_ON(!buf->vaddr))
+ return NULL;
+
+- dbuf = dma_buf_export(buf, &vb2_vmalloc_dmabuf_ops, buf->size, flags, NULL);
++ dbuf = dma_buf_export(&exp_info);
+ if (IS_ERR(dbuf))
+ return NULL;
+