mirror of
https://github.com/genesi/linux-legacy.git
synced 2026-07-08 17:56:32 +00:00
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.
This commit is contained in:
@@ -618,35 +618,6 @@ kgsl_device_regwrite(gsl_deviceid_t device_id, unsigned int offsetwords, unsigne
|
||||
return (status);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
int
|
||||
kgsl_device_waitirq(gsl_deviceid_t device_id, gsl_intrid_t intr_id, unsigned int *count, unsigned int timeout)
|
||||
{
|
||||
int status = GSL_FAILURE_NOTINITIALIZED;
|
||||
gsl_device_t *device;
|
||||
|
||||
kgsl_log_write( KGSL_LOG_GROUP_DEVICE | KGSL_LOG_LEVEL_TRACE,
|
||||
"--> int kgsl_device_waitirq(gsl_deviceid_t device_id=%D, gsl_intrid_t intr_id=%d, unsigned int *count=0x%08x, unsigned int timout=0x%08x)\n", device_id, intr_id, count, timeout);
|
||||
|
||||
mutex_lock(&gsl_driver.lock);
|
||||
|
||||
device = &gsl_driver.device[device_id-1]; // device_id is 1 based
|
||||
|
||||
if (device->ftbl.device_waitirq)
|
||||
{
|
||||
status = device->ftbl.device_waitirq(device, intr_id, count, timeout);
|
||||
}
|
||||
|
||||
mutex_unlock(&gsl_driver.lock);
|
||||
|
||||
kgsl_log_write( KGSL_LOG_GROUP_DEVICE | KGSL_LOG_LEVEL_TRACE, "<-- kgsl_device_waitirq. Return value %B\n", status );
|
||||
|
||||
return (status);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
int
|
||||
kgsl_device_runpending(gsl_device_t *device)
|
||||
{
|
||||
|
||||
@@ -568,77 +568,6 @@ kgsl_g12_regwrite(gsl_device_t *device, unsigned int offsetwords, unsigned int v
|
||||
return (GSL_SUCCESS);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
int
|
||||
kgsl_g12_waitirq(gsl_device_t *device, gsl_intrid_t intr_id, unsigned int *count, unsigned int timeout)
|
||||
{
|
||||
int status = GSL_FAILURE_NOTSUPPORTED;
|
||||
int complete = 0;
|
||||
|
||||
#ifndef _Z180
|
||||
if (intr_id == GSL_INTR_G12_G2D || intr_id == GSL_INTR_G12_FBC)
|
||||
#else
|
||||
if (intr_id == GSL_INTR_G12_G2D)
|
||||
#endif //_Z180
|
||||
{
|
||||
if (kgsl_intr_isenabled(&device->intr, intr_id) == GSL_SUCCESS)
|
||||
{
|
||||
// wait until intr completion event is received and check that
|
||||
// the interrupt is still enabled. If event is received, but
|
||||
// interrupt is not enabled any more, the driver is shutting
|
||||
// down and event structure is not valid anymore.
|
||||
|
||||
if (timeout != OS_INFINITE)
|
||||
complete = wait_for_completion_timeout(&device->intr.evnt[intr_id], msecs_to_jiffies(timeout));
|
||||
else
|
||||
complete = wait_for_completion_killable(&device->intr.evnt[intr_id]);
|
||||
|
||||
if (complete && kgsl_intr_isenabled(&device->intr, intr_id) == GSL_SUCCESS)
|
||||
{
|
||||
unsigned int cntrs;
|
||||
int i;
|
||||
struct completion *comp = &device->intr.evnt[intr_id];
|
||||
|
||||
kgsl_device_active(device);
|
||||
|
||||
INIT_COMPLETION(*comp);
|
||||
device->ftbl.device_regread(device, (ADDR_VGC_IRQ_ACTIVE_CNT >> 2), &cntrs);
|
||||
|
||||
for (i = 0; i < GSL_G12_INTR_COUNT; i++)
|
||||
{
|
||||
int intrcnt = cntrs >> ((8 * i)) & 255;
|
||||
|
||||
// maximum allowed counter value is 254. if set to 255 then something has gone wrong
|
||||
if (intrcnt && (intrcnt < 0xFF))
|
||||
{
|
||||
device->intrcnt[i] += intrcnt;
|
||||
}
|
||||
}
|
||||
|
||||
*count = device->intrcnt[intr_id - GSL_INTR_G12_MH];
|
||||
device->intrcnt[intr_id - GSL_INTR_G12_MH] = 0;
|
||||
status = GSL_SUCCESS;
|
||||
}
|
||||
else
|
||||
{
|
||||
status = GSL_FAILURE_TIMEOUT;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(intr_id == GSL_INTR_FOOBAR)
|
||||
{
|
||||
if (kgsl_intr_isenabled(&device->intr, GSL_INTR_G12_G2D) == GSL_SUCCESS)
|
||||
{
|
||||
complete_all(&device->intr.evnt[GSL_INTR_G12_G2D]);
|
||||
}
|
||||
}
|
||||
|
||||
return (status);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
int
|
||||
kgsl_g12_waittimestamp(gsl_device_t *device, gsl_timestamp_t timestamp, unsigned int timeout)
|
||||
{
|
||||
@@ -664,7 +593,6 @@ kgsl_g12_getfunctable(gsl_functable_t *ftbl)
|
||||
ftbl->device_idle = kgsl_g12_idle;
|
||||
ftbl->device_regread = kgsl_g12_regread;
|
||||
ftbl->device_regwrite = kgsl_g12_regwrite;
|
||||
ftbl->device_waitirq = kgsl_g12_waitirq;
|
||||
ftbl->device_waittimestamp = kgsl_g12_waittimestamp;
|
||||
ftbl->device_runpending = NULL;
|
||||
ftbl->device_addtimestamp = kgsl_g12_addtimestamp;
|
||||
|
||||
@@ -279,23 +279,3 @@ kgsl_intr_detach(gsl_intr_t *intr, gsl_intrid_t id)
|
||||
|
||||
return (GSL_SUCCESS);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
int
|
||||
kgsl_intr_isenabled(gsl_intr_t *intr, gsl_intrid_t id)
|
||||
{
|
||||
int status = GSL_FAILURE;
|
||||
const gsl_intrblock_reg_t *block = kgsl_intr_id2block(id);
|
||||
|
||||
if (block != NULL)
|
||||
{
|
||||
// check if interrupt is enabled
|
||||
if (intr->enabled[block->id] & gsl_cfg_intr_mask[id])
|
||||
{
|
||||
status = GSL_SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
return (status);
|
||||
}
|
||||
|
||||
@@ -258,32 +258,6 @@ static int gsl_kmod_ioctl(struct inode *inode, struct file *fd, unsigned int cmd
|
||||
kgslStatus = kgsl_device_regwrite(param.device_id, param.offsetwords, param.value);
|
||||
break;
|
||||
}
|
||||
case IOCTL_KGSL_DEVICE_WAITIRQ:
|
||||
{
|
||||
kgsl_device_waitirq_t param;
|
||||
unsigned int count;
|
||||
|
||||
printk(KERN_ERR "%s: IOCTL_KGSL_DEVICE_WAITIRQ obsoleted!\n", __func__);
|
||||
// kgslStatus = -ENOTTY; break;
|
||||
|
||||
if (copy_from_user(¶m, (void __user *)arg, sizeof(kgsl_device_waitirq_t)))
|
||||
{
|
||||
printk(KERN_ERR "%s: copy_from_user error\n", __func__);
|
||||
kgslStatus = GSL_FAILURE;
|
||||
break;
|
||||
}
|
||||
kgslStatus = kgsl_device_waitirq(param.device_id, param.intr_id, &count, param.timeout);
|
||||
if (kgslStatus == GSL_SUCCESS)
|
||||
{
|
||||
if (copy_to_user(param.count, &count, sizeof(unsigned int)))
|
||||
{
|
||||
printk(KERN_ERR "%s: copy_to_user error\n", __func__);
|
||||
kgslStatus = GSL_FAILURE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case IOCTL_KGSL_CMDSTREAM_ISSUEIBCMDS:
|
||||
{
|
||||
kgsl_cmdstream_issueibcmds_t param;
|
||||
|
||||
@@ -810,41 +810,6 @@ kgsl_yamato_regwrite(gsl_device_t *device, unsigned int offsetwords, unsigned in
|
||||
return (GSL_SUCCESS);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
int
|
||||
kgsl_yamato_waitirq(gsl_device_t *device, gsl_intrid_t intr_id, unsigned int *count, unsigned int timeout)
|
||||
{
|
||||
int status = GSL_FAILURE_NOTSUPPORTED;
|
||||
|
||||
if (intr_id == GSL_INTR_YDX_CP_IB1_INT || intr_id == GSL_INTR_YDX_CP_IB2_INT ||
|
||||
intr_id == GSL_INTR_YDX_CP_SW_INT || intr_id == GSL_INTR_YDX_RBBM_DISPLAY_UPDATE)
|
||||
{
|
||||
if (kgsl_intr_isenabled(&device->intr, intr_id) == GSL_SUCCESS)
|
||||
{
|
||||
// wait until intr completion event is received
|
||||
int complete = OS_SUCCESS;
|
||||
|
||||
if (timeout != OS_INFINITE)
|
||||
complete = wait_for_completion_timeout(&device->intr.evnt[intr_id], msecs_to_jiffies(timeout));
|
||||
else
|
||||
wait_for_completion_killable(&device->intr.evnt[intr_id]);
|
||||
|
||||
if (complete == OS_SUCCESS)
|
||||
{
|
||||
*count = 1;
|
||||
status = GSL_SUCCESS;
|
||||
}
|
||||
else
|
||||
{
|
||||
status = GSL_FAILURE_TIMEOUT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return (status);
|
||||
}
|
||||
|
||||
int kgsl_yamato_check_timestamp(gsl_deviceid_t device_id, gsl_timestamp_t timestamp)
|
||||
{
|
||||
int i;
|
||||
@@ -902,7 +867,6 @@ kgsl_yamato_getfunctable(gsl_functable_t *ftbl)
|
||||
ftbl->device_waittimestamp = kgsl_yamato_waittimestamp;
|
||||
ftbl->device_regread = kgsl_yamato_regread;
|
||||
ftbl->device_regwrite = kgsl_yamato_regwrite;
|
||||
ftbl->device_waitirq = kgsl_yamato_waitirq;
|
||||
ftbl->device_runpending = kgsl_yamato_runpending;
|
||||
ftbl->intr_isr = kgsl_yamato_isr;
|
||||
ftbl->mmu_tlbinvalidate = kgsl_yamato_tlbinvalidate;
|
||||
|
||||
@@ -64,7 +64,6 @@ int kgsl_device_getproperty(gsl_deviceid_t device_id, gsl_propert
|
||||
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);
|
||||
int kgsl_device_waitirq(gsl_deviceid_t device_id, gsl_intrid_t intr_id, unsigned int *count, unsigned int timeout);
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -54,7 +54,6 @@ int gsl_device_getcount(void);
|
||||
int gsl_device_getinfo(gsl_devhandle_t devhandle, gsl_devinfo_t *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, gsl_timestamp_t timestamp, unsigned int timeout);
|
||||
int gsl_device_addtimestamp(gsl_devhandle_t devhandle, gsl_timestamp_t *timestamp);
|
||||
|
||||
|
||||
@@ -513,9 +513,7 @@ typedef enum _gsl_intrid_t
|
||||
GSL_INTR_G12_MH_AXI_WRITE_ERROR,
|
||||
GSL_INTR_G12_MH_MMU_PAGE_FAULT,
|
||||
|
||||
GSL_INTR_COUNT,
|
||||
|
||||
GSL_INTR_FOOBAR = 0x7FFFFFFF
|
||||
GSL_INTR_COUNT
|
||||
} gsl_intrid_t;
|
||||
|
||||
#endif // __GSL_TYPES_H
|
||||
|
||||
@@ -50,7 +50,6 @@ typedef struct _gsl_functable_t {
|
||||
int (*device_idle) (gsl_device_t *device, unsigned int timeout);
|
||||
int (*device_regread) (gsl_device_t *device, unsigned int offsetwords, unsigned int *value);
|
||||
int (*device_regwrite) (gsl_device_t *device, unsigned int offsetwords, unsigned int value);
|
||||
int (*device_waitirq) (gsl_device_t *device, gsl_intrid_t intr_id, unsigned int *count, unsigned int timeout);
|
||||
int (*device_waittimestamp) (gsl_device_t *device, gsl_timestamp_t timestamp, unsigned int timeout);
|
||||
int (*device_runpending) (gsl_device_t *device);
|
||||
int (*device_addtimestamp) (gsl_device_t *device_id, gsl_timestamp_t *timestamp);
|
||||
@@ -92,7 +91,6 @@ struct _gsl_device_t {
|
||||
#endif // GSL_BLD_YAMATO
|
||||
|
||||
#ifdef GSL_BLD_G12
|
||||
unsigned int intrcnt[GSL_G12_INTR_COUNT];
|
||||
gsl_timestamp_t current_timestamp;
|
||||
gsl_timestamp_t timestamp;
|
||||
#ifdef IRQTHREAD_POLL
|
||||
|
||||
@@ -99,7 +99,6 @@ int kgsl_intr_attach(gsl_intr_t *intr, gsl_intrid_t id, gsl_intr_cal
|
||||
int kgsl_intr_detach(gsl_intr_t *intr, gsl_intrid_t id);
|
||||
int kgsl_intr_enable(gsl_intr_t *intr, gsl_intrid_t id);
|
||||
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(gsl_device_t *device, gsl_intrblock_t block_id);
|
||||
|
||||
#endif // __GSL_INTMGR_H
|
||||
|
||||
@@ -80,13 +80,6 @@ typedef struct _kgsl_device_regwrite_t {
|
||||
unsigned int value;
|
||||
} kgsl_device_regwrite_t;
|
||||
|
||||
typedef struct _kgsl_device_waitirq_t {
|
||||
gsl_deviceid_t device_id;
|
||||
gsl_intrid_t intr_id;
|
||||
unsigned int *count;
|
||||
unsigned int timeout;
|
||||
} kgsl_device_waitirq_t;
|
||||
|
||||
typedef struct _kgsl_cmdstream_issueibcmds_t {
|
||||
gsl_deviceid_t device_id;
|
||||
int drawctxt_index;
|
||||
@@ -218,7 +211,6 @@ typedef struct _kgsl_device_clock_t {
|
||||
#define IOCTL_KGSL_DEVICE_SETPROPERTY _IOW(GSL_MAGIC, 0x25, struct _kgsl_device_setproperty_t)
|
||||
#define IOCTL_KGSL_DEVICE_REGREAD _IOWR(GSL_MAGIC, 0x26, struct _kgsl_device_regread_t)
|
||||
#define IOCTL_KGSL_DEVICE_REGWRITE _IOW(GSL_MAGIC, 0x27, struct _kgsl_device_regwrite_t)
|
||||
#define IOCTL_KGSL_DEVICE_WAITIRQ _IOWR(GSL_MAGIC, 0x28, struct _kgsl_device_waitirq_t)
|
||||
#define IOCTL_KGSL_CMDSTREAM_ISSUEIBCMDS _IOWR(GSL_MAGIC, 0x29, struct _kgsl_cmdstream_issueibcmds_t)
|
||||
#define IOCTL_KGSL_CMDSTREAM_READTIMESTAMP _IOWR(GSL_MAGIC, 0x2A, struct _kgsl_cmdstream_readtimestamp_t)
|
||||
#define IOCTL_KGSL_CMDSTREAM_FREEMEMONTIMESTAMP _IOW(GSL_MAGIC, 0x2B, struct _kgsl_cmdstream_freememontimestamp_t)
|
||||
|
||||
Reference in New Issue
Block a user