[Pkg-fglrx-devel] r1249 - fglrx-driver/trunk/debian/patches
Michael Gilbert
mgilbert at alioth.debian.org
Thu Jul 25 17:01:02 UTC 2013
Author: mgilbert
Date: 2013-07-25 17:01:01 +0000 (Thu, 25 Jul 2013)
New Revision: 1249
Added:
fglrx-driver/trunk/debian/patches/07-change-create_proc-to-proc_create-for-kernel-3.10.X.patch
fglrx-driver/trunk/debian/patches/08-add-linux-seq_file.h-for-kernel-3.10.X.patch
Modified:
fglrx-driver/trunk/debian/patches/series
Log:
add support for linux 3.10 (closes: #717224)
Added: fglrx-driver/trunk/debian/patches/07-change-create_proc-to-proc_create-for-kernel-3.10.X.patch
===================================================================
--- fglrx-driver/trunk/debian/patches/07-change-create_proc-to-proc_create-for-kernel-3.10.X.patch (rev 0)
+++ fglrx-driver/trunk/debian/patches/07-change-create_proc-to-proc_create-for-kernel-3.10.X.patch 2013-07-25 17:01:01 UTC (rev 1249)
@@ -0,0 +1,64 @@
+From 9cd3d917851adf5be745cbdad0d3d178994e122e Mon Sep 17 00:00:00 2001
+From: Krzysztof Kolasa <kkolasa at winsoft.pl>
+Date: Sun, 7 Jul 2013 14:52:26 +0200
+Subject: change create_proc* to proc_create for kernel >= 3.10.X
+Origin: other, https://github.com/kolasa/fglrx-8.97.100.7/commit/9cd3d917851adf5be745cbdad0d3d178994e122e
+
+---
+ drm_proc.h | 15 +++++++++++++++
+ 1 file changed, 15 insertions(+)
+
+diff --git a/common/lib/modules/fglrx/build_mod/drm_proc.h b/common/lib/modules/fglrx/build_mod/drm_proc.h
+index 1e3ab4a..3879352 100644
+--- a/common/lib/modules/fglrx/build_mod/drm_proc.h
++++ b/common/lib/modules/fglrx/build_mod/drm_proc.h
+@@ -95,22 +95,35 @@ struct proc_dir_entry *DRM(proc_init)(drm_device_t *dev, int minor,
+ int i, j;
+ char name[64];
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
+ if (!minor) root = create_proc_entry("dri", S_IFDIR, NULL);
++#else
++ if (!minor) root = proc_mkdir("dri", NULL);
++#endif
+ if (!root) {
+ DRM_ERROR("Cannot create /proc/ati\n");
+ return NULL;
+ }
+
+ sprintf(name, "%d", minor);
++#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
+ *dev_root = create_proc_entry(name, S_IFDIR, root);
++#else
++ *dev_root = proc_mkdir(name, root);
++#endif
+ if (!*dev_root) {
+ DRM_ERROR("Cannot create /proc/ati/%s\n", name);
+ return NULL;
+ }
+
+ for (i = 0; i < DRM_PROC_ENTRIES; i++) {
++#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
+ ent = create_proc_entry(DRM(proc_list)[i].name,
+ S_IFREG|S_IRUGO, *dev_root);
++#else
++ ent = proc_create_data(DRM(proc_list)[i].name,
++ S_IFREG|S_IRUGO, *dev_root, &firegl_fops, dev);
++#endif
+ if (!ent) {
+ DRM_ERROR("Cannot create /proc/ati/%s/%s\n",
+ name, DRM(proc_list)[i].name);
+@@ -121,8 +134,10 @@ struct proc_dir_entry *DRM(proc_init)(drm_device_t *dev, int minor,
+ if (!minor) remove_proc_entry("dri", NULL);
+ return NULL;
+ }
++#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
+ ent->read_proc = DRM(proc_list)[i].f;
+ ent->data = dev;
++#endif
+ }
+
+ return root;
+--
+1.7.10.4
+
Added: fglrx-driver/trunk/debian/patches/08-add-linux-seq_file.h-for-kernel-3.10.X.patch
===================================================================
--- fglrx-driver/trunk/debian/patches/08-add-linux-seq_file.h-for-kernel-3.10.X.patch (rev 0)
+++ fglrx-driver/trunk/debian/patches/08-add-linux-seq_file.h-for-kernel-3.10.X.patch 2013-07-25 17:01:01 UTC (rev 1249)
@@ -0,0 +1,202 @@
+From 8fe4ed8f29b70601a818cd7d04ecffcda0bb2193 Mon Sep 17 00:00:00 2001
+From: Krzysztof Kolasa <kkolasa at winsoft.pl>
+Date: Sun, 7 Jul 2013 16:08:06 +0200
+Subject: add linux/seq_file.h for kernel >= 3.10.X
+Origin: other, https://github.com/kolasa/fglrx-8.97.100.7/commit/8fe4ed8f29b70601a818cd7d04ecffcda0bb2193
+
+---
+ firegl_public.c | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++++---
+ 1 file changed, 74 insertions(+), 4 deletions(-)
+
+diff --git a/common/lib/modules/fglrx/build_mod/firegl_public.c b/common/lib/modules/fglrx/build_mod/firegl_public.c
+index c69e69d..03eddec 100644
+--- a/common/lib/modules/fglrx/build_mod/firegl_public.c
++++ b/common/lib/modules/fglrx/build_mod/firegl_public.c
+@@ -196,6 +196,10 @@
+ #include "kcl_io.h"
+ #include "kcl_debug.h"
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)
++#include <linux/seq_file.h>
++#endif
++
+ // ============================================================
+
+ // VM_SHM is deleted in 2.6.18 or higher kernels.
+@@ -513,16 +517,26 @@ READ_PROC_WRAP(firegl_lock_info)
+ #ifdef DEBUG
+ READ_PROC_WRAP(drm_bq_info)
+ #endif
++#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
+ READ_PROC_WRAP(firegl_debug_proc_read)
++#endif
+ READ_PROC_WRAP(firegl_bios_version)
+ READ_PROC_WRAP(firegl_interrupt_info)
+ READ_PROC_WRAP(firegl_ptm_info)
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
+ static int firegl_debug_proc_write_wrap(void* file, const char *buffer, unsigned long count, void *data)
+-{
+- return firegl_debug_proc_write(file, buffer, count, data);
++#else
++static int firegl_debug_proc_read_wrap(struct seq_file *m, void* data)
++{
++ return firegl_debug_proc_read(m->buf, m->from, m->index, m->size, m->size - m->count, data);
+ }
+
++static ssize_t firegl_debug_proc_write_wrap(struct file *file, const char *buffer, size_t count, void *data)
++#endif
++{
++ return firegl_debug_proc_write(file, buffer, count, data);
++}
+ /** \brief Callback function for reading from /proc/ati/major
+ *
+ * Returns the major device number in the outupt buffer in decimal.
+@@ -536,9 +550,14 @@ static int firegl_debug_proc_write_wrap(void* file, const char *buffer, unsigned
+ *
+ * \return number of bytes written
+ */
++#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
+ static int firegl_major_proc_read(char *buf, char **start, kcl_off_t offset,
+ int request, int* eof, void* data)
++#else
++static int firegl_major_proc_read(struct seq_file *m, void* data)
++#endif
+ {
++#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
+ int len = 0; // For ProcFS: fill buf from the beginning
+
+ KCL_DEBUG1(FN_FIREGL_PROC, "offset %d\n", (int)offset);
+@@ -553,7 +572,9 @@ static int firegl_major_proc_read(char *buf, char **start, kcl_off_t offset,
+ *eof = 1;
+
+ len = snprintf(buf, request, "%d\n", major);
+-
++#else
++ int len = seq_printf(m, "%d\n", major);
++#endif
+ KCL_DEBUG1(FN_FIREGL_PROC, "return len=%i\n",len);
+
+ return len;
+@@ -576,6 +597,29 @@ kcl_proc_list_t KCL_PROC_FileList[] =
+ { "NULL", NULL, NULL} // Terminate List!!!
+ };
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)
++static int firegl_major_proc_open(struct inode *inode, struct file *file){
++ return single_open(file, firegl_major_proc_read, NULL);
++}
++
++static const struct file_operations firegl_major_fops = {
++ .open = firegl_major_proc_open,
++ .read = seq_read,
++ .llseek = seq_lseek,
++};
++
++static int firegl_debug_proc_open(struct inode *inode, struct file *file){
++ return single_open(file, firegl_debug_proc_read_wrap, NULL);
++}
++
++static const struct file_operations firegl_debug_fops = {
++ .open = firegl_debug_proc_open,
++ .write = firegl_debug_proc_write_wrap,
++ .read = seq_read,
++ .llseek = seq_lseek,
++};
++#endif
++
+ static struct proc_dir_entry *firegl_proc_init( device_t *dev,
+ int minor,
+ struct proc_dir_entry *root,
+@@ -588,7 +632,11 @@ static struct proc_dir_entry *firegl_proc_init( device_t *dev,
+ KCL_DEBUG1(FN_FIREGL_PROC, "minor %d, proc_list 0x%08lx\n", minor, (unsigned long)proc_list);
+ if (!minor)
+ {
++#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
+ root = create_proc_entry("ati", S_IFDIR, NULL);
++#else
++ root = proc_mkdir("ati", NULL);
++#endif
+ }
+
+ if (!root)
+@@ -600,18 +648,28 @@ static struct proc_dir_entry *firegl_proc_init( device_t *dev,
+ if (minor == 0)
+ {
+ // Global major debice number entry
++#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
+ ent = create_proc_entry("major", S_IFREG|S_IRUGO, root);
++#else
++ ent = proc_create("major", S_IFREG|S_IRUGO, root, &firegl_major_fops);
++#endif
+ if (!ent)
+ {
+ remove_proc_entry("ati", NULL);
+ KCL_DEBUG_ERROR("Cannot create /proc/ati/major\n");
+ return NULL;
+ }
++#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
+ ent->read_proc = (read_proc_t*)firegl_major_proc_read;
++#endif
+ }
+
+ sprintf(name, "%d", minor);
++#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
+ *dev_root = create_proc_entry(name, S_IFDIR, root);
++#else
++ *dev_root = proc_mkdir(name, root);
++#endif
+ if (!*dev_root) {
+ remove_proc_entry("major", root);
+ remove_proc_entry("ati", NULL);
+@@ -621,7 +679,12 @@ static struct proc_dir_entry *firegl_proc_init( device_t *dev,
+
+ while (list->f || list->fops)
+ {
++#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
+ ent = create_proc_entry(list->name, S_IFREG|S_IRUGO, *dev_root);
++#else
++ ent = proc_create_data(list->name, S_IFREG|S_IRUGO, *dev_root, &firegl_fops,
++ (dev->pubdev.signature == FGL_DEVICE_SIGNATURE)? firegl_find_device(minor) : (dev));
++#endif
+ if (!ent)
+ {
+ KCL_DEBUG_ERROR("Cannot create /proc/ati/%s/%s\n", name, list->name);
+@@ -639,6 +702,7 @@ static struct proc_dir_entry *firegl_proc_init( device_t *dev,
+ return NULL;
+ }
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
+ if (list->f)
+ {
+ ent->read_proc = (read_proc_t*)list->f;
+@@ -652,19 +716,25 @@ static struct proc_dir_entry *firegl_proc_init( device_t *dev,
+ {
+ ent->data = (dev->pubdev.signature == FGL_DEVICE_SIGNATURE)? firegl_find_device(minor) : (dev);
+ }
+-
++#endif
+ list++;
+ }
+
+ if (minor == 0)
+ {
+ // Global debug entry, only create it once
++#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
+ ent = create_proc_entry("debug", S_IFREG|S_IRUGO, root);
++#else
++ ent = proc_create_data("debug", S_IFREG|S_IRUGO, root, &firegl_debug_fops, dev);
++#endif
+ if (ent)
+ {
++#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
+ ent->read_proc = (read_proc_t*)firegl_debug_proc_read_wrap;
+ ent->write_proc = (write_proc_t*)firegl_debug_proc_write_wrap;
+ ent->data = dev;
++#endif
+ }
+ }
+
+--
+1.7.10.4
+
Modified: fglrx-driver/trunk/debian/patches/series
===================================================================
--- fglrx-driver/trunk/debian/patches/series 2013-07-25 17:00:56 UTC (rev 1248)
+++ fglrx-driver/trunk/debian/patches/series 2013-07-25 17:01:01 UTC (rev 1249)
@@ -1,3 +1,5 @@
02-dkms-arch_compat.diff
03-authatieventsd.sh.diff
06-stub-for-agpless-kernel.diff
+07-change-create_proc-to-proc_create-for-kernel-3.10.X.patch
+08-add-linux-seq_file.h-for-kernel-3.10.X.patch
More information about the Pkg-fglrx-devel
mailing list