amd-gpu: move includes into the driver root directory

* add #include statements where necessary to build. Some of this is a bit hacky.
* fix some things along the way (register defs mmCP_RB_RPTR -> REG_CP_RB_RPTR)
* move klibapi prototypes into the includes for those subsystems
* delete tbdump etc. includes
* delete unreferenced includes that would be touched by userspace using them (not)
This commit is contained in:
Matt Sealey
2012-11-28 14:24:21 -08:00
parent ae6cc482cf
commit e74c1b6efa
51 changed files with 296 additions and 673 deletions

View File

@@ -1,74 +0,0 @@
/* Copyright (c) 2008-2010, Code Aurora Forum. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of Code Aurora Forum nor
* the names of its contributors may be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef __GSL_DISPLAYAPI_H
#define __GSL_DISPLAYAPI_H
#ifdef __cplusplus
extern "C" {
#endif // __cplusplus
// defines
#define GSL_DISPLAY_PANEL_TOSHIBA_640x480 0
#define GSL_DISPLAY_PANEL_HITACHI_240x320 1
#define GSL_DISPLAY_PANEL_DEFAULT GSL_DISPLAY_PANEL_TOSHIBA_640x480
//////////////////////////////////////////////////////////////////////////////
// types
//////////////////////////////////////////////////////////////////////////////
typedef int gsl_display_id_t;
typedef int gsl_surface_id_t;
typedef struct _gsl_displaymode_t {
int panel_id;
int width;
int height;
int bpp;
int orientation;
int frequency;
} gsl_displaymode_t;
//////////////////////////////////////////////////////////////////////////////
// prototypes
//////////////////////////////////////////////////////////////////////////////
extern gsl_display_id_t gsl_display_open(gsl_devhandle_t devhandle, int panel_id);
extern int gsl_display_close(gsl_display_id_t display_id);
extern int gsl_display_getcount(void);
extern int gsl_display_setmode(gsl_display_id_t display_id, gsl_displaymode_t displaymode);
extern int gsl_display_getmode(gsl_display_id_t display_id, gsl_displaymode_t *displaymode);
extern gsl_surface_id_t gsl_display_setsurface(gsl_display_id_t display_id, void *buffer);
extern int gsl_display_getactivesurface(gsl_display_id_t display_id, void **buffer);
extern int gsl_display_flipsurface(gsl_display_id_t display_id, gsl_surface_id_t surface_id);
#ifdef __cplusplus
}
#endif // __cplusplus
#endif // __GSL_DISPLAYAPI_H

View File

@@ -1,121 +0,0 @@
/* Copyright (c) 2008-2010, Code Aurora Forum. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of Code Aurora Forum nor
* the names of its contributors may be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef __GSL_KLIBAPI_H
#define __GSL_KLIBAPI_H
#ifdef __cplusplus
extern "C" {
#endif // __cplusplus
#include "gsl_types.h"
#include "gsl_properties.h"
//////////////////////////////////////////////////////////////////////////////
// version control
//////////////////////////////////////////////////////////////////////////////
#define KGSLLIB_NAME "AMD GSL Kernel Library"
#define KGSLLIB_VERSION "0.1"
//////////////////////////////////////////////////////////////////////////////
// library API
//////////////////////////////////////////////////////////////////////////////
int kgsl_driver_init(void);
int kgsl_driver_close(void);
int kgsl_driver_entry(gsl_flags_t flags);
int kgsl_driver_exit(void);
int kgsl_driver_destroy(unsigned int pid);
////////////////////////////////////////////////////////////////////////////
// device API
////////////////////////////////////////////////////////////////////////////
int kgsl_device_start(unsigned int device_id, gsl_flags_t flags);
int kgsl_device_stop(unsigned int device_id);
int kgsl_device_idle(unsigned int device_id, unsigned int timeout);
int kgsl_device_isidle(unsigned int device_id);
int kgsl_device_getproperty(unsigned int device_id, gsl_property_type_t type, void *value, unsigned int sizebytes);
int kgsl_device_setproperty(unsigned int device_id, gsl_property_type_t type, void *value, unsigned int sizebytes);
int kgsl_device_regread(unsigned int device_id, unsigned int offsetwords, unsigned int *value);
int kgsl_device_regwrite(unsigned int device_id, unsigned int offsetwords, unsigned int value);
int kgsl_device_waitirq(unsigned int device_id, gsl_intrid_t intr_id, unsigned int *count, unsigned int timeout);
////////////////////////////////////////////////////////////////////////////
// command API
////////////////////////////////////////////////////////////////////////////
int kgsl_cmdstream_issueibcmds(unsigned int device_id, int drawctxt_index, uint32_t ibaddr, int sizedwords, unsigned int *timestamp, gsl_flags_t flags);
unsigned int kgsl_cmdstream_readtimestamp(unsigned int device_id, enum kgsl_timestamp_type type);
int kgsl_cmdstream_freememontimestamp(unsigned int device_id, struct kgsl_memdesc *memdesc, unsigned int timestamp, enum kgsl_timestamp_type type);
int kgsl_cmdstream_waittimestamp(unsigned int device_id, unsigned int timestamp, unsigned int timeout);
int kgsl_cmdwindow_write(unsigned int device_id, enum kgsl_cmdwindow_type target, unsigned int addr, unsigned int data);
int kgsl_add_timestamp(unsigned int device_id, unsigned int *timestamp);
int kgsl_cmdstream_check_timestamp(unsigned int device_id, unsigned int timestamp);
////////////////////////////////////////////////////////////////////////////
// context API
////////////////////////////////////////////////////////////////////////////
int kgsl_context_create(unsigned int device_id, gsl_context_type_t type, unsigned int *drawctxt_id, gsl_flags_t flags);
int kgsl_context_destroy(unsigned int device_id, unsigned int drawctxt_id);
int kgsl_drawctxt_bind_gmem_shadow(unsigned int device_id, unsigned int drawctxt_id, const struct kgsl_gmem_desc* gmem_rect, unsigned int shadow_x, unsigned int shadow_y, const struct kgsl_buffer_desc* shadow_buffer, unsigned int buffer_id);
////////////////////////////////////////////////////////////////////////////
// sharedmem API
////////////////////////////////////////////////////////////////////////////
int kgsl_sharedmem_alloc(unsigned int device_id, gsl_flags_t flags, int sizebytes, struct kgsl_memdesc *memdesc);
int kgsl_sharedmem_free(struct kgsl_memdesc *memdesc);
int kgsl_sharedmem_read(const struct kgsl_memdesc *memdesc, void *dst, unsigned int offsetbytes, unsigned int sizebytes, unsigned int touserspace);
int kgsl_sharedmem_write(const struct kgsl_memdesc *memdesc, unsigned int offsetbytes, void *src, unsigned int sizebytes, unsigned int fromuserspace);
int kgsl_sharedmem_set(const struct kgsl_memdesc *memdesc, unsigned int offsetbytes, unsigned int value, unsigned int sizebytes);
unsigned int kgsl_sharedmem_largestfreeblock(unsigned int device_id, gsl_flags_t flags);
int kgsl_sharedmem_map(unsigned int device_id, gsl_flags_t flags, const gsl_scatterlist_t *scatterlist, struct kgsl_memdesc *memdesc);
int kgsl_sharedmem_unmap(struct kgsl_memdesc *memdesc);
int kgsl_sharedmem_getmap(const struct kgsl_memdesc *memdesc, gsl_scatterlist_t *scatterlist);
int kgsl_sharedmem_cacheoperation(const struct kgsl_memdesc *memdesc, unsigned int offsetbytes, unsigned int sizebytes, unsigned int operation);
int kgsl_sharedmem_fromhostpointer(unsigned int device_id, struct kgsl_memdesc *memdesc, void* hostptr);
////////////////////////////////////////////////////////////////////////////
// interrupt API
////////////////////////////////////////////////////////////////////////////
void kgsl_intr_isr(struct kgsl_device *device);
////////////////////////////////////////////////////////////////////////////
// TB dump API
////////////////////////////////////////////////////////////////////////////
int kgsl_tbdump_waitirq(void);
int kgsl_tbdump_exportbmp(const void* addr, unsigned int format, unsigned int stride, unsigned int width, unsigned int height);
#ifdef __cplusplus
}
#endif // __cplusplus
#endif // __GSL_KLIBAPI_H

View File

@@ -1,104 +0,0 @@
/* Copyright (c) 2008-2010, Code Aurora Forum. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of Code Aurora Forum nor
* the names of its contributors may be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef __GSL_LIBAPI_H
#define __GSL_LIBAPI_H
#ifdef __cplusplus
extern "C" {
#endif // __cplusplus
#include "gsl_types.h"
// defines
#define GSLLIB_NAME "AMD GSL User Library"
#define GSLLIB_VERSION "0.1"
// libary API
int gsl_library_open(gsl_flags_t flags);
int gsl_library_close(void);
// device API
gsl_devhandle_t gsl_device_open(unsigned int device_id, gsl_flags_t flags);
int gsl_device_close(gsl_devhandle_t devhandle);
int gsl_device_idle(gsl_devhandle_t devhandle, unsigned int timeout);
int gsl_device_isidle(gsl_devhandle_t devhandle);
int gsl_device_getcount(void);
int gsl_device_getinfo(gsl_devhandle_t devhandle, struct kgsl_devinfo *devinfo);
int gsl_device_setpowerstate(gsl_devhandle_t devhandle, gsl_flags_t flags);
int gsl_device_setdmistate(gsl_devhandle_t devhandle, gsl_flags_t flags);
int gsl_device_waitirq(gsl_devhandle_t devhandle, gsl_intrid_t intr_id, unsigned int *count, unsigned int timeout);
int gsl_device_waittimestamp(gsl_devhandle_t devhandle, unsigned int timestamp, unsigned int timeout);
int gsl_device_addtimestamp(gsl_devhandle_t devhandle, unsigned int *timestamp);
// direct register API
int gsl_register_read(gsl_devhandle_t devhandle, unsigned int offsetwords, unsigned int *data);
// command API
int gsl_cp_issueibcommands(gsl_devhandle_t devhandle, gsl_ctxthandle_t ctxthandle, uint32_t ibaddr, unsigned int sizewords, unsigned int *timestamp, gsl_flags_t flags);
unsigned int gsl_cp_readtimestamp(gsl_devhandle_t devhandle, enum kgsl_timestamp_type type);
int gsl_cp_checktimestamp(gsl_devhandle_t devhandle, unsigned int timestamp, enum kgsl_timestamp_type type);
int gsl_cp_freememontimestamp(gsl_devhandle_t devhandle, gsl_memdesc_t *memdesc, unsigned int timestamp, enum kgsl_timestamp_type type);
int gsl_v3_issuecommand(gsl_devhandle_t devhandle, enum kgsl_cmdwindow_type target, unsigned int addr, unsigned int data);
// context API
gsl_ctxthandle_t gsl_context_create(gsl_devhandle_t devhandle, gsl_context_type_t type, gsl_flags_t flags);
int gsl_context_destroy(gsl_devhandle_t devhandle, gsl_ctxthandle_t ctxthandle);
int gsl_context_bind_gmem_shadow(gsl_devhandle_t devhandle, gsl_ctxthandle_t ctxthandle, const kgsl_gmem_desc* gmem_rect, unsigned int shadow_x, unsigned int shadow_y, const struct kgsl_buffer_desc* shadow_buffer, unsigned int buffer_id);
// sharedmem API
int gsl_memory_alloc(unsigned int device_id, unsigned int sizebytes, gsl_flags_t flags, gsl_memdesc_t *memdesc);
int gsl_memory_free(gsl_memdesc_t *memdesc);
int gsl_memory_read(const gsl_memdesc_t *memdesc, void *dst, unsigned int sizebytes, unsigned int offsetbytes);
int gsl_memory_write(const gsl_memdesc_t *memdesc, void *src, unsigned int sizebytes, unsigned int offsetbytes);
int gsl_memory_write_multiple(const gsl_memdesc_t *memdesc, void *src, unsigned int srcstridebytes, unsigned int dststridebytes, unsigned int blocksizebytes, unsigned int numblocks, unsigned int offsetbytes);
unsigned int gsl_memory_getlargestfreeblock(unsigned int device_id, gsl_flags_t flags);
int gsl_memory_set(const gsl_memdesc_t *memdesc, unsigned int offsetbytes, unsigned int value, unsigned int sizebytes);
int gsl_memory_cacheoperation(const gsl_memdesc_t *memdesc, unsigned int offsetbytes, unsigned int sizebytes, unsigned int operation);
int gsl_memory_fromhostpointer(unsigned int device_id, gsl_memdesc_t *memdesc, void* hostptr);
#ifdef _DIRECT_MAPPED
unsigned int gsl_sharedmem_gethostaddr(const gsl_memdesc_t *memdesc);
#endif // _DIRECT_MAPPED
// address translation API
int gsl_translate_physaddr(void* virtAddr, unsigned int* physAddr);
// TB dump API
int gsl_tbdump_waitirq();
int gsl_tbdump_exportbmp(const void* addr, unsigned int format, unsigned int stride, unsigned int width, unsigned int height);
#ifdef __cplusplus
}
#endif // __cplusplus
#endif // __GSL_LIBAPI_H

View File

@@ -1,43 +0,0 @@
/* Copyright (c) 2008-2010, Code Aurora Forum. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of Code Aurora Forum nor
* the names of its contributors may be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef __GSL_UTILS_H
#define __GSL_UTILS_H
//////////////////////////////////////////////////////////////////////////////
// macros
//////////////////////////////////////////////////////////////////////////////
#define GSL_QUADPOW2_TO_SIZEBYTES(quadpow2) (8 << (quadpow2))
#define GSL_QUADPOW2_TO_SIZEDWORDS(quadpow2) (2 << (quadpow2))
#define GSL_POW2TEST(size) ((size) && !((size) & ((size) - 1)))
#define GSL_POW2ALIGN_DOWN(addr, alignsize) ((addr) & ~((alignsize) - 1));
#define GSL_POW2ALIGN_UP(addr, alignsize) (((addr) + ((alignsize) - 1)) & ~((alignsize) - 1))
#endif // __GSL_UTILS_H

View File

@@ -1,71 +0,0 @@
/* Copyright (c) 2008-2010, Code Aurora Forum. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of Code Aurora Forum nor
* the names of its contributors may be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef __GSL_H
#define __GSL_H
#define __KERNEL_MODE__
struct kgsl_device;
//////////////////////////////////////////////////////////////////////////////
// includes
//////////////////////////////////////////////////////////////////////////////
#include "gsl_buildconfig.h"
#include "gsl_klibapi.h"
// Z430
#include <yamato_reg.h>
#include "gsl_pm4types.h"
#include "gsl_utils.h"
#include "gsl_drawctxt.h"
#include "gsl_ringbuffer.h"
// Z160/Z180
#include <g12_reg.h>
#include "gsl_cmdwindow.h"
#include "gsl_debug.h"
#include "gsl_mmu.h"
#include "gsl_memmgr.h"
#include "gsl_sharedmem.h"
#include "gsl_intrmgr.h"
#include "gsl_cmdstream.h"
#include "gsl_device.h"
#include "gsl_driver.h"
#include "gsl_log.h"
#include "gsl_config.h"
#define DEBUG_ASSERT(x)
#endif // __GSL_H

View File

@@ -1,113 +0,0 @@
/* Copyright (c) 2008-2010, Advanced Micro Devices. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of Advanced Micro Devices nor
* the names of its contributors may be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef __GSL_DEBUG_H
#define __GSL_DEBUG_H
#ifdef BB_DUMPX
#include "dumpx.h"
#endif
#ifdef TBDUMP
#include "gsl_tbdump.h"
#endif
//////////////////////////////////////////////////////////////////////////////
// macros
//////////////////////////////////////////////////////////////////////////////
#ifdef _DEBUG
#define KGSL_DEBUG(flag, action) if (gsl_driver.flags_debug & flag) {action;}
#define KGSL_DEBUG_DUMPPM4(cmds, sizedwords) Yamato_DumpPM4((cmds), (sizedwords))
#define KGSL_DEBUG_DUMPREGWRITE(addr, value) Yamato_DumpRegisterWrite((addr), (value))
#define KGSL_DEBUG_DUMPMEMWRITE(addr, sizebytes, data) Yamato_DumpWriteMemory(addr, sizebytes, data)
#define KGSL_DEBUG_DUMPMEMSET(addr, sizebytes, value) Yamato_DumpSetMemory(addr, sizebytes, value)
#define KGSL_DEBUG_DUMPFBSTART(device) Yamato_DumpFbStart(device)
#define KGSL_DEBUG_DUMPREGSPACE(device) Yamato_DumpRegSpace(device)
#define KGSL_DEBUG_DUMPWINDOW(addr, width, height) Yamato_DumpWindow(addr, width, height)
#ifdef TBDUMP
#define KGSL_DEBUG_TBDUMP_OPEN(filename) tbdump_open(filename)
#define KGSL_DEBUG_TBDUMP_CLOSE() tbdump_close()
#define KGSL_DEBUG_TBDUMP_SYNCMEM(addr, src, sizebytes) tbdump_syncmem((unsigned int)addr, (unsigned int)src, sizebytes)
#define KGSL_DEBUG_TBDUMP_SETMEM(addr, value, sizebytes) tbdump_setmem((unsigned int)addr, value, sizebytes)
#define KGSL_DEBUG_TBDUMP_SLAVEWRITE(addr, value) tbdump_slavewrite(addr, value)
#define KGSL_DEBUG_TBDUMP_WAITIRQ() tbdump_waitirq()
#else
#define KGSL_DEBUG_TBDUMP_OPEN(file)
#define KGSL_DEBUG_TBDUMP_CLOSE()
#define KGSL_DEBUG_TBDUMP_SYNCMEM(addr, src, sizebytes)
#define KGSL_DEBUG_TBDUMP_SETMEM(addr, value, sizebytes)
#define KGSL_DEBUG_TBDUMP_SLAVEWRITE(addr, value)
#define KGSL_DEBUG_TBDUMP_WAITIRQ()
#endif
#ifdef BB_DUMPX
#define KGSL_DEBUG_DUMPX_OPEN(filename, param) dumpx_open((filename), (param))
#define KGSL_DEBUG_DUMPX(cmd, par1, par2, par3, comment) dumpx(cmd, (par1), (par2), (par3), (comment))
#define KGSL_DEBUG_DUMPX_CLOSE() dumpx_close()
#else
#define KGSL_DEBUG_DUMPX_OPEN(filename, param)
#define KGSL_DEBUG_DUMPX(cmd, par1, par2, par3, comment)
#define KGSL_DEBUG_DUMPX_CLOSE()
#endif
#else
#define KGSL_DEBUG(flag, action)
#define KGSL_DEBUG_DUMPPM4(cmds, sizedwords)
#define KGSL_DEBUG_DUMPREGWRITE(addr, value)
#define KGSL_DEBUG_DUMPMEMWRITE(addr, sizebytes, data)
#define KGSL_DEBUG_DUMPMEMSET(addr, sizebytes, value)
#define KGSL_DEBUG_DUMPFBSTART(device)
#define KGSL_DEBUG_DUMPREGSPACE(device)
#define KGSL_DEBUG_DUMPWINDOW(addr, width, height)
#define KGSL_DEBUG_DUMPX(cmd, par1, par2, par3, comment)
#define KGSL_DEBUG_TBDUMP_OPEN(file)
#define KGSL_DEBUG_TBDUMP_CLOSE()
#define KGSL_DEBUG_TBDUMP_SYNCMEM(addr, src, sizebytes)
#define KGSL_DEBUG_TBDUMP_SETMEM(addr, value, sizebytes)
#define KGSL_DEBUG_TBDUMP_SLAVEWRITE(addr, value)
#define KGSL_DEBUG_TBDUMP_WAITIRQ()
#endif // _DEBUG
//////////////////////////////////////////////////////////////////////////////
// prototypes
//////////////////////////////////////////////////////////////////////////////
void Yamato_DumpPM4(unsigned int *cmds, unsigned int sizedwords);
void Yamato_DumpRegisterWrite(unsigned int dwAddress, unsigned int value);
void Yamato_DumpWriteMemory(unsigned int dwAddress, unsigned int dwSize, void* pData);
void Yamato_DumpSetMemory(unsigned int dwAddress, unsigned int dwSize, unsigned int pData);
void Yamato_DumpFbStart(struct kgsl_device *device);
void Yamato_DumpRegSpace(struct kgsl_device *device);
#ifdef _DEBUG
int kgsl_dumpx_parse_ibs(uint32_t gpuaddr, int sizedwords);
#endif //_DEBUG
#endif // __GSL_DRIVER_H

View File

@@ -1,38 +0,0 @@
/* Copyright (c) 2008-2010, Code Aurora Forum. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of Code Aurora Forum nor
* the names of its contributors may be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef __GSL_TBDUMP_H
#define __GSL_TBDUMP_H
void tbdump_open(char* filename);
void tbdump_close();
void tbdump_syncmem(unsigned int addr, unsigned int src, unsigned int sizebytes);
void tbdump_setmem(unsigned int addr, unsigned int value, unsigned int sizebytes);
void tbdump_slavewrite(unsigned int addr, unsigned int value);
#endif // __GSL_TBDUMP_H

View File

@@ -33,16 +33,6 @@
#ifndef __GSL__BUILDCONFIG_H
#define __GSL__BUILDCONFIG_H
#define GSL_STATS_MEM
#define GSL_STATS_RINGBUFFER
#define GSL_STATS_MMU
#define GSL_RB_USE_MEM_RPTR
#define GSL_RB_USE_MEM_TIMESTAMP
#define GSL_RB_TIMESTAMP_INTERUPT
/* #define GSL_RB_USE_WPTR_POLLING */
#define GSL_CALLER_PROCESS_MAX 64
#define GSL_SHMEM_MAX_APERTURES 2
#endif /* __GSL__BUILDCONFIG_H */

View File

@@ -19,10 +19,19 @@
#include <linux/sched.h>
#include <linux/slab.h>
#include "gsl.h"
#include "gsl_hal.h"
#include "gsl_cmdstream.h"
#include "kgsl_types.h"
#include "kgsl_mmu.h"
#include "kgsl_buildconfig.h"
//#include "kgsl_properties.h"
#include "kgsl_device.h"
#include "kgsl_driver.h"
#include "kgsl_linux_map.h"
#include "kgsl_halconfig.h"
#include "kgsl_hal.h"
#include "kgsl_cmdstream.h"
#include "kgsl_g12_vgv3types.h"
#include "kgsl_log.h"
// functions

View File

@@ -29,6 +29,8 @@
#ifndef __GSL_CMDSTREAM_H
#define __GSL_CMDSTREAM_H
#include "kgsl_device.h"
#define GSL_CMDSTREAM_GET_SOP_TIMESTAMP(device, data) kgsl_sharedmem_read0(&device->memstore, (data), GSL_DEVICE_MEMSTORE_OFFSET(soptimestamp), 4, false)
#define GSL_CMDSTREAM_GET_EOP_TIMESTAMP(device, data) kgsl_sharedmem_read0(&device->memstore, (data), GSL_DEVICE_MEMSTORE_OFFSET(eoptimestamp), 4, false)
@@ -37,4 +39,12 @@ void kgsl_cmdstream_memqueue_drain(struct kgsl_device *device);
int kgsl_cmdstream_init(struct kgsl_device *device);
int kgsl_cmdstream_close(struct kgsl_device *device);
int kgsl_cmdstream_issueibcmds(unsigned int device_id, int drawctxt_index, uint32_t ibaddr, int sizedwords, unsigned int *timestamp, gsl_flags_t flags);
unsigned int kgsl_cmdstream_readtimestamp(unsigned int device_id, enum kgsl_timestamp_type type);
int kgsl_cmdstream_freememontimestamp(unsigned int device_id, struct kgsl_memdesc *memdesc, unsigned int timestamp, enum kgsl_timestamp_type type);
int kgsl_cmdstream_waittimestamp(unsigned int device_id, unsigned int timestamp, unsigned int timeout);
int kgsl_cmdwindow_write(unsigned int device_id, enum kgsl_cmdwindow_type target, unsigned int addr, unsigned int data);
int kgsl_add_timestamp(unsigned int device_id, unsigned int *timestamp);
int kgsl_cmdstream_check_timestamp(unsigned int device_id, unsigned int timestamp);
#endif // __GSL_CMDSTREAM_H

View File

@@ -18,8 +18,17 @@
#include <linux/sched.h>
#include "gsl.h"
#include "gsl_hal.h"
#include "kgsl_buildconfig.h"
#include "kgsl_types.h"
#include "kgsl_hal.h"
#include "kgsl_mmu.h"
#include "kgsl_sharedmem.h"
#include "kgsl_device.h"
#include "kgsl_driver.h"
#include "kgsl_log.h"
#include "g12_reg.h"
// defines
#define GSL_CMDWINDOW_TARGET_MASK 0x000000FF

View File

@@ -33,6 +33,13 @@
#ifndef __GSL__CONFIG_H
#define __GSL__CONFIG_H
#include "kgsl_types.h" // GSL_DEVICE_MAX
#include "kgsl_mmu.h" // kgsl_mmu_stuff
#include "kgsl_ringbuffer.h" // GSL_RB_SIZE_*
#include "g12_reg.h" // MH stuff
#include "yamato_reg.h" // bleh
/* ------------------------
* Yamato ringbuffer config
* ------------------------ */

View File

@@ -16,8 +16,22 @@
*
*/
#include "gsl.h"
#include "gsl_hal.h"
#include "kgsl_types.h"
#include "kgsl_mmu.h"
#include "kgsl_buildconfig.h"
#include "kgsl_hal.h"
#include "kgsl_halconfig.h"
#include "kgsl_memmgr.h"
#include "kgsl_sharedmem.h"
#include "kgsl_properties.h"
#include "kgsl_intrmgr.h"
#include "kgsl_ringbuffer.h"
#include "kgsl_drawctxt.h"
#include "kgsl_cmdwindow.h"
#include "kgsl_device.h"
#include "kgsl_driver.h"
#include "kgsl_linux_map.h"
#include "kgsl_hwaccess.h"
//////////////////////////////////////////////////////////////////////////////
// functions

View File

@@ -26,37 +26,32 @@
*
*/
#ifndef __GSL_DISPLAY_H
#define __GSL_DISPLAY_H
#define __GSLDISPLAY_EXPORTS
#include "gsl_libapi.h"
#include "gsl_klibapi.h" // hack to enable direct reg write
#include "gsl_displayapi.h"
#ifndef __GSL_DEBUG_H
#define __GSL_DEBUG_H
//////////////////////////////////////////////////////////////////////////////
// defines
// macros
//////////////////////////////////////////////////////////////////////////////
#define GSL_LIB_MAXDISPLAYS 1
#define GSL_LIB_MAXSURFACES 3
#ifdef _DEBUG
#define KGSL_DEBUG(flag, action) if (gsl_driver.flags_debug & flag) {action;}
#else
#define KGSL_DEBUG(flag, action)
#endif
#define KGSL_DEBUG_DUMPPM4(cmds, sizedwords)
#define KGSL_DEBUG_DUMPREGWRITE(addr, value)
#define KGSL_DEBUG_DUMPMEMWRITE(addr, sizebytes, data)
#define KGSL_DEBUG_DUMPMEMSET(addr, sizebytes, value)
#define KGSL_DEBUG_DUMPFBSTART(device)
#define KGSL_DEBUG_DUMPREGSPACE(device)
#define KGSL_DEBUG_DUMPWINDOW(addr, width, height)
#define KGSL_DEBUG_DUMPX(cmd, par1, par2, par3, comment)
//////////////////////////////////////////////////////////////////////////////
// types
//////////////////////////////////////////////////////////////////////////////
typedef struct _gsl_display_t {
int numdisplays;
gsl_displaymode_t mode[GSL_LIB_MAXDISPLAYS];
gsl_devhandle_t devhandle;
} gsl_display_t;
#define KGSL_DEBUG_TBDUMP_OPEN(file)
#define KGSL_DEBUG_TBDUMP_CLOSE()
#define KGSL_DEBUG_TBDUMP_SYNCMEM(addr, src, sizebytes)
#define KGSL_DEBUG_TBDUMP_SETMEM(addr, value, sizebytes)
#define KGSL_DEBUG_TBDUMP_SLAVEWRITE(addr, value)
#define KGSL_DEBUG_TBDUMP_WAITIRQ()
//////////////////////////////////////////////////////////////////////////////
// prototypes
//////////////////////////////////////////////////////////////////////////////
int gsl_display_hitachi_240x320_tft_init(int display_id);
int gsl_display_toshiba_640x480_tft_init(int display_id);
#endif // __GSL_DISPLAY_H
#endif // __GSL_DEBUG_H

View File

@@ -18,8 +18,17 @@
#include <linux/sched.h>
#include "gsl.h"
#include "gsl_hal.h"
#include "kgsl_types.h"
#include "kgsl_hal.h"
#include "kgsl_log.h"
#include "kgsl_device.h"
#include "kgsl_driver.h"
#include "kgsl_cmdstream.h"
#include "kgsl_ioctl.h"
#include "kgsl_debug.h"
int kgsl_device_stop(unsigned int device_id);
//////////////////////////////////////////////////////////////////////////////
// inline functions
@@ -557,7 +566,7 @@ kgsl_device_regread(unsigned int device_id, unsigned int offsetwords, unsigned i
#ifdef CONFIG_KGSL_LOGGING
if( offsetwords != mmRBBM_STATUS && offsetwords != mmCP_RB_RPTR ) // Would otherwise flood the log
if( offsetwords != REG_RBBM_STATUS && offsetwords != REG_CP_RB_RPTR ) // Would otherwise flood the log
kgsl_log_write( KGSL_LOG_GROUP_DEVICE | KGSL_LOG_LEVEL_TRACE,
"--> int kgsl_device_regread(unsigned int device_id=%D, unsigned int offsetwords=%R, unsigned int *value=0x%08x)\n", device_id, offsetwords, value );
#endif
@@ -577,7 +586,7 @@ kgsl_device_regread(unsigned int device_id, unsigned int offsetwords, unsigned i
mutex_unlock(&gsl_driver.lock);
#ifdef CONFIG_KGSL_LOGGING
if( offsetwords != mmRBBM_STATUS && offsetwords != mmCP_RB_RPTR )
if( offsetwords != REG_RBBM_STATUS && offsetwords != REG_CP_RB_RPTR )
kgsl_log_write( KGSL_LOG_GROUP_DEVICE | KGSL_LOG_LEVEL_TRACE, "<-- kgsl_device_regread. Return value %B\n", status );
#endif

View File

@@ -36,6 +36,18 @@
// types
//////////////////////////////////////////////////////////////////////////////
// forward declaration
struct kgsl_device;
#include "kgsl_types.h"
#include "kgsl_intrmgr.h" // for gsl_intr_t
#include "kgsl_ringbuffer.h" // for gsl_ringbuffer_t
#include "kgsl_drawctxt.h" // gsl_drawctxt_t
#include "kgsl_cmdwindow.h" // for GSL_G12_INTR_COUNT
#include "kgsl_properties.h" // for gsl_property_type_t
#include "kgsl_mmu.h" // for kgsl_mmu
// --------------
// function table
// --------------
@@ -62,6 +74,8 @@ struct kgsl_functable {
int (*context_destroy) (struct kgsl_device *device_id, unsigned int drawctxt_id);
};
#define GSL_CALLER_PROCESS_MAX 64
// device object
struct kgsl_device {
unsigned int refcnt;
@@ -116,6 +130,16 @@ int kgsl_device_runpending(struct kgsl_device *device);
int kgsl_yamato_getfunctable(struct kgsl_functable *ftbl);
int kgsl_g12_getfunctable(struct kgsl_functable *ftbl);
int kgsl_device_start(unsigned int device_id, gsl_flags_t flags);
int kgsl_device_stop(unsigned int device_id);
int kgsl_device_idle(unsigned int device_id, unsigned int timeout);
int kgsl_device_isidle(unsigned int device_id);
int kgsl_device_getproperty(unsigned int device_id, gsl_property_type_t type, void *value, unsigned int sizebytes);
int kgsl_device_setproperty(unsigned int device_id, gsl_property_type_t type, void *value, unsigned int sizebytes);
int kgsl_device_regread(unsigned int device_id, unsigned int offsetwords, unsigned int *value);
int kgsl_device_regwrite(unsigned int device_id, unsigned int offsetwords, unsigned int value);
int kgsl_device_waitirq(unsigned int device_id, gsl_intrid_t intr_id, unsigned int *count, unsigned int timeout);
int kgsl_clock(unsigned int dev, int enable);
int kgsl_device_active(struct kgsl_device *dev);
int kgsl_device_clock(unsigned int id, int enable);

View File

@@ -19,10 +19,26 @@
#include <linux/sched.h>
#include <asm/div64.h>
#include "gsl.h"
#include "gsl_hal.h"
#include "kgsl_buildconfig.h"
#include "kgsl_types.h"
#include "kgsl_mmu.h"
#include "kgsl_properties.h"
#include "kgsl_device.h"
#include "kgsl_driver.h"
#include "kgsl_drawctxt.h"
#include "kgsl_hal.h"
#include "kgsl_properties.h"
#include "kgsl_ringbuffer.h"
#include "kgsl_memmgr.h"
#include "kgsl_sharedmem.h"
#include "kgsl_debug.h"
#include "g12_reg.h"
#include "kgsl_g12_vgv3types.h"
#include "yamato_reg.h"
#include "kgsl_pm4types.h"
//////////////////////////////////////////////////////////////////////////////
//
// Memory Map for Register, Constant & Instruction Shadow, and Command Buffers (34.5KB)

View File

@@ -29,6 +29,8 @@
#ifndef __GSL_DRAWCTXT_H
#define __GSL_DRAWCTXT_H
#include "kgsl_types.h"
//////////////////////////////////////////////////////////////////////////////
// Flags
//////////////////////////////////////////////////////////////////////////////
@@ -115,4 +117,10 @@ void kgsl_drawctxt_switch(struct kgsl_device *device, gsl_drawctxt_t *drawctx
int kgsl_drawctxt_create(struct kgsl_device* device, gsl_context_type_t type, unsigned int *drawctxt_id, gsl_flags_t flags);
int kgsl_drawctxt_destroy(struct kgsl_device* device, unsigned int drawctxt_id);
int kgsl_drawctxt_bind_gmem_shadow(unsigned int device_id, unsigned int drawctxt_id, const struct kgsl_gmem_desc* gmem_rect, unsigned int shadow_x, unsigned int shadow_y, const struct kgsl_buffer_desc* shadow_buffer, unsigned int buffer_id);
/* these are in the wrong place..! */
int kgsl_context_create(unsigned int device_id, gsl_context_type_t type, unsigned int *drawctxt_id, gsl_flags_t flags);
int kgsl_context_destroy(unsigned int device_id, unsigned int drawctxt_id);
#endif // __GSL_DRAWCTXT_H

View File

@@ -18,9 +18,11 @@
#include <linux/sched.h>
#include "gsl.h"
#include "gsl_hal.h"
#include "kgsl_driver.h"
#include "kgsl_debug.h"
#include "kgsl_device.h"
#include "kgsl_cmdstream.h"
#include "kgsl_log.h"
//////////////////////////////////////////////////////////////////////////////
// defines
@@ -131,8 +133,7 @@ kgsl_driver_close0(gsl_flags_t flags)
//----------------------------------------------------------------------------
int
kgsl_driver_init()
int kgsl_driver_init(void)
{
// only an external (platform specific device driver) component should call this
@@ -141,8 +142,7 @@ kgsl_driver_init()
//----------------------------------------------------------------------------
int
kgsl_driver_close()
int kgsl_driver_close(void)
{
// only an external (platform specific device driver) component should call this

View File

@@ -31,6 +31,11 @@
#include <linux/mutex.h>
#include "kgsl_types.h" // GSL_DRIVER_MAX
#include "kgsl_device.h" // kgsl_device etc.
#include "kgsl_sharedmem.h" // gsl_sharedmem_t
#include "kgsl_buildconfig.h" // GSL_CALLER_PROCESS_MAX
//////////////////////////////////////////////////////////////////////////////
// types
//////////////////////////////////////////////////////////////////////////////
@@ -80,5 +85,10 @@ kgsl_driver_getcallerprocessindex(unsigned int pid, int *index)
return (GSL_FAILURE);
}
int kgsl_driver_init(void);
int kgsl_driver_close(void);
int kgsl_driver_entry(gsl_flags_t flags);
int kgsl_driver_exit(void);
int kgsl_driver_destroy(unsigned int pid);
#endif // __GSL_DRIVER_H

View File

@@ -19,9 +19,15 @@
#include <linux/delay.h>
#include <linux/sched.h>
#include "gsl.h"
#include "gsl_hal.h"
#include "gsl_cmdstream.h"
#include "kgsl_types.h"
#include "kgsl_hal.h"
#include "kgsl_cmdstream.h"
#include "kgsl_sharedmem.h"
#include "kgsl_driver.h"
#include "kgsl_hwaccess.h"
#include "kgsl_ioctl.h"
#include "g12_reg.h"
#include "kgsl_g12_vgv3types.h"
#ifdef CONFIG_ARCH_MX35

View File

@@ -21,10 +21,6 @@
* Copyright (C) 2010-2011 Freescale Semiconductor, Inc. All Rights Reserved.
*/
#include "gsl_hal.h"
#include "gsl_halconfig.h"
#include "gsl_linux_map.h"
#include <linux/clk.h>
#include <linux/kernel.h>
#include <linux/pci.h>
@@ -35,6 +31,14 @@
#include <asm/tlbflush.h>
#include <asm/cacheflush.h>
#include "kgsl_hal.h"
#include "kgsl_halconfig.h"
#include "kgsl_linux_map.h"
#include "kgsl_driver.h"
#include "yamato_reg.h"
#include "g12_reg.h"
#define DRVNAME "amd-gpu"
#define GSL_HAL_MEM1 0

View File

@@ -33,9 +33,7 @@
extern "C" {
#endif // __cplusplus
#include "gsl.h"
#include "gsl_hwaccess.h"
#include "kgsl_types.h"
//////////////////////////////////////////////////////////////////////////////
// linkage
@@ -86,6 +84,8 @@ typedef struct _gsl_apertureconfig_t
unsigned int sizebytes;
} gsl_apertureconfig_t;
#define GSL_SHMEM_MAX_APERTURES 2
// --------------------
// shared memory config
// --------------------

View File

@@ -33,7 +33,8 @@
#include <asm/system.h>
#include <asm/uaccess.h>
#include "gsl_linux_map.h"
#include "kgsl_halconfig.h" // EMEM_MMU stuff
#include "kgsl_linux_map.h" // GSL_LINUX_MAP_RANGE_START etc.
static __inline void
kgsl_hwaccess_memread(void *dst, unsigned int gpubase, unsigned int gpuoffset, unsigned int sizebytes, unsigned int touserspace)

View File

@@ -19,7 +19,13 @@
#include <linux/slab.h>
#include <linux/string.h>
#include "gsl.h"
#include "kgsl_types.h"
#include "kgsl_intrmgr.h"
#include "kgsl_device.h"
#include "yamato_reg.h"
#include "kgsl_config.h" //gsl_cfg_intrblock_reg
//////////////////////////////////////////////////////////////////////////////
// macros

View File

@@ -31,6 +31,8 @@
#include <linux/sched.h>
#include "kgsl_types.h"
//////////////////////////////////////////////////////////////////////////////
// types
//////////////////////////////////////////////////////////////////////////////
@@ -102,4 +104,6 @@ int kgsl_intr_disable(gsl_intr_t *intr, gsl_intrid_t id);
int kgsl_intr_isenabled(gsl_intr_t *intr, gsl_intrid_t id);
void kgsl_intr_decode(struct kgsl_device *device, gsl_intrblock_t block_id);
void kgsl_intr_isr(struct kgsl_device *device);
#endif // __GSL_INTMGR_H

View File

@@ -29,8 +29,8 @@
#ifndef _GSL_IOCTL_H
#define _GSL_IOCTL_H
#include "gsl_types.h"
#include "gsl_properties.h"
#include "kgsl_types.h"
#include "kgsl_properties.h"
//////////////////////////////////////////////////////////////////////////////
// types

View File

@@ -16,14 +16,6 @@
*
*/
#include "gsl_types.h"
#include "gsl.h"
#include "gsl_buildconfig.h"
#include "gsl_halconfig.h"
#include "gsl_ioctl.h"
#include "kgsl_kmod_cleanup.h"
#include "gsl_linux_map.h"
#include <linux/version.h>
#include <linux/kernel.h>
#include <linux/module.h>
@@ -41,6 +33,26 @@
#include <linux/fsl_devices.h>
#include "kgsl_types.h"
#include "kgsl_properties.h"
#include "kgsl_linux_map.h"
#include "kgsl_ioctl.h"
#include "kgsl_driver.h"
#include "kgsl_device.h"
#include "kgsl_sharedmem.h"
#include "kgsl_cmdstream.h"
#include "kgsl_cmdwindow.h"
//#include "gsl_buildconfig.h"
#include "kgsl_halconfig.h"
//#include "gsl_ioctl.h"
#include "kgsl_kmod_cleanup.h"
//#define GSL_IOCTL_DEBUG
int gpu_2d_irq, gpu_3d_irq;

View File

@@ -15,13 +15,15 @@
* 02110-1301, USA.
*
*/
#include "gsl.h"
#include "kgsl_kmod_cleanup.h"
#include <linux/kernel.h>
#include <linux/fs.h>
#include "kgsl_kmod_cleanup.h"
#include "kgsl_device.h"
#include "kgsl_drawctxt.h"
#include "kgsl_sharedmem.h"
/*
* Local helper functions to check and convert device/context id's (1 based)
* to index (0 based).

View File

@@ -28,13 +28,14 @@
#ifndef __GSL_KMOD_CLEANUP_H
#define __GSL_KMOD_CLEANUP_H
#include "gsl_types.h"
#include <linux/gfp.h>
#include <linux/slab.h>
#include <linux/fs.h>
#include <linux/list.h>
#include "kgsl_types.h"
#if (GSL_CONTEXT_MAX > 127)
#error created_contexts_array supports context numbers only 127 or less.
#endif

View File

@@ -23,7 +23,7 @@
#include <linux/slab.h>
#include <asm/uaccess.h>
#include "gsl_linux_map.h"
#include "kgsl_linux_map.h"
struct gsl_linux_map
{

View File

@@ -29,8 +29,6 @@
#ifndef __GSL_LINUX_MAP_H__
#define __GSL_LINUX_MAP_H__
#include "gsl_halconfig.h"
#define GSL_LINUX_MAP_RANGE_START (1024*1024)
#define GSL_LINUX_MAP_RANGE_END (GSL_LINUX_MAP_RANGE_START+GSL_HAL_SHMEM_SIZE_EMEM_MMU)

View File

@@ -18,8 +18,10 @@
#include <linux/slab.h>
#include "gsl.h"
#include "gsl_hal.h"
#include "kgsl_types.h"
#include "kgsl_memmgr.h"
#include "kgsl_debug.h"
#include "kgsl_log.h"
/*
* defines

View File

@@ -19,9 +19,13 @@
#include <linux/slab.h>
#include <linux/sched.h>
#include "gsl.h"
#include "gsl_hal.h"
#include "kgsl_sharedmem.h"
#include "kgsl_mmu.h"
#include "kgsl_device.h"
#include "kgsl_log.h"
#include "kgsl_config.h"
#include "kgsl_driver.h"
#include "kgsl_debug.h"
//////////////////////////////////////////////////////////////////////////////
// types

View File

@@ -29,6 +29,8 @@
#ifndef __GSL_MMU_H
#define __GSL_MMU_H
#include "kgsl_types.h"
#include "kgsl_buildconfig.h" // ugh stats
//////////////////////////////////////////////////////////////////////////////
// defines

View File

@@ -29,6 +29,7 @@
#ifndef __GSL_PROPERTIES_H
#define __GSL_PROPERTIES_H
#include "kgsl_types.h"
//////////////////////////////////////////////////////////////////////////////
// types

View File

@@ -18,16 +18,17 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include <gsl.h>
#include <linux/timer.h>
#include <linux/spinlock.h>
#include <linux/slab.h>
#include <linux/hardirq.h>
#include <linux/semaphore.h>
#include "kgsl_device.h"
#include "kgsl_driver.h"
typedef struct _gsl_autogate_t {
struct timer_list timer;
struct timer_list timer;
spinlock_t lock;
int active;
/* pending indicate the timer has been fired but clock not yet disabled. */

View File

@@ -18,10 +18,18 @@
#include <linux/sched.h>
#include "gsl.h"
#include "gsl_hal.h"
#include "gsl_cmdstream.h"
#include "gsl_ringbuffer.h"
#include "kgsl_types.h"
#include "kgsl_hal.h"
#include "kgsl_cmdstream.h"
#include "kgsl_ringbuffer.h"
#include "kgsl_driver.h"
#include "kgsl_log.h"
#include "kgsl_debug.h"
#include "kgsl_config.h"
#include "yamato_reg.h"
#include "kgsl_pm4types.h"
//////////////////////////////////////////////////////////////////////////////
// ucode

View File

@@ -29,6 +29,14 @@
#ifndef __GSL_RINGBUFFER_H
#define __GSL_RINGBUFFER_H
// CONFIGURATION ITEMS
#define GSL_RB_USE_MEM_RPTR
#define GSL_RB_USE_MEM_TIMESTAMP
#define GSL_RB_TIMESTAMP_INTERUPT
/* #define GSL_RB_USE_WPTR_POLLING */
#include "kgsl_types.h"
//////////////////////////////////////////////////////////////////////////////
// defines
@@ -64,7 +72,7 @@
#define GSL_HAL_SUBBLOCK_OFFSET(reg) ((unsigned int)((reg) - (0x2000)))
// CP timestamp register
#define mmCP_TIMESTAMP mmSCRATCH_REG0
#define REG_CP_TIMESTAMP REG_SCRATCH_REG0
//////////////////////////////////////////////////////////////////////////////
@@ -179,7 +187,7 @@ typedef struct _gsl_ringbuffer_t {
#else
#define GSL_RB_MEMPTRS_SCRATCH_MASK 0x0 // disable
#define GSL_RB_INIT_TIMESTAMP(rb) kgsl_device_regwrite((rb)->device->id, mmCP_TIMESTAMP, 0);
#define GSL_RB_INIT_TIMESTAMP(rb) kgsl_device_regwrite((rb)->device->id, REG_CP_TIMESTAMP, 0);
#endif // GSL_RB_USE_MEMTIMESTAMP
// --------
@@ -190,7 +198,7 @@ typedef struct _gsl_ringbuffer_t {
#define GSL_RB_GET_READPTR(rb, data) kgsl_sharedmem_read0(&(rb)->memptrs_desc, (data), GSL_RB_MEMPTRS_RPTR_OFFSET, 4, false)
#else
#define GSL_RB_CNTL_NO_UPDATE 0x1 // disable
#define GSL_RB_GET_READPTR(rb, data) (rb)->device->fbtl.device_regread((rb)->device, mmCP_RB_RPTR,(data))
#define GSL_RB_GET_READPTR(rb, data) (rb)->device->fbtl.device_regread((rb)->device, REG_CP_RB_RPTR,(data))
#endif // GSL_RB_USE_MEMRPTR
// ------------

View File

@@ -19,8 +19,12 @@
#include <linux/slab.h>
#include <linux/sched.h>
#include "gsl.h"
#include "gsl_hal.h"
#include "kgsl_types.h"
#include "kgsl_driver.h"
#include "kgsl_sharedmem.h"
#include "kgsl_hwaccess.h"
#include "kgsl_debug.h"
#include "kgsl_log.h"
/////////////////////////////////////////////////////////////////////////////
// macros

View File

@@ -29,6 +29,8 @@
#ifndef __GSL_SHAREDMEM_H
#define __GSL_SHAREDMEM_H
#include "kgsl_hal.h" // MAX_APERTURES
#include "kgsl_memmgr.h"
//////////////////////////////////////////////////////////////////////////////
// defines
@@ -107,4 +109,17 @@ int kgsl_sharedmem_set0(const struct kgsl_memdesc *memdesc, unsigned
int kgsl_sharedmem_querystats(gsl_sharedmem_t *shmem, gsl_sharedmem_stats_t *stats);
unsigned int kgsl_sharedmem_convertaddr(unsigned int addr, int type);
int kgsl_sharedmem_alloc(unsigned int device_id, gsl_flags_t flags, int sizebytes, struct kgsl_memdesc *memdesc);
int kgsl_sharedmem_free(struct kgsl_memdesc *memdesc);
int kgsl_sharedmem_read(const struct kgsl_memdesc *memdesc, void *dst, unsigned int offsetbytes, unsigned int sizebytes, unsigned int touserspace);
int kgsl_sharedmem_write(const struct kgsl_memdesc *memdesc, unsigned int offsetbytes, void *src, unsigned int sizebytes, unsigned int fromuserspace);
int kgsl_sharedmem_set(const struct kgsl_memdesc *memdesc, unsigned int offsetbytes, unsigned int value, unsigned int sizebytes);
unsigned int kgsl_sharedmem_largestfreeblock(unsigned int device_id, gsl_flags_t flags);
int kgsl_sharedmem_map(unsigned int device_id, gsl_flags_t flags, const gsl_scatterlist_t *scatterlist, struct kgsl_memdesc *memdesc);
int kgsl_sharedmem_unmap(struct kgsl_memdesc *memdesc);
int kgsl_sharedmem_getmap(const struct kgsl_memdesc *memdesc, gsl_scatterlist_t *scatterlist);
int kgsl_sharedmem_cacheoperation(const struct kgsl_memdesc *memdesc, unsigned int offsetbytes, unsigned int sizebytes, unsigned int operation);
int kgsl_sharedmem_fromhostpointer(unsigned int device_id, struct kgsl_memdesc *memdesc, void* hostptr);
#endif // __GSL_SHAREDMEM_H

View File

@@ -508,4 +508,6 @@ typedef enum _gsl_intrid_t
GSL_INTR_FOOBAR = 0x7FFFFFFF
} gsl_intrid_t;
#define DEBUG_ASSERT(x)
#endif // __GSL_TYPES_H

View File

@@ -19,12 +19,18 @@
#include <linux/delay.h>
#include <linux/sched.h>
#include "gsl.h"
#include "gsl_hal.h"
#include "kgsl_types.h"
#include "kgsl_device.h"
#include "kgsl_driver.h"
#include "kgsl_ringbuffer.h" // needed for rb config
#include "kgsl_drawctxt.h"
#include "kgsl_cmdstream.h"
#include "kgsl_hwaccess.h"
#include "gsl_ringbuffer.h"
#include "gsl_drawctxt.h"
#include "yamato_reg.h"
#include "kgsl_pm4types.h"
#include "kgsl_debug.h"
/* Yamato MH arbiter config*/
#define KGSL_CFG_YAMATO_MHARB \

View File

@@ -389,7 +389,6 @@ union reg_cp_rb_cntl {
#define REG_SCRATCH_ADDR 0x01DD
#define REG_SCRATCH_REG0 0x0578
#define REG_CP_TIMESTAMP REG_SCRATCH_REG0 // hack for fsl/qcom compat
#define REG_SCRATCH_REG2 0x057A
#define REG_SCRATCH_REG7 0x057F // fsl
#define REG_SCRATCH_UMSK 0x01DC