mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-08-02 07:27:49 +00:00
remove package xf86-video-fglrx
Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
parent
0d2fcfcd98
commit
3094c1cb01
@ -1,126 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
################################################################################
|
||||
# This file is part of OpenELEC - http://www.openelec.tv
|
||||
# Copyright (C) 2009-2012 Stephan Raue (stephan@openelec.tv)
|
||||
#
|
||||
# This Program 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, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# This Program 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.tv; see the file COPYING. If not, write to
|
||||
# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA.
|
||||
# http://www.gnu.org/copyleft/gpl.html
|
||||
################################################################################
|
||||
|
||||
. config/options $1
|
||||
|
||||
if [ "$TARGET_ARCH" = i386 ]; then
|
||||
FGLRX_ARCH=x86
|
||||
LIBDIR=lib
|
||||
BASEDIR=xpic
|
||||
elif [ "$TARGET_ARCH" = x86_64 ]; then
|
||||
FGLRX_ARCH=x86_64
|
||||
LIBDIR=lib64
|
||||
BASEDIR=xpic_64a
|
||||
fi
|
||||
|
||||
INSTALL_DIR=".install/usr/lib/fglrx/"
|
||||
|
||||
cd $PKG_BUILD/common/lib/modules/fglrx/build_mod
|
||||
ln -sf $ROOT/$PKG_BUILD/arch/$FGLRX_ARCH/lib/modules/fglrx/build_mod/libfglrx_ip.a .
|
||||
|
||||
cd 2.6.x
|
||||
sed -i -e 's/ -DPAGE_ATTR_FIX=/-DCOMPAT_ALLOC_USER_SPACE=arch_compat_alloc_user_space -DPAGE_ATTR_FIX=/' Makefile
|
||||
LDFLAGS="" make CC=${CC} KDIR=$(kernel_path)
|
||||
|
||||
cd $ROOT/$PKG_BUILD
|
||||
|
||||
# config files
|
||||
mkdir -p $INSTALL_DIR/etc/ati
|
||||
cp common/etc/ati/amdpcsdb.default $INSTALL_DIR/etc/ati
|
||||
cp common/etc/ati/control $INSTALL_DIR/etc/ati
|
||||
#cp common/etc/ati/signature $INSTALL_DIR/etc/ati
|
||||
echo "b707d1012f4412b1c0f865b95bee38e0:8e29e1311d692383f0c1578136c309d48f32e6326c6953e589d85d8b6edb0ad0:8f62e3384a752180f19c538069dd00d3d137b2301a732a80f3ce068a6bd75cd48f61e2334a722183f69b53806edd5dd58f3eb5391a202ad3f69d01db6b8f5cd0" > $INSTALL_DIR/etc/ati/signature
|
||||
ln -sf /storage/.config/fglrx.conf $INSTALL_DIR/etc/ati/amdpcsdb
|
||||
|
||||
(
|
||||
cd $INSTALL_DIR/
|
||||
for etc in `find etc -type f`; do
|
||||
mkdir -p $ROOT/$PKG_BUILD/.install/`dirname $etc`
|
||||
ln -sf /var/run/fglrx/$etc $ROOT/$PKG_BUILD/.install/$etc
|
||||
done
|
||||
ln -sf /var/run/fglrx/etc/ati/amdpcsdb $ROOT/$PKG_BUILD/.install/etc/ati/amdpcsdb
|
||||
)
|
||||
|
||||
# ATI config
|
||||
mkdir -p $INSTALL_DIR/bin
|
||||
cp -P arch/$FGLRX_ARCH/usr/X11R6/bin/aticonfig $INSTALL_DIR/bin
|
||||
|
||||
(
|
||||
cd $INSTALL_DIR/
|
||||
for bin in `find bin -type f`; do
|
||||
mkdir -p $ROOT/$PKG_BUILD/.install/usr/`dirname $bin`
|
||||
ln -sf /var/run/fglrx/$bin $ROOT/$PKG_BUILD/.install/usr/$bin
|
||||
done
|
||||
)
|
||||
|
||||
# OpenGL libs
|
||||
mkdir -p $INSTALL_DIR/lib
|
||||
# rename to not conflicting with Mesa libGL.so
|
||||
cp -P arch/$FGLRX_ARCH/usr/X11R6/$LIBDIR/fglrx/fglrx-libGL.so* $INSTALL_DIR/lib/libGL_fglrx.so.1
|
||||
|
||||
# System Libs
|
||||
mkdir -p $INSTALL_DIR/lib
|
||||
cp arch/$FGLRX_ARCH/usr/$LIBDIR/libati*.so $INSTALL_DIR/lib
|
||||
cp arch/$FGLRX_ARCH/usr/$LIBDIR/libatiuki.so* $INSTALL_DIR/lib/libatiuki.so.1
|
||||
cp arch/$FGLRX_ARCH/usr/X11R6/$LIBDIR/libati*.so* $INSTALL_DIR/lib
|
||||
cp arch/$FGLRX_ARCH/usr/X11R6/$LIBDIR/libfglrx*.so* $INSTALL_DIR/lib
|
||||
|
||||
# DRI driver
|
||||
mkdir -p $INSTALL_DIR/lib/dri
|
||||
cp arch/$FGLRX_ARCH/usr/X11R6/$LIBDIR/modules/dri/fglrx_dri.so* $INSTALL_DIR/lib/dri
|
||||
|
||||
# X.Org modules
|
||||
mkdir -p $INSTALL_DIR/lib/xorg/modules
|
||||
cp -P $BASEDIR/usr/X11R6/$LIBDIR/modules/*.so $INSTALL_DIR/lib/xorg/modules
|
||||
|
||||
mkdir -p $INSTALL_DIR/lib/xorg/modules/drivers
|
||||
cp -P $BASEDIR/usr/X11R6/$LIBDIR/modules/drivers/*_drv.so $INSTALL_DIR/lib/xorg/modules/drivers
|
||||
|
||||
mkdir -p $INSTALL_DIR/lib/xorg/modules/extensions
|
||||
cp -P $BASEDIR/usr/X11R6/$LIBDIR/modules/extensions/fglrx/fglrx-libglx.so $INSTALL_DIR/lib/xorg/modules/extensions/libglx_fglrx.so
|
||||
|
||||
mkdir -p $INSTALL_DIR/lib/xorg/modules/linux
|
||||
cp -P $BASEDIR/usr/X11R6/$LIBDIR/modules/linux/*.so $INSTALL_DIR/lib/xorg/modules/linux
|
||||
|
||||
# disabled until we can expect non broken drivers from AMD:
|
||||
# if [ "$XVBA" = yes ]; then
|
||||
# cp arch/$FGLRX_ARCH/usr/X11R6/$LIBDIR/libAMDXvBA.cap $INSTALL_DIR/lib
|
||||
# cp arch/$FGLRX_ARCH/usr/X11R6/$LIBDIR/libAMDXvBA.so* $INSTALL_DIR/lib/libAMDXvBA.so.1
|
||||
# cp arch/$FGLRX_ARCH/usr/X11R6/$LIBDIR/libXvBAW.so* $INSTALL_DIR/lib/libXvBAW.so.1
|
||||
|
||||
# # install needed files for toolchain
|
||||
# mkdir -p $SYSROOT_PREFIX/usr/include/amd
|
||||
# cp $PKG_DIR/source/amdxvba.h $SYSROOT_PREFIX/usr/include/amd
|
||||
|
||||
# mkdir -p $SYSROOT_PREFIX/usr/lib
|
||||
# cp arch/$FGLRX_ARCH/usr/X11R6/*/libXvBAW.so* $SYSROOT_PREFIX/usr/lib
|
||||
# ln -sf libXvBAW.so.1.0 $SYSROOT_PREFIX/usr/lib/libXvBAW.so.1
|
||||
# ln -sf libXvBAW.so.1 $SYSROOT_PREFIX/usr/lib/libXvBAW.so
|
||||
# fi
|
||||
|
||||
(
|
||||
cd $INSTALL_DIR/
|
||||
for lib in `find lib -type f`; do
|
||||
mkdir -p $ROOT/$PKG_BUILD/.install/usr/`dirname $lib`
|
||||
ln -sf /var/run/fglrx/$lib $ROOT/$PKG_BUILD/.install/usr/$lib
|
||||
done
|
||||
)
|
@ -1,22 +0,0 @@
|
||||
AMDPCSDBV1
|
||||
[AMDPCSROOT/SYSTEM/MCIL]
|
||||
DigitalHDTVDefaultUnderscan=V0
|
||||
UvdEnabled=V1
|
||||
|
||||
[AMDPCSROOT/SYSTEM/DDX]
|
||||
|
||||
DAL2_DATA__2_0\DisplayPath_1\default=R64
|
||||
DAL2_DATA__2_0\DisplayPath_1\Adjustment\default=R64
|
||||
DAL2_DATA__2_0\DisplayPath_1\Adjustment\All_nodes=R00
|
||||
DAL2_DATA__2_0\DisplayPath_1\Adjustment\RangeRgbLimited=R0100000000000000
|
||||
DAL2_DATA__2_0\DisplayPath_1\Option\default=R64
|
||||
DAL2_DATA__2_0\DisplayPath_1\Option\All_nodes=R42657374566965774F7074696F6E5F48646D6900
|
||||
DAL2_DATA__2_0\DisplayPath_1\Option\BestViewOption_Hdmi=R0000000000000000030000000100000008000000
|
||||
|
||||
DAL2_DATA__2_0\DisplayPath_2\default=R64
|
||||
DAL2_DATA__2_0\DisplayPath_2\Adjustment\default=R64
|
||||
DAL2_DATA__2_0\DisplayPath_2\Adjustment\All_nodes=R00
|
||||
DAL2_DATA__2_0\DisplayPath_2\Adjustment\RangeRgbLimited=R0100000000000000
|
||||
DAL2_DATA__2_0\DisplayPath_2\Option\default=R64
|
||||
DAL2_DATA__2_0\DisplayPath_2\Option\All_nodes=R42657374566965774F7074696F6E5F48646D6900
|
||||
DAL2_DATA__2_0\DisplayPath_2\Option\BestViewOption_Hdmi=R0000000000000000030000000100000008000000
|
@ -1,27 +0,0 @@
|
||||
Section "ServerLayout"
|
||||
Identifier "aticonfig Layout"
|
||||
Screen 0 "screen" 0 0
|
||||
EndSection
|
||||
|
||||
Section "Device"
|
||||
Identifier "fglrx"
|
||||
Driver "fglrx"
|
||||
Option "HWCursor" "false"
|
||||
EndSection
|
||||
|
||||
Section "DRI"
|
||||
Mode 0666
|
||||
EndSection
|
||||
|
||||
Section "Screen"
|
||||
Identifier "screen"
|
||||
Device "fglrx"
|
||||
DefaultDepth 24
|
||||
SubSection "Display"
|
||||
Depth 24
|
||||
EndSubSection
|
||||
EndSection
|
||||
|
||||
Section "Extensions"
|
||||
Option "Composite" "false"
|
||||
EndSection
|
@ -1,38 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
################################################################################
|
||||
# This file is part of OpenELEC - http://www.openelec.tv
|
||||
# Copyright (C) 2009-2012 Stephan Raue (stephan@openelec.tv)
|
||||
#
|
||||
# This Program 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, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# This Program 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.tv; see the file COPYING. If not, write to
|
||||
# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA.
|
||||
# http://www.gnu.org/copyleft/gpl.html
|
||||
################################################################################
|
||||
|
||||
. config/options $1
|
||||
|
||||
VER=`ls $BUILD/linux*/modules/lib/modules`
|
||||
|
||||
# ATI kernel driver
|
||||
mkdir -p $INSTALL/lib/modules/$VER/ati
|
||||
cp $PKG_BUILD/common/lib/modules/fglrx/build_mod/2.6.x/fglrx.ko $INSTALL/lib/modules/$VER/ati
|
||||
|
||||
mkdir -p $INSTALL/etc/X11
|
||||
cp $PKG_DIR/config/*.conf $INSTALL/etc/X11
|
||||
|
||||
mkdir -p $INSTALL/usr/config/
|
||||
cp $PKG_DIR/config/amdpcsdb $INSTALL/usr/config/fglrx.conf
|
||||
|
||||
mkdir -p $INSTALL
|
||||
cp -PR $PKG_BUILD/.install/* $INSTALL
|
@ -1,43 +0,0 @@
|
||||
################################################################################
|
||||
# This file is part of OpenELEC - http://www.openelec.tv
|
||||
# Copyright (C) 2009-2012 Stephan Raue (stephan@openelec.tv)
|
||||
#
|
||||
# This Program 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, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# This Program 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.tv; see the file COPYING. If not, write to
|
||||
# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA.
|
||||
# http://www.gnu.org/copyleft/gpl.html
|
||||
################################################################################
|
||||
#http://www2.ati.com/drivers/beta/amd-driver-installer-catalyst-13-6-beta-x86.x86_64.zip
|
||||
PKG_NAME="xf86-video-fglrx"
|
||||
PKG_VERSION="13-6"
|
||||
PKG_REV="1"
|
||||
PKG_ARCH="i386 x86_64"
|
||||
PKG_LICENSE="nonfree"
|
||||
PKG_SITE="http://www.ati.com/"
|
||||
#PKG_URL="http://www2.ati.com/drivers/linux/amd-driver-installer-catalyst-$PKG_VERSION-x86.x86_64.zip"
|
||||
PKG_URL="http://www2.ati.com/drivers/beta/amd-driver-installer-catalyst-$PKG_VERSION-beta-x86.x86_64.zip"
|
||||
PKG_DEPENDS="linux libX11 libXinerama libXcomposite"
|
||||
PKG_BUILD_DEPENDS="toolchain util-macros libX11 libXinerama libXcomposite linux"
|
||||
PKG_PRIORITY="optional"
|
||||
PKG_SECTION="x11/driver"
|
||||
PKG_SHORTDESC="xf86-video-fglrx: ATI binary Xorg driver"
|
||||
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."
|
||||
PKG_IS_ADDON="no"
|
||||
|
||||
PKG_AUTORECONF="no"
|
||||
|
||||
if [ "$XVBA" = yes ]; then
|
||||
# hack around broken AMD drivers
|
||||
PKG_DEPENDS="libXVBA"
|
||||
PKG_BUILD_DEPENDS="toolchain libXVBA"
|
||||
fi
|
@ -1,31 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
################################################################################
|
||||
# This file is part of OpenELEC - http://www.openelec.tv
|
||||
# Copyright (C) 2009-2012 Stephan Raue (stephan@openelec.tv)
|
||||
#
|
||||
# This Program 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, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# This Program 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.tv; see the file COPYING. If not, write to
|
||||
# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA.
|
||||
# http://www.gnu.org/copyleft/gpl.html
|
||||
################################################################################
|
||||
|
||||
. config/options $1
|
||||
|
||||
STAMP=$STAMPS/$1/unpack
|
||||
|
||||
test $PKG_DIR/config/linux.$TARGET_ARCH.conf -nt $STAMP -o \
|
||||
$PROJECT_DIR/$PROJECT/linux/linux.$TARGET_ARCH.conf -nt $STAMP -o \
|
||||
$PKG_DIR/url -nt $STAMP && rm -f $STAMP
|
||||
|
||||
exit 0
|
@ -1,371 +0,0 @@
|
||||
From 455d3759e6d732a4e382dbdeca35afaedaf3f52e Mon Sep 17 00:00:00 2001
|
||||
From: Alberto Milone <alberto.milone@canonical.com>
|
||||
Date: Thu, 20 Jun 2013 16:02:12 +0200
|
||||
Subject: [PATCH 1/1] Add support for Linux 3.10
|
||||
|
||||
source: http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/x11-drivers/ati-drivers/files/ati-drivers-13.6-linux-3.10-proc.diff
|
||||
---
|
||||
drmP.h | 4 -
|
||||
drm_proc.h | 55 ------------
|
||||
firegl_public.c | 252 +++++++++++++++++++++++++++++++++++++++++++------------
|
||||
3 files changed, 197 insertions(+), 114 deletions(-)
|
||||
|
||||
diff --git a/drmP.h b/drmP.h
|
||||
index 81546b2..4e74526 100755
|
||||
--- a/common/lib/modules/fglrx/build_mod/drmP.h
|
||||
+++ b/common/lib/modules/fglrx/build_mod//drmP.h
|
||||
@@ -901,10 +901,6 @@ int DRM(stub_register)(const char *name,
|
||||
int DRM(stub_unregister)(int minor);
|
||||
|
||||
/* Proc support (drm_proc.h) */
|
||||
-extern struct proc_dir_entry *DRM(proc_init)(drm_device_t *dev,
|
||||
- int minor,
|
||||
- struct proc_dir_entry *root,
|
||||
- struct proc_dir_entry **dev_root);
|
||||
extern int DRM(proc_cleanup)(int minor,
|
||||
struct proc_dir_entry *root,
|
||||
struct proc_dir_entry *dev_root);
|
||||
diff --git a/drm_proc.h b/drm_proc.h
|
||||
index 1e3ab4a..c52ad7e 100755
|
||||
--- a/common/lib/modules/fglrx/build_mod/drm_proc.h
|
||||
+++ b/common/lib/modules/fglrx/build_mod//drm_proc.h
|
||||
@@ -75,61 +75,6 @@ struct drm_proc_list {
|
||||
#define DRM_PROC_ENTRIES (sizeof(DRM(proc_list))/sizeof(DRM(proc_list)[0]))
|
||||
|
||||
/**
|
||||
- * Initialize the DRI proc filesystem for a device.
|
||||
- *
|
||||
- * \param dev DRM device.
|
||||
- * \param minor device minor number.
|
||||
- * \param root DRI proc dir entry.
|
||||
- * \param dev_root resulting DRI device proc dir entry.
|
||||
- * \return root entry pointer on success, or NULL on failure.
|
||||
- *
|
||||
- * Create the DRI proc root entry "/proc/ati", the device proc root entry
|
||||
- * "/proc/ati/%minor%/", and each entry in proc_list as
|
||||
- * "/proc/ati/%minor%/%name%".
|
||||
- */
|
||||
-struct proc_dir_entry *DRM(proc_init)(drm_device_t *dev, int minor,
|
||||
- struct proc_dir_entry *root,
|
||||
- struct proc_dir_entry **dev_root)
|
||||
-{
|
||||
- struct proc_dir_entry *ent;
|
||||
- int i, j;
|
||||
- char name[64];
|
||||
-
|
||||
- if (!minor) root = create_proc_entry("dri", S_IFDIR, NULL);
|
||||
- if (!root) {
|
||||
- DRM_ERROR("Cannot create /proc/ati\n");
|
||||
- return NULL;
|
||||
- }
|
||||
-
|
||||
- sprintf(name, "%d", minor);
|
||||
- *dev_root = create_proc_entry(name, S_IFDIR, root);
|
||||
- if (!*dev_root) {
|
||||
- DRM_ERROR("Cannot create /proc/ati/%s\n", name);
|
||||
- return NULL;
|
||||
- }
|
||||
-
|
||||
- for (i = 0; i < DRM_PROC_ENTRIES; i++) {
|
||||
- ent = create_proc_entry(DRM(proc_list)[i].name,
|
||||
- S_IFREG|S_IRUGO, *dev_root);
|
||||
- if (!ent) {
|
||||
- DRM_ERROR("Cannot create /proc/ati/%s/%s\n",
|
||||
- name, DRM(proc_list)[i].name);
|
||||
- for (j = 0; j < i; j++)
|
||||
- remove_proc_entry(DRM(proc_list)[i].name,
|
||||
- *dev_root);
|
||||
- remove_proc_entry(name, root);
|
||||
- if (!minor) remove_proc_entry("dri", NULL);
|
||||
- return NULL;
|
||||
- }
|
||||
- ent->read_proc = DRM(proc_list)[i].f;
|
||||
- ent->data = dev;
|
||||
- }
|
||||
-
|
||||
- return root;
|
||||
-}
|
||||
-
|
||||
-
|
||||
-/**
|
||||
* Cleanup the proc filesystem resources.
|
||||
*
|
||||
* \param minor device minor number.
|
||||
diff --git a/firegl_public.c b/firegl_public.c
|
||||
index d3ad3ce..890a0aa 100755
|
||||
--- a/common/lib/modules/fglrx/build_mod/firegl_public.c
|
||||
+++ b/common/lib/modules/fglrx/build_mod//firegl_public.c
|
||||
@@ -583,6 +583,202 @@ kcl_proc_list_t KCL_PROC_FileList[] =
|
||||
{ "NULL", NULL, NULL} // Terminate List!!!
|
||||
};
|
||||
|
||||
+
|
||||
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)
|
||||
+typedef int (read_proc_t)(char *page, char **start, off_t off, int count, int *eof, void *data);
|
||||
+typedef int (write_proc_t)(struct file *file, const char __user *buffer, unsigned long count, void *data);
|
||||
+#else
|
||||
+#define PDE_DATA(inode) (PDE((inode))->data)
|
||||
+#endif
|
||||
+
|
||||
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)
|
||||
+typedef struct {
|
||||
+ read_proc_t *read_func;
|
||||
+ write_proc_t *write_func;
|
||||
+ void *data;
|
||||
+} gentoo_proc_wrapper_t;
|
||||
+
|
||||
+#define GENTOO_PROC_WRAPPER_OVERFLOW_MAGIC 939750305
|
||||
+
|
||||
+static ssize_t gentoo_proc_wrapper_read (struct file *myfile, char __user *buffer, size_t count, loff_t *offset) {
|
||||
+ int is_eof=0, retval;
|
||||
+ char *start, *usebuffer=NULL;
|
||||
+ gentoo_proc_wrapper_t* wrapper_data=(gentoo_proc_wrapper_t*)(myfile->private_data);
|
||||
+ if (PAGE_SIZE<*offset) {
|
||||
+ printk(KERN_ERR "Trying to read beyond 4k on proc\n");
|
||||
+ return -EIO;
|
||||
+ }
|
||||
+ //printk(KERN_NOTICE " call with: dev %p, func %p\n", wrapper_data->data, wrapper_data->read_func);
|
||||
+
|
||||
+ usebuffer=kmalloc(2*PAGE_SIZE, GFP_KERNEL);
|
||||
+ if (!usebuffer)
|
||||
+ return -ENOMEM;
|
||||
+ ((u32*)usebuffer)[1024]=GENTOO_PROC_WRAPPER_OVERFLOW_MAGIC;
|
||||
+
|
||||
+ retval=wrapper_data->read_func(usebuffer, &start, *offset, count, &is_eof, wrapper_data->data);
|
||||
+
|
||||
+ BUG_ON(GENTOO_PROC_WRAPPER_OVERFLOW_MAGIC != ((u32*)usebuffer)[1024]);
|
||||
+
|
||||
+ if (0 > retval)
|
||||
+ {
|
||||
+ printk(KERN_ERR "Proc read failed with %d", retval);
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
+ if (copy_to_user(buffer, start, retval)) {
|
||||
+ printk(KERN_NOTICE "copy to user failed in amd drivers proc code\n");
|
||||
+ retval=-EFAULT;
|
||||
+ goto out;
|
||||
+ }
|
||||
+ *offset+=retval;
|
||||
+
|
||||
+out:
|
||||
+ if (usebuffer)
|
||||
+ kfree(usebuffer);
|
||||
+ return retval;
|
||||
+}
|
||||
+static ssize_t gentoo_proc_wrapper_write (struct file *myfile, const char __user *buffer, size_t count, loff_t *offset) {
|
||||
+ gentoo_proc_wrapper_t* wrapper_data=(gentoo_proc_wrapper_t*)(myfile->private_data);
|
||||
+ int retval=0;
|
||||
+ void *usebuffer=NULL;
|
||||
+
|
||||
+ BUG_ON(*offset);
|
||||
+ if (!wrapper_data->write_func)
|
||||
+ return -EPERM;
|
||||
+
|
||||
+ usebuffer=kmalloc(count, GFP_KERNEL);
|
||||
+ if (!usebuffer)
|
||||
+ return -ENOMEM;
|
||||
+ if (copy_from_user(usebuffer, buffer, count)) {
|
||||
+ printk(KERN_NOTICE "copy from user failed in amd drivers proc code\n");
|
||||
+ retval=-EFAULT;
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
+ retval=wrapper_data->write_func(myfile, buffer, count, wrapper_data->data);
|
||||
+ *offset+=retval;
|
||||
+out:
|
||||
+ if (usebuffer)
|
||||
+ kfree(usebuffer);
|
||||
+ return retval;
|
||||
+}
|
||||
+static int gentoo_proc_wrapper_open(struct inode *myinode, struct file *myfile) {
|
||||
+ myfile->private_data=PDE_DATA(myinode);
|
||||
+ return generic_file_open(myinode, myfile);
|
||||
+}
|
||||
+struct file_operations gentoo_proc_fops = {
|
||||
+ .read=gentoo_proc_wrapper_read,
|
||||
+ .write=gentoo_proc_wrapper_write,
|
||||
+ .open=gentoo_proc_wrapper_open,
|
||||
+};
|
||||
+
|
||||
+static void *gentoo_proc_wrapper_data(read_proc_t *reader, write_proc_t *writer, void *mydata) {
|
||||
+ gentoo_proc_wrapper_t *retval=kmalloc(sizeof(gentoo_proc_wrapper_t), GFP_KERNEL);
|
||||
+ if (!retval)
|
||||
+ return retval;
|
||||
+ retval->read_func=reader;
|
||||
+ retval->write_func=writer;
|
||||
+ retval->data=mydata;
|
||||
+ return retval;
|
||||
+}
|
||||
+
|
||||
+static struct proc_dir_entry *firegl_proc_init( device_t *dev,
|
||||
+ int minor,
|
||||
+ struct proc_dir_entry *root,
|
||||
+ struct proc_dir_entry **dev_root,
|
||||
+ kcl_proc_list_t *proc_list ) // proc_list must be terminated!
|
||||
+{
|
||||
+ struct proc_dir_entry *ent;
|
||||
+ char name[64];
|
||||
+ kcl_proc_list_t *list = proc_list;
|
||||
+ void *tempdata;
|
||||
+ KCL_DEBUG1(FN_FIREGL_PROC, "minor %d, proc_list 0x%08lx\n", minor, (unsigned long)proc_list);
|
||||
+ if (!minor)
|
||||
+ {
|
||||
+ root = proc_mkdir("ati", NULL);
|
||||
+ }
|
||||
+
|
||||
+ if (!root)
|
||||
+ {
|
||||
+ KCL_DEBUG_ERROR("Cannot create /proc/ati\n");
|
||||
+ return NULL;
|
||||
+ }
|
||||
+
|
||||
+ if (minor == 0)
|
||||
+ {
|
||||
+ // Global major debice number entry
|
||||
+ tempdata=gentoo_proc_wrapper_data((read_proc_t*)firegl_major_proc_read, NULL, NULL);
|
||||
+ if (!tempdata)
|
||||
+ return NULL;
|
||||
+ ent = proc_create_data("major", S_IFREG|S_IRUGO, root, &gentoo_proc_fops, tempdata);
|
||||
+ if (!ent)
|
||||
+ {
|
||||
+ remove_proc_entry("ati", NULL);
|
||||
+ KCL_DEBUG_ERROR("Cannot create /proc/ati/major\n");
|
||||
+ return NULL;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ sprintf(name, "%d", minor);
|
||||
+ *dev_root = proc_mkdir(name, root);
|
||||
+ if (!*dev_root) {
|
||||
+ remove_proc_entry("major", root);
|
||||
+ remove_proc_entry("ati", NULL);
|
||||
+ KCL_DEBUG_ERROR("Cannot create /proc/ati/%s\n", name);
|
||||
+ return NULL;
|
||||
+ }
|
||||
+
|
||||
+ while (list->f || list->fops)
|
||||
+ {
|
||||
+ struct file_operations *my_fops = &gentoo_proc_fops;
|
||||
+ if (list->fops)
|
||||
+ {
|
||||
+ my_fops = (struct file_operations*)list->fops;
|
||||
+ tempdata=(dev->pubdev.signature == FGL_DEVICE_SIGNATURE)? firegl_find_device(minor) : (dev);
|
||||
+ }
|
||||
+ else {
|
||||
+ BUG_ON(!list->f);
|
||||
+ tempdata=gentoo_proc_wrapper_data((read_proc_t*)list->f, NULL, (dev->pubdev.signature == FGL_DEVICE_SIGNATURE)? firegl_find_device(minor) : (dev) );
|
||||
+ if (!tempdata)
|
||||
+ return NULL;
|
||||
+ }
|
||||
+ //printk(KERN_NOTICE "name %s, dev %p, func %p, data %p\n", list->name, (dev->pubdev.signature == FGL_DEVICE_SIGNATURE)? firegl_find_device(minor) : (dev), list->f, tempdata);
|
||||
+ ent = proc_create_data(list->name, S_IFREG|S_IRUGO, *dev_root, my_fops, tempdata);
|
||||
+
|
||||
+ if (!ent)
|
||||
+ {
|
||||
+ KCL_DEBUG_ERROR("Cannot create /proc/ati/%s/%s\n", name, list->name);
|
||||
+ while (proc_list != list)
|
||||
+ {
|
||||
+ remove_proc_entry(proc_list->name, *dev_root);
|
||||
+ proc_list++;
|
||||
+ }
|
||||
+ remove_proc_entry(name, root);
|
||||
+ if (!minor)
|
||||
+ {
|
||||
+ remove_proc_entry("major", root);
|
||||
+ remove_proc_entry("ati", NULL);
|
||||
+ }
|
||||
+ return NULL;
|
||||
+ }
|
||||
+
|
||||
+ list++;
|
||||
+ }
|
||||
+
|
||||
+ if (minor == 0)
|
||||
+ {
|
||||
+ // Global debug entry, only create it once
|
||||
+ tempdata=gentoo_proc_wrapper_data((read_proc_t*)firegl_debug_proc_read_wrap, (write_proc_t*)firegl_debug_proc_write_wrap, dev);
|
||||
+ if (!tempdata)
|
||||
+ return NULL;
|
||||
+ ent=proc_create_data("debug", S_IFREG|S_IRUGO, root, &gentoo_proc_fops, tempdata);
|
||||
+ if (!ent)
|
||||
+ return NULL;
|
||||
+ }
|
||||
+
|
||||
+ return root;
|
||||
+}
|
||||
+#else
|
||||
static struct proc_dir_entry *firegl_proc_init( device_t *dev,
|
||||
int minor,
|
||||
struct proc_dir_entry *root,
|
||||
@@ -677,6 +873,7 @@ static struct proc_dir_entry *firegl_proc_init( device_t *dev,
|
||||
|
||||
return root;
|
||||
}
|
||||
+#endif
|
||||
|
||||
static int firegl_proc_cleanup( int minor,
|
||||
struct proc_dir_entry *root,
|
||||
@@ -6135,59 +6332,4 @@ void ATI_API_CALL KCL_fpu_end(void)
|
||||
kernel_fpu_end();
|
||||
}
|
||||
|
||||
-/** Create new directory entry under "/proc/ati/...."
|
||||
- * Where
|
||||
- * root_dir - Root directory. If NULL then we should use "/proc/ati" root.
|
||||
- * name - Pointer to the name of directory
|
||||
- * access - Access attribute. We could use it to disable access to the directory for everybody accept owner.
|
||||
- * By default owner is root.
|
||||
- * Return NULL if failure. Pointer to proc_dir_entry otherwise
|
||||
- */
|
||||
-void * KCL_create_proc_dir(void *root_dir, const char *name, unsigned int access)
|
||||
-{
|
||||
- struct proc_dir_entry *dir = NULL;
|
||||
-
|
||||
- if (root_dir == NULL)
|
||||
- dir = create_proc_entry(name, S_IFDIR | access, firegl_stub_root);
|
||||
- else
|
||||
- dir = create_proc_entry(name, S_IFDIR | access, (struct proc_dir_entry *)root_dir);
|
||||
-
|
||||
- return dir;
|
||||
-}
|
||||
-
|
||||
-/* Remove proc directory entry
|
||||
- * root - Pointer to directory proc entry or NULL if for "/proc/ati"
|
||||
- * name - Name to delete
|
||||
- */
|
||||
-void KCL_remove_proc_dir_entry(void *root, const char *name)
|
||||
-{
|
||||
- if (root == NULL)
|
||||
- remove_proc_entry(name, firegl_stub_root);
|
||||
- else
|
||||
- remove_proc_entry(name, (struct proc_dir_entry *)root);
|
||||
-}
|
||||
-
|
||||
-
|
||||
-/* Create proc_entry under "root_dir"
|
||||
- * read_fn - Function which will be called on read request
|
||||
- * write_fn - Function which will be called on write request
|
||||
- * private_data - Pointer to private data which will be passed
|
||||
- */
|
||||
-void KCL_create_proc_entry(void *root_dir, const char *name, unsigned int access_mode, void *read_fn, void *write_fn, void *private_data)
|
||||
-{
|
||||
- struct proc_dir_entry *ent = NULL;
|
||||
-
|
||||
- if (root_dir == NULL || name == NULL)
|
||||
- return;
|
||||
-
|
||||
- ent = create_proc_entry(name, access_mode, (struct proc_dir_entry *)root_dir);
|
||||
-
|
||||
- if (ent)
|
||||
- {
|
||||
- ent->read_proc = (read_proc_t *)read_fn;
|
||||
- ent->write_proc = (write_proc_t *)write_fn;
|
||||
- ent->data = private_data;
|
||||
- }
|
||||
-}
|
||||
-
|
||||
#endif /* __KERNEL__ */
|
||||
--
|
||||
1.7.9.5
|
||||
|
@ -1,831 +0,0 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Copyright (c) 2011, Advanced Micro Devices, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following are met:
|
||||
*
|
||||
* Neither the name of the copyright holder nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific, prior, written permission.
|
||||
*
|
||||
* You must reproduce the above copyright notice.
|
||||
*
|
||||
* You must include the following terms in your license and/or other
|
||||
* materials provided with the software.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* Without limiting the foregoing, the software may implement third
|
||||
* party technologies (e.g. third party libraries) for which you must
|
||||
* obtain licenses from parties other than AMD. You agree that AMD has
|
||||
* not obtained or conveyed to you, and that you shall be responsible for
|
||||
* obtaining the rights to use and/or distribute the applicable underlying
|
||||
* intellectual property rights related to the third party technologies.
|
||||
* These third party technologies are not licensed hereunder.
|
||||
*
|
||||
* Without limiting the foregoing, for MPEG-2 products, the following
|
||||
* additional notices are provided: For MPEG-2 Encoding Products (those
|
||||
* that are "Sold" to end-users, directly or indirectly):
|
||||
*
|
||||
* NO LICENSE IS GRANTED HEREIN, BY IMPLICATION OR OTHERWISE,
|
||||
* TO YOU OR YOUR CUSTOMERS TO USE MPEG-2 ENCODING PRODUCTS,
|
||||
* MPEG-2 DISTRIBUTION ENCODING PRODUCTS, MPEG-2 ENCODING SOFTWARE,
|
||||
* AND/OR MPEG-2 BUNDLED ENCODING SOFTWARE FOR ENCODING OR HAVING
|
||||
* ENCODED ONE OR MORE MPEG-2 VIDEO EVENTS FOR RECORDING ON AN
|
||||
* MPEG-2 PACKAGED MEDIUM FOR ANY USE OR DISTRIBUTION OTHER THAN
|
||||
* PERSONAL USE OF LICENSEE'S CUSTOMER.
|
||||
*
|
||||
* For MPEG-2 Intermediate Products (those that are NOT "Sold" to
|
||||
* end-users, directly or indirectly):
|
||||
*
|
||||
* NO LICENSE IS GRANTED HEREIN, BY IMPLICATION OR OTHERWISE,
|
||||
* TO YOU OR YOUR CUSTOMERS TO USE MPEG-2 INTERMEDIATE PRODUCTS
|
||||
* MANUFACTURED OR SOLD BY YOU.
|
||||
*
|
||||
* If you use the software (in whole or in part), you shall adhere to
|
||||
* all applicable U.S., European, and other export laws, including but
|
||||
* not limited to the U.S. Export Administration Regulations ("EAR"),
|
||||
* (15 C.F.R. Sections 730 through 774), and E.U. Council Regulation (EC)
|
||||
* No 1334/2000 of 22 June 2000. Further, pursuant to Section 740.6 of
|
||||
* the EAR, you hereby certify that, except pursuant to a license granted
|
||||
* by the United States Department of Commerce Bureau of Industry and
|
||||
* Security or as otherwise permitted pursuant to a License Exception
|
||||
* under the U.S. Export Administration Regulations ("EAR"), you will
|
||||
* not (1) export, re-export or release to a national of a country in
|
||||
* Country Groups D:1, E:1 or E:2 any restricted technology, software,
|
||||
* or source code you receive hereunder, or (2) export to Country Groups
|
||||
* D:1, E:1 or E:2 the direct product of such technology or software, if
|
||||
* such foreign produced direct product is subject to national security
|
||||
* controls as identified on the Commerce Control List (currently found
|
||||
* in Supplement 1 to Part 774 of EAR). For the most current Country
|
||||
* Group listings, or for additional information about the EAR or your
|
||||
* obligations under those regulations, please refer to the U.S. Bureau
|
||||
* of Industry and Security's website at http://www.bis.doc.gov/.
|
||||
*
|
||||
*******************************************************************************/
|
||||
|
||||
#ifndef _XVBA_H
|
||||
#define _XVBA_H
|
||||
|
||||
// A minor revision change indicates a backward-compatible change; a major revision change indicates a backward-incompatible
|
||||
#define XVBA_VERSION_MAJOR 0
|
||||
#define XVBA_VERSION_MINOR 74
|
||||
#define XVBA_VERSION ((XVBA_VERSION_MAJOR << 16) | XVBA_VERSION_MINOR)
|
||||
|
||||
#define NUM_OF_XVBA_DECODE_CAP 3
|
||||
#define NUM_OF_XVBA_GET_SURFACE_TARGET 3
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef enum _XVBA_SURFACE_FLAG
|
||||
{
|
||||
XVBA_FRAME = 0,
|
||||
XVBA_TOP_FIELD,
|
||||
XVBA_BOTTOM_FIELD,
|
||||
|
||||
} XVBA_SURFACE_FLAG;
|
||||
|
||||
/* Four-character-code (FOURCC) */
|
||||
#define XVBA_FOURCC(a,b,c,d)\
|
||||
(((unsigned int)(a)<<0) |\
|
||||
((unsigned int)(b)<<8) |\
|
||||
((unsigned int)(c)<<16)|\
|
||||
((unsigned int)(d)<<24))
|
||||
|
||||
typedef enum _XVBA_SURFACE_FORMAT
|
||||
{
|
||||
XVBA_NV12 = XVBA_FOURCC('N','V','1','2'), /* 12bit Y/CbCr 4:2:0 planar */
|
||||
XVBA_YUY2 = XVBA_FOURCC('Y','U','Y','2'), /* 16bit YUV 4:2:2 */
|
||||
XVBA_ARGB = XVBA_FOURCC('A','R','G','B'), /* 32bit ARGB-8-8-8-8 */
|
||||
XVBA_AYUV = XVBA_FOURCC('A','Y','U','V'), /* 32bit AYUV-8-8-8-8 */
|
||||
XVBA_YV12 = XVBA_FOURCC('Y','V','1','2'), /* 12bit Y/V/U 4:2:0 planar */
|
||||
} XVBA_SURFACE_FORMAT;
|
||||
|
||||
typedef struct _XVBA_GetSurface_Target
|
||||
{
|
||||
unsigned int size; ///< structure size
|
||||
XVBA_SURFACE_FORMAT surfaceType;
|
||||
XVBA_SURFACE_FLAG flag;
|
||||
} XVBA_GetSurface_Target;
|
||||
|
||||
/**
|
||||
* XVBA Query Extension
|
||||
*/
|
||||
Bool
|
||||
XVBAQueryExtension
|
||||
(
|
||||
Display *display,
|
||||
int *version
|
||||
);
|
||||
|
||||
/******************************************************************/
|
||||
/* XVBA Context */
|
||||
/******************************************************************/
|
||||
|
||||
/**
|
||||
* XVBA Context Create
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
unsigned int size; ///< structure size
|
||||
Display *display;
|
||||
Drawable draw;
|
||||
|
||||
} XVBA_Create_Context_Input;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned int size; ///< structure size
|
||||
void *context;
|
||||
|
||||
} XVBA_Create_Context_Output;
|
||||
|
||||
Status
|
||||
XVBACreateContext
|
||||
(
|
||||
XVBA_Create_Context_Input *create_context_input,
|
||||
XVBA_Create_Context_Output *create_context_output
|
||||
);
|
||||
|
||||
/**
|
||||
* XVBA Context Destroy
|
||||
*/
|
||||
Status
|
||||
XVBADestroyContext
|
||||
(
|
||||
void *context
|
||||
);
|
||||
|
||||
|
||||
/******************************************************************/
|
||||
/* XVBA Sessions */
|
||||
/******************************************************************/
|
||||
|
||||
/**
|
||||
* XVBA Context Query Session Info
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
unsigned int size; ///< structure size
|
||||
void *context;
|
||||
|
||||
} XVBA_GetSessionInfo_Input;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned int size; ///< structure size
|
||||
unsigned int getcapdecode_output_size; ///< 0 = Decode not supported, NZ = Decode session is supported and the value is used for XVBAGetCapDecode output struct size
|
||||
unsigned int xvba_gsio_reserved_0;
|
||||
unsigned int xvba_gsio_reserved_1;
|
||||
} XVBA_GetSessionInfo_Output;
|
||||
|
||||
Status
|
||||
XVBAGetSessionInfo
|
||||
(
|
||||
XVBA_GetSessionInfo_Input *get_session_info_input,
|
||||
XVBA_GetSessionInfo_Output *get_session_info_output
|
||||
);
|
||||
|
||||
/******************************************************************/
|
||||
/* XVBA decode errors */
|
||||
/******************************************************************/
|
||||
|
||||
typedef enum
|
||||
{
|
||||
XVBA_DECODE_NO_ERROR = 0,
|
||||
XVBA_DECODE_BAD_PICTURE, ///< the entire picture is corrupted . All MBs are invalid
|
||||
XVBA_DECODE_BAD_SLICE, ///< part of the picture, slice, wasn.t decoded properly . all MBs in this slice are bad
|
||||
XVBA_DECODE_BAD_MB ///< some MBs are not decoded properly
|
||||
|
||||
} XVBA_DECODE_ERROR;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned int size; ///< structure size
|
||||
XVBA_DECODE_ERROR type;
|
||||
unsigned int num_of_bad_mbs; ///< number of marcoblocks that were not properly decoded
|
||||
|
||||
} XVBADecodeError;
|
||||
|
||||
/******************************************************************/
|
||||
/* XVBA Surface */
|
||||
/******************************************************************/
|
||||
|
||||
/**
|
||||
* XVBA Surface create
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
unsigned int size;
|
||||
void *session;
|
||||
unsigned int width;
|
||||
unsigned int height;
|
||||
XVBA_SURFACE_FORMAT surface_type;
|
||||
|
||||
} XVBA_Create_Surface_Input;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned int size;
|
||||
void *surface; ///< Pointer to XVBASurface
|
||||
|
||||
} XVBA_Create_Surface_Output;
|
||||
|
||||
Status
|
||||
XVBACreateSurface(
|
||||
XVBA_Create_Surface_Input *create_surface_input,
|
||||
XVBA_Create_Surface_Output *create_surface_output
|
||||
);
|
||||
|
||||
/**
|
||||
* XVBA Surface destroy
|
||||
*/
|
||||
Status
|
||||
XVBADestroySurface(
|
||||
void *surface
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
* Synchronization query_status_flags
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
XVBA_GET_SURFACE_STATUS = 1, ///< get surface status; is surface still used by GPU
|
||||
XVBA_GET_DECODE_ERRORS ///< get decode errors for target surface
|
||||
|
||||
} XVBA_QUERY_STATUS;
|
||||
|
||||
/**
|
||||
* Synchronization status flags
|
||||
*/
|
||||
#define XVBA_STILL_PENDING 0x00000001 ///< surface is still used by HW
|
||||
#define XVBA_COMPLETED 0x00000002 ///< HW completed job on this surface
|
||||
#define XVBA_NO_ERROR_DECODE 0x00000004 ///< no decode errors
|
||||
#define XVBA_ERROR_DECODE 0x00000008 ///< decode errors for queried surface
|
||||
|
||||
|
||||
/**
|
||||
* XVBA Surface synchronization
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
unsigned int size;
|
||||
void *session;
|
||||
void *surface;
|
||||
XVBA_QUERY_STATUS query_status;
|
||||
|
||||
} XVBA_Surface_Sync_Input;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned int size;
|
||||
unsigned int status_flags;
|
||||
XVBADecodeError decode_error;
|
||||
|
||||
} XVBA_Surface_Sync_Output;
|
||||
|
||||
Status
|
||||
XVBASyncSurface (
|
||||
XVBA_Surface_Sync_Input *surface_sync_input,
|
||||
XVBA_Surface_Sync_Output *surface_sync_output
|
||||
);
|
||||
|
||||
|
||||
// Conversion from OGL to XVBA surface
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned int size;
|
||||
void *session;
|
||||
void *glcontext;
|
||||
unsigned int gltexture;
|
||||
|
||||
} XVBA_Create_GLShared_Surface_Input;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned int size;
|
||||
void *surface; // Pointer to XVBASurface
|
||||
|
||||
} XVBA_Create_GLShared_Surface_Output;
|
||||
|
||||
Status
|
||||
XVBACreateGLSharedSurface (
|
||||
XVBA_Create_GLShared_Surface_Input *create_glshared_surface_input,
|
||||
XVBA_Create_GLShared_Surface_Output *create_glshared_surface_output
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
* XVBA Get Surface
|
||||
*/
|
||||
typedef struct {
|
||||
unsigned int size; ///< structure size
|
||||
void *session; // XVBA session
|
||||
void *src_surface; // source XVBA surface
|
||||
void *target_buffer; // application supplied system memory buffer
|
||||
unsigned int target_pitch; // pitch of the destination buffer
|
||||
unsigned int target_width; // width of the destination buffer
|
||||
unsigned int target_height; // height of the destination buffer
|
||||
XVBA_GetSurface_Target target_parameter; // destination buffer format and flag
|
||||
unsigned int reserved [4]; // reserved
|
||||
} XVBA_Get_Surface_Input;
|
||||
|
||||
Status
|
||||
XVBAGetSurface (
|
||||
XVBA_Get_Surface_Input *get_surface_input
|
||||
);
|
||||
|
||||
/**
|
||||
* XVBA Transfer Surface
|
||||
*/
|
||||
typedef struct {
|
||||
unsigned int size; ///< structure size
|
||||
void *session; // XVBA session
|
||||
void *src_surface; // source XVBA surface
|
||||
void *target_surface; // destination XVBA surface
|
||||
XVBA_SURFACE_FLAG flag; // top, bottom or frame
|
||||
unsigned int reserved [4]; // reserved
|
||||
} XVBA_Transfer_Surface_Input;
|
||||
|
||||
Status
|
||||
XVBATransferSurface (
|
||||
XVBA_Transfer_Surface_Input *transfer_surface_input
|
||||
);
|
||||
|
||||
/******************************************************************/
|
||||
/* XVBA Buffers */
|
||||
/******************************************************************/
|
||||
|
||||
typedef enum
|
||||
{
|
||||
XVBA_NONE = 0,
|
||||
XVBA_PICTURE_DESCRIPTION_BUFFER,
|
||||
XVBA_DATA_BUFFER,
|
||||
XVBA_DATA_CTRL_BUFFER,
|
||||
XVBA_QM_BUFFER
|
||||
|
||||
} XVBA_BUFFER;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned int size; ///< structure size
|
||||
XVBA_BUFFER buffer_type;
|
||||
unsigned int buffer_size; ///< allocated size of data in bytes
|
||||
void *bufferXVBA; ///< pointer to XVBA decode data buffer
|
||||
unsigned int data_size_in_buffer;///< Used in Decode call only
|
||||
int data_offset; ///< Used in Decode call only
|
||||
void *appPrivate; ///< used only by application to store pointer to its private data.
|
||||
|
||||
} XVBABufferDescriptor;
|
||||
|
||||
/**
|
||||
* XVBA Decode buffers create
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
unsigned int size; ///< structure size
|
||||
void *session;
|
||||
XVBA_BUFFER buffer_type;
|
||||
unsigned int num_of_buffers;
|
||||
|
||||
} XVBA_Create_DecodeBuff_Input;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned int size; ///< structure size
|
||||
unsigned int num_of_buffers_in_list;
|
||||
XVBABufferDescriptor *buffer_list;
|
||||
|
||||
} XVBA_Create_DecodeBuff_Output;
|
||||
|
||||
Status
|
||||
XVBACreateDecodeBuffers (
|
||||
XVBA_Create_DecodeBuff_Input *create_decodebuff_input,
|
||||
XVBA_Create_DecodeBuff_Output *create_decodebuff_output
|
||||
);
|
||||
|
||||
/**
|
||||
* XVBA Decode buffers destroy
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
unsigned int size;
|
||||
void *session;
|
||||
unsigned int num_of_buffers_in_list;
|
||||
XVBABufferDescriptor *buffer_list;
|
||||
|
||||
} XVBA_Destroy_Decode_Buffers_Input;
|
||||
|
||||
Status
|
||||
XVBADestroyDecodeBuffers (
|
||||
XVBA_Destroy_Decode_Buffers_Input *buffer_list
|
||||
);
|
||||
|
||||
|
||||
/******************************************************************/
|
||||
/* XVBA Decode session (XVBADecodeCap) */
|
||||
/******************************************************************/
|
||||
|
||||
/**
|
||||
* XVBADecodeCap flags
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
XVBA_NOFLAG = 0,
|
||||
XVBA_H264_BASELINE,
|
||||
XVBA_H264_MAIN,
|
||||
XVBA_H264_HIGH,
|
||||
|
||||
XVBA_VC1_SIMPLE,
|
||||
XVBA_VC1_MAIN,
|
||||
XVBA_VC1_ADVANCED,
|
||||
|
||||
} XVBA_DECODE_FLAGS;
|
||||
|
||||
/**
|
||||
* XVBADecodeCap capability_id
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
XVBA_H264 = 0x100,///< bitstream level of acceleration
|
||||
XVBA_VC1, ///< bitstream level of acceleration
|
||||
XVBA_MPEG2_IDCT, ///< iDCT and motion compensation level of acceleration
|
||||
XVBA_MPEG2_VLD ///< bitstream level of acceleration
|
||||
|
||||
} XVBA_CAPABILITY_ID;
|
||||
|
||||
typedef struct {
|
||||
unsigned int size; ///< structure size
|
||||
XVBA_CAPABILITY_ID capability_id; ///< Unique descriptor for decode capability
|
||||
XVBA_DECODE_FLAGS flags; ///< defines for additional information about capability
|
||||
XVBA_SURFACE_FORMAT surface_type; ///< Surface type: fourcc YUV or RGB supported with this capability.
|
||||
|
||||
} XVBADecodeCap;
|
||||
|
||||
/**
|
||||
* XVBADecodeCap Query Info
|
||||
*/
|
||||
typedef struct {
|
||||
unsigned int size; ///< structure size
|
||||
void *context;
|
||||
|
||||
} XVBA_GetCapDecode_Input;
|
||||
|
||||
typedef struct {
|
||||
unsigned int size; ///< structure size
|
||||
unsigned int num_of_decodecaps;
|
||||
XVBADecodeCap decode_caps_list[NUM_OF_XVBA_DECODE_CAP];
|
||||
unsigned int num_of_getsurface_target;
|
||||
XVBA_GetSurface_Target getsurface_target_list[NUM_OF_XVBA_GET_SURFACE_TARGET];
|
||||
} XVBA_GetCapDecode_Output;
|
||||
|
||||
Status
|
||||
XVBAGetCapDecode (
|
||||
XVBA_GetCapDecode_Input *decodecap_list_input,
|
||||
XVBA_GetCapDecode_Output *decodecap_list_output
|
||||
);
|
||||
|
||||
/**
|
||||
* XVBADecodeCap create
|
||||
*/
|
||||
typedef struct {
|
||||
unsigned int size; ///< structure size
|
||||
unsigned int width; ///< decoded video width
|
||||
unsigned int height; ///< decoded video height
|
||||
void *context;
|
||||
XVBADecodeCap *decode_cap; ///< capability from the driver reported list
|
||||
|
||||
} XVBA_Create_Decode_Session_Input;
|
||||
|
||||
typedef struct {
|
||||
unsigned int size; ///< structure size
|
||||
void *session; ///< Pointer to the created decode session
|
||||
|
||||
} XVBA_Create_Decode_Session_Output;
|
||||
|
||||
Status
|
||||
XVBACreateDecode (
|
||||
XVBA_Create_Decode_Session_Input *create_decode_session_input,
|
||||
XVBA_Create_Decode_Session_Output *create_decode_session_output
|
||||
);
|
||||
|
||||
/**
|
||||
* XVBADecodeCap destroy
|
||||
*/
|
||||
Status
|
||||
XVBADestroyDecode (
|
||||
void *session
|
||||
);
|
||||
|
||||
|
||||
/******************************************************************/
|
||||
/* XVBA Decode API */
|
||||
/******************************************************************/
|
||||
#define XVBA_PREDICTION_FIELD 0x01
|
||||
#define XVBA_PREDICTION_FRAME 0x02
|
||||
#define XVBA_PREDICTION_DUAL_PRIME 0x03
|
||||
#define XVBA_PREDICTION_16x8 0x02
|
||||
|
||||
#define XVBA_SECOND_FIELD 0x00000004
|
||||
|
||||
|
||||
/**
|
||||
* XVBA inits picture decoding
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
unsigned int size; ///< structure size
|
||||
void *session; ///< pointer to decode session
|
||||
void *target_surface; ///< decode target
|
||||
|
||||
} XVBA_Decode_Picture_Start_Input;
|
||||
|
||||
Status
|
||||
XVBAStartDecodePicture (
|
||||
XVBA_Decode_Picture_Start_Input *decode_picture_start
|
||||
);
|
||||
|
||||
/**
|
||||
* XVBA picture decode
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
unsigned int size; ///< structure size
|
||||
void *session; ///< pointer to decode session
|
||||
unsigned int num_of_buffers_in_list; ///< number of decode compressed data buffers
|
||||
XVBABufferDescriptor **buffer_list; ///< array of XVBABufferDescriptor structures
|
||||
|
||||
} XVBA_Decode_Picture_Input;
|
||||
|
||||
Status
|
||||
XVBADecodePicture (
|
||||
XVBA_Decode_Picture_Input *decode_picture_input
|
||||
);
|
||||
|
||||
/**
|
||||
* XVBA end picture decode
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
unsigned int size;
|
||||
void *session;
|
||||
|
||||
} XVBA_Decode_Picture_End_Input;
|
||||
|
||||
Status
|
||||
XVBAEndDecodePicture (
|
||||
XVBA_Decode_Picture_End_Input *decode_picture_end_input
|
||||
);
|
||||
|
||||
/******************************************************************/
|
||||
/* XVBA Decode Data buffers */
|
||||
/******************************************************************/
|
||||
|
||||
/*
|
||||
* XVBA compressed data type: XVBA_PICTURE_DESCRIPTOR_BUFFER
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
//VC-1, MPEG2 bitstream references
|
||||
void *past_surface;
|
||||
void *future_surface;
|
||||
|
||||
unsigned int profile;
|
||||
unsigned int level;
|
||||
|
||||
unsigned int width_in_mb;
|
||||
unsigned int height_in_mb;
|
||||
unsigned int picture_structure;
|
||||
|
||||
union {
|
||||
struct {
|
||||
unsigned int residual_colour_transform_flag : 1;
|
||||
unsigned int delta_pic_always_zero_flag : 1;
|
||||
unsigned int gaps_in_frame_num_value_allowed_flag: 1;
|
||||
unsigned int frame_mbs_only_flag : 1;
|
||||
unsigned int mb_adaptive_frame_field_flag : 1;
|
||||
unsigned int direct_8x8_inference_flag : 1;
|
||||
unsigned int xvba_avc_sps_reserved : 26;
|
||||
} avc;
|
||||
|
||||
struct {
|
||||
unsigned int postprocflag : 1;
|
||||
unsigned int pulldown : 1;
|
||||
unsigned int interlace : 1;
|
||||
unsigned int tfcntrflag : 1;
|
||||
unsigned int finterpflag : 1;
|
||||
unsigned int reserved : 1;
|
||||
unsigned int psf : 1;
|
||||
unsigned int second_field : 1;
|
||||
unsigned int xvba_vc1_sps_reserved : 24;
|
||||
} vc1;
|
||||
|
||||
unsigned int flags;
|
||||
} sps_info;
|
||||
|
||||
unsigned char chroma_format;
|
||||
unsigned char avc_bit_depth_luma_minus8;
|
||||
unsigned char avc_bit_depth_chroma_minus8;
|
||||
unsigned char avc_log2_max_frame_num_minus4;
|
||||
|
||||
unsigned char avc_pic_order_cnt_type;
|
||||
unsigned char avc_log2_max_pic_order_cnt_lsb_minus4;
|
||||
unsigned char avc_num_ref_frames;
|
||||
unsigned char avc_reserved_8bit;
|
||||
|
||||
union {
|
||||
struct {
|
||||
unsigned int entropy_coding_mode_flag : 1;
|
||||
unsigned int pic_order_present_flag : 1;
|
||||
unsigned int weighted_pred_flag : 1;
|
||||
unsigned int weighted_bipred_idc : 2;
|
||||
unsigned int deblocking_filter_control_present_flag : 1;
|
||||
unsigned int constrained_intra_pred_flag : 1;
|
||||
unsigned int redundant_pic_cnt_present_flag : 1;
|
||||
unsigned int transform_8x8_mode_flag : 1;
|
||||
unsigned int xvba_avc_pps_reserved : 23;
|
||||
} avc;
|
||||
|
||||
struct {
|
||||
unsigned int panscan_flag : 1;
|
||||
unsigned int refdist_flag : 1;
|
||||
unsigned int loopfilter : 1;
|
||||
unsigned int fastuvmc : 1;
|
||||
unsigned int extended_mv : 1;
|
||||
unsigned int dquant : 2;
|
||||
unsigned int vstransform : 1;
|
||||
unsigned int overlap : 1;
|
||||
unsigned int quantizer : 2;
|
||||
unsigned int extended_dmv : 1;
|
||||
unsigned int maxbframes : 3;
|
||||
unsigned int rangered : 1;
|
||||
unsigned int syncmarker : 1;
|
||||
unsigned int multires : 1;
|
||||
unsigned int reserved : 2;
|
||||
unsigned int range_mapy_flag : 1;
|
||||
unsigned int range_mapy : 3;
|
||||
unsigned int range_mapuv_flag : 1;
|
||||
unsigned int range_mapuv : 3;
|
||||
unsigned int xvba_vc1_pps_reserved: 4;
|
||||
} vc1;
|
||||
|
||||
unsigned int flags;
|
||||
} pps_info;
|
||||
|
||||
unsigned char avc_num_slice_groups_minus1;
|
||||
unsigned char avc_slice_group_map_type;
|
||||
unsigned char avc_num_ref_idx_l0_active_minus1;
|
||||
unsigned char avc_num_ref_idx_l1_active_minus1;
|
||||
|
||||
char avc_pic_init_qp_minus26;
|
||||
char avc_pic_init_qs_minus26;
|
||||
char avc_chroma_qp_index_offset;
|
||||
char avc_second_chroma_qp_index_offset;
|
||||
|
||||
unsigned short avc_slice_group_change_rate_minus1;
|
||||
unsigned short avc_reserved_16bit;
|
||||
|
||||
unsigned int avc_frame_num;
|
||||
unsigned int avc_frame_num_list[16]; ///< bit 31 is used to indicate long/short term
|
||||
int avc_curr_field_order_cnt_list[2];
|
||||
int avc_field_order_cnt_list[16][2];
|
||||
|
||||
unsigned char avc_slice_group_map[810];
|
||||
|
||||
int avc_intra_flag;
|
||||
int avc_reference;
|
||||
|
||||
int xvba_reserved[14];
|
||||
|
||||
} XVBAPictureDescriptor;
|
||||
|
||||
/**
|
||||
* XVBA Compressed data type: XVBA_DATA_CTRL_BUFFER
|
||||
* (H264 and VC1 only)
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
unsigned int SliceBitsInBuffer;
|
||||
unsigned int SliceDataLocation;
|
||||
unsigned int SliceBytesInBuffer;
|
||||
unsigned int reserved[5];
|
||||
|
||||
} XVBADataCtrl;
|
||||
|
||||
/**
|
||||
* XVBA Compressed data type: XVBA_DATA_BUFFER
|
||||
* (MPEG2 iDCT level decode only)
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
struct
|
||||
{
|
||||
unsigned short index: 15; ///< contains rates scan index of the coefficient within the block.
|
||||
///< cannot be greater or equal to (block width * block height)
|
||||
unsigned short endofblock: 1;
|
||||
} idx;
|
||||
short coeff; ///< value of the coefficient in the block; mismatch control and
|
||||
///< clipping is host.s responsibility
|
||||
|
||||
} XVBAMpeg2Residual;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
short horizontal;
|
||||
short vertical;
|
||||
} XVBAMpeg2MV;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned short mb_address;
|
||||
struct
|
||||
{
|
||||
unsigned short mb_intra : 1;
|
||||
unsigned short motion_fw : 1;
|
||||
unsigned short motion_back : 1;
|
||||
unsigned short reserved2 : 2;
|
||||
unsigned short field_residual : 1;
|
||||
unsigned short mb_scan_mode : 2;
|
||||
unsigned short motion_type : 2;
|
||||
unsigned short reserved1 : 2;
|
||||
unsigned short motion_vector_sel0 : 1;
|
||||
unsigned short motion_vector_sel1 : 1;
|
||||
unsigned short motion_vector_sel2 : 1;
|
||||
unsigned short motion_vector_sel3 : 1;
|
||||
} mpeg2data1;
|
||||
|
||||
struct
|
||||
{
|
||||
unsigned int mb_data_resid_location : 24;
|
||||
unsigned int skipped_mb : 8;
|
||||
} mpeg2data2;
|
||||
|
||||
unsigned short pattern_code;
|
||||
unsigned char numcoeff[6];
|
||||
|
||||
} XVBAMpeg2IntraMB;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned short mb_address;
|
||||
struct
|
||||
{
|
||||
unsigned short mb_intra : 1;
|
||||
unsigned short motion_fw : 1;
|
||||
unsigned short motion_back : 1;
|
||||
unsigned short reserved2 : 2;
|
||||
unsigned short field_residual : 1;
|
||||
unsigned short mb_scan_mode : 2;
|
||||
unsigned short motion_type : 2;
|
||||
unsigned short reserved1 : 2;
|
||||
unsigned short motion_vector_sel0 : 1;
|
||||
unsigned short motion_vector_sel1 : 1;
|
||||
unsigned short motion_vector_sel2 : 1;
|
||||
unsigned short motion_vector_sel3 : 1;
|
||||
} mpeg2data1;
|
||||
|
||||
struct
|
||||
{
|
||||
unsigned int mb_data_resid_location : 24;
|
||||
unsigned int skipped_mb : 8;
|
||||
} mpeg2data2;
|
||||
|
||||
unsigned short pattern_code;
|
||||
unsigned char numcoeff[6];
|
||||
|
||||
XVBAMpeg2MV motion_vector[4];
|
||||
|
||||
} XVBAMpeg2NonIntraMB;
|
||||
|
||||
/**
|
||||
* XVBA compressed data type: XVBA_QM_BUFFER
|
||||
* (H264 and VC1 only)
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
unsigned char bScalingLists4x4[6][16];
|
||||
unsigned char bScalingLists8x8[2][64];
|
||||
|
||||
} XVBAQuantMatrixAvc;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif //_XVBA_H
|
@ -1,40 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
################################################################################
|
||||
# This file is part of OpenELEC - http://www.openelec.tv
|
||||
# Copyright (C) 2009-2012 Stephan Raue (stephan@openelec.tv)
|
||||
#
|
||||
# This Program 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, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# This Program 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.tv; see the file COPYING. If not, write to
|
||||
# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA.
|
||||
# http://www.gnu.org/copyleft/gpl.html
|
||||
################################################################################
|
||||
|
||||
. config/options $1
|
||||
|
||||
require_eglibc $1
|
||||
|
||||
ZIP_PKG="`echo $PKG_URL | sed 's%.*/\(.*\)$%\1%'`"
|
||||
[ -d $PKG_BUILD ] && rm -rf $PKG_BUILD
|
||||
|
||||
mkdir -p $BUILD/${PKG_NAME}-${PKG_VERSION}
|
||||
unzip $SOURCES/$1/$ZIP_PKG -d $BUILD/${PKG_NAME}-${PKG_VERSION} >/dev/null 2>&1
|
||||
ATI_PKG=`ls -d $BUILD/${PKG_NAME}-${PKG_VERSION}/amd-driver-installer-*.run`
|
||||
sh $ATI_PKG --extract $BUILD/$PKG_NAME-$PKG_VERSION
|
||||
|
||||
echo "### Applying upstream patches ###"
|
||||
|
||||
for patch in `ls $PKG_DIR/patches.upstream/*.patch`; do
|
||||
cat $patch | patch -d \
|
||||
`echo $BUILD/$PKG_NAME-$PKG_VERSION | cut -f1 -d\ ` -p1
|
||||
done
|
Loading…
x
Reference in New Issue
Block a user