Notice: Trying to access array offset on value of type bool in /srv/www/vhosts/openpandora.org/domains/bugs.openpandora.org/httpdocs/scripts/details.php on line 649 FS#274 : Patch for TI SGX 4.04.00.03 drivers to compile against kernel 3.2.1

OpenPandora Development OS

  • Status Unconfirmed
  • Percent Complete
    0%
  • Task Type Bug Report
  • Category Backend / Core
  • Operating System AllRelease 2 (Yars Revenge)
  • Priority Very Low
  • Reported Version First Release
Attached to Project: OpenPandora Development OS
Opened by Chris - 17.02.2012

FS#274 - Patch for TI SGX 4.04.00.03 drivers to compile against kernel 3.2.1

This patch when applied aginst TI 4.04.00.03 SGX drivers will allow building the pvr kernel modules. This relies on task 272 (kernel patch) and should be used inconjuction with task 273 diff -ru a/Graphics_SDK_4_04_00_03/GFX_Linux_KM/services4/3rdparty/dc_omapfb3_linux/omaplfb_displayclass.c b/Graphics_SDK_4_04_00_03/GFX_Linux_KM/services4/3rdparty/dc_omapfb3_linux/omaplfb_displayclass.c --- a/Graphics_SDK_4_04_00_03/GFX_Linux_KM/services4/3rdparty/dc_omapfb3_linux/omaplfb_displayclass.c 2011-06-20 21:03:33.000000000 +1000 +++ b/Graphics_SDK_4_04_00_03/GFX_Linux_KM/services4/3rdparty/dc_omapfb3_linux/omaplfb_displayclass.c 2012-02-09 08:37:21.000000000 +1100 @@ -830,7 +830,11 @@ unsigned long ulLCM; unsigned uiFBDevID = psDevInfo->uiFBDevID; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38) + console_lock(); +#else acquire_console_sem(); +#endif psLINFBInfo = registered_fb[uiFBDevID]; if (psLINFBInfo == NULL) @@ -972,7 +976,11 @@ ErrorModPut: module_put(psLINFBOwner); ErrorRelSem: +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38) + console_unlock(); +#else release_console_sem(); +#endif return eError; } @@ -982,7 +990,11 @@ struct fb_info *psLINFBInfo = psDevInfo->psLINFBInfo; struct module *psLINFBOwner; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38) + console_lock(); +#else acquire_console_sem(); +#endif psLINFBOwner = psLINFBInfo->fbops->owner; @@ -993,7 +1005,11 @@ module_put(psLINFBOwner); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38) + console_unlock(); +#else release_console_sem(); +#endif } static OMAPLFB_DEVINFO *OMAPLFBInitDev(unsigned uiFBDevID) diff -ru a/Graphics_SDK_4_04_00_03/GFX_Linux_KM/services4/3rdparty/dc_omapfb3_linux/omaplfb_linux.c b/Graphics_SDK_4_04_00_03/GFX_Linux_KM/services4/3rdparty/dc_omapfb3_linux/omaplfb_linux.c --- a/Graphics_SDK_4_04_00_03/GFX_Linux_KM/services4/3rdparty/dc_omapfb3_linux/omaplfb_linux.c 2011-06-20 21:03:33.000000000 +1000 +++ b/Graphics_SDK_4_04_00_03/GFX_Linux_KM/services4/3rdparty/dc_omapfb3_linux/omaplfb_linux.c 2012-02-09 13:14:28.000000000 +1100 @@ -24,11 +24,14 @@ * ******************************************************************************/ + +#include +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38) #ifndef AUTOCONF_INCLUDED #include #endif +#endif -#include #include @@ -236,8 +239,11 @@ struct fb_var_screeninfo sFBVar; int res; unsigned long ulYResVirtual; - +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38) + console_lock(); +#else acquire_console_sem(); +#endif sFBVar = psDevInfo->psLINFBInfo->var; @@ -268,31 +274,37 @@ printk(KERN_INFO DRIVER_PREFIX ": %s: Device %u: fb_pan_display failed (Y Offset: %lu, Error: %d)\n", __FUNCTION__, psDevInfo->uiFBDevID, psBuffer->ulYOffset, res); } } - +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38) + console_unlock(); +#else release_console_sem(); +#endif } OMAPLFB_UPDATE_MODE OMAPLFBGetUpdateMode(OMAPLFB_DEVINFO *psDevInfo) { struct omap_dss_device *psDSSDev = fb2display(psDevInfo->psLINFBInfo); OMAP_DSS_DRIVER(psDSSDrv, psDSSDev); - - enum omap_dss_update_mode eMode; - - if (psDSSDrv == NULL || psDSSDrv->get_update_mode == NULL) - { - DEBUG_PRINTK((KERN_INFO DRIVER_PREFIX ": %s: Device %u: Can't get update mode\n", __FUNCTION__, psDevInfo->uiFBDevID)); - return OMAPLFB_UPDATE_MODE_UNDEFINED; + if (psDSSDrv == NULL || psDSSDev == NULL) + { + DEBUG_PRINTK((KERN_INFO DRIVER_PREFIX ": %s: Device %u: No DSS device\n", __FUNCTION__, psDevInfo->uiFBDevID)); + } + enum omapfb_update_mode eMode; + + if (!omapfb_get_update_mode(psDevInfo->psLINFBInfo, &eMode)) + { +// DEBUG_PRINTK((KERN_INFO DRIVER_PREFIX ": %s: Device %u: Can't get update mode\n", __FUNCTION__, psDevInfo->uiFBDevID)); + return OMAPLFB_UPDATE_MODE_AUTO; +// return OMAPLFB_UPDATE_MODE_UNDEFINED; } - eMode = psDSSDrv->get_update_mode(psDSSDev); switch(eMode) { - case OMAP_DSS_UPDATE_AUTO: + case OMAPFB_AUTO_UPDATE: return OMAPLFB_UPDATE_MODE_AUTO; - case OMAP_DSS_UPDATE_MANUAL: + case OMAPFB_MANUAL_UPDATE: return OMAPLFB_UPDATE_MODE_MANUAL; - case OMAP_DSS_UPDATE_DISABLED: + case OMAPFB_UPDATE_DISABLED: return OMAPLFB_UPDATE_MODE_DISABLED; default: DEBUG_PRINTK((KERN_INFO DRIVER_PREFIX ": %s: Device %u: Unknown update mode (%d)\n", __FUNCTION__, psDevInfo->uiFBDevID, eMode)); @@ -307,10 +319,10 @@ { struct omap_dss_device *psDSSDev = fb2display(psDevInfo->psLINFBInfo); OMAP_DSS_DRIVER(psDSSDrv, psDSSDev); - enum omap_dss_update_mode eDSSMode; + enum omapfb_update_mode eDSSMode; int res; - if (psDSSDrv == NULL || psDSSDrv->set_update_mode == NULL) + if (psDSSDrv == NULL) { DEBUG_PRINTK((KERN_INFO DRIVER_PREFIX ": %s: Device %u: Can't set update mode\n", __FUNCTION__, psDevInfo->uiFBDevID)); return OMAPLFB_FALSE; @@ -319,20 +331,20 @@ switch(eMode) { case OMAPLFB_UPDATE_MODE_AUTO: - eDSSMode = OMAP_DSS_UPDATE_AUTO; + eDSSMode = OMAPFB_AUTO_UPDATE; break; case OMAPLFB_UPDATE_MODE_MANUAL: - eDSSMode = OMAP_DSS_UPDATE_MANUAL; + eDSSMode = OMAPFB_MANUAL_UPDATE; break; case OMAPLFB_UPDATE_MODE_DISABLED: - eDSSMode = OMAP_DSS_UPDATE_DISABLED; + eDSSMode = OMAPFB_UPDATE_DISABLED; break; default: DEBUG_PRINTK((KERN_INFO DRIVER_PREFIX ": %s: Device %u: Unknown update mode (%d)\n", __FUNCTION__, psDevInfo->uiFBDevID, eMode)); return OMAPLFB_FALSE; } - res = psDSSDrv->set_update_mode(psDSSDev, eDSSMode); + res = omapfb_set_update_mode(psDevInfo->psLINFBInfo, eDSSMode); if (res != 0) { DEBUG_PRINTK((KERN_INFO DRIVER_PREFIX ": %s: Device %u: set_update_mode failed (%d)\n", __FUNCTION__, psDevInfo->uiFBDevID, res)); @@ -441,10 +453,17 @@ OMAPLFB_ERROR OMAPLFBUnblankDisplay(OMAPLFB_DEVINFO *psDevInfo) { int res; - +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38) + console_lock(); +#else acquire_console_sem(); +#endif res = fb_blank(psDevInfo->psLINFBInfo, 0); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38) + console_unlock(); +#else release_console_sem(); +#endif if (res != 0 && res != -EINVAL) { printk(KERN_WARNING DRIVER_PREFIX @@ -459,9 +478,17 @@ static void OMAPLFBBlankDisplay(OMAPLFB_DEVINFO *psDevInfo) { +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38) + console_lock(); +#else acquire_console_sem(); +#endif fb_blank(psDevInfo->psLINFBInfo, 1); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38) + console_unlock(); +#else release_console_sem(); +#endif } static void OMAPLFBEarlySuspendHandler(struct early_suspend *h) @@ -692,9 +719,17 @@ flush_workqueue(psDevInfo->psSwapChain->psWorkQueue); } +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38) + console_lock(); +#else acquire_console_sem(); +#endif ret = fb_blank(psDevInfo->psLINFBInfo, iFBMode); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38) + console_unlock(); +#else release_console_sem(); +#endif OMAPLFBCreateSwapChainUnLock(psDevInfo); @@ -717,7 +752,6 @@ static int __init OMAPLFB_Init(void) #endif { - if(OMAPLFBInit() != OMAPLFB_OK) { printk(KERN_WARNING DRIVER_PREFIX ": %s: OMAPLFBInit failed\n", __FUNCTION__); diff -ru a/Graphics_SDK_4_04_00_03/GFX_Linux_KM/services4/srvkm/common/resman.c b/Graphics_SDK_4_04_00_03/GFX_Linux_KM/services4/srvkm/common/resman.c --- a/Graphics_SDK_4_04_00_03/GFX_Linux_KM/services4/srvkm/common/resman.c 2011-06-20 21:03:34.000000000 +1000 +++ b/Graphics_SDK_4_04_00_03/GFX_Linux_KM/services4/srvkm/common/resman.c 2012-02-09 23:33:43.000000000 +1100 @@ -24,15 +24,17 @@ * ******************************************************************************/ +#include #include "services_headers.h" #include "resman.h" #ifdef __linux__ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38) #ifndef AUTOCONF_INCLUDED #include #endif +#endif -#include #include #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,9) #include diff -ru a/Graphics_SDK_4_04_00_03/GFX_Linux_KM/services4/srvkm/env/linux/event.c b/Graphics_SDK_4_04_00_03/GFX_Linux_KM/services4/srvkm/env/linux/event.c --- a/Graphics_SDK_4_04_00_03/GFX_Linux_KM/services4/srvkm/env/linux/event.c 2011-06-20 21:03:34.000000000 +1000 +++ b/Graphics_SDK_4_04_00_03/GFX_Linux_KM/services4/srvkm/env/linux/event.c 2012-02-09 09:00:12.000000000 +1100 @@ -24,11 +24,14 @@ * ******************************************************************************/ +#include + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38) #ifndef AUTOCONF_INCLUDED #include #endif +#endif -#include #include #include #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)) diff -ru a/Graphics_SDK_4_04_00_03/GFX_Linux_KM/services4/srvkm/env/linux/mmap.c b/Graphics_SDK_4_04_00_03/GFX_Linux_KM/services4/srvkm/env/linux/mmap.c --- a/Graphics_SDK_4_04_00_03/GFX_Linux_KM/services4/srvkm/env/linux/mmap.c 2011-06-20 21:03:34.000000000 +1000 +++ b/Graphics_SDK_4_04_00_03/GFX_Linux_KM/services4/srvkm/env/linux/mmap.c 2012-02-09 08:56:41.000000000 +1100 @@ -24,11 +24,14 @@ * ******************************************************************************/ +#include + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38) #ifndef AUTOCONF_INCLUDED #include #endif +#endif -#include #include #include #include diff -ru a/Graphics_SDK_4_04_00_03/GFX_Linux_KM/services4/srvkm/env/linux/mm.c b/Graphics_SDK_4_04_00_03/GFX_Linux_KM/services4/srvkm/env/linux/mm.c --- a/Graphics_SDK_4_04_00_03/GFX_Linux_KM/services4/srvkm/env/linux/mm.c 2011-06-20 21:03:34.000000000 +1000 +++ b/Graphics_SDK_4_04_00_03/GFX_Linux_KM/services4/srvkm/env/linux/mm.c 2012-02-09 08:52:48.000000000 +1100 @@ -24,11 +24,14 @@ * ******************************************************************************/ +#include + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38) #ifndef AUTOCONF_INCLUDED #include #endif +#endif -#include #include #include #include diff -ru a/Graphics_SDK_4_04_00_03/GFX_Linux_KM/services4/srvkm/env/linux/mm.h b/Graphics_SDK_4_04_00_03/GFX_Linux_KM/services4/srvkm/env/linux/mm.h --- a/Graphics_SDK_4_04_00_03/GFX_Linux_KM/services4/srvkm/env/linux/mm.h 2011-06-20 21:03:34.000000000 +1000 +++ b/Graphics_SDK_4_04_00_03/GFX_Linux_KM/services4/srvkm/env/linux/mm.h 2012-02-09 08:55:49.000000000 +1100 @@ -27,11 +27,14 @@ #ifndef __IMG_LINUX_MM_H__ #define __IMG_LINUX_MM_H__ +#include + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38) #ifndef AUTOCONF_INCLUDED #include #endif +#endif -#include #include #include #include diff -ru a/Graphics_SDK_4_04_00_03/GFX_Linux_KM/services4/srvkm/env/linux/module.c b/Graphics_SDK_4_04_00_03/GFX_Linux_KM/services4/srvkm/env/linux/module.c --- a/Graphics_SDK_4_04_00_03/GFX_Linux_KM/services4/srvkm/env/linux/module.c 2011-06-20 21:03:34.000000000 +1000 +++ b/Graphics_SDK_4_04_00_03/GFX_Linux_KM/services4/srvkm/env/linux/module.c 2012-02-09 08:59:05.000000000 +1100 @@ -24,9 +24,13 @@ * ******************************************************************************/ +#include + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38) #ifndef AUTOCONF_INCLUDED #include #endif +#endif #if !defined(SUPPORT_DRI_DRM) @@ -44,7 +48,6 @@ #include #include #include -#include #include #include diff -ru a/Graphics_SDK_4_04_00_03/GFX_Linux_KM/services4/srvkm/env/linux/mutils.c b/Graphics_SDK_4_04_00_03/GFX_Linux_KM/services4/srvkm/env/linux/mutils.c --- a/Graphics_SDK_4_04_00_03/GFX_Linux_KM/services4/srvkm/env/linux/mutils.c 2011-06-20 21:03:34.000000000 +1000 +++ b/Graphics_SDK_4_04_00_03/GFX_Linux_KM/services4/srvkm/env/linux/mutils.c 2012-02-10 00:24:09.000000000 +1100 @@ -24,10 +24,13 @@ * ******************************************************************************/ +#include + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38) #ifndef AUTOCONF_INCLUDED #include #endif -#include +#endif #include #include diff -ru a/Graphics_SDK_4_04_00_03/GFX_Linux_KM/services4/srvkm/env/linux/mutils.h b/Graphics_SDK_4_04_00_03/GFX_Linux_KM/services4/srvkm/env/linux/mutils.h --- a/Graphics_SDK_4_04_00_03/GFX_Linux_KM/services4/srvkm/env/linux/mutils.h 2011-06-20 21:03:34.000000000 +1000 +++ b/Graphics_SDK_4_04_00_03/GFX_Linux_KM/services4/srvkm/env/linux/mutils.h 2012-02-09 08:54:31.000000000 +1100 @@ -27,11 +27,13 @@ #ifndef __IMG_LINUX_MUTILS_H__ #define __IMG_LINUX_MUTILS_H__ +#include + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38) #ifndef AUTOCONF_INCLUDED #include #endif - -#include +#endif #if !(defined(__i386__) && (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26))) #if defined(SUPPORT_LINUX_X86_PAT) diff -ru a/Graphics_SDK_4_04_00_03/GFX_Linux_KM/services4/srvkm/env/linux/osfunc.c b/Graphics_SDK_4_04_00_03/GFX_Linux_KM/services4/srvkm/env/linux/osfunc.c --- a/Graphics_SDK_4_04_00_03/GFX_Linux_KM/services4/srvkm/env/linux/osfunc.c 2011-06-20 21:03:34.000000000 +1000 +++ b/Graphics_SDK_4_04_00_03/GFX_Linux_KM/services4/srvkm/env/linux/osfunc.c 2012-02-09 09:01:16.000000000 +1100 @@ -24,11 +24,14 @@ * ******************************************************************************/ +#include + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38) #ifndef AUTOCONF_INCLUDED #include #endif +#endif -#include #include #include #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)) diff -ru a/Graphics_SDK_4_04_00_03/GFX_Linux_KM/services4/srvkm/env/linux/proc.c b/Graphics_SDK_4_04_00_03/GFX_Linux_KM/services4/srvkm/env/linux/proc.c --- a/Graphics_SDK_4_04_00_03/GFX_Linux_KM/services4/srvkm/env/linux/proc.c 2011-06-20 21:03:34.000000000 +1000 +++ b/Graphics_SDK_4_04_00_03/GFX_Linux_KM/services4/srvkm/env/linux/proc.c 2012-02-09 08:57:49.000000000 +1100 @@ -24,13 +24,16 @@ * ******************************************************************************/ +#include + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38) #ifndef AUTOCONF_INCLUDED #include #endif +#endif #include #include -#include #include #include #include diff -ru a/Graphics_SDK_4_04_00_03/GFX_Linux_KM/services4/srvkm/env/linux/pvr_debug.c b/Graphics_SDK_4_04_00_03/GFX_Linux_KM/services4/srvkm/env/linux/pvr_debug.c --- a/Graphics_SDK_4_04_00_03/GFX_Linux_KM/services4/srvkm/env/linux/pvr_debug.c 2011-06-20 21:03:34.000000000 +1000 +++ b/Graphics_SDK_4_04_00_03/GFX_Linux_KM/services4/srvkm/env/linux/pvr_debug.c 2012-02-09 23:54:38.000000000 +1100 @@ -24,9 +24,12 @@ * ******************************************************************************/ +#include +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38) #ifndef AUTOCONF_INCLUDED #include #endif +#endif #include #include @@ -72,7 +75,7 @@ static PVRSRV_LINUX_MUTEX gsDebugMutexNonIRQ; -static spinlock_t gsDebugLockIRQ = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(gsDebugLockIRQ); #if !defined (USE_SPIN_LOCK) #define USE_SPIN_LOCK (in_interrupt() || !preemptible()) diff -ru a/Graphics_SDK_4_04_00_03/GFX_Linux_KM/services4/srvkm/env/linux/pvr_drm.c b/Graphics_SDK_4_04_00_03/GFX_Linux_KM/services4/srvkm/env/linux/pvr_drm.c --- a/Graphics_SDK_4_04_00_03/GFX_Linux_KM/services4/srvkm/env/linux/pvr_drm.c 2011-06-20 21:03:34.000000000 +1000 +++ b/Graphics_SDK_4_04_00_03/GFX_Linux_KM/services4/srvkm/env/linux/pvr_drm.c 2012-02-16 01:58:14.000000000 +1100 @@ -26,14 +26,16 @@ #if defined(SUPPORT_DRI_DRM) +#include +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38) #ifndef AUTOCONF_INCLUDED #include #endif +#endif #include #include #include -#include #include #include #include @@ -371,11 +373,23 @@ .poll = drm_poll, .fasync = drm_fasync, }, +#if (LINUX_VERSION_CODE name = PVR_DRM_NAME, +// .pci->id_table = asPciIdList, +// }, +#endif .name = PVR_DRM_NAME, .desc = PVR_DRM_DESC, @@ -385,6 +399,13 @@ .patchlevel = PVRVERSION_BUILD, }; +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) +static struct pci_driver pci_pvr_driver = { + .name = PVR_DRM_NAME, + .id_table = asPciIdList, +}; +#endif + static int __init PVRSRVDrmInit(void) { int iRes; @@ -401,7 +422,11 @@ } #endif +#if (LINUX_VERSION_CODE
Grazvydas commented on 17.02.2012 11:12
I suggest just always returning OMAPLFB_UPDATE_MODE_AUTO, since it's always the case on pandora, then you don't need patch in bug272 and this patch becomes smaller.

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing