commit da34867514d7354b134a18b60fd7c5c6782dbee0
Author: Nicolas Chauvet <kwizart(a)gmail.com>
Date: Mon Jul 23 13:54:36 2018 +0200
Add patch for 4.17
Linux-4.17-Compatibility.patch | 69 ++++++++++++++++++++++++++++++++++++++++++
crystalhd-kmod.spec | 13 ++++++--
2 files changed, 80 insertions(+), 2 deletions(-)
---
diff --git a/Linux-4.17-Compatibility.patch b/Linux-4.17-Compatibility.patch
new file mode 100644
index 0000000..63414b8
--- /dev/null
+++ b/Linux-4.17-Compatibility.patch
@@ -0,0 +1,69 @@
+From 6869e853d6b808bf7b3453e165e53d8810b0fd3b Mon Sep 17 00:00:00 2001
+From: Philip Langdale <philipl(a)overt.org>
+Date: Sun, 3 Jun 2018 19:41:25 -0700
+Subject: [PATCH] Linux 4.17 Compatibility
+
+---
+ driver/linux/crystalhd_fleafuncs.c | 12 ++++++++++++
+ driver/linux/crystalhd_hw.c | 4 ++++
+ 2 files changed, 16 insertions(+)
+
+diff --git a/driver/linux/crystalhd_fleafuncs.c b/driver/linux/crystalhd_fleafuncs.c
+index 6e4c0a7..0ba94db 100644
+--- a/driver/linux/crystalhd_fleafuncs.c
++++ b/driver/linux/crystalhd_fleafuncs.c
+@@ -513,7 +513,11 @@ void crystalhd_flea_runtime_power_up(struct crystalhd_hw *hw)
+
+ /*printk("RT Power Up Flea Complete\n"); */
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,17,0)
++ currTick = rdtsc_ordered();
++#else
+ rdtscll(currTick);
++#endif
+
+ hw->TickSpentInPD += (currTick - hw->TickStartInPD);
+
+@@ -735,7 +739,11 @@ void crystalhd_flea_runtime_power_dn(struct crystalhd_hw *hw)
+ /*printk("RT Power Down Flea Complete\n"); */
+
+ /* Measure how much time we spend in idle */
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,17,0)
++ hw->TickStartInPD = rdtsc_ordered();
++#else
+ rdtscll(hw->TickStartInPD);
++#endif
+
+ return;
+ }
+@@ -2874,7 +2882,11 @@ bool flea_GetPictureInfo(struct crystalhd_hw *hw, struct
crystalhd_rx_dma_pkt *
+ hw->PDRatio = 0; /* NAREN - reset PD ratio to start measuring for new clip */
+ hw->PauseThreshold = hw->DefaultPauseThreshold;
+ hw->TickSpentInPD = 0;
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,17,0)
++ hw->TickCntDecodePU = rdtsc_ordered();
++#else
+ rdtscll(hw->TickCntDecodePU);
++#endif
+
+ dev_dbg(dev, "[FMT CH] DoneSz:0x%x, PIB:%x %x %x %x %x %x %x %x %x %x\n",
+ rx_pkt->dio_req->uinfo.y_done_sz * 4,
+diff --git a/driver/linux/crystalhd_hw.c b/driver/linux/crystalhd_hw.c
+index d05c33e..8063860 100644
+--- a/driver/linux/crystalhd_hw.c
++++ b/driver/linux/crystalhd_hw.c
+@@ -655,7 +655,11 @@ BC_STATUS crystalhd_rx_pkt_done(struct crystalhd_hw *hw,
+ hw->PauseThreshold--;
+ }
+ else {
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,17,0)
++ currTick = rdtsc_ordered();
++#else
+ rdtscll(currTick);
++#endif
+
+ temp_64 = (hw->TickSpentInPD)>>24;
+ TickSpentInPD_Hi = (uint32_t)(temp_64);
+--
+2.17.1
+
diff --git a/crystalhd-kmod.spec b/crystalhd-kmod.spec
index 1f544e9..377aa90 100644
--- a/crystalhd-kmod.spec
+++ b/crystalhd-kmod.spec
@@ -4,13 +4,14 @@
Name: crystalhd-kmod
Summary: Kernel module (kmod) for crystalhd
Version: 20170515
-Release: 1%{?dist}
+Release: 2%{?dist}
License: GPLv2
-URL:
https://github.com/philipl/crystalhd.git
+URL:
https://github.com/philipl/crystalhd
Source0: crystalhd-kmod-%{version}.tar.xz
Source1: crystalhd-Makefile
Source2: crystalhd-Kconfig
Source11: crystalhd-kmodtool-excludekernel-filterfile
+Patch0: Linux-4.17-Compatibility.patch
# get the needed BuildRequires (in parts depending on what we build for)
BuildRequires: %{_bindir}/kmodtool
%{!?kernels:BuildRequires:
buildsys-build-rpmfusion-kerneldevpkgs-%{?buildforkernels:%{buildforkernels}}%{!?buildforkernels:current}-%{_target_cpu}
}
@@ -34,6 +35,11 @@ kmodtool --target %{_target_cpu} --repo rpmfusion --kmodname %{name}
%{?buildfo
#Copied from kernel sources
install -pm 0644 %{SOURCE1} drivers/staging/crystalhd/Makefile
install -pm 0644 %{SOURCE2} drivers/staging/crystalhd/Kconfig
+
+pushd drivers/staging/crystalhd/
+%patch0 -p3
+popd
+
for kernel_version in %{?kernel_versions} ; do
cp -a drivers/staging/crystalhd _kmod_build_${kernel_version%%___*}
done
@@ -59,6 +65,9 @@ done
%changelog
+* Mon Jul 23 2018 Nicolas Chauvet <kwizart(a)gmail.com> - 20170515-2
+- Add patch for 4.17
+
* Wed May 17 2017 Nicolas Chauvet <kwizart(a)gmail.com> - 20170515-1
- Update to 20170515