Files
linux-legacy-genesi-2/drivers/mxc/amd-gpu/include/api/gsl_klibapi.h
Matt Sealey 16d6513c0b amd-gpu: remove unused waitirq ioctl and associated infrastructure
This is implemented in the "current" userspace libkgsl.so but in fact
since the ioctl is deprecated, there are no users for it and no evidence
of it ever being used in real life can be presented. Therefore we can
just take out the few things it does and it's single-use dependencies.
2012-12-10 16:13:52 -06:00

121 lines
7.1 KiB
C

/* 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(gsl_deviceid_t device_id, gsl_flags_t flags);
int kgsl_device_stop(gsl_deviceid_t device_id);
int kgsl_device_idle(gsl_deviceid_t device_id, unsigned int timeout);
int kgsl_device_isidle(gsl_deviceid_t device_id);
int kgsl_device_getproperty(gsl_deviceid_t device_id, gsl_property_type_t type, void *value, unsigned int sizebytes);
int kgsl_device_setproperty(gsl_deviceid_t device_id, gsl_property_type_t type, void *value, unsigned int sizebytes);
int kgsl_device_regread(gsl_deviceid_t device_id, unsigned int offsetwords, unsigned int *value);
int kgsl_device_regwrite(gsl_deviceid_t device_id, unsigned int offsetwords, unsigned int value);
////////////////////////////////////////////////////////////////////////////
// command API
////////////////////////////////////////////////////////////////////////////
int kgsl_cmdstream_issueibcmds(gsl_deviceid_t device_id, int drawctxt_index, gpuaddr_t ibaddr, int sizedwords, gsl_timestamp_t *timestamp, gsl_flags_t flags);
gsl_timestamp_t kgsl_cmdstream_readtimestamp(gsl_deviceid_t device_id, gsl_timestamp_type_t type);
int kgsl_cmdstream_freememontimestamp(gsl_deviceid_t device_id, gsl_memdesc_t *memdesc, gsl_timestamp_t timestamp, gsl_timestamp_type_t type);
int kgsl_cmdstream_waittimestamp(gsl_deviceid_t device_id, gsl_timestamp_t timestamp, unsigned int timeout);
int kgsl_cmdwindow_write(gsl_deviceid_t device_id, gsl_cmdwindow_t target, unsigned int addr, unsigned int data);
int kgsl_add_timestamp(gsl_deviceid_t device_id, gsl_timestamp_t *timestamp);
int kgsl_cmdstream_check_timestamp(gsl_deviceid_t device_id, gsl_timestamp_t timestamp);
////////////////////////////////////////////////////////////////////////////
// context API
////////////////////////////////////////////////////////////////////////////
int kgsl_context_create(gsl_deviceid_t device_id, gsl_context_type_t type, unsigned int *drawctxt_id, gsl_flags_t flags);
int kgsl_context_destroy(gsl_deviceid_t device_id, unsigned int drawctxt_id);
int kgsl_drawctxt_bind_gmem_shadow(gsl_deviceid_t device_id, unsigned int drawctxt_id, const gsl_rect_t* gmem_rect, unsigned int shadow_x, unsigned int shadow_y, const gsl_buffer_desc_t* shadow_buffer, unsigned int buffer_id);
////////////////////////////////////////////////////////////////////////////
// sharedmem API
////////////////////////////////////////////////////////////////////////////
int kgsl_sharedmem_alloc(gsl_deviceid_t device_id, gsl_flags_t flags, int sizebytes, gsl_memdesc_t *memdesc);
int kgsl_sharedmem_free(gsl_memdesc_t *memdesc);
int kgsl_sharedmem_read(const gsl_memdesc_t *memdesc, void *dst, unsigned int offsetbytes, unsigned int sizebytes, unsigned int touserspace);
int kgsl_sharedmem_write(const gsl_memdesc_t *memdesc, unsigned int offsetbytes, void *src, unsigned int sizebytes, unsigned int fromuserspace);
int kgsl_sharedmem_set(const gsl_memdesc_t *memdesc, unsigned int offsetbytes, unsigned int value, unsigned int sizebytes);
unsigned int kgsl_sharedmem_largestfreeblock(gsl_deviceid_t device_id, gsl_flags_t flags);
int kgsl_sharedmem_map(gsl_deviceid_t device_id, gsl_flags_t flags, const gsl_scatterlist_t *scatterlist, gsl_memdesc_t *memdesc);
int kgsl_sharedmem_unmap(gsl_memdesc_t *memdesc);
int kgsl_sharedmem_getmap(const gsl_memdesc_t *memdesc, gsl_scatterlist_t *scatterlist);
int kgsl_sharedmem_cacheoperation(const gsl_memdesc_t *memdesc, unsigned int offsetbytes, unsigned int sizebytes, unsigned int operation);
int kgsl_sharedmem_fromhostpointer(gsl_deviceid_t device_id, gsl_memdesc_t *memdesc, void* hostptr);
////////////////////////////////////////////////////////////////////////////
// interrupt API
////////////////////////////////////////////////////////////////////////////
void kgsl_intr_isr(gsl_device_t *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