/******************************************************************************* ** ** gckGALDEVICE_Stop_Threads ** ** Stop the gal device, including the following actions: stop the daemon ** thread, release the irq. ** ** INPUT: ** ** gckGALDEVICE Device ** Pointer to an gckGALDEVICE object. ** ** OUTPUT: ** ** Nothing. ** ** RETURNS: ** ** Nothing. */ gceSTATUS gckGALDEVICE_Stop_Threads( gckGALDEVICE Device ) { gctINT i; gcmkHEADER_ARG("Device=0x%x", Device); gcmkVERIFY_ARGUMENT(Device != NULL); for (i = 0; i < gcdMAX_GPU_COUNT; i++) { /* Stop the kernel threads. */ if (Device->threadInitializeds[i]) { Device->killThread = gcvTRUE; up(&Device->semas[i]); kthread_stop(Device->threadCtxts[i]); Device->threadCtxts[i] = gcvNULL; Device->threadInitializeds[i] = gcvFALSE; } } gcmkFOOTER_NO(); return gcvSTATUS_OK; }
gceSTATUS gckKERNEL_SecurityMapMemory( IN gckKERNEL Kernel, IN gctUINT32 *PhysicalArray, IN gctUINT32 PageCount, OUT gctUINT32 * GPUAddress ) { gceSTATUS status; gcsTA_INTERFACE iface; gcmkHEADER(); iface.command = KERNEL_MAP_MEMORY; #if defined(LINUX) gcmkONERROR(gckOS_GetPhysicalAddress(Kernel->os, PhysicalArray, (gctUINT32 *)&iface.u.MapMemory.physicals)); #endif iface.u.MapMemory.pageCount = PageCount; gcmkONERROR(gckKERNEL_SecurityCallService(Kernel->securityChannel, &iface)); *GPUAddress = iface.u.MapMemory.gpuAddress; gcmkFOOTER_NO(); return gcvSTATUS_OK; OnError: gcmkFOOTER(); return status; }
gceSTATUS gckKERNEL_SecurityUnmapMemory( IN gckKERNEL Kernel, IN gctUINT32 GPUAddress, IN gctUINT32 PageCount ) { gceSTATUS status; gcsTA_INTERFACE iface; gcmkHEADER(); iface.command = KERNEL_UNMAP_MEMORY; iface.u.UnmapMemory.gpuAddress = GPUAddress; iface.u.UnmapMemory.pageCount = PageCount; gcmkONERROR(gckKERNEL_SecurityCallService(Kernel->securityChannel, &iface)); gcmkFOOTER_NO(); return gcvSTATUS_OK; OnError: gcmkFOOTER(); return status; }
static int __devinit gpu_remove(struct platform_device *pdev) { gcmkHEADER(); #if MRVL_CONFIG_USE_PM_RUNTIME pm_runtime_put_sync(&pdev->dev); pm_runtime_disable(&pdev->dev); #endif #if MRVL_CONFIG_ENABLE_GPUFREQ __disable_gpufreq(galDevice); #endif remove_gc_sysfs_file(pdev); drv_exit(); #if MRVL_CONFIG_ENABLE_EARLYSUSPEND unregister_early_suspend(&gpu_early_suspend_handler); #endif #if MRVL_CONFIG_PROC remove_gc_proc_file(); #endif gcmkFOOTER_NO(); return 0; }
gceSTATUS gckKERNEL_SecurityAllocateSecurityMemory( IN gckKERNEL Kernel, IN gctUINT32 Bytes, OUT gctUINT32 * Handle ) { gceSTATUS status; gcsTA_INTERFACE iface; gcmkHEADER(); iface.command = KERNEL_ALLOCATE_SECRUE_MEMORY; iface.u.AllocateSecurityMemory.bytes = Bytes; gcmkONERROR(gckKERNEL_SecurityCallService(Kernel->securityChannel, &iface)); *Handle = iface.u.AllocateSecurityMemory.memory_handle; gcmkFOOTER_NO(); return gcvSTATUS_OK; OnError: gcmkFOOTER(); return status; }
/******************************************************************************* ** ** gckKERNEL_QueryVideoMemory ** ** Query the amount of video memory. ** ** INPUT: ** ** gckKERNEL Kernel ** Pointer to an gckKERNEL object. ** ** OUTPUT: ** ** gcsHAL_INTERFACE * Interface ** Pointer to an gcsHAL_INTERFACE structure that will be filled in with ** the memory information. */ gceSTATUS gckKERNEL_QueryVideoMemory( IN gckKERNEL Kernel, OUT gcsHAL_INTERFACE * Interface ) { gckGALDEVICE device; gcmkHEADER_ARG("Kernel=%p", Kernel); /* Verify the arguments. */ gcmkVERIFY_OBJECT(Kernel, gcvOBJ_KERNEL); gcmkVERIFY_ARGUMENT(Interface != NULL); /* Extract the pointer to the gckGALDEVICE class. */ device = (gckGALDEVICE) Kernel->context; /* Get internal memory size and physical address. */ Interface->u.QueryVideoMemory.internalSize = device->internalSize; Interface->u.QueryVideoMemory.internalPhysical = device->internalPhysicalName; /* Get external memory size and physical address. */ Interface->u.QueryVideoMemory.externalSize = device->externalSize; Interface->u.QueryVideoMemory.externalPhysical = device->externalPhysicalName; /* Get contiguous memory size and physical address. */ Interface->u.QueryVideoMemory.contiguousSize = device->contiguousSize; Interface->u.QueryVideoMemory.contiguousPhysical = device->contiguousPhysicalName; /* Success. */ gcmkFOOTER_NO(); return gcvSTATUS_OK; }
static void drv_exit(void) #endif { gcmkHEADER(); gcmkASSERT(gpuClass != gcvNULL); device_destroy(gpuClass, MKDEV(major, 0)); class_destroy(gpuClass); unregister_chrdev(major, DRV_NAME); gcmkVERIFY_OK(gckGALDEVICE_Stop(galDevice)); gcmkVERIFY_OK(gckGALDEVICE_Destroy(galDevice)); if(gckDebugFileSystemIsEnabled()) { gckDebugFileSystemTerminate(); } #if ENABLE_GPU_CLOCK_BY_DRIVER && LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,28) { #if MRVL_PLATFORM_PXA1088 gcmkVERIFY_OK(gckOS_GpuPowerDisable(galDevice->os, gcvCORE_2D, gcvTRUE, gcvFALSE)); #endif gcmkVERIFY_OK(gckOS_GpuPowerDisable(galDevice->os, gcvCORE_MAJOR, gcvTRUE, gcvTRUE)); } #endif gcmkFOOTER_NO(); }
static void drv_exit(void) #endif { gcmkHEADER(); gcmkASSERT(gpuClass != gcvNULL); device_destroy(gpuClass, MKDEV(major, 0)); class_destroy(gpuClass); unregister_chrdev(major, DEVICE_NAME); gcmkVERIFY_OK(gckGALDEVICE_Stop(galDevice)); gcmkVERIFY_OK(gckGALDEVICE_Destroy(galDevice)); if(gckDEBUGFS_IsEnabled()) { gckDEBUGFS_Terminate(); } #if ENABLE_GPU_CLOCK_BY_DRIVER && LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,28) { struct clk * clk = NULL; #if defined(CONFIG_PXA_DVFM) && (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,29)) gc_pwr(0); #endif clk = clk_get(NULL, "GCCLK"); clk_disable(clk); } #endif gcmkFOOTER_NO(); }
void gckIOMMU_Destory( IN gckOS Os, IN gckIOMMU Iommu ) { gcmkHEADER(); if (Iommu->domain && Iommu->device) { iommu_attach_device(Iommu->domain, Iommu->device); } if (Iommu->domain) { iommu_domain_free(Iommu->domain); } if (Iommu) { gcmkOS_SAFE_FREE(Os, Iommu); } gcmkFOOTER_NO(); }
/******************************************************************************* ** ** gckVGMMU_Destroy ** ** Destroy a nAQMMU object. ** ** INPUT: ** ** gckVGMMU Mmu ** Pointer to an gckVGMMU object. ** ** OUTPUT: ** ** Nothing. */ gceSTATUS gckVGMMU_Destroy( IN gckVGMMU Mmu ) { gcmkHEADER_ARG("Mmu=0x%x", Mmu); /* Verify the arguments. */ gcmkVERIFY_OBJECT(Mmu, gcvOBJ_MMU); /* Free the page table. */ gcmkVERIFY_OK(gckOS_FreeContiguous(Mmu->os, Mmu->pageTablePhysical, Mmu->pageTableLogical, Mmu->pageTableSize)); /* Roll back. */ gcmkVERIFY_OK(gckOS_DeleteMutex(Mmu->os, Mmu->mutex)); /* Mark the gckVGMMU object as unknown. */ Mmu->object.type = gcvOBJ_UNKNOWN; /* Free the gckVGMMU object. */ gcmkVERIFY_OK(gckOS_Free(Mmu->os, Mmu)); gcmkFOOTER_NO(); /* Success. */ return gcvSTATUS_OK; }
gceSTATUS gckIOMMU_Map( IN gckIOMMU Iommu, IN gctUINT32 DomainAddress, IN gctUINT32 Physical, IN gctUINT32 Bytes ) { gceSTATUS status; int ret; gcmkHEADER_ARG("DomainAddress=%#X, Physical=%#X, Bytes=%d", DomainAddress, Physical, Bytes); ret = iommu_map(Iommu->domain, DomainAddress, Physical, Bytes, 0); if (ret) { gcmkONERROR(gcvSTATUS_NOT_SUPPORTED); } gcmkFOOTER_NO(); return gcvSTATUS_OK; OnError: gcmkFOOTER(); return status; }
gceSTATUS gckHEAP_ProfileEnd( IN gckHEAP Heap, IN gctCONST_STRING Title ) { gcmkHEADER_ARG("Heap=0x%x Title=0x%x", Heap, Title); /* Verify the arguments. */ gcmkVERIFY_OBJECT(Heap, gcvOBJ_HEAP); gcmkVERIFY_ARGUMENT(Title != gcvNULL); gcmkPRINT(""); gcmkPRINT("=====[ HEAP - %s ]=====", Title); gcmkPRINT("Number of allocations : %12u", Heap->allocCount); gcmkPRINT("Number of bytes allocated : %12llu", Heap->allocBytes); gcmkPRINT("Maximum allocation size : %12llu", Heap->allocBytesMax); gcmkPRINT("Total number of bytes allocated : %12llu", Heap->allocBytesTotal); gcmkPRINT("Number of heaps : %12u", Heap->heapCount); gcmkPRINT("Heap memory in bytes : %12llu", Heap->heapMemory); gcmkPRINT("Maximum number of heaps : %12u", Heap->heapCountMax); gcmkPRINT("Maximum heap memory in bytes : %12llu", Heap->heapMemoryMax); gcmkPRINT("=============================================="); /* Success. */ gcmkFOOTER_NO(); return gcvSTATUS_OK; }
/******************************************************************************* ** ** gckCOMMAND_Stop ** ** Stop the command queue. ** ** INPUT: ** ** gckCOMMAND Command ** Pointer to an gckCOMMAND object to stop. ** ** OUTPUT: ** ** Nothing. */ gceSTATUS gckCOMMAND_Stop( IN gckCOMMAND Command ) { gckHARDWARE hardware; gceSTATUS status; gctUINT32 idle; gcmkHEADER_ARG("Command=0x%x", Command); /* Verify the arguments. */ gcmkVERIFY_OBJECT(Command, gcvOBJ_COMMAND); if (!Command->running) { /* Command queue is not running. */ gcmkFOOTER_NO(); return gcvSTATUS_OK; } /* Extract the gckHARDWARE object. */ hardware = Command->kernel->hardware; gcmkVERIFY_OBJECT(hardware, gcvOBJ_HARDWARE); /* Replace last WAIT with END. */ gcmkONERROR( gckHARDWARE_End(hardware, Command->wait, &Command->waitSize)); /* Wait for idle. */ gcmkONERROR( gckHARDWARE_GetIdle(hardware, gcvTRUE, &idle)); /* Command queue is no longer running. */ Command->running = gcvFALSE; /* Success. */ gcmkFOOTER_NO(); return gcvSTATUS_OK; OnError: /* Return the status. */ gcmkFOOTER(); return status; }
static int __devinit gpu_probe(struct platform_device *pdev) #endif { int ret = -ENODEV; struct resource* res; gcmkHEADER(); res = platform_get_resource_byname(pdev, IORESOURCE_IRQ, "gpu_irq"); if (!res) { printk(KERN_ERR "%s: No irq line supplied.\n",__FUNCTION__); goto gpu_probe_fail; } irqLine = res->start; res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "gpu_base"); if (!res) { printk(KERN_ERR "%s: No register base supplied.\n",__FUNCTION__); goto gpu_probe_fail; } registerMemBase = res->start; registerMemSize = res->end - res->start + 1; res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "gpu_mem"); if (!res) { printk(KERN_ERR "%s: No memory base supplied.\n",__FUNCTION__); goto gpu_probe_fail; } contiguousBase = res->start; contiguousSize = res->end - res->start + 1; /*####modified for marvell-bg2*/ ret = drv_get_dts_for_gpu(); /*if there is no gpu2d, it will also return error*/ /*####end for marvell-bg2*/ ret = drv_init(); if (!ret) { platform_set_drvdata(pdev, galDevice); gcmkFOOTER_NO(); return ret; } gpu_probe_fail: gcmkFOOTER_ARG(KERN_INFO "Failed to register gpu driver: %d\n", ret); return ret; }
static int __devexit gpu_remove(struct platform_device *pdev) #endif { gcmkHEADER(); drv_exit(); gcmkFOOTER_NO(); return 0; }
/******************************************************************************* ** ** gckGALDEVICE_Setup_ISR ** ** Start the ISR routine. ** ** INPUT: ** ** gckGALDEVICE Device ** Pointer to an gckGALDEVICE object. ** ** OUTPUT: ** ** Nothing. ** ** RETURNS: ** ** gcvSTATUS_OK ** Setup successfully. ** gcvSTATUS_GENERIC_IO ** Setup failed. */ gceSTATUS gckGALDEVICE_Setup_ISR( IN gckGALDEVICE Device ) { gceSTATUS status; gctINT ret; gcmkHEADER_ARG("Device=0x%x", Device); gcmkVERIFY_ARGUMENT(Device != NULL); if (Device->irqLines[gcvCORE_MAJOR] < 0) { gcmkONERROR(gcvSTATUS_GENERIC_IO); } /* Hook up the isr based on the irq line. */ #ifdef FLAREON gc500_handle.dev_name = "galcore interrupt service"; gc500_handle.dev_id = Device; gc500_handle.handler = isrRoutine; gc500_handle.intr_gen = GPIO_INTR_LEVEL_TRIGGER; gc500_handle.intr_trig = GPIO_TRIG_HIGH_LEVEL; ret = dove_gpio_request( DOVE_GPIO0_7, &gc500_handle ); #else ret = request_irq( Device->irqLines[gcvCORE_MAJOR], isrRoutine, IRQF_DISABLED, "galcore interrupt service", Device ); #endif if (ret != 0) { gcmkTRACE_ZONE( gcvLEVEL_ERROR, gcvZONE_DRIVER, "%s(%d): Could not register irq line %d (error=%d)\n", __FUNCTION__, __LINE__, Device->irqLines[gcvCORE_MAJOR], ret ); gcmkONERROR(gcvSTATUS_GENERIC_IO); } /* Mark ISR as initialized. */ Device->isrInitializeds[gcvCORE_MAJOR] = gcvTRUE; gcmkFOOTER_NO(); return gcvSTATUS_OK; OnError: gcmkFOOTER(); return status; }
gceSTATUS gckIOMMU_Construct( IN gckOS Os, OUT gckIOMMU * Iommu ) { gceSTATUS status; gckIOMMU iommu = gcvNULL; struct device *dev; int ret; gcmkHEADER(); dev = &Os->device->platform->device->dev; gcmkONERROR(gckOS_Allocate(Os, gcmSIZEOF(gcsIOMMU), (gctPOINTER *)&iommu)); gckOS_ZeroMemory(iommu, gcmSIZEOF(gcsIOMMU)); iommu->domain = iommu_domain_alloc(&platform_bus_type); if (!iommu->domain) { gcmkTRACE_ZONE(gcvLEVEL_INFO, gcvZONE_OS, "iommu_domain_alloc() fail"); gcmkONERROR(gcvSTATUS_NOT_SUPPORTED); } iommu_set_fault_handler(iommu->domain, _IOMMU_Fault_Handler, dev); ret = iommu_attach_device(iommu->domain, dev); if (ret) { gcmkTRACE_ZONE( gcvLEVEL_INFO, gcvZONE_OS, "iommu_attach_device() fail %d", ret); gcmkONERROR(gcvSTATUS_NOT_SUPPORTED); } iommu->device = dev; _FlatMapping(iommu); *Iommu = iommu; gcmkFOOTER_NO(); return gcvSTATUS_OK; OnError: gckIOMMU_Destory(Os, iommu); gcmkFOOTER(); return status; }
gceSTATUS gckDVFS_Construct( IN gckHARDWARE Hardware, OUT gckDVFS * Dvfs ) { gceSTATUS status = gcvSTATUS_OK; gctPOINTER pointer; gckDVFS dvfs = gcvNULL; gckOS os = Hardware->os; gcmkHEADER_ARG("Hardware=0x%X", Hardware); gcmkVERIFY_OBJECT(Hardware, gcvOBJ_HARDWARE); gcmkVERIFY_ARGUMENT(Dvfs != gcvNULL); /* Allocate a gckDVFS manager. */ gcmkONERROR(gckOS_Allocate(os, gcmSIZEOF(struct _gckDVFS), &pointer)); gckOS_ZeroMemory(pointer, gcmSIZEOF(struct _gckDVFS)); dvfs = pointer; /* Initialization. */ dvfs->hardware = Hardware; dvfs->pollingTime = gcdDVFS_POLLING_TIME; dvfs->os = Hardware->os; dvfs->currentScale = 64; /* Create a polling timer. */ gcmkONERROR(gckOS_CreateTimer(os, _TimerFunction, pointer, &dvfs->timer)); /* Initialize frequency and voltage adjustment helper. */ gcmkONERROR(gckOS_PrepareGPUFrequency(os, Hardware->core)); /* Return result. */ *Dvfs = dvfs; gcmkFOOTER_NO(); return gcvSTATUS_OK; OnError: /* Roll back. */ if (dvfs) { if (dvfs->timer) { gcmkVERIFY_OK(gckOS_DestroyTimer(os, dvfs->timer)); } gcmkOS_SAFE_FREE(os, dvfs); } gcmkFOOTER(); return status; }
static int __devinit gpu_remove(struct platform_device *pdev) { gcmkHEADER(); drv_exit(); #ifdef CONFIG_G2D clk_put(g2d_core_clk); clk_put(g2d_axi_clkhb); clk_put(g2d_cfg_clk); #endif gcmkFOOTER_NO(); return 0; }
gceSTATUS gckDVFS_Stop( IN gckDVFS Dvfs ) { gcmkHEADER_ARG("Dvfs=0x%X", Dvfs); gcmkVERIFY_ARGUMENT(Dvfs != gcvNULL); Dvfs->stop = gcvTRUE; gcmkFOOTER_NO(); return gcvSTATUS_OK; }
gceSTATUS gckKERNEL_AttachProcess( IN gckKERNEL Kernel, IN gctBOOL Attach ) { gceSTATUS status; gctINT32 old; gcmkHEADER_ARG("Kernel=0x%x Attach=%d", Kernel, Attach); /* Verify the arguments. */ gcmkVERIFY_OBJECT(Kernel, gcvOBJ_KERNEL); if (Attach) { /* Increment the number of clients attached. */ gcmkONERROR( gckOS_AtomIncrement(Kernel->os, Kernel->atomClients, &old)); if (old == 0) { /* gcmkONERROR(gckHARDWARE_SetPowerManagementState(Kernel->hardware, gcvPOWER_ON)); */ } } else { /* Decrement the number of clients attached. */ gcmkONERROR( gckOS_AtomDecrement(Kernel->os, Kernel->atomClients, &old)); if (old == 1) { gcmkONERROR(gckHARDWARE_SetPowerManagementState(Kernel->hardware, gcvPOWER_OFF)); /* Flush the debug cache. */ gcmkPRINT("$$FLUSH$$"); } } /* Success. */ gcmkFOOTER_NO(); return gcvSTATUS_OK; OnError: /* Return the status. */ gcmkFOOTER(); return status; }
gceSTATUS gckIOMMU_Unmap( IN gckIOMMU Iommu, IN gctUINT32 DomainAddress, IN gctUINT32 Bytes ) { gcmkHEADER(); iommu_unmap(Iommu->domain, DomainAddress, Bytes); gcmkFOOTER_NO(); return gcvSTATUS_OK; }
/******************************************************************************* ** ** gckGALDEVICE_Stop ** ** Stop the gal device, including the following actions: stop the daemon ** thread, release the irq. ** ** INPUT: ** ** gckGALDEVICE Device ** Pointer to an gckGALDEVICE object. ** ** OUTPUT: ** ** Nothing. ** ** RETURNS: ** ** Nothing. */ gceSTATUS gckGALDEVICE_Stop( gckGALDEVICE Device ) { gceSTATUS status; gcmkHEADER_ARG("Device=0x%x", Device); gcmkVERIFY_ARGUMENT(Device != NULL); if (Device->kernels[gcvCORE_MAJOR] != gcvNULL) { /* Switch to OFF power state. */ gcmkONERROR(gckHARDWARE_SetPowerManagementState( Device->kernels[gcvCORE_MAJOR]->hardware, gcvPOWER_OFF )); /* Remove the ISR routine. */ gcmkONERROR(gckGALDEVICE_Release_ISR(Device)); } if (Device->kernels[gcvCORE_2D] != gcvNULL) { /* Setup the ISR routine. */ gcmkONERROR(gckGALDEVICE_Release_ISR_2D(Device)); /* Switch to OFF power state. */ gcmkONERROR(gckHARDWARE_SetPowerManagementState( Device->kernels[gcvCORE_2D]->hardware, gcvPOWER_OFF )); } if (Device->kernels[gcvCORE_VG] != gcvNULL) { /* Setup the ISR routine. */ gcmkONERROR(gckGALDEVICE_Release_ISR_VG(Device)); } /* Stop the kernel thread. */ gcmkONERROR(gckGALDEVICE_Stop_Threads(Device)); gcmkFOOTER_NO(); return gcvSTATUS_OK; OnError: gcmkFOOTER(); return status; }
static int __devexit gpu_remove(struct platform_device *pdev) #endif { gcmkHEADER(); drv_exit(); if (platform.ops->putPower) { platform.ops->putPower(&platform); } gcmkFOOTER_NO(); return 0; }
/******************************************************************************* ** ** gckVIDMEM_Destroy ** ** Destroy an gckVIDMEM object. ** ** INPUT: ** ** gckVIDMEM Memory ** Pointer to an gckVIDMEM object to destroy. ** ** OUTPUT: ** ** Nothing. */ gceSTATUS gckVIDMEM_Destroy( IN gckVIDMEM Memory ) { gcuVIDMEM_NODE_PTR node, next; gctINT i; gcmkHEADER_ARG("Memory=0x%x", Memory); /* Verify the arguments. */ gcmkVERIFY_OBJECT(Memory, gcvOBJ_VIDMEM); /* Walk all sentinels. */ for (i = 0; i < gcmCOUNTOF(Memory->sentinel); ++i) { /* Bail out of the heap is not used. */ if (Memory->sentinel[i].VidMem.next == gcvNULL) { break; } /* Walk all the nodes until we reach the sentinel. */ for (node = Memory->sentinel[i].VidMem.next; node->VidMem.bytes != 0; node = next) { /* Save pointer to the next node. */ next = node->VidMem.next; /* Free the node. */ gcmkVERIFY_OK(gckOS_Free(Memory->os, node)); } } /* Free the mutex. */ gcmkVERIFY_OK(gckOS_DeleteMutex(Memory->os, Memory->mutex)); /* Mark the object as unknown. */ Memory->object.type = gcvOBJ_UNKNOWN; /* Free the gckVIDMEM object. */ gcmkVERIFY_OK(gckOS_Free(Memory->os, Memory)); /* Success. */ gcmkFOOTER_NO(); return gcvSTATUS_OK; }
gceSTATUS gckKERNEL_QuerySettings( IN gckKERNEL Kernel, OUT gcsKERNEL_SETTINGS * Settings ) { gcmkHEADER_ARG("Kernel=%p", Kernel); /* Verify the arguments. */ gcmkVERIFY_OBJECT(Kernel, gcvOBJ_KERNEL); gcmkVERIFY_ARGUMENT(Settings != gcvNULL); /* Success. */ gcmkFOOTER_NO(); return gcvSTATUS_OK; }
/******************************************************************************* ** ** gckGALDEVICE_Start ** ** Start the gal device, including the following actions: setup the isr routine ** and start the daemoni thread. ** ** INPUT: ** ** gckGALDEVICE Device ** Pointer to an gckGALDEVICE object. ** ** OUTPUT: ** ** Nothing. ** ** RETURNS: ** ** gcvSTATUS_OK ** Start successfully. */ gceSTATUS gckGALDEVICE_Start( IN gckGALDEVICE Device ) { gceSTATUS status; gcmkHEADER_ARG("Device=0x%x", Device); /* Start the kernel thread. */ gcmkONERROR(gckGALDEVICE_Start_Threads(Device)); if (Device->kernels[gcvCORE_MAJOR] != gcvNULL) { /* Setup the ISR routine. */ gcmkONERROR(gckGALDEVICE_Setup_ISR(Device)); /* Switch to SUSPEND power state. */ gcmkONERROR(gckHARDWARE_SetPowerManagementState( Device->kernels[gcvCORE_MAJOR]->hardware, gcvPOWER_OFF_BROADCAST )); } if (Device->kernels[gcvCORE_2D] != gcvNULL) { /* Setup the ISR routine. */ gcmkONERROR(gckGALDEVICE_Setup_ISR_2D(Device)); /* Switch to SUSPEND power state. */ gcmkONERROR(gckHARDWARE_SetPowerManagementState( Device->kernels[gcvCORE_2D]->hardware, gcvPOWER_OFF_BROADCAST )); } if (Device->kernels[gcvCORE_VG] != gcvNULL) { /* Setup the ISR routine. */ gcmkONERROR(gckGALDEVICE_Setup_ISR_VG(Device)); } gcmkFOOTER_NO(); return gcvSTATUS_OK; OnError: gcmkFOOTER(); return status; }
gceSTATUS gckVGMMU_Flush( IN gckVGMMU Mmu ) { gckVGHARDWARE hardware; gcmkHEADER_ARG("Mmu=0x%x", Mmu); hardware = Mmu->hardware; gcmkVERIFY_OK( gckOS_AtomSet(hardware->os, hardware->pageTableDirty, 1)); /* Success. */ gcmkFOOTER_NO(); return gcvSTATUS_OK; }
/******************************************************************************* ** ** gckVIDMEM_DestroyVirtual ** ** Destroy an gcuVIDMEM_NODE union for virtual memory. ** ** INPUT: ** ** gcuVIDMEM_NODE_PTR Node ** Pointer to a gcuVIDMEM_NODE union. ** ** OUTPUT: ** ** Nothing. */ gceSTATUS gckVIDMEM_DestroyVirtual( IN gcuVIDMEM_NODE_PTR Node ) { gckOS os; gcmkHEADER_ARG("Node=0x%x", Node); /* Verify the arguments. */ gcmkVERIFY_OBJECT(Node->Virtual.kernel, gcvOBJ_KERNEL); /* Extact the gckOS object pointer. */ os = Node->Virtual.kernel->os; gcmkVERIFY_OBJECT(os, gcvOBJ_OS); #ifdef __QNXNTO__ /* Unregister. */ gcmkVERIFY_OK( gckMMU_RemoveNode(Node->Virtual.kernel->mmu, Node)); /* Free virtual memory. */ gcmkVERIFY_OK( gckOS_FreePagedMemory(os, Node->Virtual.physical, Node->Virtual.bytes)); #endif /* Delete the mutex. */ gcmkVERIFY_OK(gckOS_DeleteMutex(os, Node->Virtual.mutex)); if (Node->Virtual.pageTable != gcvNULL) { /* Free the pages. */ gcmkVERIFY_OK(gckMMU_FreePages(Node->Virtual.kernel->mmu, Node->Virtual.pageTable, Node->Virtual.pageCount)); } /* Delete the gcuVIDMEM_NODE union. */ gcmkVERIFY_OK(gckOS_Free(os, Node)); /* Success. */ gcmkFOOTER_NO(); return gcvSTATUS_OK; }
gceSTATUS gckDVFS_Start( IN gckDVFS Dvfs ) { gcmkHEADER_ARG("Dvfs=0x%X", Dvfs); gcmkVERIFY_ARGUMENT(Dvfs != gcvNULL); gckHARDWARE_InitDVFS(Dvfs->hardware); Dvfs->stop = gcvFALSE; gckOS_StartTimer(Dvfs->os, Dvfs->timer, Dvfs->pollingTime); gcmkFOOTER_NO(); return gcvSTATUS_OK; }