Created
February 23, 2011 17:41
-
-
Save nicodds/840787 to your computer and use it in GitHub Desktop.
Patch to let psb-kernel-source compile against linux kernel version 2.6.38
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -u ./drm_agpsupport.c ../psb-kernel-source-4.42.0/drm_agpsupport.c | |
--- ./drm_agpsupport.c 2011-02-23 18:16:22.000000000 +0100 | |
+++ ../psb-kernel-source-4.42.0/drm_agpsupport.c 2011-02-23 14:56:03.000000000 +0100 | |
@@ -641,10 +641,10 @@ | |
} | |
EXPORT_SYMBOL(psb_drm_agp_init_ttm); | |
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25) | |
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25) && LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38) | |
void psb_drm_agp_flush_chipset(struct drm_device *dev) | |
{ | |
- agp_flush_chipset(dev->agp->bridge); | |
+ agp_flush_chipset(dev->agp->bridge); | |
} | |
EXPORT_SYMBOL(psb_drm_agp_flush_chipset); | |
#endif | |
diff -u ./psb_drv.c ../psb-kernel-source-4.42.0/psb_drv.c | |
--- ./psb_drv.c 2011-02-23 18:16:22.000000000 +0100 | |
+++ ../psb-kernel-source-4.42.0/psb_drv.c 2011-02-23 18:01:42.000000000 +0100 | |
@@ -355,7 +355,7 @@ | |
tt_pages -= tt_start >> PAGE_SHIFT; | |
mutex_lock(&dev->struct_mutex); | |
- | |
+ | |
if (!psb_drm_bo_init_mm(dev, DRM_BO_MEM_VRAM, 0, | |
pg->stolen_size >> PAGE_SHIFT)) { | |
dev_priv->have_vram = 1; | |
@@ -387,7 +387,7 @@ | |
#endif | |
mutex_unlock(&dev->struct_mutex); | |
- | |
+ | |
return 0; | |
out_err: | |
psb_do_takedown(dev); | |
@@ -989,7 +989,11 @@ | |
.owner = THIS_MODULE, | |
.open = psb_drm_open, | |
.release = psb_release, | |
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38) | |
+ .unlocked_ioctl = psb_drm_ioctl, | |
+#else | |
.ioctl = psb_drm_ioctl, | |
+#endif | |
.mmap = psb_drm_mmap, | |
.poll = psb_poll, | |
.fasync = psb_drm_fasync, | |
diff -u ./psb_fb.c ../psb-kernel-source-4.42.0/psb_fb.c | |
--- ./psb_fb.c 2011-02-23 18:16:22.000000000 +0100 | |
+++ ../psb-kernel-source-4.42.0/psb_fb.c 2011-02-23 18:24:45.000000000 +0100 | |
@@ -1,3 +1,4 @@ | |
+ | |
/************************************************************************** | |
* Copyright (c) 2007, Intel Corporation. | |
* All Rights Reserved. | |
@@ -58,6 +59,22 @@ | |
int dpms_state; | |
}; | |
+static void psb_console_lock() { | |
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38) | |
+ console_lock(); | |
+#else | |
+ acquire_console_sem(); | |
+#endif | |
+} | |
+ | |
+static void psb_console_unlock() { | |
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38) | |
+ console_unlock(); | |
+#else | |
+ release_console_sem(); | |
+#endif | |
+} | |
+ | |
static void psbfb_vm_info_deref(struct psbfb_vm_info **vi) | |
{ | |
struct psbfb_vm_info *tmp = *vi; | |
@@ -873,10 +890,9 @@ | |
struct drm_file *file_priv) | |
{ | |
int ret; | |
- | |
- acquire_console_sem(); | |
+ psb_console_lock(); | |
ret = psbfb_kms_off(dev, 0); | |
- release_console_sem(); | |
+ psb_console_unlock(); | |
return ret; | |
} | |
@@ -952,10 +968,9 @@ | |
struct drm_file *file_priv) | |
{ | |
int ret; | |
- | |
- acquire_console_sem(); | |
+ psb_console_lock(); | |
ret = psbfb_kms_on(dev, 0); | |
- release_console_sem(); | |
+ psb_console_unlock(); | |
#ifdef SII_1392_WA | |
if((SII_1392 != 1) || (drm_psb_no_fb==0)) | |
psb_drm_disable_unused_functions(dev); | |
@@ -967,16 +982,16 @@ | |
void psbfb_suspend(struct drm_device *dev) | |
{ | |
- acquire_console_sem(); | |
+ psb_console_lock(); | |
psbfb_kms_off(dev, 1); | |
- release_console_sem(); | |
+ psb_console_unlock(); | |
} | |
void psbfb_resume(struct drm_device *dev) | |
{ | |
- acquire_console_sem(); | |
+ psb_console_lock(); | |
psbfb_kms_on(dev, 1); | |
- release_console_sem(); | |
+ psb_console_unlock(); | |
#ifdef SII_1392_WA | |
if((SII_1392 != 1) || (drm_psb_no_fb==0)) | |
psb_drm_disable_unused_functions(dev); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment