mirror of
https://github.com/void-linux/void-packages.git
synced 2025-08-01 18:32:58 +02:00
parent
5eef922b9e
commit
c4187e76d7
3 changed files with 114 additions and 1 deletions
44
srcpkgs/nvidia/files/0001-linux-4.7-i686.patch
Normal file
44
srcpkgs/nvidia/files/0001-linux-4.7-i686.patch
Normal file
|
@ -0,0 +1,44 @@
|
|||
--- kernel/nvidia-drm/nvidia-drm-fb.c.orig
|
||||
+++ kernel/nvidia-drm/nvidia-drm-fb.c
|
||||
@@ -31,6 +31,7 @@
|
||||
#include "nvidia-drm-gem.h"
|
||||
|
||||
#include <drm/drm_crtc_helper.h>
|
||||
+#include <linux/version.h>
|
||||
|
||||
static void nvidia_framebuffer_destroy(struct drm_framebuffer *fb)
|
||||
{
|
||||
@@ -114,7 +115,11 @@
|
||||
* We don't support any planar format, pick up first buffer only.
|
||||
*/
|
||||
|
||||
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0)
|
||||
+ gem = drm_gem_object_lookup(file, cmd->handles[0]);
|
||||
+#else
|
||||
gem = drm_gem_object_lookup(dev, file, cmd->handles[0]);
|
||||
+#endif
|
||||
|
||||
if (gem == NULL)
|
||||
{
|
||||
--- kernel/nvidia-drm/nvidia-drm-gem.c.orig
|
||||
+++ kernel/nvidia-drm/nvidia-drm-gem.c
|
||||
@@ -27,6 +27,7 @@
|
||||
#include "nvidia-drm-priv.h"
|
||||
#include "nvidia-drm-ioctl.h"
|
||||
#include "nvidia-drm-gem.h"
|
||||
+#include <linux/version.h>
|
||||
|
||||
static struct nvidia_drm_gem_object *nvidia_drm_gem_new
|
||||
(
|
||||
@@ -408,7 +409,11 @@
|
||||
|
||||
mutex_lock(&dev->struct_mutex);
|
||||
|
||||
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0)
|
||||
+ gem = drm_gem_object_lookup(file, handle);
|
||||
+#else
|
||||
gem = drm_gem_object_lookup(dev, file, handle);
|
||||
+#endif
|
||||
|
||||
if (gem == NULL)
|
||||
{
|
61
srcpkgs/nvidia/files/0001-linux-4.7-x86_64.patch
Normal file
61
srcpkgs/nvidia/files/0001-linux-4.7-x86_64.patch
Normal file
|
@ -0,0 +1,61 @@
|
|||
--- kernel/nvidia-drm/nvidia-drm-fb.c.orig
|
||||
+++ kernel/nvidia-drm/nvidia-drm-fb.c
|
||||
@@ -31,6 +31,7 @@
|
||||
#include "nvidia-drm-gem.h"
|
||||
|
||||
#include <drm/drm_crtc_helper.h>
|
||||
+#include <linux/version.h>
|
||||
|
||||
static void nvidia_framebuffer_destroy(struct drm_framebuffer *fb)
|
||||
{
|
||||
@@ -114,7 +115,11 @@
|
||||
* We don't support any planar format, pick up first buffer only.
|
||||
*/
|
||||
|
||||
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0)
|
||||
+ gem = drm_gem_object_lookup(file, cmd->handles[0]);
|
||||
+#else
|
||||
gem = drm_gem_object_lookup(dev, file, cmd->handles[0]);
|
||||
+#endif
|
||||
|
||||
if (gem == NULL)
|
||||
{
|
||||
--- kernel/nvidia-drm/nvidia-drm-gem.c.orig
|
||||
+++ kernel/nvidia-drm/nvidia-drm-gem.c
|
||||
@@ -27,6 +27,7 @@
|
||||
#include "nvidia-drm-priv.h"
|
||||
#include "nvidia-drm-ioctl.h"
|
||||
#include "nvidia-drm-gem.h"
|
||||
+#include <linux/version.h>
|
||||
|
||||
static struct nvidia_drm_gem_object *nvidia_drm_gem_new
|
||||
(
|
||||
@@ -408,7 +409,11 @@
|
||||
|
||||
mutex_lock(&dev->struct_mutex);
|
||||
|
||||
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0)
|
||||
+ gem = drm_gem_object_lookup(file, handle);
|
||||
+#else
|
||||
gem = drm_gem_object_lookup(dev, file, handle);
|
||||
+#endif
|
||||
|
||||
if (gem == NULL)
|
||||
{
|
||||
--- kernel/nvidia-uvm/uvm_linux.h.orig
|
||||
+++ kernel/nvidia-uvm/uvm_linux.h
|
||||
@@ -554,12 +554,13 @@
|
||||
INIT_RADIX_TREE(tree, GFP_NOWAIT);
|
||||
}
|
||||
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,7,0)
|
||||
static bool radix_tree_empty(struct radix_tree_root *tree)
|
||||
{
|
||||
void *dummy;
|
||||
return radix_tree_gang_lookup(tree, &dummy, 0, 1) == 0;
|
||||
}
|
||||
-
|
||||
+#endif
|
||||
|
||||
#if !defined(NV_USLEEP_RANGE_PRESENT)
|
||||
static void __sched usleep_range(unsigned long min, unsigned long max)
|
|
@ -4,7 +4,7 @@ _desc="NVIDIA drivers for linux (long-lived series)"
|
|||
|
||||
pkgname=nvidia
|
||||
version=367.35
|
||||
revision=1
|
||||
revision=2
|
||||
maintainer="Juan RP <xtraeme@voidlinux.eu>"
|
||||
license="Proprietary NVIDIA license"
|
||||
homepage="http://www.nvidia.com"
|
||||
|
@ -39,6 +39,14 @@ do_extract() {
|
|||
./${_pkg}.run --extract-only
|
||||
rm -f ${_pkg}.run
|
||||
}
|
||||
do_configure() {
|
||||
cd ${_pkg}
|
||||
# patches
|
||||
case "$XBPS_TARGET_MACHINE" in
|
||||
i686) patch -sNp0 -i ${FILESDIR}/0001-linux-4.7-i686.patch;;
|
||||
x86_64) patch -sNp0 -i ${FILESDIR}/0001-linux-4.7-x86_64.patch;;
|
||||
esac
|
||||
}
|
||||
do_install() {
|
||||
cd ${_pkg}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue