#! /bin/sh /usr/share/dpatch/dpatch-run
## 2.6.38.dpatch by <luca@tower>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: No description.
@DPATCH@
diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' psb-kernel-source~/drm_agpsupport.c psb-kernel-source/drm_agpsupport.c
--- psb-kernel-source~/drm_agpsupport.c 2011-02-24 09:11:42.892073202 +0100
+++ psb-kernel-source/drm_agpsupport.c 2011-02-24 09:14:45.656073202 +0100
@@ -641,7 +641,7 @@
}
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);
diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' psb-kernel-source~/psb_fb.c psb-kernel-source/psb_fb.c
--- psb-kernel-source~/psb_fb.c 2011-02-24 09:11:42.940073202 +0100
+++ psb-kernel-source/psb_fb.c 2011-02-24 09:19:34.500073202 +0100
@@ -58,6 +58,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;
@@ -874,9 +890,9 @@
{
int ret;
- acquire_console_sem();
+ psb_console_lock();
ret = psbfb_kms_off(dev, 0);
- release_console_sem();
+ psb_console_unlock();
return ret;
}
@@ -953,9 +969,9 @@
{
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 +983,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);