mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-29 13:46:49 +00:00
Merge pull request #4075 from lrusak/generic_legacy
New Project - Nvidia-Legacy
This commit is contained in:
commit
0fd552ba8f
@ -35,6 +35,11 @@ get_graphicdrivers() {
|
|||||||
VDPAU_SUPPORT="yes"
|
VDPAU_SUPPORT="yes"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "$drv" = "nvidia-legacy" ]; then
|
||||||
|
XORG_DRIVERS="$XORG_DRIVERS nvidia-legacy"
|
||||||
|
VDPAU_SUPPORT="yes"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "$drv" = "r200" ]; then
|
if [ "$drv" = "r200" ]; then
|
||||||
DRI_DRIVERS="$DRI_DRIVERS,r200"
|
DRI_DRIVERS="$DRI_DRIVERS,r200"
|
||||||
XORG_DRIVERS="$XORG_DRIVERS ati"
|
XORG_DRIVERS="$XORG_DRIVERS ati"
|
||||||
|
@ -0,0 +1,33 @@
|
|||||||
|
Section "Device"
|
||||||
|
Identifier "nvidia"
|
||||||
|
Driver "nvidia"
|
||||||
|
Option "DynamicTwinView" "False"
|
||||||
|
Option "NoFlip" "false"
|
||||||
|
Option "NoLogo" "true"
|
||||||
|
Option "ConnectToAcpid" "0"
|
||||||
|
Option "ModeValidation" "NoVesaModes, NoXServerModes"
|
||||||
|
Option "HWCursor" "false"
|
||||||
|
# To put Xorg in debug mode change "false" to "true" in the line below:
|
||||||
|
Option "ModeDebug" "false"
|
||||||
|
# To use a local edid.bin file uncomment the 4 lines below (change DFP-0 to match your card)
|
||||||
|
# Option "ConnectedMonitor" "DFP-0"
|
||||||
|
# Option "CustomEDID" "DFP-0:/storage/.config/edid.bin"
|
||||||
|
# Option "IgnoreEDID" "false"
|
||||||
|
# Option "UseEDID" "true"
|
||||||
|
EndSection
|
||||||
|
|
||||||
|
Section "Screen"
|
||||||
|
Identifier "screen"
|
||||||
|
Device "nvidia"
|
||||||
|
DefaultDepth 24
|
||||||
|
Option "ColorRange" "Full"
|
||||||
|
# Option "ColorRange" "Limited"
|
||||||
|
# Option "ColorSpace" "RGB"
|
||||||
|
SubSection "Display"
|
||||||
|
Depth 24
|
||||||
|
EndSubSection
|
||||||
|
EndSection
|
||||||
|
|
||||||
|
Section "Extensions"
|
||||||
|
Option "Composite" "false"
|
||||||
|
EndSection
|
80
packages/x11/driver/xf86-video-nvidia-legacy/package.mk
Normal file
80
packages/x11/driver/xf86-video-nvidia-legacy/package.mk
Normal file
@ -0,0 +1,80 @@
|
|||||||
|
################################################################################
|
||||||
|
# This file is part of OpenELEC - http://www.openelec.tv
|
||||||
|
# Copyright (C) 2009-2014 Stephan Raue (stephan@openelec.tv)
|
||||||
|
#
|
||||||
|
# OpenELEC is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 2 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# OpenELEC is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with OpenELEC. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
PKG_NAME="xf86-video-nvidia-legacy"
|
||||||
|
PKG_VERSION="304.125"
|
||||||
|
PKG_REV="1"
|
||||||
|
PKG_ARCH="x86_64"
|
||||||
|
PKG_LICENSE="nonfree"
|
||||||
|
PKG_SITE="http://www.nvidia.com/"
|
||||||
|
PKG_URL="http://us.download.nvidia.com/XFree86/Linux-x86_64/$PKG_VERSION/NVIDIA-Linux-x86_64-$PKG_VERSION-no-compat32.run"
|
||||||
|
PKG_DEPENDS_TARGET="toolchain util-macros linux xorg-server libvdpau"
|
||||||
|
PKG_NEED_UNPACK="$LINUX_DEPENDS"
|
||||||
|
PKG_PRIORITY="optional"
|
||||||
|
PKG_SECTION="x11/driver"
|
||||||
|
PKG_SHORTDESC="xf86-video-nvidia-legacy: The Xorg driver for NVIDIA video chips supporting Geforce 6 and Geforce 7 devices too"
|
||||||
|
PKG_LONGDESC="These binary drivers provide optimized hardware acceleration of OpenGL applications via a direct-rendering X Server. AGP, PCIe, SLI, TV-out and flat panel displays are also supported. This version only supports GeForce 6xxx and higher of the Geforce GPUs plus complimentary Quadros and nforce."
|
||||||
|
|
||||||
|
PKG_IS_ADDON="no"
|
||||||
|
PKG_AUTORECONF="no"
|
||||||
|
|
||||||
|
unpack() {
|
||||||
|
NV_PKG="`echo $PKG_URL | sed 's%.*/\(.*\)$%\1%'`"
|
||||||
|
[ -d $PKG_BUILD ] && rm -rf $PKG_BUILD
|
||||||
|
|
||||||
|
sh $SOURCES/$PKG_NAME/$NV_PKG --extract-only --target $BUILD/$PKG_NAME-$PKG_VERSION
|
||||||
|
}
|
||||||
|
|
||||||
|
make_target() {
|
||||||
|
unset LDFLAGS
|
||||||
|
|
||||||
|
cd kernel
|
||||||
|
make module CC=$CC SYSSRC=$(kernel_path) SYSOUT=$(kernel_path)
|
||||||
|
cd ..
|
||||||
|
}
|
||||||
|
|
||||||
|
makeinstall_target() {
|
||||||
|
mkdir -p $INSTALL/$XORG_PATH_MODULES/drivers
|
||||||
|
cp -P nvidia_drv.so $INSTALL/$XORG_PATH_MODULES/drivers
|
||||||
|
|
||||||
|
mkdir -p $INSTALL/$XORG_PATH_MODULES/extensions
|
||||||
|
# rename to not conflicting with Mesa libGL.so
|
||||||
|
cp -P libglx.so* $INSTALL/$XORG_PATH_MODULES/extensions/libglx_nvidia.so
|
||||||
|
|
||||||
|
mkdir -p $INSTALL/etc/X11
|
||||||
|
cp $PKG_DIR/config/*.conf $INSTALL/etc/X11
|
||||||
|
|
||||||
|
mkdir -p $INSTALL/usr/lib
|
||||||
|
cp -P libnvidia-glcore.so.$PKG_VERSION $INSTALL/usr/lib
|
||||||
|
cp -P libnvidia-ml.so.$PKG_VERSION $INSTALL/usr/lib
|
||||||
|
ln -sf libnvidia-ml.so.$PKG_VERSION $INSTALL/usr/lib/libnvidia-ml.so.1
|
||||||
|
cp -P tls/libnvidia-tls.so.$PKG_VERSION $INSTALL/usr/lib
|
||||||
|
# rename to not conflicting with Mesa libGL.so
|
||||||
|
cp -P libGL.so* $INSTALL/usr/lib/libGL_nvidia.so.1
|
||||||
|
|
||||||
|
mkdir -p $INSTALL/lib/modules/$(get_module_dir)/nvidia
|
||||||
|
cp kernel/nvidia.ko $INSTALL/lib/modules/$(get_module_dir)/nvidia
|
||||||
|
|
||||||
|
mkdir -p $INSTALL/usr/bin
|
||||||
|
cp nvidia-smi $INSTALL/usr/bin
|
||||||
|
cp nvidia-xconfig $INSTALL/usr/bin
|
||||||
|
|
||||||
|
mkdir -p $INSTALL/usr/lib/vdpau
|
||||||
|
cp libvdpau_nvidia.so* $INSTALL/usr/lib/vdpau/libvdpau_nvidia.so.1
|
||||||
|
ln -sf libvdpau_nvidia.so.1 $INSTALL/usr/lib/vdpau/libvdpau_nvidia.so
|
||||||
|
}
|
@ -0,0 +1,30 @@
|
|||||||
|
diff -Naur xf86-video-nvidia-legacy-304.125/kernel/nv.c xf86-video-nvidia-legacy-304.125.patch/kernel/nv.c
|
||||||
|
--- xf86-video-nvidia-legacy-304.125/kernel/nv.c 2014-12-02 04:55:59.000000000 +0100
|
||||||
|
+++ xf86-video-nvidia-legacy-304.125.patch/kernel/nv.c 2015-02-11 19:07:09.844431593 +0100
|
||||||
|
@@ -17,7 +17,7 @@
|
||||||
|
#include "rmil.h"
|
||||||
|
|
||||||
|
#if defined(MODULE_LICENSE)
|
||||||
|
-MODULE_LICENSE("NVIDIA");
|
||||||
|
+MODULE_LICENSE("GPL\0NVIDIA");
|
||||||
|
#endif
|
||||||
|
#if defined(MODULE_INFO)
|
||||||
|
MODULE_INFO(supported, "external");
|
||||||
|
@@ -2026,7 +2026,7 @@
|
||||||
|
unsigned long i_arg
|
||||||
|
)
|
||||||
|
{
|
||||||
|
- return nv_kern_ioctl(file->f_dentry->d_inode, file, cmd, i_arg);
|
||||||
|
+ return nv_kern_ioctl(file->f_path.dentry->d_inode, file, cmd, i_arg);
|
||||||
|
}
|
||||||
|
|
||||||
|
long nv_kern_compat_ioctl(
|
||||||
|
@@ -2035,7 +2035,7 @@
|
||||||
|
unsigned long i_arg
|
||||||
|
)
|
||||||
|
{
|
||||||
|
- return nv_kern_ioctl(file->f_dentry->d_inode, file, cmd, i_arg);
|
||||||
|
+ return nv_kern_ioctl(file->f_path.dentry->d_inode, file, cmd, i_arg);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
@ -0,0 +1,29 @@
|
|||||||
|
diff -Naur NVIDIA-Linux-x86_64-340.76-no-compat32/kernel/nv-pat.c NVIDIA-Linux-x86_64-340.76-no-compat32.patch/kernel/nv-pat.c
|
||||||
|
--- NVIDIA-Linux-x86_64-340.76-no-compat32/kernel/nv-pat.c 2015-01-22 20:01:16.000000000 +0100
|
||||||
|
+++ NVIDIA-Linux-x86_64-340.76-no-compat32.patch/kernel/nv-pat.c 2015-04-04 19:16:01.931219988 +0200
|
||||||
|
@@ -35,8 +35,13 @@
|
||||||
|
unsigned long cr0 = read_cr0();
|
||||||
|
write_cr0(((cr0 & (0xdfffffff)) | 0x40000000));
|
||||||
|
wbinvd();
|
||||||
|
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 20, 0)
|
||||||
|
*cr4 = read_cr4();
|
||||||
|
if (*cr4 & 0x80) write_cr4(*cr4 & ~0x80);
|
||||||
|
+#else
|
||||||
|
+ *cr4 = __read_cr4();
|
||||||
|
+ if (*cr4 & 0x80) __write_cr4(*cr4 & ~0x80);
|
||||||
|
+#endif
|
||||||
|
__flush_tlb();
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -46,7 +51,11 @@
|
||||||
|
wbinvd();
|
||||||
|
__flush_tlb();
|
||||||
|
write_cr0((cr0 & 0x9fffffff));
|
||||||
|
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 20, 0)
|
||||||
|
if (cr4 & 0x80) write_cr4(cr4);
|
||||||
|
+#else
|
||||||
|
+ if (cr4 & 0x80) __write_cr4(cr4);
|
||||||
|
+#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
static int nv_determine_pat_mode(void)
|
4351
projects/Nvidia-Legacy/linux/linux.x86_64.conf
Normal file
4351
projects/Nvidia-Legacy/linux/linux.x86_64.conf
Normal file
File diff suppressed because one or more lines are too long
107
projects/Nvidia-Legacy/options
Normal file
107
projects/Nvidia-Legacy/options
Normal file
@ -0,0 +1,107 @@
|
|||||||
|
################################################################################
|
||||||
|
# setup system defaults
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
# The TARGET_CPU variable controls which processor should be targeted for
|
||||||
|
# generated code.
|
||||||
|
case $TARGET_ARCH in
|
||||||
|
x86_64)
|
||||||
|
# (AMD CPUs) k8 k8-sse3 opteron opteron-sse3 athlon64 athlon64-sse3
|
||||||
|
# athlon-fx amdfam10 barcelona
|
||||||
|
# (Intel CPUs) atom core2 nocona
|
||||||
|
#
|
||||||
|
TARGET_CPU="x86-64"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# Bootloader to use (syslinux / u-boot)
|
||||||
|
BOOTLOADER="syslinux"
|
||||||
|
|
||||||
|
# u-boot version to use (default)
|
||||||
|
UBOOT_VERSION="default"
|
||||||
|
|
||||||
|
# Configuration for u-boot
|
||||||
|
UBOOT_CONFIG=""
|
||||||
|
|
||||||
|
# Target Configfile for u-boot
|
||||||
|
UBOOT_CONFIGFILE=""
|
||||||
|
|
||||||
|
# Kernel target for u-boot (default 'uImage' if BOOTLOADER=u-boot) (uImage / zImage)
|
||||||
|
KERNEL_UBOOT_TARGET=""
|
||||||
|
|
||||||
|
# Kernel extra targets to build
|
||||||
|
KERNEL_UBOOT_EXTRA_TARGET=""
|
||||||
|
|
||||||
|
# Additional kernel make parameters (for example to specify the u-boot loadaddress)
|
||||||
|
KERNEL_MAKE_EXTRACMD=""
|
||||||
|
|
||||||
|
# Kernel to use. values can be:
|
||||||
|
# default: default mainline kernel
|
||||||
|
LINUX="default"
|
||||||
|
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# setup build defaults
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
# Build optimizations (size/normal)
|
||||||
|
OPTIMIZATIONS="size"
|
||||||
|
|
||||||
|
# Project CFLAGS
|
||||||
|
PROJECT_CFLAGS="-mmmx -msse -msse2 -mfpmath=sse"
|
||||||
|
|
||||||
|
# LTO (Link Time Optimization) support
|
||||||
|
LTO_SUPPORT="yes"
|
||||||
|
|
||||||
|
# GOLD (Google Linker) support
|
||||||
|
GOLD_SUPPORT="yes"
|
||||||
|
|
||||||
|
# SquashFS compression method (gzip / lzo / xz)
|
||||||
|
SQUASHFS_COMPRESSION="gzip"
|
||||||
|
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# setup project defaults
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
# build and install ALSA Audio support (yes / no)
|
||||||
|
ALSA_SUPPORT="yes"
|
||||||
|
|
||||||
|
# OpenGL(X) implementation to use (no / mesa)
|
||||||
|
OPENGL="mesa"
|
||||||
|
|
||||||
|
# OpenGL-ES implementation to use (no / bcm2835-driver / gpu-viv-bin-mx6q)
|
||||||
|
OPENGLES="no"
|
||||||
|
|
||||||
|
# include uvesafb support (yes / no)
|
||||||
|
UVESAFB_SUPPORT="yes"
|
||||||
|
|
||||||
|
# Displayserver to use (x11 / no)
|
||||||
|
DISPLAYSERVER="x11"
|
||||||
|
|
||||||
|
# KODI Player implementation to use (default / bcm2835-driver / libfslvpuwrap)
|
||||||
|
KODIPLAYER_DRIVER="default"
|
||||||
|
|
||||||
|
# KODI DCADEC support (yes / no)
|
||||||
|
DCADEC_SUPPORT="no"
|
||||||
|
|
||||||
|
# Modules to install in initramfs for early boot
|
||||||
|
INITRAMFS_MODULES=""
|
||||||
|
|
||||||
|
# additional Firmware to use (dvb-firmware, misc-firmware, wlan-firmware)
|
||||||
|
# Space separated list is supported,
|
||||||
|
# e.g. FIRMWARE="dvb-firmware misc-firmware wlan-firmware"
|
||||||
|
FIRMWARE="misc-firmware wlan-firmware dvb-firmware iwlwifi-firmware"
|
||||||
|
|
||||||
|
# additional drivers to install:
|
||||||
|
# for a list of additinoal drivers see packages/linux-drivers
|
||||||
|
# Space separated list is supported,
|
||||||
|
# e.g. ADDITIONAL_DRIVERS="DRIVER1 DRIVER2"
|
||||||
|
ADDITIONAL_DRIVERS="$ADDITIONAL_DRIVERS mt7601u"
|
||||||
|
|
||||||
|
# Xorg Graphic drivers to use (all / i915,i965,r200,r300,r600,nvidia)
|
||||||
|
GRAPHIC_DRIVERS="i915 nvidia-legacy"
|
||||||
|
|
||||||
|
# set the addon dirs (use Generic project add-ons)
|
||||||
|
ADDON_PATH="$ADDON_VERSION/Generic/$TARGET_ARCH"
|
||||||
|
ADDON_URL="$ADDON_SERVER_URL/$ADDON_PATH"
|
Loading…
x
Reference in New Issue
Block a user